Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / server / api / intZohoAccount / intZohoAccount.options.js
1 const a418_0x157f=['1151427FxQWsL','3HKtfmc','727877Unizgq','util','lastIndexOf','refreshToken','substring','api','parse','https://accounts.zoho.com','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','then','slice','@config/logger','info','https://accounts.zoho.eu','int_zoho_accounts','875808jOzmgH','https://accounts.zoho.com.cn','changed','catch','exports','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','serverUrl','https://accounts.zoho.com.au','name','format','clientSecret','options','refresh_token','21468HqLKgG','1LTVmyr','inspect','request-promise-native','6VNooHV','POST','zone','code','clientId','1712990GKMsgZ','application/x-www-form-urlencoded','48hQBIfX','364268zWnqjo','1EbhFjM','/oauth/v2/token','1592031lWJbVg'];const a418_0x3f56=function(_0x4ded5a,_0xac7dc0){_0x4ded5a=_0x4ded5a-0x1b3;let _0x157f34=a418_0x157f[_0x4ded5a];return _0x157f34;};const a418_0x345ec3=a418_0x3f56;(function(_0x50d233,_0x5871fb){const _0x74ef1f=a418_0x3f56;while(!![]){try{const _0x9e8a19=parseInt(_0x74ef1f(0x1b4))*parseInt(_0x74ef1f(0x1bc))+parseInt(_0x74ef1f(0x1c2))+parseInt(_0x74ef1f(0x1bf))*-parseInt(_0x74ef1f(0x1c4))+parseInt(_0x74ef1f(0x1b3))*parseInt(_0x74ef1f(0x1be))+parseInt(_0x74ef1f(0x1c3))*parseInt(_0x74ef1f(0x1c0))+parseInt(_0x74ef1f(0x1d6))+parseInt(_0x74ef1f(0x1b7))*-parseInt(_0x74ef1f(0x1c5));if(_0x9e8a19===_0x5871fb)break;else _0x50d233['push'](_0x50d233['shift']());}catch(_0x3ce3bd){_0x50d233['push'](_0x50d233['shift']());}}}(a418_0x157f,0xdc5fe));const util=require(a418_0x345ec3(0x1c6)),rp=require(a418_0x345ec3(0x1b6)),logger=require(a418_0x345ec3(0x1d2))(a418_0x345ec3(0x1ca));function options(_0x3aea0e){const _0x12945c=a418_0x345ec3;return{'sequelize':_0x3aea0e,'tableName':_0x12945c(0x1d5),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1207b0){const _0x5e9b4f=_0x12945c;if(_0x1207b0['changed'](_0x5e9b4f(0x1b9))||_0x1207b0[_0x5e9b4f(0x1d8)](_0x5e9b4f(0x1dc))||_0x1207b0[_0x5e9b4f(0x1d8)](_0x5e9b4f(0x1bb))||_0x1207b0['changed'](_0x5e9b4f(0x1e0))||_0x1207b0[_0x5e9b4f(0x1d8)]('code')||_0x1207b0[_0x5e9b4f(0x1d8)]('host')){let _0x2f1e8f,_0x31acd6;_0x2f1e8f=_0x1207b0[_0x5e9b4f(0x1dc)];const _0x19b52f=_0x2f1e8f[_0x5e9b4f(0x1d1)](-0x1);(_0x19b52f==='/'||_0x19b52f==='\x5c'||_0x19b52f===':')&&(_0x2f1e8f=_0x2f1e8f['substring'](0x0,_0x2f1e8f[_0x5e9b4f(0x1c7)](_0x19b52f)));switch(_0x1207b0[_0x5e9b4f(0x1b9)]){case'US':_0x31acd6=_0x5e9b4f(0x1cc);break;case'AU':_0x31acd6='https://accounts.zoho.com.au';break;case'IN':_0x31acd6='https://accounts.zoho.in';break;case'CN':_0x31acd6=_0x5e9b4f(0x1d7);break;default:_0x31acd6=_0x5e9b4f(0x1d4);break;}const _0xf52e9c={'method':_0x5e9b4f(0x1b8),'uri':_0x31acd6+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x1207b0[_0x5e9b4f(0x1bb)],'client_secret':_0x1207b0['clientSecret'],'redirect_uri':_0x1207b0[_0x5e9b4f(0x1dc)],'code':_0x1207b0[_0x5e9b4f(0x1ba)]},'headers':{'Content-Type':_0x5e9b4f(0x1bd)}};return rp(_0xf52e9c)['then'](function(_0xd0fee5){const _0x1da836=_0x5e9b4f,_0x28e827=JSON[_0x1da836(0x1cb)](_0xd0fee5);_0x28e827[_0x1da836(0x1e2)]?(_0x1207b0[_0x1da836(0x1c8)]=_0x28e827[_0x1da836(0x1e2)],logger['info'](util[_0x1da836(0x1df)](_0x1da836(0x1db),_0x1207b0[_0x1da836(0x1de)],_0x1207b0['id']))):logger[_0x1da836(0x1cd)](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1207b0['name'],_0x1207b0['id']),util[_0x1da836(0x1b5)](_0x28e827,{'showHidden':![],'depth':null}));})[_0x5e9b4f(0x1d9)](function(_0x16d954){const _0x8a091d=_0x5e9b4f;logger[_0x8a091d(0x1cd)](util[_0x8a091d(0x1df)]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1207b0[_0x8a091d(0x1de)],_0x1207b0['id']));throw _0x16d954;});}},'beforeUpdate':function(_0x170046){const _0x393a55=_0x12945c;if(_0x170046[_0x393a55(0x1d8)](_0x393a55(0x1b9))||_0x170046[_0x393a55(0x1d8)](_0x393a55(0x1dc))||_0x170046[_0x393a55(0x1d8)](_0x393a55(0x1bb))||_0x170046[_0x393a55(0x1d8)](_0x393a55(0x1e0))||_0x170046[_0x393a55(0x1d8)]('code')||_0x170046['changed'](_0x393a55(0x1cf))){let _0x2bf5a2,_0x35966d;_0x2bf5a2=_0x170046[_0x393a55(0x1dc)];const _0x195ca0=_0x2bf5a2[_0x393a55(0x1d1)](-0x1);(_0x195ca0==='/'||_0x195ca0==='\x5c'||_0x195ca0===':')&&(_0x2bf5a2=_0x2bf5a2[_0x393a55(0x1c9)](0x0,_0x2bf5a2['lastIndexOf'](_0x195ca0)));switch(_0x170046[_0x393a55(0x1b9)]){case'US':_0x35966d=_0x393a55(0x1cc);break;case'AU':_0x35966d=_0x393a55(0x1dd);break;case'IN':_0x35966d='https://accounts.zoho.in';break;case'CN':_0x35966d=_0x393a55(0x1d7);break;default:_0x35966d=_0x393a55(0x1d4);break;}const _0x4d1d4d={'method':_0x393a55(0x1b8),'uri':_0x35966d+_0x393a55(0x1c1),'form':{'grant_type':'authorization_code','client_id':_0x170046[_0x393a55(0x1bb)],'client_secret':_0x170046[_0x393a55(0x1e0)],'redirect_uri':_0x170046['serverUrl'],'code':_0x170046[_0x393a55(0x1ba)]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4d1d4d)[_0x393a55(0x1d0)](function(_0x206acf){const _0x5de14d=_0x393a55,_0x1a2baf=JSON[_0x5de14d(0x1cb)](_0x206acf);_0x1a2baf[_0x5de14d(0x1e2)]?(_0x170046[_0x5de14d(0x1c8)]=_0x1a2baf['refresh_token'],logger[_0x5de14d(0x1d3)](util[_0x5de14d(0x1df)](_0x5de14d(0x1db),_0x170046[_0x5de14d(0x1de)],_0x170046['id']))):logger[_0x5de14d(0x1cd)](util['format'](_0x5de14d(0x1ce),_0x170046[_0x5de14d(0x1de)],_0x170046['id']),util[_0x5de14d(0x1b5)](_0x1a2baf,{'showHidden':![],'depth':null}));})[_0x393a55(0x1d9)](function(_0x28fd08){const _0x457b8c=_0x393a55;logger[_0x457b8c(0x1cd)](util[_0x457b8c(0x1df)](_0x457b8c(0x1ce),_0x170046[_0x457b8c(0x1de)],_0x170046['id']));throw _0x28fd08;});}}}};}module[a418_0x345ec3(0x1da)][a418_0x345ec3(0x1e1)]=options;