73f662b39c8624fb6488567d91388a2c34666a05
[motion-next.git] / server / api / intFreshsalesAccount / intFreshsalesAccount.rpc.js
1 const a270_0x518f=['raw','catch','stringify','options','attributes','model','error','map','debug','include','../../mysqldb','where','FreshsalesAccount','message','GetFreshsalesAccount','lodash','ShowFreshsalesAccount','../../config/logger','limit','findOne','then'];(function(_0x20776b,_0x518f9c){const _0x36d567=function(_0x22c1bc){while(--_0x22c1bc){_0x20776b['push'](_0x20776b['shift']());}};_0x36d567(++_0x518f9c);}(a270_0x518f,0xea));const a270_0x36d5=function(_0x20776b,_0x518f9c){_0x20776b=_0x20776b-0x0;let _0x36d567=a270_0x518f[_0x20776b];return _0x36d567;};const _0x12ab16=a270_0x36d5;'use strict';const _=require(_0x12ab16('0xc')),db=require(_0x12ab16('0x7'))['db'],logger=require(_0x12ab16('0xe'))('rpc');exports[_0x12ab16('0xb')]=function(_0x22c1bc){const _0x2e4ab0=this;return new Promise(function(_0x491a8d,_0x2ea0fc){const _0x284df3=a270_0x36d5;return db[_0x284df3('0x9')]['findAll']({'raw':_0x22c1bc['options']?_0x22c1bc[_0x284df3('0x0')]['raw']===undefined?!![]:![]:!![],'where':_0x22c1bc[_0x284df3('0x0')]?_0x22c1bc[_0x284df3('0x0')][_0x284df3('0x8')]||null:null,'attributes':_0x22c1bc[_0x284df3('0x0')]?_0x22c1bc[_0x284df3('0x0')][_0x284df3('0x1')]||null:null,'limit':_0x22c1bc[_0x284df3('0x0')]?_0x22c1bc[_0x284df3('0x0')][_0x284df3('0xf')]||null:null,'include':_0x22c1bc[_0x284df3('0x0')]?_0x22c1bc[_0x284df3('0x0')][_0x284df3('0x6')]?_['map'](_0x22c1bc[_0x284df3('0x0')]['include'],function(_0x3ab3eb){const _0x304779=_0x284df3;return{'model':db[_0x3ab3eb[_0x304779('0x2')]],'as':_0x3ab3eb['as'],'attributes':_0x3ab3eb[_0x304779('0x1')],'include':_0x3ab3eb['include']?_[_0x304779('0x4')](_0x3ab3eb[_0x304779('0x6')],function(_0x3af9db){const _0x2a0481=_0x304779;return{'model':db[_0x3af9db[_0x2a0481('0x2')]],'as':_0x3af9db['as'],'attributes':_0x3af9db[_0x2a0481('0x1')],'include':_0x3af9db['include']?_[_0x2a0481('0x4')](_0x3af9db[_0x2a0481('0x6')],function(_0x53c3a7){const _0x31536d=_0x2a0481;return{'model':db[_0x53c3a7[_0x31536d('0x2')]],'as':_0x53c3a7['as'],'attributes':_0x53c3a7[_0x31536d('0x1')]};}):[]};}):[]};}):[]:[]})[_0x284df3('0x11')](function(_0x394453){const _0x17d830=_0x284df3;logger['info']('GetFreshsalesAccount',_0x22c1bc),logger['debug'](_0x17d830('0xb'),_0x22c1bc,JSON['stringify'](_0x394453)),_0x491a8d(_0x394453);})[_0x284df3('0x13')](function(_0x4bcfaf){const _0x169b9a=_0x284df3;logger['error']('GetFreshsalesAccount',_0x4bcfaf['message'],_0x22c1bc),_0x2ea0fc(_0x2e4ab0[_0x169b9a('0x3')](0x1f4,_0x4bcfaf[_0x169b9a('0xa')]));});});},exports['ShowFreshsalesAccount']=function(_0x3c977e){const _0x866cac=this;return new Promise(function(_0x23afca,_0xa2a245){const _0x37d9a1=a270_0x36d5;return db[_0x37d9a1('0x9')][_0x37d9a1('0x10')]({'raw':_0x3c977e[_0x37d9a1('0x0')]?_0x3c977e[_0x37d9a1('0x0')][_0x37d9a1('0x12')]===undefined?!![]:![]:!![],'where':_0x3c977e['options']?_0x3c977e[_0x37d9a1('0x0')]['where']||null:null,'attributes':_0x3c977e['options']?_0x3c977e[_0x37d9a1('0x0')][_0x37d9a1('0x1')]||null:null,'include':_0x3c977e[_0x37d9a1('0x0')]?_0x3c977e['options'][_0x37d9a1('0x6')]?_[_0x37d9a1('0x4')](_0x3c977e[_0x37d9a1('0x0')]['include'],function(_0x56db19){const _0x1e28be=_0x37d9a1;return{'model':db[_0x56db19[_0x1e28be('0x2')]],'as':_0x56db19['as'],'attributes':_0x56db19[_0x1e28be('0x1')],'include':_0x56db19[_0x1e28be('0x6')]?_[_0x1e28be('0x4')](_0x56db19[_0x1e28be('0x6')],function(_0x339b52){const _0x343007=_0x1e28be;return{'model':db[_0x339b52[_0x343007('0x2')]],'as':_0x339b52['as'],'attributes':_0x339b52[_0x343007('0x1')],'include':_0x339b52[_0x343007('0x6')]?_[_0x343007('0x4')](_0x339b52[_0x343007('0x6')],function(_0x73d48){const _0x37f991=_0x343007;return{'model':db[_0x73d48[_0x37f991('0x2')]],'as':_0x73d48['as'],'attributes':_0x73d48[_0x37f991('0x1')]};}):[]};}):[]};}):[]:[]})[_0x37d9a1('0x11')](function(_0x7147d5){const _0x242055=_0x37d9a1;logger['info'](_0x242055('0xd'),_0x3c977e),logger[_0x242055('0x5')](_0x242055('0xd'),_0x3c977e,JSON[_0x242055('0x14')](_0x7147d5)),_0x23afca(_0x7147d5);})[_0x37d9a1('0x13')](function(_0x5abc93){const _0x2bdd59=_0x37d9a1;logger['error'](_0x2bdd59('0xd'),_0x5abc93[_0x2bdd59('0xa')],_0x3c977e),_0xa2a245(_0x866cac['error'](0x1f4,_0x5abc93['message']));});});};