45d15488f93eb24cc8dca322dcca82b9801a4e8e
[motion-next.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
1 const a348_0x3e50=['message','map','stringify','raw','ShowZohoAccount','options','GetZohoAccount','include','ZohoAccount','lodash','attributes','catch','model','rpc','debug','where','error','then','info'];(function(_0x1a3bcb,_0x3e5094){const _0xc75eb2=function(_0x3bd9dc){while(--_0x3bd9dc){_0x1a3bcb['push'](_0x1a3bcb['shift']());}};_0xc75eb2(++_0x3e5094);}(a348_0x3e50,0xf2));const a348_0xc75e=function(_0x1a3bcb,_0x3e5094){_0x1a3bcb=_0x1a3bcb-0x0;let _0xc75eb2=a348_0x3e50[_0x1a3bcb];return _0xc75eb2;};const _0x3c0735=a348_0xc75e;'use strict';const _=require(_0x3c0735('0xe')),db=require('../../mysqldb')['db'],logger=require('../../config/logger')(_0x3c0735('0x12'));exports[_0x3c0735('0xb')]=function(_0x3bd9dc){const _0x3e6b38=this;return new Promise(function(_0x4c2902,_0x464e8b){const _0x498e85=a348_0xc75e;return db[_0x498e85('0xd')]['findAll']({'raw':_0x3bd9dc[_0x498e85('0xa')]?_0x3bd9dc[_0x498e85('0xa')][_0x498e85('0x8')]===undefined?!![]:![]:!![],'where':_0x3bd9dc[_0x498e85('0xa')]?_0x3bd9dc[_0x498e85('0xa')][_0x498e85('0x1')]||null:null,'attributes':_0x3bd9dc[_0x498e85('0xa')]?_0x3bd9dc[_0x498e85('0xa')][_0x498e85('0xf')]||null:null,'limit':_0x3bd9dc[_0x498e85('0xa')]?_0x3bd9dc[_0x498e85('0xa')]['limit']||null:null,'include':_0x3bd9dc['options']?_0x3bd9dc['options']['include']?_[_0x498e85('0x6')](_0x3bd9dc[_0x498e85('0xa')]['include'],function(_0x13d3f5){const _0x3bc503=_0x498e85;return{'model':db[_0x13d3f5[_0x3bc503('0x11')]],'as':_0x13d3f5['as'],'attributes':_0x13d3f5[_0x3bc503('0xf')],'include':_0x13d3f5[_0x3bc503('0xc')]?_[_0x3bc503('0x6')](_0x13d3f5[_0x3bc503('0xc')],function(_0x1862cf){const _0x3cb12b=_0x3bc503;return{'model':db[_0x1862cf[_0x3cb12b('0x11')]],'as':_0x1862cf['as'],'attributes':_0x1862cf[_0x3cb12b('0xf')],'include':_0x1862cf[_0x3cb12b('0xc')]?_[_0x3cb12b('0x6')](_0x1862cf['include'],function(_0x3fe9a6){const _0x1c2b32=_0x3cb12b;return{'model':db[_0x3fe9a6[_0x1c2b32('0x11')]],'as':_0x3fe9a6['as'],'attributes':_0x3fe9a6[_0x1c2b32('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38a397){const _0x56ba7a=_0x498e85;logger[_0x56ba7a('0x4')]('GetZohoAccount',_0x3bd9dc),logger[_0x56ba7a('0x0')](_0x56ba7a('0xb'),_0x3bd9dc,JSON['stringify'](_0x38a397)),_0x4c2902(_0x38a397);})[_0x498e85('0x10')](function(_0x1f36cb){const _0x29c95e=_0x498e85;logger[_0x29c95e('0x2')](_0x29c95e('0xb'),_0x1f36cb['message'],_0x3bd9dc),_0x464e8b(_0x3e6b38[_0x29c95e('0x2')](0x1f4,_0x1f36cb['message']));});});},exports[_0x3c0735('0x9')]=function(_0x120dca){const _0x5975da=this;return new Promise(function(_0xdd2f8b,_0x33fbb3){const _0x492523=a348_0xc75e;return db[_0x492523('0xd')]['findOne']({'raw':_0x120dca[_0x492523('0xa')]?_0x120dca['options'][_0x492523('0x8')]===undefined?!![]:![]:!![],'where':_0x120dca['options']?_0x120dca[_0x492523('0xa')][_0x492523('0x1')]||null:null,'attributes':_0x120dca['options']?_0x120dca[_0x492523('0xa')]['attributes']||null:null,'include':_0x120dca[_0x492523('0xa')]?_0x120dca[_0x492523('0xa')]['include']?_[_0x492523('0x6')](_0x120dca[_0x492523('0xa')]['include'],function(_0x40e420){const _0x318042=_0x492523;return{'model':db[_0x40e420[_0x318042('0x11')]],'as':_0x40e420['as'],'attributes':_0x40e420[_0x318042('0xf')],'include':_0x40e420['include']?_[_0x318042('0x6')](_0x40e420['include'],function(_0x20d0e2){const _0x3574ab=_0x318042;return{'model':db[_0x20d0e2[_0x3574ab('0x11')]],'as':_0x20d0e2['as'],'attributes':_0x20d0e2[_0x3574ab('0xf')],'include':_0x20d0e2[_0x3574ab('0xc')]?_[_0x3574ab('0x6')](_0x20d0e2[_0x3574ab('0xc')],function(_0x4034a9){const _0x2b10dd=_0x3574ab;return{'model':db[_0x4034a9[_0x2b10dd('0x11')]],'as':_0x4034a9['as'],'attributes':_0x4034a9[_0x2b10dd('0xf')]};}):[]};}):[]};}):[]:[]})[_0x492523('0x3')](function(_0x1b9fcf){const _0x129295=_0x492523;logger['info'](_0x129295('0x9'),_0x120dca),logger['debug'](_0x129295('0x9'),_0x120dca,JSON[_0x129295('0x7')](_0x1b9fcf)),_0xdd2f8b(_0x1b9fcf);})[_0x492523('0x10')](function(_0x56813b){const _0x412cd6=_0x492523;logger[_0x412cd6('0x2')](_0x412cd6('0x9'),_0x56813b[_0x412cd6('0x5')],_0x120dca),_0x33fbb3(_0x5975da[_0x412cd6('0x2')](0x1f4,_0x56813b[_0x412cd6('0x5')]));});});};