Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / intVtigerAccount / intVtigerAccount.rpc.js
index d6f3664..757d691 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x731e=['error','code','message','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','debug','ShowVtigerAccount','VtigerAccount','find','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1f8974,_0x1cf003){var _0x28a046=function(_0x1edabd){while(--_0x1edabd){_0x1f8974['push'](_0x1f8974['shift']());}};_0x28a046(++_0x1cf003);}(_0x731e,0x198));var _0xe731=function(_0x3e0c78,_0x347a58){_0x3e0c78=_0x3e0c78-0x0;var _0x201901=_0x731e[_0x3e0c78];return _0x201901;};'use strict';var _=require(_0xe731('0x0'));var util=require(_0xe731('0x1'));var moment=require('moment');var BPromise=require(_0xe731('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe731('0x3'))['db'];var utils=require(_0xe731('0x4'));var logger=require('../../config/logger')(_0xe731('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe731('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1b3d6f,_0x13ea51,_0x15a287){return new BPromise(function(_0x31fe18,_0x36cbdf){return client['request'](_0x1b3d6f,_0x15a287)[_0xe731('0x7')](function(_0x47a98b){logger[_0xe731('0x8')](_0xe731('0x9'),_0x13ea51,_0xe731('0xa'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x13ea51,_0xe731('0xa'),JSON[_0xe731('0xb')](_0x47a98b));if(_0x47a98b[_0xe731('0xc')]){if(_0x47a98b[_0xe731('0xc')][_0xe731('0xd')]===0x1f4){logger[_0xe731('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x13ea51,_0x47a98b[_0xe731('0xc')][_0xe731('0xe')]);return _0x36cbdf(_0x47a98b[_0xe731('0xc')][_0xe731('0xe')]);}logger[_0xe731('0xc')](_0xe731('0x9'),_0x13ea51,_0x47a98b[_0xe731('0xc')][_0xe731('0xe')]);return _0x31fe18(_0x47a98b[_0xe731('0xc')][_0xe731('0xe')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x13ea51,'request\x20sent');_0x31fe18(_0x47a98b['result'][_0xe731('0xe')]);}})['catch'](function(_0x2743e2){logger[_0xe731('0xc')](_0xe731('0x9'),_0x13ea51,_0x2743e2);_0x36cbdf(_0x2743e2);});});}exports['GetVtigerAccount']=function(_0x5e166f){var _0x5f1969=this;return new Promise(function(_0x45b7a4,_0x598a02){return db['VtigerAccount'][_0xe731('0xf')]({'raw':_0x5e166f[_0xe731('0x10')]?_0x5e166f[_0xe731('0x10')][_0xe731('0x11')]===undefined?!![]:![]:!![],'where':_0x5e166f[_0xe731('0x10')]?_0x5e166f['options'][_0xe731('0x12')]||null:null,'attributes':_0x5e166f[_0xe731('0x10')]?_0x5e166f[_0xe731('0x10')]['attributes']||null:null,'limit':_0x5e166f['options']?_0x5e166f['options'][_0xe731('0x13')]||null:null,'include':_0x5e166f['options']?_0x5e166f[_0xe731('0x10')][_0xe731('0x14')]?_[_0xe731('0x15')](_0x5e166f[_0xe731('0x10')][_0xe731('0x14')],function(_0x3e5693){return{'model':db[_0x3e5693[_0xe731('0x16')]],'as':_0x3e5693['as'],'attributes':_0x3e5693['attributes'],'include':_0x3e5693[_0xe731('0x14')]?_[_0xe731('0x15')](_0x3e5693[_0xe731('0x14')],function(_0x35b875){return{'model':db[_0x35b875['model']],'as':_0x35b875['as'],'attributes':_0x35b875['attributes'],'include':_0x35b875[_0xe731('0x14')]?_['map'](_0x35b875[_0xe731('0x14')],function(_0x351c20){return{'model':db[_0x351c20['model']],'as':_0x351c20['as'],'attributes':_0x351c20[_0xe731('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe731('0x7')](function(_0xae06bb){logger[_0xe731('0x8')](_0xe731('0x18'),_0x5e166f);logger[_0xe731('0x19')](_0xe731('0x18'),_0x5e166f,JSON[_0xe731('0xb')](_0xae06bb));_0x45b7a4(_0xae06bb);})['catch'](function(_0x5c23ad){logger[_0xe731('0xc')]('GetVtigerAccount',_0x5c23ad[_0xe731('0xe')],_0x5e166f);_0x598a02(_0x5f1969[_0xe731('0xc')](0x1f4,_0x5c23ad[_0xe731('0xe')]));});});};exports[_0xe731('0x1a')]=function(_0x5607fa){var _0x478c06=this;return new Promise(function(_0x4129dd,_0x1d3ff8){return db[_0xe731('0x1b')][_0xe731('0x1c')]({'raw':_0x5607fa['options']?_0x5607fa[_0xe731('0x10')][_0xe731('0x11')]===undefined?!![]:![]:!![],'where':_0x5607fa['options']?_0x5607fa[_0xe731('0x10')][_0xe731('0x12')]||null:null,'attributes':_0x5607fa['options']?_0x5607fa[_0xe731('0x10')][_0xe731('0x17')]||null:null,'include':_0x5607fa[_0xe731('0x10')]?_0x5607fa[_0xe731('0x10')][_0xe731('0x14')]?_['map'](_0x5607fa['options'][_0xe731('0x14')],function(_0x10ba2d){return{'model':db[_0x10ba2d[_0xe731('0x16')]],'as':_0x10ba2d['as'],'attributes':_0x10ba2d['attributes'],'include':_0x10ba2d['include']?_['map'](_0x10ba2d[_0xe731('0x14')],function(_0x11b482){return{'model':db[_0x11b482['model']],'as':_0x11b482['as'],'attributes':_0x11b482['attributes'],'include':_0x11b482[_0xe731('0x14')]?_[_0xe731('0x15')](_0x11b482[_0xe731('0x14')],function(_0xc7bb69){return{'model':db[_0xc7bb69[_0xe731('0x16')]],'as':_0xc7bb69['as'],'attributes':_0xc7bb69[_0xe731('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe731('0x7')](function(_0x218d46){logger['info']('ShowVtigerAccount',_0x5607fa);logger[_0xe731('0x19')](_0xe731('0x1a'),_0x5607fa,JSON[_0xe731('0xb')](_0x218d46));_0x4129dd(_0x218d46);})[_0xe731('0x1d')](function(_0x54e502){logger[_0xe731('0xc')](_0xe731('0x1a'),_0x54e502[_0xe731('0xe')],_0x5607fa);_0x1d3ff8(_0x478c06[_0xe731('0xc')](0x1f4,_0x54e502[_0xe731('0xe')]));});});};
\ No newline at end of file
+var _0xb9b5=['model','then','stringify','find','ShowVtigerAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','attributes','include','map'];(function(_0x28d867,_0x3898db){var _0x2d2a1f=function(_0x59c447){while(--_0x59c447){_0x28d867['push'](_0x28d867['shift']());}};_0x2d2a1f(++_0x3898db);}(_0xb9b5,0xd1));var _0x5b9b=function(_0x4c321c,_0x3e9da0){_0x4c321c=_0x4c321c-0x0;var _0x25accb=_0xb9b5[_0x4c321c];return _0x25accb;};'use strict';var _=require(_0x5b9b('0x0'));var util=require('util');var moment=require(_0x5b9b('0x1'));var BPromise=require(_0x5b9b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b9b('0x3'));var db=require(_0x5b9b('0x4'))['db'];var utils=require(_0x5b9b('0x5'));var logger=require(_0x5b9b('0x6'))(_0x5b9b('0x7'));var config=require(_0x5b9b('0x8'));var jayson=require(_0x5b9b('0x9'));var client=jayson[_0x5b9b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b7f5e,_0x103aa8,_0x113a8e){return new BPromise(function(_0x138993,_0x5e61d2){return client[_0x5b9b('0xb')](_0x1b7f5e,_0x113a8e)['then'](function(_0x56f552){logger[_0x5b9b('0xc')](_0x5b9b('0xd'),_0x103aa8,_0x5b9b('0xe'));logger[_0x5b9b('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x103aa8,_0x5b9b('0xe'),JSON['stringify'](_0x56f552));if(_0x56f552[_0x5b9b('0x10')]){if(_0x56f552[_0x5b9b('0x10')][_0x5b9b('0x11')]===0x1f4){logger[_0x5b9b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x103aa8,_0x56f552[_0x5b9b('0x10')][_0x5b9b('0x12')]);return _0x5e61d2(_0x56f552[_0x5b9b('0x10')][_0x5b9b('0x12')]);}logger[_0x5b9b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x103aa8,_0x56f552[_0x5b9b('0x10')][_0x5b9b('0x12')]);return _0x138993(_0x56f552[_0x5b9b('0x10')][_0x5b9b('0x12')]);}else{logger[_0x5b9b('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x103aa8,_0x5b9b('0xe'));_0x138993(_0x56f552[_0x5b9b('0x13')][_0x5b9b('0x12')]);}})[_0x5b9b('0x14')](function(_0xde145f){logger[_0x5b9b('0x10')](_0x5b9b('0xd'),_0x103aa8,_0xde145f);_0x5e61d2(_0xde145f);});});}exports[_0x5b9b('0x15')]=function(_0x4664ec){var _0xc7d8c6=this;return new Promise(function(_0x50d15f,_0x200105){return db[_0x5b9b('0x16')]['findAll']({'raw':_0x4664ec[_0x5b9b('0x17')]?_0x4664ec[_0x5b9b('0x17')][_0x5b9b('0x18')]===undefined?!![]:![]:!![],'where':_0x4664ec['options']?_0x4664ec[_0x5b9b('0x17')][_0x5b9b('0x19')]||null:null,'attributes':_0x4664ec[_0x5b9b('0x17')]?_0x4664ec[_0x5b9b('0x17')][_0x5b9b('0x1a')]||null:null,'limit':_0x4664ec[_0x5b9b('0x17')]?_0x4664ec[_0x5b9b('0x17')]['limit']||null:null,'include':_0x4664ec['options']?_0x4664ec['options'][_0x5b9b('0x1b')]?_[_0x5b9b('0x1c')](_0x4664ec[_0x5b9b('0x17')][_0x5b9b('0x1b')],function(_0x1bdc4e){return{'model':db[_0x1bdc4e[_0x5b9b('0x1d')]],'as':_0x1bdc4e['as'],'attributes':_0x1bdc4e[_0x5b9b('0x1a')],'include':_0x1bdc4e[_0x5b9b('0x1b')]?_['map'](_0x1bdc4e[_0x5b9b('0x1b')],function(_0x3eee5b){return{'model':db[_0x3eee5b[_0x5b9b('0x1d')]],'as':_0x3eee5b['as'],'attributes':_0x3eee5b[_0x5b9b('0x1a')],'include':_0x3eee5b[_0x5b9b('0x1b')]?_[_0x5b9b('0x1c')](_0x3eee5b[_0x5b9b('0x1b')],function(_0x2bbe58){return{'model':db[_0x2bbe58[_0x5b9b('0x1d')]],'as':_0x2bbe58['as'],'attributes':_0x2bbe58[_0x5b9b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5b9b('0x1e')](function(_0x24fa54){logger[_0x5b9b('0xc')](_0x5b9b('0x15'),_0x4664ec);logger[_0x5b9b('0xf')]('GetVtigerAccount',_0x4664ec,JSON[_0x5b9b('0x1f')](_0x24fa54));_0x50d15f(_0x24fa54);})['catch'](function(_0x5126d3){logger['error'](_0x5b9b('0x15'),_0x5126d3[_0x5b9b('0x12')],_0x4664ec);_0x200105(_0xc7d8c6[_0x5b9b('0x10')](0x1f4,_0x5126d3[_0x5b9b('0x12')]));});});};exports['ShowVtigerAccount']=function(_0xe13188){var _0x4b85d3=this;return new Promise(function(_0x2214c4,_0xa215e0){return db[_0x5b9b('0x16')][_0x5b9b('0x20')]({'raw':_0xe13188[_0x5b9b('0x17')]?_0xe13188[_0x5b9b('0x17')][_0x5b9b('0x18')]===undefined?!![]:![]:!![],'where':_0xe13188[_0x5b9b('0x17')]?_0xe13188[_0x5b9b('0x17')][_0x5b9b('0x19')]||null:null,'attributes':_0xe13188[_0x5b9b('0x17')]?_0xe13188[_0x5b9b('0x17')]['attributes']||null:null,'include':_0xe13188[_0x5b9b('0x17')]?_0xe13188[_0x5b9b('0x17')][_0x5b9b('0x1b')]?_['map'](_0xe13188[_0x5b9b('0x17')][_0x5b9b('0x1b')],function(_0x12ec68){return{'model':db[_0x12ec68[_0x5b9b('0x1d')]],'as':_0x12ec68['as'],'attributes':_0x12ec68[_0x5b9b('0x1a')],'include':_0x12ec68[_0x5b9b('0x1b')]?_[_0x5b9b('0x1c')](_0x12ec68['include'],function(_0x250f8a){return{'model':db[_0x250f8a[_0x5b9b('0x1d')]],'as':_0x250f8a['as'],'attributes':_0x250f8a['attributes'],'include':_0x250f8a['include']?_['map'](_0x250f8a[_0x5b9b('0x1b')],function(_0x178713){return{'model':db[_0x178713[_0x5b9b('0x1d')]],'as':_0x178713['as'],'attributes':_0x178713[_0x5b9b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5b9b('0x1e')](function(_0xe4dc2c){logger['info']('ShowVtigerAccount',_0xe13188);logger[_0x5b9b('0xf')](_0x5b9b('0x21'),_0xe13188,JSON['stringify'](_0xe4dc2c));_0x2214c4(_0xe4dc2c);})[_0x5b9b('0x14')](function(_0x4665d5){logger[_0x5b9b('0x10')](_0x5b9b('0x21'),_0x4665d5[_0x5b9b('0x12')],_0xe13188);_0xa215e0(_0x4b85d3[_0x5b9b('0x10')](0x1f4,_0x4665d5['message']));});});};
\ No newline at end of file