Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / intFreshsalesAccount / intFreshsalesAccount.rpc.js
index 67d6901..6e495e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf79e=['message','result','catch','GetFreshsalesAccount','findAll','options','attributes','limit','include','map','model','ShowFreshsalesAccount','FreshsalesAccount','raw','where','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x203211,_0x34e672){var _0x7d6f5c=function(_0x325cac){while(--_0x325cac){_0x203211['push'](_0x203211['shift']());}};_0x7d6f5c(++_0x34e672);}(_0xf79e,0x185));var _0xef79=function(_0x21e418,_0xcedbf5){_0x21e418=_0x21e418-0x0;var _0x3e5bc7=_0xf79e[_0x21e418];return _0x3e5bc7;};'use strict';var _=require('lodash');var util=require(_0xef79('0x0'));var moment=require(_0xef79('0x1'));var BPromise=require(_0xef79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef79('0x3'));var db=require(_0xef79('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xef79('0x5'));var config=require(_0xef79('0x6'));var jayson=require(_0xef79('0x7'));var client=jayson[_0xef79('0x8')][_0xef79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa668,_0x49d0ea,_0x1e7443){return new BPromise(function(_0x4a8de0,_0x33b384){return client[_0xef79('0xa')](_0x2fa668,_0x1e7443)['then'](function(_0x42dee6){logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));logger[_0xef79('0xe')](_0xef79('0xf'),_0x49d0ea,_0xef79('0xd'),JSON[_0xef79('0x10')](_0x42dee6));if(_0x42dee6['error']){if(_0x42dee6[_0xef79('0x11')][_0xef79('0x12')]===0x1f4){logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);return _0x33b384(_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);}logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6['error']['message']);return _0x4a8de0(_0x42dee6['error']['message']);}else{logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));_0x4a8de0(_0x42dee6[_0xef79('0x14')]['message']);}})[_0xef79('0x15')](function(_0x6a689c){logger['error'](_0xef79('0xc'),_0x49d0ea,_0x6a689c);_0x33b384(_0x6a689c);});});}exports[_0xef79('0x16')]=function(_0x249a8c){var _0x406ca2=this;return new Promise(function(_0x55492c,_0x276b8b){return db['FreshsalesAccount'][_0xef79('0x17')]({'raw':_0x249a8c[_0xef79('0x18')]?_0x249a8c[_0xef79('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x249a8c[_0xef79('0x18')]?_0x249a8c[_0xef79('0x18')]['where']||null:null,'attributes':_0x249a8c['options']?_0x249a8c[_0xef79('0x18')][_0xef79('0x19')]||null:null,'limit':_0x249a8c['options']?_0x249a8c[_0xef79('0x18')][_0xef79('0x1a')]||null:null,'include':_0x249a8c[_0xef79('0x18')]?_0x249a8c['options'][_0xef79('0x1b')]?_['map'](_0x249a8c['options'][_0xef79('0x1b')],function(_0x196672){return{'model':db[_0x196672['model']],'as':_0x196672['as'],'attributes':_0x196672[_0xef79('0x19')],'include':_0x196672[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x196672[_0xef79('0x1b')],function(_0x5b4017){return{'model':db[_0x5b4017[_0xef79('0x1d')]],'as':_0x5b4017['as'],'attributes':_0x5b4017[_0xef79('0x19')],'include':_0x5b4017[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x5b4017['include'],function(_0x38ec60){return{'model':db[_0x38ec60['model']],'as':_0x38ec60['as'],'attributes':_0x38ec60[_0xef79('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x102d6f){logger[_0xef79('0xb')](_0xef79('0x16'),_0x249a8c);logger[_0xef79('0xe')](_0xef79('0x16'),_0x249a8c,JSON[_0xef79('0x10')](_0x102d6f));_0x55492c(_0x102d6f);})[_0xef79('0x15')](function(_0x2e3bbf){logger['error'](_0xef79('0x16'),_0x2e3bbf['message'],_0x249a8c);_0x276b8b(_0x406ca2[_0xef79('0x11')](0x1f4,_0x2e3bbf[_0xef79('0x13')]));});});};exports[_0xef79('0x1e')]=function(_0x34db2f){var _0x84ad52=this;return new Promise(function(_0x3bb745,_0x2d70ce){return db[_0xef79('0x1f')]['find']({'raw':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x20')]===undefined?!![]:![]:!![],'where':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x21')]||null:null,'attributes':_0x34db2f[_0xef79('0x18')]?_0x34db2f['options'][_0xef79('0x19')]||null:null,'include':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x34db2f[_0xef79('0x18')][_0xef79('0x1b')],function(_0x360b28){return{'model':db[_0x360b28[_0xef79('0x1d')]],'as':_0x360b28['as'],'attributes':_0x360b28[_0xef79('0x19')],'include':_0x360b28[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x360b28[_0xef79('0x1b')],function(_0x41d36b){return{'model':db[_0x41d36b[_0xef79('0x1d')]],'as':_0x41d36b['as'],'attributes':_0x41d36b[_0xef79('0x19')],'include':_0x41d36b[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x41d36b[_0xef79('0x1b')],function(_0x565cf1){return{'model':db[_0x565cf1['model']],'as':_0x565cf1['as'],'attributes':_0x565cf1[_0xef79('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bc12a){logger['info'](_0xef79('0x1e'),_0x34db2f);logger[_0xef79('0xe')]('ShowFreshsalesAccount',_0x34db2f,JSON[_0xef79('0x10')](_0x4bc12a));_0x3bb745(_0x4bc12a);})['catch'](function(_0x529bb4){logger['error'](_0xef79('0x1e'),_0x529bb4[_0xef79('0x13')],_0x34db2f);_0x2d70ce(_0x84ad52[_0xef79('0x11')](0x1f4,_0x529bb4[_0xef79('0x13')]));});});};
\ No newline at end of file
+var _0xafcd=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','map','include','model','stringify','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5614cb,_0x523e23){var _0xa68aa1=function(_0x3eac8f){while(--_0x3eac8f){_0x5614cb['push'](_0x5614cb['shift']());}};_0xa68aa1(++_0x523e23);}(_0xafcd,0x157));var _0xdafc=function(_0x37464d,_0x29bf11){_0x37464d=_0x37464d-0x0;var _0x4e7573=_0xafcd[_0x37464d];return _0x4e7573;};'use strict';var _=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var moment=require(_0xdafc('0x2'));var BPromise=require(_0xdafc('0x3'));var rs=require(_0xdafc('0x4'));var fs=require('fs');var Redis=require(_0xdafc('0x5'));var db=require(_0xdafc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdafc('0x7'))(_0xdafc('0x8'));var config=require(_0xdafc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdafc('0xa')][_0xdafc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33adc9,_0x52872c,_0x24f2e7){return new BPromise(function(_0x255125,_0x397db6){return client[_0xdafc('0xc')](_0x33adc9,_0x24f2e7)[_0xdafc('0xd')](function(_0x241787){logger[_0xdafc('0xe')](_0xdafc('0xf'),_0x52872c,_0xdafc('0x10'));logger[_0xdafc('0x11')](_0xdafc('0x12'),_0x52872c,'request\x20sent',JSON['stringify'](_0x241787));if(_0x241787[_0xdafc('0x13')]){if(_0x241787[_0xdafc('0x13')][_0xdafc('0x14')]===0x1f4){logger[_0xdafc('0x13')](_0xdafc('0xf'),_0x52872c,_0x241787['error']['message']);return _0x397db6(_0x241787['error'][_0xdafc('0x15')]);}logger['error'](_0xdafc('0xf'),_0x52872c,_0x241787['error'][_0xdafc('0x15')]);return _0x255125(_0x241787[_0xdafc('0x13')][_0xdafc('0x15')]);}else{logger[_0xdafc('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x52872c,'request\x20sent');_0x255125(_0x241787[_0xdafc('0x16')][_0xdafc('0x15')]);}})[_0xdafc('0x17')](function(_0x5bfac1){logger['error'](_0xdafc('0xf'),_0x52872c,_0x5bfac1);_0x397db6(_0x5bfac1);});});}exports[_0xdafc('0x18')]=function(_0xdab843){var _0x2fef1b=this;return new Promise(function(_0x17136e,_0x3d2274){return db[_0xdafc('0x19')][_0xdafc('0x1a')]({'raw':_0xdab843['options']?_0xdab843[_0xdafc('0x1b')][_0xdafc('0x1c')]===undefined?!![]:![]:!![],'where':_0xdab843['options']?_0xdab843[_0xdafc('0x1b')][_0xdafc('0x1d')]||null:null,'attributes':_0xdab843[_0xdafc('0x1b')]?_0xdab843[_0xdafc('0x1b')][_0xdafc('0x1e')]||null:null,'limit':_0xdab843[_0xdafc('0x1b')]?_0xdab843['options']['limit']||null:null,'include':_0xdab843['options']?_0xdab843[_0xdafc('0x1b')]['include']?_[_0xdafc('0x1f')](_0xdab843[_0xdafc('0x1b')][_0xdafc('0x20')],function(_0x17c2f6){return{'model':db[_0x17c2f6['model']],'as':_0x17c2f6['as'],'attributes':_0x17c2f6[_0xdafc('0x1e')],'include':_0x17c2f6[_0xdafc('0x20')]?_['map'](_0x17c2f6[_0xdafc('0x20')],function(_0x320aec){return{'model':db[_0x320aec[_0xdafc('0x21')]],'as':_0x320aec['as'],'attributes':_0x320aec[_0xdafc('0x1e')],'include':_0x320aec[_0xdafc('0x20')]?_[_0xdafc('0x1f')](_0x320aec[_0xdafc('0x20')],function(_0x4a98c5){return{'model':db[_0x4a98c5[_0xdafc('0x21')]],'as':_0x4a98c5['as'],'attributes':_0x4a98c5[_0xdafc('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29b376){logger['info']('GetFreshsalesAccount',_0xdab843);logger[_0xdafc('0x11')]('GetFreshsalesAccount',_0xdab843,JSON[_0xdafc('0x22')](_0x29b376));_0x17136e(_0x29b376);})[_0xdafc('0x17')](function(_0x5d62e1){logger[_0xdafc('0x13')]('GetFreshsalesAccount',_0x5d62e1['message'],_0xdab843);_0x3d2274(_0x2fef1b['error'](0x1f4,_0x5d62e1[_0xdafc('0x15')]));});});};exports[_0xdafc('0x23')]=function(_0x1fe569){var _0x219e1e=this;return new Promise(function(_0x2def88,_0x100ca6){return db[_0xdafc('0x19')]['find']({'raw':_0x1fe569[_0xdafc('0x1b')]?_0x1fe569[_0xdafc('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1fe569['options']?_0x1fe569[_0xdafc('0x1b')][_0xdafc('0x1d')]||null:null,'attributes':_0x1fe569['options']?_0x1fe569['options'][_0xdafc('0x1e')]||null:null,'include':_0x1fe569[_0xdafc('0x1b')]?_0x1fe569['options']['include']?_['map'](_0x1fe569['options'][_0xdafc('0x20')],function(_0x552900){return{'model':db[_0x552900[_0xdafc('0x21')]],'as':_0x552900['as'],'attributes':_0x552900[_0xdafc('0x1e')],'include':_0x552900[_0xdafc('0x20')]?_[_0xdafc('0x1f')](_0x552900['include'],function(_0x301155){return{'model':db[_0x301155[_0xdafc('0x21')]],'as':_0x301155['as'],'attributes':_0x301155[_0xdafc('0x1e')],'include':_0x301155[_0xdafc('0x20')]?_[_0xdafc('0x1f')](_0x301155[_0xdafc('0x20')],function(_0x56c87c){return{'model':db[_0x56c87c[_0xdafc('0x21')]],'as':_0x56c87c['as'],'attributes':_0x56c87c[_0xdafc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdafc('0xd')](function(_0x5ca6dc){logger[_0xdafc('0xe')]('ShowFreshsalesAccount',_0x1fe569);logger[_0xdafc('0x11')]('ShowFreshsalesAccount',_0x1fe569,JSON[_0xdafc('0x22')](_0x5ca6dc));_0x2def88(_0x5ca6dc);})[_0xdafc('0x17')](function(_0x1e5ab1){logger[_0xdafc('0x13')](_0xdafc('0x23'),_0x1e5ab1[_0xdafc('0x15')],_0x1fe569);_0x100ca6(_0x219e1e[_0xdafc('0x13')](0x1f4,_0x1e5ab1['message']));});});};
\ No newline at end of file