Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / intFreshsalesAccount / intFreshsalesAccount.rpc.js
index 0a733bc..363ded7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ac2=['find','raw','ShowFreshsalesAccount','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','attributes','limit','include','model','map','then'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x6ac2,0x184));var _0x26ac=function(_0x43d050,_0x170448){_0x43d050=_0x43d050-0x0;var _0x157b31=_0x6ac2[_0x43d050];return _0x157b31;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});}exports[_0x26ac('0x13')]=function(_0xb03bbc){var _0x5cd737=this;return new Promise(function(_0x539eda,_0x111613){return db[_0x26ac('0x14')]['findAll']({'raw':_0xb03bbc[_0x26ac('0x15')]?_0xb03bbc['options']['raw']===undefined?!![]:![]:!![],'where':_0xb03bbc['options']?_0xb03bbc[_0x26ac('0x15')]['where']||null:null,'attributes':_0xb03bbc[_0x26ac('0x15')]?_0xb03bbc[_0x26ac('0x15')][_0x26ac('0x16')]||null:null,'limit':_0xb03bbc[_0x26ac('0x15')]?_0xb03bbc[_0x26ac('0x15')][_0x26ac('0x17')]||null:null,'include':_0xb03bbc[_0x26ac('0x15')]?_0xb03bbc[_0x26ac('0x15')][_0x26ac('0x18')]?_['map'](_0xb03bbc[_0x26ac('0x15')][_0x26ac('0x18')],function(_0x2b8299){return{'model':db[_0x2b8299[_0x26ac('0x19')]],'as':_0x2b8299['as'],'attributes':_0x2b8299[_0x26ac('0x16')],'include':_0x2b8299[_0x26ac('0x18')]?_[_0x26ac('0x1a')](_0x2b8299[_0x26ac('0x18')],function(_0x4172c2){return{'model':db[_0x4172c2[_0x26ac('0x19')]],'as':_0x4172c2['as'],'attributes':_0x4172c2['attributes'],'include':_0x4172c2['include']?_[_0x26ac('0x1a')](_0x4172c2['include'],function(_0x185296){return{'model':db[_0x185296[_0x26ac('0x19')]],'as':_0x185296['as'],'attributes':_0x185296[_0x26ac('0x16')]};}):[]};}):[]};}):[]:[]})[_0x26ac('0x1b')](function(_0x31cb17){logger[_0x26ac('0xb')]('GetFreshsalesAccount',_0xb03bbc);logger['debug'](_0x26ac('0x13'),_0xb03bbc,JSON[_0x26ac('0xf')](_0x31cb17));_0x539eda(_0x31cb17);})[_0x26ac('0x12')](function(_0x4d873e){logger['error'](_0x26ac('0x13'),_0x4d873e[_0x26ac('0x11')],_0xb03bbc);_0x111613(_0x5cd737[_0x26ac('0x10')](0x1f4,_0x4d873e[_0x26ac('0x11')]));});});};exports['ShowFreshsalesAccount']=function(_0x5e1cbc){var _0x3ea2f0=this;return new Promise(function(_0x3e2148,_0x17691a){return db[_0x26ac('0x14')][_0x26ac('0x1c')]({'raw':_0x5e1cbc[_0x26ac('0x15')]?_0x5e1cbc[_0x26ac('0x15')][_0x26ac('0x1d')]===undefined?!![]:![]:!![],'where':_0x5e1cbc[_0x26ac('0x15')]?_0x5e1cbc[_0x26ac('0x15')]['where']||null:null,'attributes':_0x5e1cbc[_0x26ac('0x15')]?_0x5e1cbc[_0x26ac('0x15')]['attributes']||null:null,'include':_0x5e1cbc[_0x26ac('0x15')]?_0x5e1cbc[_0x26ac('0x15')][_0x26ac('0x18')]?_[_0x26ac('0x1a')](_0x5e1cbc[_0x26ac('0x15')][_0x26ac('0x18')],function(_0x375f83){return{'model':db[_0x375f83[_0x26ac('0x19')]],'as':_0x375f83['as'],'attributes':_0x375f83[_0x26ac('0x16')],'include':_0x375f83[_0x26ac('0x18')]?_[_0x26ac('0x1a')](_0x375f83[_0x26ac('0x18')],function(_0x583109){return{'model':db[_0x583109[_0x26ac('0x19')]],'as':_0x583109['as'],'attributes':_0x583109[_0x26ac('0x16')],'include':_0x583109[_0x26ac('0x18')]?_['map'](_0x583109[_0x26ac('0x18')],function(_0x4a842a){return{'model':db[_0x4a842a[_0x26ac('0x19')]],'as':_0x4a842a['as'],'attributes':_0x4a842a[_0x26ac('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x66dc0c){logger[_0x26ac('0xb')](_0x26ac('0x1e'),_0x5e1cbc);logger[_0x26ac('0x1f')](_0x26ac('0x1e'),_0x5e1cbc,JSON[_0x26ac('0xf')](_0x66dc0c));_0x3e2148(_0x66dc0c);})['catch'](function(_0x76f6c4){logger['error'](_0x26ac('0x1e'),_0x76f6c4['message'],_0x5e1cbc);_0x17691a(_0x3ea2f0[_0x26ac('0x10')](0x1f4,_0x76f6c4['message']));});});};
\ No newline at end of file
+var _0xd48e=['map','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FreshsalesAccount,\x20%s,\x20%s','message','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include'];(function(_0x10daff,_0x44a2dc){var _0x3ea007=function(_0x271863){while(--_0x271863){_0x10daff['push'](_0x10daff['shift']());}};_0x3ea007(++_0x44a2dc);}(_0xd48e,0x93));var _0xed48=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xd48e[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require(_0xed48('0x0'));var moment=require(_0xed48('0x1'));var BPromise=require(_0xed48('0x2'));var rs=require(_0xed48('0x3'));var fs=require('fs');var Redis=require(_0xed48('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed48('0x5'));var logger=require(_0xed48('0x6'))(_0xed48('0x7'));var config=require('../../config/environment');var jayson=require(_0xed48('0x8'));var client=jayson[_0xed48('0x9')][_0xed48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50b4ce,_0x2cc522,_0x1c9299){return new BPromise(function(_0x52a5e2,_0x5f0f1b){return client['request'](_0x50b4ce,_0x1c9299)[_0xed48('0xb')](function(_0x28096a){logger[_0xed48('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x2cc522,'request\x20sent');logger[_0xed48('0xd')](_0xed48('0xe'),_0x2cc522,_0xed48('0xf'),JSON['stringify'](_0x28096a));if(_0x28096a[_0xed48('0x10')]){if(_0x28096a[_0xed48('0x10')][_0xed48('0x11')]===0x1f4){logger[_0xed48('0x10')](_0xed48('0x12'),_0x2cc522,_0x28096a[_0xed48('0x10')][_0xed48('0x13')]);return _0x5f0f1b(_0x28096a[_0xed48('0x10')][_0xed48('0x13')]);}logger[_0xed48('0x10')](_0xed48('0x12'),_0x2cc522,_0x28096a[_0xed48('0x10')][_0xed48('0x13')]);return _0x52a5e2(_0x28096a['error'][_0xed48('0x13')]);}else{logger['info'](_0xed48('0x12'),_0x2cc522,'request\x20sent');_0x52a5e2(_0x28096a['result'][_0xed48('0x13')]);}})[_0xed48('0x14')](function(_0x3dd77d){logger[_0xed48('0x10')](_0xed48('0x12'),_0x2cc522,_0x3dd77d);_0x5f0f1b(_0x3dd77d);});});}exports['GetFreshsalesAccount']=function(_0x355224){var _0x5a058c=this;return new Promise(function(_0x10c4a8,_0x4e5eaf){return db[_0xed48('0x15')][_0xed48('0x16')]({'raw':_0x355224[_0xed48('0x17')]?_0x355224['options']['raw']===undefined?!![]:![]:!![],'where':_0x355224[_0xed48('0x17')]?_0x355224[_0xed48('0x17')][_0xed48('0x18')]||null:null,'attributes':_0x355224['options']?_0x355224[_0xed48('0x17')][_0xed48('0x19')]||null:null,'limit':_0x355224[_0xed48('0x17')]?_0x355224['options'][_0xed48('0x1a')]||null:null,'include':_0x355224[_0xed48('0x17')]?_0x355224[_0xed48('0x17')][_0xed48('0x1b')]?_[_0xed48('0x1c')](_0x355224[_0xed48('0x17')]['include'],function(_0x2683e4){return{'model':db[_0x2683e4['model']],'as':_0x2683e4['as'],'attributes':_0x2683e4[_0xed48('0x19')],'include':_0x2683e4[_0xed48('0x1b')]?_[_0xed48('0x1c')](_0x2683e4['include'],function(_0x4b460f){return{'model':db[_0x4b460f[_0xed48('0x1d')]],'as':_0x4b460f['as'],'attributes':_0x4b460f[_0xed48('0x19')],'include':_0x4b460f[_0xed48('0x1b')]?_[_0xed48('0x1c')](_0x4b460f[_0xed48('0x1b')],function(_0x28dbf6){return{'model':db[_0x28dbf6[_0xed48('0x1d')]],'as':_0x28dbf6['as'],'attributes':_0x28dbf6['attributes']};}):[]};}):[]};}):[]:[]})[_0xed48('0xb')](function(_0x3ce573){logger[_0xed48('0xc')]('GetFreshsalesAccount',_0x355224);logger[_0xed48('0xd')](_0xed48('0x1e'),_0x355224,JSON['stringify'](_0x3ce573));_0x10c4a8(_0x3ce573);})[_0xed48('0x14')](function(_0x5ed24d){logger['error'](_0xed48('0x1e'),_0x5ed24d['message'],_0x355224);_0x4e5eaf(_0x5a058c['error'](0x1f4,_0x5ed24d[_0xed48('0x13')]));});});};exports[_0xed48('0x1f')]=function(_0xc1b7da){var _0x52246b=this;return new Promise(function(_0x1ca723,_0x7c59){return db[_0xed48('0x15')][_0xed48('0x20')]({'raw':_0xc1b7da['options']?_0xc1b7da['options'][_0xed48('0x21')]===undefined?!![]:![]:!![],'where':_0xc1b7da['options']?_0xc1b7da[_0xed48('0x17')][_0xed48('0x18')]||null:null,'attributes':_0xc1b7da[_0xed48('0x17')]?_0xc1b7da[_0xed48('0x17')]['attributes']||null:null,'include':_0xc1b7da['options']?_0xc1b7da[_0xed48('0x17')][_0xed48('0x1b')]?_[_0xed48('0x1c')](_0xc1b7da[_0xed48('0x17')][_0xed48('0x1b')],function(_0x32d3a8){return{'model':db[_0x32d3a8[_0xed48('0x1d')]],'as':_0x32d3a8['as'],'attributes':_0x32d3a8[_0xed48('0x19')],'include':_0x32d3a8[_0xed48('0x1b')]?_[_0xed48('0x1c')](_0x32d3a8[_0xed48('0x1b')],function(_0x33db30){return{'model':db[_0x33db30['model']],'as':_0x33db30['as'],'attributes':_0x33db30[_0xed48('0x19')],'include':_0x33db30[_0xed48('0x1b')]?_[_0xed48('0x1c')](_0x33db30[_0xed48('0x1b')],function(_0x8f2fe){return{'model':db[_0x8f2fe[_0xed48('0x1d')]],'as':_0x8f2fe['as'],'attributes':_0x8f2fe[_0xed48('0x19')]};}):[]};}):[]};}):[]:[]})[_0xed48('0xb')](function(_0x17ed62){logger[_0xed48('0xc')]('ShowFreshsalesAccount',_0xc1b7da);logger[_0xed48('0xd')](_0xed48('0x1f'),_0xc1b7da,JSON[_0xed48('0x22')](_0x17ed62));_0x1ca723(_0x17ed62);})[_0xed48('0x14')](function(_0x5426c4){logger[_0xed48('0x10')](_0xed48('0x1f'),_0x5426c4['message'],_0xc1b7da);_0x7c59(_0x52246b[_0xed48('0x10')](0x1f4,_0x5426c4[_0xed48('0x13')]));});});};
\ No newline at end of file