@ranger-testing/ranger-cli 3.1.6-alpha.aca5f9c-53 → 3.1.6-alpha.cbf7608-55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/scenarioOriginCheck.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +14 -5
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xe4ce29,_0x3d7cf3){const _0xa3da43=_0x2836,_0x475f0a=_0xe4ce29();while(!![]){try{const _0x144c88=parseInt(_0xa3da43(0x1c3))/0x1*(parseInt(_0xa3da43(0x212))/0x2)+parseInt(_0xa3da43(0x1e9))/0x3+parseInt(_0xa3da43(0x1fe))/0x4+parseInt(_0xa3da43(0x1d6))/0x5+parseInt(_0xa3da43(0x22a))/0x6*(-parseInt(_0xa3da43(0x21f))/0x7)+-parseInt(_0xa3da43(0x1bb))/0x8+-parseInt(_0xa3da43(0x235))/0x9;if(_0x144c88===_0x3d7cf3)break;else _0x475f0a['push'](_0x475f0a['shift']());}catch(_0x12359d){_0x475f0a['push'](_0x475f0a['shift']());}}}(_0x1a7b,0xf1c22));import{readdir,rm}from'fs/promises';function _0x2836(_0x35f9fc,_0x5a6160){_0x35f9fc=_0x35f9fc-0x1ac;const _0x1a7bc2=_0x1a7b();let _0x2836ea=_0x1a7bc2[_0x35f9fc];return _0x2836ea;}import{join}from'path';import{existsSync}from'fs';import _0x2b71a3 from'inquirer';function _0x1a7b(){const _0x4413df=['AFaIS','list','retry','TrHlR','log','DlRZh','yTxyZ','HEAD','name','6054388VVbbXu','xqbUp','profile.add.autoRouted','input','DeVfr','\x20\x20Did\x20you\x20mean\x20','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','prompt','trackPhaseEnd','\x0a✓\x20Profile\x20\x27','ERkpX','error','✓\x20Profile\x20\x27','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','lajQo','some','Found\x20auth\x20environment\x20\x27','isTTY','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','YIxyV','50822SArXNS','\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','profile.add.autoRouteSkipped','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20','url','TypeError','SSGEk','cdpEndpoint','startsWith','http://','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','pwfCf','42fBGeXF','ZmMvG','test','\x20--url\x20','QTdrF','JFivS','khMGp','\x0a\x20\x20Auth\x20environment\x20\x22','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','TzoMP','exit','911622GQikwB','ixoPh','VJYlH','RAnEi','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.','yes','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','Use\x20','XRmUP','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20','\x20Configured\x20envs:\x20','14320134njbmsn','XSNhz','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','baseUrl','\x27\x20to\x20the\x20cloud?','\x27\x20matching\x20','isElectron','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','message','\x22:\x20','boTnm','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','\x27\x20created\x20(no\x20session).\x0a','egKqa','no_auth_config','\x20--skip-auth\x0a','skipAuth','indexOf','\x27\x20created.\x0a','7055544MDwAJd','status','beREe','hUeCB','trim','BKmsG','xDRBN','zTsai','69WQZgGY','\x0a🌐\x20Profile\x20Setup\x0a','stdout','kEilj','\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','DZarU','isProtocolError','✓\x20Cloud\x20profile\x20\x27','KWEAc','gDhkw','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','cwd','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','no_match','\x20\x20Set\x20active\x20profile:\x20','2917980urbejO','Continue\x20anyway','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','keys','env_not_found','Ryljw','setupHeader','length','authEnv','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','environments','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','\x20\x20https://docs.ranger.net/main/concepts/profiles','Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000','fetch\x20failed','YAZOo','rbjYD','1573143qIkxBo','--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','includes','saveToCloud','setupHeaders','EZePF','origin','action','force','What\x20would\x20you\x20like\x20to\x20do?','join','http://localhost:3000'];_0x1a7b=function(){return _0x4413df;};return _0x1a7b();}import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING='This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization';function warnCloudProfileSharedInOrg(){const _0x299297=_0x2836;if(!process[_0x299297(0x1c5)][_0x299297(0x20f)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x529afd){const _0x12a9a1=_0x2836,_0x5585ef={'tQwDO':function(_0xd0565c,_0x41a45d){return _0xd0565c<_0x41a45d;},'TrHlR':function(_0x441b57,_0xcfbb12){return _0x441b57===_0xcfbb12;},'KWEAc':_0x12a9a1(0x218),'qgxmu':_0x12a9a1(0x1e6)};try{const _0xe5a2c8=new AbortController(),_0x59bfa5=setTimeout(()=>_0xe5a2c8['abort'](),0x1388),_0x5592bc={'method':_0x12a9a1(0x1fc),'signal':_0xe5a2c8['signal'],'redirect':'manual'};/^https:\/\/localhost(:\d+)?/i['test'](_0x529afd)&&(process['env']['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x3b918a=await fetch(_0x529afd,_0x5592bc);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x59bfa5);if(_0x5585ef['tQwDO'](_0x3b918a[_0x12a9a1(0x1bc)],0x190))return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x3b918a[_0x12a9a1(0x1bc)]};}catch(_0x198b15){delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x4e8a04=_0x198b15,_0xabd8b4=_0x4e8a04['message']||String(_0x198b15),_0x1d0e36=_0xabd8b4['includes']('Invalid\x20URL')||_0x5585ef[_0x12a9a1(0x1f8)](_0x4e8a04[_0x12a9a1(0x1fd)],_0x5585ef[_0x12a9a1(0x1cd)])||_0xabd8b4[_0x12a9a1(0x1eb)](_0x5585ef['qgxmu']);return{'ok':![],'error':_0xabd8b4,'isProtocolError':_0x1d0e36};}}async function sweepOrphanLocalProfile(_0x17939c,_0x1c4f04,_0x34d8ae){const _0x13bad1=_0x2836,_0x288f01={'AYehI':function(_0xf57b5a,_0x53f042){return _0xf57b5a(_0x53f042);},'boTnm':function(_0x985d73,_0x3c4d8a,_0x1ed60f){return _0x985d73(_0x3c4d8a,_0x1ed60f);}},_0x9fcfd0=join(_0x1c4f04,'local'),_0x311a1d=join(_0x9fcfd0,_0x17939c);existsSync(_0x311a1d)&&(_0x34d8ae&&await isPathGitTracked(_0x311a1d)?console['log']('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x311a1d+_0x13bad1(0x21d)):(await rm(_0x311a1d,{'recursive':!![],'force':!![]}),console[_0x13bad1(0x1f9)](_0x13bad1(0x1e3)+_0x311a1d)));if(existsSync(_0x9fcfd0)){let _0x7eea84=[];try{_0x7eea84=await _0x288f01['AYehI'](readdir,_0x9fcfd0);}catch{return;}const _0xe059c0='.tmp-'+_0x17939c+'-';for(const _0x454ad9 of _0x7eea84){if(!_0x454ad9[_0x13bad1(0x21b)](_0xe059c0))continue;const _0x82f2e0=join(_0x9fcfd0,_0x454ad9);await _0x288f01[_0x13bad1(0x1b2)](rm,_0x82f2e0,{'recursive':!![],'force':!![]}),console['log'](_0x13bad1(0x1e3)+_0x82f2e0);}}}async function sweepOrphansBestEffort(_0x45bf32){const _0x36ee55=_0x2836,_0xa8178={'DVtKr':function(_0x3c8c29,_0x4c4a4e,_0x526e86,_0x407195){return _0x3c8c29(_0x4c4a4e,_0x526e86,_0x407195);},'UBRke':function(_0x3fa05f){return _0x3fa05f();},'GlMqZ':function(_0x2f64f0){return _0x2f64f0();},'JFivS':function(_0x3e962d,_0x498bf8,_0x1faaeb,_0x31ced9){return _0x3e962d(_0x498bf8,_0x1faaeb,_0x31ced9);},'kEilj':function(_0x502815,_0x1a0d8a){return _0x502815 instanceof _0x1a0d8a;}};try{await _0xa8178['DVtKr'](sweepOrphanLocalProfile,_0x45bf32,_0xa8178['UBRke'](getRangerHomeDir),![]);const _0x25c294=_0xa8178['GlMqZ'](getRangerDir);_0x25c294!==getRangerHomeDir()&&await _0xa8178[_0x36ee55(0x224)](sweepOrphanLocalProfile,_0x45bf32,_0x25c294,!![]);}catch(_0x36d6ef){console[_0x36ee55(0x1f9)](_0x36ee55(0x230)+(_0xa8178[_0x36ee55(0x1c6)](_0x36d6ef,Error)?_0x36d6ef[_0x36ee55(0x1b0)]:String(_0x36d6ef))+').');}}async function markActive(_0xf73eed){const _0x37c922=_0x2836;try{await writeActiveProfileName(_0xf73eed),console[_0x37c922(0x1f9)](_0x37c922(0x1d5)+_0xf73eed);}catch{console['log']('Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.');}}async function tryAutoRouteCloudProfile(_0xd3209e,_0x55afb4,_0x317fba,_0x5365c3,_0x405dd7){const _0x153200=_0x2836,_0x29344f={'bxrFR':function(_0x12b55c,_0x3f9679){return _0x12b55c instanceof _0x3f9679;},'gDhkw':function(_0x425aad,_0x1ec39c){return _0x425aad===_0x1ec39c;},'nUOqi':_0x153200(0x215),'PSRIU':_0x153200(0x1b6),'DZarU':function(_0x30f99,_0x508235){return _0x30f99+_0x508235;},'YAZOo':_0x153200(0x204),'ZmMvG':_0x153200(0x1da),'ixoPh':_0x153200(0x1d4),'egKqa':'confirm','pwfCf':_0x153200(0x227),'RtslG':function(_0x4825fc,_0x2d232c,_0x2efe85,_0x5daf0e){return _0x4825fc(_0x2d232c,_0x2efe85,_0x5daf0e);},'owyDT':_0x153200(0x200)};let _0x20ce71;try{_0x20ce71=await fetchAuthConfig();}catch(_0x58a94c){return _0x405dd7?.[_0x153200(0x206)](_0x153200(0x215),{'reason':_0x153200(0x1b6),'profileName':_0xd3209e}),console['error']('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x29344f['bxrFR'](_0x58a94c,Error)?_0x58a94c['message']:String(_0x58a94c))),![];}if((!_0x20ce71||!_0x20ce71['environments']||_0x29344f[_0x153200(0x1ce)](Object['keys'](_0x20ce71[_0x153200(0x1e1)])[_0x153200(0x1dd)],0x0))&&!_0x317fba[_0x153200(0x1de)]){if(_0x5365c3)return await captureEnvLessProfile(_0xd3209e,_0x55afb4,_0x317fba,_0x405dd7);return _0x405dd7?.['trackPhaseEnd'](_0x29344f['nUOqi'],{'reason':_0x29344f['PSRIU'],'profileName':_0xd3209e}),console['error'](_0x29344f[_0x153200(0x1ca)](_0x29344f['DZarU'](_0x29344f[_0x153200(0x1ca)](_0x29344f[_0x153200(0x1ca)]('\x0a\x20\x20Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team\x20yet\x20—\x20that\x27s\x20the\x20path\x20that\x20lets\x20Ranger\x20log\x20into\x20your\x20app\x20for\x20you\x20in\x20CI\x20/\x20background\x20agents.\x0a','\x0a')+'\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a'+(_0x153200(0x216)+_0xd3209e+_0x153200(0x222)+_0x55afb4+_0x153200(0x1b7)),'\x0a'),_0x29344f[_0x153200(0x1e7)]),_0x153200(0x210))),![];}let _0x5d79a4;if(_0x317fba[_0x153200(0x1de)]){if(!_0x20ce71?.['environments']?.[_0x317fba['authEnv']]){const _0x59d5ef=Object['keys'](_0x20ce71?.[_0x153200(0x1e1)]??{});return _0x405dd7?.[_0x153200(0x206)](_0x29344f['nUOqi'],{'reason':_0x29344f[_0x153200(0x220)],'profileName':_0xd3209e}),console[_0x153200(0x209)](_0x153200(0x226)+_0x317fba[_0x153200(0x1de)]+'\x22\x20not\x20found.'+(_0x59d5ef['length']?_0x153200(0x234)+_0x59d5ef[_0x153200(0x1f3)](',\x20')+'.':_0x153200(0x1ae))),![];}_0x5d79a4=_0x317fba['authEnv'];}else _0x5d79a4=matchAuthEnvironment(_0x55afb4,_0x20ce71);if(!_0x5d79a4)return _0x405dd7?.['trackPhaseEnd'](_0x29344f['nUOqi'],{'reason':_0x29344f[_0x153200(0x22b)],'profileName':_0xd3209e}),console['error'](_0x153200(0x1e2)+_0x55afb4+_0x153200(0x1b3)+Object[_0x153200(0x1d9)](_0x20ce71?.[_0x153200(0x1e1)]??{})['join'](',\x20')+'.'),![];const _0x286eba=_0x20ce71?.[_0x153200(0x1e1)]?.[_0x5d79a4],_0x1d56ca=_0x286eba?.['domains']??[];if(_0x5365c3&&!_0x317fba[_0x153200(0x22f)]){const {saveToCloud:_0x42de8b}=await _0x2b71a3[_0x153200(0x205)]([{'type':_0x29344f[_0x153200(0x1b5)],'name':_0x153200(0x1ec),'message':_0x153200(0x20e)+_0x5d79a4+_0x153200(0x1ac)+_0x55afb4+'\x0a\x20\x20(domains:\x20'+_0x1d56ca['join'](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0xd3209e+_0x153200(0x239),'default':!![]}]);if(!_0x42de8b)return _0x405dd7?.['trackPhaseEnd'](_0x153200(0x215),{'reason':'user_declined','profileName':_0xd3209e}),console['error'](_0x29344f[_0x153200(0x21e)]),![];}const _0x30cea3=_0x1d56ca[_0x153200(0x20d)](_0x1ded45=>{const _0x586f32=_0x153200;try{return new URL(_0x1ded45)[_0x586f32(0x1ef)]===new URL(_0x55afb4)['origin'];}catch{return![];}}),_0x491d50={};!_0x30cea3&&(_0x491d50[_0x153200(0x238)]=_0x55afb4);try{await _0x29344f['RtslG'](createCloudProfile,_0xd3209e,_0x5d79a4,{'settings':_0x491d50}),warnCloudProfileSharedInOrg();}catch(_0x31ec3e){if(_0x31ec3e instanceof ApiError&&_0x31ec3e[_0x153200(0x1bc)]===0x199){console[_0x153200(0x209)](_0x29344f['DZarU']('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0xd3209e+_0x153200(0x20b),_0x153200(0x1af)+_0xd3209e));throw _0x31ec3e;}throw _0x31ec3e;}return console[_0x153200(0x1f9)](_0x29344f[_0x153200(0x1ca)]('✓\x20Profile\x20\x27'+_0xd3209e+_0x153200(0x1ba),_0x153200(0x237)+_0xd3209e)),await sweepOrphansBestEffort(_0xd3209e),_0x405dd7?.['trackPhaseEnd'](_0x29344f['owyDT'],{'envKey':_0x5d79a4,'profileName':_0xd3209e}),!![];}async function createUnconfiguredCloudProfile(_0x368974,_0xb6a6c1){const _0x18b54a=_0x2836,_0x46f4c7={'qmNxE':function(_0x2480d5,_0x136566){return _0x2480d5 instanceof _0x136566;},'HYwCU':function(_0x25058e,_0x92fd3e){return _0x25058e===_0x92fd3e;},'rbjYD':function(_0x286ce5,_0x2d5112){return _0x286ce5+_0x2d5112;}};try{await createCloudProfile(_0x368974,undefined,{'settings':_0xb6a6c1}),warnCloudProfileSharedInOrg();}catch(_0x978fa){_0x46f4c7['qmNxE'](_0x978fa,ApiError)&&_0x46f4c7['HYwCU'](_0x978fa[_0x18b54a(0x1bc)],0x199)&&console['error'](_0x46f4c7[_0x18b54a(0x1e8)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x368974+_0x18b54a(0x20b),_0x18b54a(0x1af)+_0x368974));throw _0x978fa;}}async function captureEnvLessProfile(_0x270470,_0x40f13a,_0x51ce11,_0x103469){const _0x209869=_0x2836,_0x5b44cd={'KyBhX':'confirm','mGoou':'capture','XRmUP':'user_declined','XSNhz':function(_0x885a17,_0x207f68){return _0x885a17+_0x207f68;},'VUcXA':function(_0x5e8f9a,_0x58544b){return _0x5e8f9a>_0x58544b;},'DlRZh':function(_0x28c002,_0x47342a,_0x4ae56f){return _0x28c002(_0x47342a,_0x4ae56f);},'iUSJQ':function(_0x58c237,_0x179595){return _0x58c237>_0x179595;},'YIxyV':function(_0x454241,_0x2b3360){return _0x454241(_0x2b3360);}};if(!_0x51ce11[_0x209869(0x22f)]){const {capture:_0x101764}=await _0x2b71a3['prompt']([{'type':_0x5b44cd['KyBhX'],'name':_0x5b44cd['mGoou'],'message':'Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','default':!![]}]);if(!_0x101764)return _0x103469?.[_0x209869(0x206)](_0x209869(0x215),{'reason':_0x5b44cd[_0x209869(0x232)],'profileName':_0x270470}),console[_0x209869(0x209)](_0x5b44cd[_0x209869(0x236)](_0x209869(0x1cf),_0x209869(0x22e))),![];}const _0xd19664={};if(_0x51ce11['setupHeader'])for(const _0x8a2089 of _0x51ce11['setupHeader']){const _0x298e3c=_0x8a2089[_0x209869(0x1b9)](':');if(_0x298e3c===-0x1)continue;_0xd19664[_0x8a2089['slice'](0x0,_0x298e3c)['trim']()]=_0x8a2089['slice'](_0x298e3c+0x1)[_0x209869(0x1bf)]();}const _0x491abf={'baseUrl':_0x40f13a};_0x5b44cd['VUcXA'](Object[_0x209869(0x1d9)](_0xd19664)[_0x209869(0x1dd)],0x0)&&(_0x491abf[_0x209869(0x1ed)]=_0xd19664);let _0x20d192;try{_0x20d192=await createCloudProfile(_0x270470,undefined,{'settings':_0x491abf}),warnCloudProfileSharedInOrg();}catch(_0x10a886){_0x10a886 instanceof ApiError&&_0x10a886[_0x209869(0x1bc)]===0x199&&console['error'](_0x5b44cd[_0x209869(0x236)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x270470+_0x209869(0x20b),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x270470));throw _0x10a886;}return await _0x5b44cd[_0x209869(0x1fa)](manualBrowserLogin,_0x20d192,{'key':'','domains':[_0x40f13a],'setupHeaders':_0x5b44cd['iUSJQ'](Object[_0x209869(0x1d9)](_0xd19664)['length'],0x0)?_0xd19664:undefined}),console['log'](_0x209869(0x207)+_0x270470+_0x209869(0x213)+(_0x209869(0x237)+_0x270470)),await _0x5b44cd[_0x209869(0x211)](sweepOrphansBestEffort,_0x270470),_0x103469?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':null,'profileName':_0x270470}),!![];}export async function addEnv(_0x3783a6,_0x556e73={},_0x3c7251){const _0x4b8bf5=_0x2836,_0x24b971={'lajQo':function(_0xe26bbb,_0x4326b3){return _0xe26bbb+_0x4326b3;},'EZePF':function(_0x469158,_0x452501){return _0x469158+_0x452501;},'KgcgA':function(_0x3c59c1,_0x204c52){return _0x3c59c1+_0x204c52;},'RAnEi':_0x4b8bf5(0x1c9),'cyhvG':_0x4b8bf5(0x1e4),'TzoMP':function(_0x575170,_0x165614){return _0x575170===_0x165614;},'TEAMD':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','beREe':_0x4b8bf5(0x1ea),'MsFIY':function(_0x348b61){return _0x348b61();},'VJYlH':_0x4b8bf5(0x1e5),'Ryljw':function(_0xebb997,_0x294895,_0x307a17,_0x26a95b,_0x32dbe3){return _0xebb997(_0x294895,_0x307a17,_0x26a95b,_0x32dbe3);},'yfpLs':_0x4b8bf5(0x21a),'AFaIS':_0x4b8bf5(0x1ad),'SSGEk':function(_0x29c1e8,_0x56697c){return _0x29c1e8 instanceof _0x56697c;},'QTdrF':function(_0x191f7f,_0xaea797){return _0x191f7f(_0xaea797);},'KXpYW':function(_0x210667,_0x33a49d){return _0x210667>_0x33a49d;},'yTxyZ':function(_0x4d8d55,_0x5c39d5,_0x20292a){return _0x4d8d55(_0x5c39d5,_0x20292a);},'DeVfr':function(_0x3e308f,_0x4965d2){return _0x3e308f+_0x4965d2;},'BKmsG':_0x4b8bf5(0x1c4),'ppwMI':_0x4b8bf5(0x1c8),'mRnvQ':_0x4b8bf5(0x201),'xqbUp':_0x4b8bf5(0x214),'khMGp':_0x4b8bf5(0x1f6),'ryQBB':_0x4b8bf5(0x1f2),'hUeCB':_0x4b8bf5(0x1d7),'zTsai':'continue','xDRBN':'use_suggestion','IpngU':function(_0x5a0f40,_0x32b606,_0x2df96b,_0x53abbf,_0x567e5b,_0x5965f8){return _0x5a0f40(_0x32b606,_0x2df96b,_0x53abbf,_0x567e5b,_0x5965f8);},'ERkpX':function(_0x41910d,_0x151860){return _0x41910d(_0x151860);}};_0x556e73['ci']&&(console['error'](_0x24b971[_0x4b8bf5(0x20c)](_0x24b971[_0x4b8bf5(0x20c)](_0x24b971[_0x4b8bf5(0x1ee)](_0x24b971['KgcgA'](_0x24b971[_0x4b8bf5(0x1ee)]('The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a'+'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','\x0a'),'To\x20set\x20up\x20a\x20profile,\x20run:\x0a'),_0x24b971[_0x4b8bf5(0x22d)]),'\x0a')+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a',_0x24b971['cyhvG'])),process[_0x4b8bf5(0x229)](0x1));const _0x1d908b={};if(_0x556e73[_0x4b8bf5(0x1dc)])for(const _0x223f83 of _0x556e73['setupHeader']){const _0x4d5d89=_0x223f83['indexOf'](':');if(_0x4d5d89===-0x1)throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x223f83+_0x4b8bf5(0x1d3));const _0x51b33a=_0x223f83['slice'](0x0,_0x4d5d89)['trim'](),_0x1ba71b=_0x223f83['slice'](_0x4d5d89+0x1)[_0x4b8bf5(0x1bf)]();_0x1d908b[_0x51b33a]=_0x1ba71b;}if(_0x556e73[_0x4b8bf5(0x21a)]!==undefined&&_0x24b971[_0x4b8bf5(0x228)](_0x556e73[_0x4b8bf5(0x21a)][_0x4b8bf5(0x1bf)](),''))throw new Error('--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222');if(_0x556e73['cdpEndpoint']&&_0x556e73['url'])throw new Error(_0x24b971['TEAMD']);if(_0x556e73[_0x4b8bf5(0x1de)]&&_0x556e73['skipAuth'])throw new Error(_0x24b971[_0x4b8bf5(0x1bd)]);if(_0x556e73['authEnv']&&_0x556e73[_0x4b8bf5(0x21a)])throw new Error(_0x4b8bf5(0x1d8));const _0x46347d=Boolean(_0x556e73[_0x4b8bf5(0x21a)]),_0x307f93=_0x24b971['MsFIY'](isInteractive);if(!_0x307f93&&!_0x556e73[_0x4b8bf5(0x217)]&&!_0x46347d&&!_0x556e73[_0x4b8bf5(0x1b8)])throw new Error(_0x24b971[_0x4b8bf5(0x22c)]);if(_0x46347d){const _0x1a6bfa=_0x556e73[_0x4b8bf5(0x21a)];console[_0x4b8bf5(0x1f9)](_0x4b8bf5(0x1df)),console['log']('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x1a6bfa);const _0x3cda6e={'cdpEndpoint':_0x1a6bfa,'isElectron':!![]};Object[_0x4b8bf5(0x1d9)](_0x1d908b)['length']>0x0&&(_0x3cda6e[_0x4b8bf5(0x1ed)]=_0x1d908b);await createUnconfiguredCloudProfile(_0x3783a6,_0x3cda6e);try{_0x24b971[_0x4b8bf5(0x1db)](setProfileOverride,process['cwd'](),_0x3783a6,_0x24b971['yfpLs'],_0x1a6bfa),setProfileOverride(process[_0x4b8bf5(0x1d1)](),_0x3783a6,_0x24b971[_0x4b8bf5(0x1f5)],!![]);}catch(_0x422ecc){console[_0x4b8bf5(0x209)](_0x4b8bf5(0x1c7)+(_0x24b971[_0x4b8bf5(0x219)](_0x422ecc,Error)?_0x422ecc[_0x4b8bf5(0x1b0)]:String(_0x422ecc)));}console['log'](_0x4b8bf5(0x1cc)+_0x3783a6+'\x27\x20created\x20(CDP).'),await sweepOrphansBestEffort(_0x3783a6),await _0x24b971['QTdrF'](markActive,_0x3783a6);return;}if(_0x556e73['skipAuth']){const _0x490f01={};_0x556e73[_0x4b8bf5(0x217)]&&(_0x490f01['baseUrl']=_0x556e73[_0x4b8bf5(0x217)]);_0x24b971['KXpYW'](Object[_0x4b8bf5(0x1d9)](_0x1d908b)['length'],0x0)&&(_0x490f01['setupHeaders']=_0x1d908b);await _0x24b971[_0x4b8bf5(0x1fb)](createUnconfiguredCloudProfile,_0x3783a6,_0x490f01),console[_0x4b8bf5(0x1f9)](_0x24b971[_0x4b8bf5(0x202)](_0x4b8bf5(0x20a)+_0x3783a6+_0x4b8bf5(0x1b4),_0x4b8bf5(0x233)+_0x3783a6+'`\x20again\x20without\x20--skip-auth.')),await sweepOrphansBestEffort(_0x3783a6),await _0x24b971['QTdrF'](markActive,_0x3783a6);return;}if(_0x556e73['url']){const _0x841424=_0x556e73[_0x4b8bf5(0x217)],_0x3caff3=await _0x24b971['QTdrF'](checkUrlReachability,_0x841424);if(!_0x3caff3['ok']&&!_0x556e73[_0x4b8bf5(0x1f1)])throw new Error('Could\x20not\x20reach\x20'+_0x841424+':\x20'+_0x3caff3['error']+_0x4b8bf5(0x1d2));!_0x3caff3['ok']&&_0x556e73[_0x4b8bf5(0x1f1)]&&console[_0x4b8bf5(0x1f9)]('⚠\x20Could\x20not\x20reach\x20'+_0x841424+':\x20'+_0x3caff3[_0x4b8bf5(0x209)]+'\x20(continuing\x20with\x20--force)');}else{console['log'](_0x24b971[_0x4b8bf5(0x1c0)]),console[_0x4b8bf5(0x1f9)](_0x24b971['ppwMI']),console['log'](_0x4b8bf5(0x1e0));let _0xe55f16='',_0x5fd7a7=![];while(!![]){const _0x164608=await _0x2b71a3[_0x4b8bf5(0x205)]([{'type':_0x24b971['mRnvQ'],'name':'baseUrl','message':_0x5fd7a7?_0x24b971[_0x4b8bf5(0x1ff)]:_0x4b8bf5(0x1d0),'default':_0xe55f16||_0x4b8bf5(0x1f4)}]);_0xe55f16=_0x164608[_0x4b8bf5(0x238)];const _0x2e85c7=await checkUrlReachability(_0xe55f16);if(_0x2e85c7['ok'])break;const _0x1c3162=/^[a-zA-Z][\w+.-]*:\/\//[_0x4b8bf5(0x221)](_0xe55f16),_0x261ff9=_0x2e85c7[_0x4b8bf5(0x1cb)]&&!_0x1c3162,_0x567573=_0x261ff9?_0x4b8bf5(0x21c)+_0xe55f16:null;_0x5fd7a7=!![],console[_0x4b8bf5(0x1f9)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0xe55f16+':\x20'+_0x2e85c7[_0x4b8bf5(0x209)]);_0x567573&&console['log'](_0x4b8bf5(0x203)+_0x567573+'?');const {action:_0x589e10}=await _0x2b71a3['prompt']([{'type':_0x24b971[_0x4b8bf5(0x225)],'name':_0x4b8bf5(0x1f0),'message':_0x24b971['ryQBB'],'choices':[..._0x567573?[{'name':_0x4b8bf5(0x231)+_0x567573,'value':'use_suggestion'}]:[],{'name':'Enter\x20a\x20different\x20URL','value':_0x4b8bf5(0x1f7)},{'name':_0x24b971[_0x4b8bf5(0x1be)],'value':_0x24b971[_0x4b8bf5(0x1c2)]}]}]);if(_0x589e10===_0x24b971[_0x4b8bf5(0x1c1)]&&_0x567573){_0xe55f16=_0x567573;const _0x476e7b=await _0x24b971[_0x4b8bf5(0x223)](checkUrlReachability,_0xe55f16);if(_0x476e7b['ok'])break;console['log']('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0xe55f16+':\x20'+_0x476e7b[_0x4b8bf5(0x209)]);}else{if(_0x24b971['TzoMP'](_0x589e10,_0x24b971['zTsai']))break;}}_0x556e73={..._0x556e73,'url':_0xe55f16};}let _0x1bb654=![];try{_0x1bb654=await _0x24b971['IpngU'](tryAutoRouteCloudProfile,_0x3783a6,_0x556e73[_0x4b8bf5(0x217)],_0x556e73,_0x307f93,_0x3c7251);}catch(_0x5b7569){console['error']('\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22'+_0x3783a6+_0x4b8bf5(0x1b1)+(_0x5b7569 instanceof Error?_0x5b7569['message']:String(_0x5b7569))),process['exit'](0x1);}!_0x1bb654&&process[_0x4b8bf5(0x229)](0x1),await _0x24b971[_0x4b8bf5(0x208)](markActive,_0x3783a6);}
|
|
1
|
+
const _0x291f8f=_0x3bb8;(function(_0x7a8304,_0x146abc){const _0x2eced4=_0x3bb8,_0x4a0ab6=_0x7a8304();while(!![]){try{const _0x272bbe=-parseInt(_0x2eced4(0x1a0))/0x1+parseInt(_0x2eced4(0x1a9))/0x2+-parseInt(_0x2eced4(0x1ef))/0x3+-parseInt(_0x2eced4(0x208))/0x4+-parseInt(_0x2eced4(0x1c9))/0x5*(-parseInt(_0x2eced4(0x192))/0x6)+-parseInt(_0x2eced4(0x1a8))/0x7*(parseInt(_0x2eced4(0x1cb))/0x8)+parseInt(_0x2eced4(0x1ed))/0x9;if(_0x272bbe===_0x146abc)break;else _0x4a0ab6['push'](_0x4a0ab6['shift']());}catch(_0x5beebb){_0x4a0ab6['push'](_0x4a0ab6['shift']());}}}(_0x1a99,0xe4a06));import{readdir,rm}from'fs/promises';function _0x3bb8(_0x5a7230,_0x634641){_0x5a7230=_0x5a7230-0x188;const _0x1a995b=_0x1a99();let _0x3bb8ed=_0x1a995b[_0x5a7230];return _0x3bb8ed;}function _0x1a99(){const _0x4131a3=['1174016uJGLEf','action','\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0a\x20\x20(domains:\x20','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','qiGWi','retry','\x20\x20Did\x20you\x20mean\x20','8967luubRd','338948SYEwXT','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','dXWvv','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','Enter\x20a\x20different\x20URL','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','Could\x20not\x20reach\x20','\x27\x20to\x20the\x20cloud?','mSFil','\x20Configured\x20envs:\x20','\x20--url\x20','message','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','zNYan','\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20','HTTP\x20','tOUIm','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','JTFHO','skipAuth','What\x20would\x20you\x20like\x20to\x20do?','Ktfwf','indexOf','TFLvL','yHCXk','length','\x0a\x20\x20Could\x20not\x20reach\x20','for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','error','\x22\x20not\x20found.','200630kstqGA','authEnv','5136NglVxE','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','input','name','This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization','EyDRp','ncaxP','trackPhaseEnd','env','YLZOl','profile.add.autoRouted','keys','JgsfR','IEPWe','capture','exit','`\x20again\x20without\x20--skip-auth.','rxaGb','rtHVU','qezAn','mhcCj','nZUbF','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','prompt','unRSo','join','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','use_suggestion','dYPkL','adLqY','yes','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','\x20\x20Set\x20active\x20profile:\x20','xtcyu','39903939eApLai','To\x20set\x20up\x20a\x20profile,\x20run:\x0a','5426247prwHRK','baseUrl','url','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','Pzaix','\x27\x20matching\x20','confirm','\x27\x20created.\x0a','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','log','Jldtd','saveToCloud','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','eSESg','uOiLC','JfAxO','jdcmk','HEAD','setupHeader','.tmp-','abort','Use\x20','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','no_auth_config','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','6508672jzrIQO','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','local','includes','fetch\x20failed','http://localhost:3000','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','profile.add.autoRouteSkipped','cwd','LtMBO','isTTY','cdpEndpoint','Found\x20auth\x20environment\x20\x27','kRzNr','setupHeaders','domains','✓\x20Profile\x20\x27','264vqvmAc','environments','trim','OedeB','NODE_TLS_REJECT_UNAUTHORIZED','\x0a\x20\x20A\x20profile\x20named\x20\x22','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','slice','continue','✓\x20Cloud\x20profile\x20\x27','cjPXo','ktWIR','\x0a\x20\x20Auth\x20environment\x20\x22','status'];_0x1a99=function(){return _0x4131a3;};return _0x1a99();}import{join}from'path';import{existsSync}from'fs';import _0x474d25 from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING=_0x291f8f(0x1cf);function warnCloudProfileSharedInOrg(){const _0x1e06f8=_0x291f8f;if(!process['stdout'][_0x1e06f8(0x18b)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x519e35){const _0x3fce2a=_0x291f8f,_0x2dd9a1={'IMCEn':function(_0x1acffb,_0xbe5bd,_0x2f6f1d){return _0x1acffb(_0xbe5bd,_0x2f6f1d);},'dbbtG':'manual','SPgoO':function(_0x2fb95b,_0x26549d,_0x33bc67){return _0x2fb95b(_0x26549d,_0x33bc67);},'McIuO':function(_0x4c213b,_0x192408){return _0x4c213b(_0x192408);},'HnkXC':'Invalid\x20URL','SuHzh':function(_0x56a460,_0x5f08b6){return _0x56a460===_0x5f08b6;},'BdWsi':_0x3fce2a(0x20c)};try{const _0x1d229a=new AbortController(),_0x1d52d1=_0x2dd9a1['IMCEn'](setTimeout,()=>_0x1d229a[_0x3fce2a(0x203)](),0x1388),_0x25be4f={'method':_0x3fce2a(0x200),'signal':_0x1d229a['signal'],'redirect':_0x2dd9a1['dbbtG']};/^https:\/\/localhost(:\d+)?/i['test'](_0x519e35)&&(process[_0x3fce2a(0x1d3)][_0x3fce2a(0x196)]='0');const _0x44c88c=await _0x2dd9a1['SPgoO'](fetch,_0x519e35,_0x25be4f);delete process[_0x3fce2a(0x1d3)][_0x3fce2a(0x196)],_0x2dd9a1['McIuO'](clearTimeout,_0x1d52d1);if(_0x44c88c[_0x3fce2a(0x19f)]<0x190)return{'ok':!![]};return{'ok':![],'error':_0x3fce2a(0x1b9)+_0x44c88c[_0x3fce2a(0x19f)]};}catch(_0x2797b9){delete process[_0x3fce2a(0x1d3)][_0x3fce2a(0x196)];const _0x1ab042=_0x2797b9,_0x309043=_0x1ab042[_0x3fce2a(0x1b5)]||_0x2dd9a1['McIuO'](String,_0x2797b9),_0x282f77=_0x309043['includes'](_0x2dd9a1['HnkXC'])||_0x2dd9a1['SuHzh'](_0x1ab042[_0x3fce2a(0x1ce)],'TypeError')||_0x309043[_0x3fce2a(0x20b)](_0x2dd9a1['BdWsi']);return{'ok':![],'error':_0x309043,'isProtocolError':_0x282f77};}}async function sweepOrphanLocalProfile(_0x33a2fe,_0x22714e,_0x1437f8){const _0x423ea0=_0x291f8f,_0x4fb2cf={'qezAn':function(_0x5cf4cb,_0x590dd1,_0x1fa07e){return _0x5cf4cb(_0x590dd1,_0x1fa07e);},'JfAxO':_0x423ea0(0x20a),'OWXGc':function(_0x12808b,_0x328e50){return _0x12808b(_0x328e50);},'Jldtd':function(_0x192883,_0x186916){return _0x192883(_0x186916);}},_0x41df12=_0x4fb2cf[_0x423ea0(0x1de)](join,_0x22714e,_0x4fb2cf[_0x423ea0(0x1fe)]),_0x5e3826=join(_0x41df12,_0x33a2fe);existsSync(_0x5e3826)&&(_0x1437f8&&await _0x4fb2cf['OWXGc'](isPathGitTracked,_0x5e3826)?console[_0x423ea0(0x1f8)]('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x5e3826+_0x423ea0(0x1c6)):(await _0x4fb2cf[_0x423ea0(0x1de)](rm,_0x5e3826,{'recursive':!![],'force':!![]}),console[_0x423ea0(0x1f8)]('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x5e3826)));if(_0x4fb2cf[_0x423ea0(0x1f9)](existsSync,_0x41df12)){let _0x51e6b6=[];try{_0x51e6b6=await readdir(_0x41df12);}catch{return;}const _0x3172ce=_0x423ea0(0x202)+_0x33a2fe+'-';for(const _0x3c937f of _0x51e6b6){if(!_0x3c937f['startsWith'](_0x3172ce))continue;const _0xeceb41=join(_0x41df12,_0x3c937f);await _0x4fb2cf[_0x423ea0(0x1de)](rm,_0xeceb41,{'recursive':!![],'force':!![]}),console[_0x423ea0(0x1f8)]('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0xeceb41);}}}async function sweepOrphansBestEffort(_0x2614dc){const _0x598e59=_0x291f8f,_0x2e1f21={'jdcmk':function(_0x362808,_0x39c514){return _0x362808 instanceof _0x39c514;}};try{await sweepOrphanLocalProfile(_0x2614dc,getRangerHomeDir(),![]);const _0x2e6804=getRangerDir();_0x2e6804!==getRangerHomeDir()&&await sweepOrphanLocalProfile(_0x2614dc,_0x2e6804,!![]);}catch(_0x3019f9){console[_0x598e59(0x1f8)](_0x598e59(0x1ae)+(_0x2e1f21[_0x598e59(0x1ff)](_0x3019f9,Error)?_0x3019f9[_0x598e59(0x1b5)]:String(_0x3019f9))+').');}}async function markActive(_0x333274){const _0x5da9d2=_0x291f8f,_0x2252d2={'tOUIm':_0x5da9d2(0x1f7)};try{await writeActiveProfileName(_0x333274),console['log'](_0x5da9d2(0x1eb)+_0x333274);}catch{console[_0x5da9d2(0x1f8)](_0x2252d2[_0x5da9d2(0x1ba)]);}}async function tryAutoRouteCloudProfile(_0x34750f,_0x37b928,_0x2bedc0,_0x39164d,_0xf1d95b){const _0x606e68=_0x291f8f,_0xf014d0={'OedeB':function(_0x1eb6bf,_0x4eab68){return _0x1eb6bf===_0x4eab68;},'JgsfR':'profile.add.autoRouteSkipped','TAoHC':function(_0x7881a0,_0x2a5203,_0x2a496f,_0xebd37c,_0x1fc974){return _0x7881a0(_0x2a5203,_0x2a496f,_0xebd37c,_0x1fc974);},'xvqTA':'no_auth_config','eSESg':function(_0x584515,_0x1a4b33){return _0x584515+_0x1a4b33;},'qiGWi':_0x606e68(0x1bb),'zNYan':_0x606e68(0x1e1),'cjPXo':'env_not_found','yHCXk':_0x606e68(0x1a4),'ycDmw':_0x606e68(0x1fa),'EyDRp':_0x606e68(0x1f2),'xtcyu':function(_0x2a07aa,_0x7f93f5,_0x1fcbe2,_0x57ebe2){return _0x2a07aa(_0x7f93f5,_0x1fcbe2,_0x57ebe2);},'kRzNr':function(_0x461437,_0xa8f5ac){return _0x461437 instanceof _0xa8f5ac;},'IEPWe':function(_0x13a57f,_0x318760){return _0x13a57f===_0x318760;},'OahXI':function(_0x2452b2,_0x4caed1){return _0x2452b2+_0x4caed1;},'TCNsq':function(_0x22b50e,_0x4aa9d5){return _0x22b50e(_0x4aa9d5);}};let _0x38c6af;try{_0x38c6af=await fetchAuthConfig();}catch(_0x4713d7){return _0xf1d95b?.[_0x606e68(0x1d2)](_0xf014d0[_0x606e68(0x1d7)],{'reason':_0x606e68(0x206),'profileName':_0x34750f}),console[_0x606e68(0x1c7)]('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x4713d7 instanceof Error?_0x4713d7[_0x606e68(0x1b5)]:String(_0x4713d7))),![];}if((!_0x38c6af||!_0x38c6af['environments']||Object[_0x606e68(0x1d6)](_0x38c6af['environments'])['length']===0x0)&&!_0x2bedc0['authEnv']){if(_0x39164d)return await _0xf014d0['TAoHC'](captureEnvLessProfile,_0x34750f,_0x37b928,_0x2bedc0,_0xf1d95b);return _0xf1d95b?.['trackPhaseEnd'](_0xf014d0['JgsfR'],{'reason':_0xf014d0['xvqTA'],'profileName':_0x34750f}),console[_0x606e68(0x1c7)](_0xf014d0['eSESg'](_0xf014d0[_0x606e68(0x1fc)]('\x0a\x20\x20Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team\x20yet\x20—\x20that\x27s\x20the\x20path\x20that\x20lets\x20Ranger\x20log\x20into\x20your\x20app\x20for\x20you\x20in\x20CI\x20/\x20background\x20agents.\x0a'+'\x0a','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a')+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x34750f+_0x606e68(0x1b4)+_0x37b928+'\x20--skip-auth\x0a')+'\x0a'+_0xf014d0[_0x606e68(0x1a5)],_0xf014d0[_0x606e68(0x1b7)])),![];}let _0x2f9ade;if(_0x2bedc0[_0x606e68(0x1ca)]){if(!_0x38c6af?.[_0x606e68(0x193)]?.[_0x2bedc0[_0x606e68(0x1ca)]]){const _0x2d51d7=Object[_0x606e68(0x1d6)](_0x38c6af?.['environments']??{});return _0xf1d95b?.['trackPhaseEnd'](_0xf014d0['JgsfR'],{'reason':_0xf014d0[_0x606e68(0x19c)],'profileName':_0x34750f}),console[_0x606e68(0x1c7)](_0xf014d0['eSESg'](_0x606e68(0x19e)+_0x2bedc0[_0x606e68(0x1ca)]+_0x606e68(0x1c8),_0x2d51d7[_0x606e68(0x1c3)]?_0x606e68(0x1b3)+_0x2d51d7['join'](',\x20')+'.':_0xf014d0[_0x606e68(0x1c2)])),![];}_0x2f9ade=_0x2bedc0['authEnv'];}else _0x2f9ade=matchAuthEnvironment(_0x37b928,_0x38c6af);if(!_0x2f9ade)return _0xf1d95b?.[_0x606e68(0x1d2)](_0xf014d0['JgsfR'],{'reason':'no_match','profileName':_0x34750f}),console['error']('\x0a\x20\x20No\x20auth\x20env\x20matches\x20'+_0x37b928+_0x606e68(0x20e)+Object[_0x606e68(0x1d6)](_0x38c6af?.[_0x606e68(0x193)]??{})[_0x606e68(0x1e4)](',\x20')+'.'),![];const _0x2564dc=_0x38c6af?.[_0x606e68(0x193)]?.[_0x2f9ade],_0x333b89=_0x2564dc?.[_0x606e68(0x190)]??[];if(_0x39164d&&!_0x2bedc0[_0x606e68(0x1e9)]){const {saveToCloud:_0x54d385}=await _0x474d25['prompt']([{'type':'confirm','name':_0xf014d0['ycDmw'],'message':_0x606e68(0x18d)+_0x2f9ade+_0x606e68(0x1f4)+_0x37b928+_0x606e68(0x1a3)+_0x333b89[_0x606e68(0x1e4)](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x34750f+_0x606e68(0x1b1),'default':!![]}]);if(!_0x54d385)return _0xf1d95b?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':'user_declined','profileName':_0x34750f}),console[_0x606e68(0x1c7)](_0xf014d0[_0x606e68(0x1d0)]),![];}const _0x1ad065=_0x333b89['some'](_0x1e875b=>{const _0x177b70=_0x606e68;try{return _0xf014d0[_0x177b70(0x195)](new URL(_0x1e875b)['origin'],new URL(_0x37b928)['origin']);}catch{return![];}}),_0x4876be={};!_0x1ad065&&(_0x4876be['baseUrl']=_0x37b928);try{await _0xf014d0[_0x606e68(0x1ec)](createCloudProfile,_0x34750f,_0x2f9ade,{'settings':_0x4876be}),warnCloudProfileSharedInOrg();}catch(_0x78e449){if(_0xf014d0[_0x606e68(0x18e)](_0x78e449,ApiError)&&_0xf014d0[_0x606e68(0x1d8)](_0x78e449[_0x606e68(0x19f)],0x199)){console['error'](_0xf014d0[_0x606e68(0x1fc)](_0x606e68(0x197)+_0x34750f+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x34750f));throw _0x78e449;}throw _0x78e449;}return console['log'](_0xf014d0['OahXI'](_0x606e68(0x191)+_0x34750f+_0x606e68(0x1f6),'\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x34750f)),await _0xf014d0['TCNsq'](sweepOrphansBestEffort,_0x34750f),_0xf1d95b?.['trackPhaseEnd'](_0x606e68(0x1d5),{'envKey':_0x2f9ade,'profileName':_0x34750f}),!![];}async function createUnconfiguredCloudProfile(_0x1c5e96,_0x295cc6){const _0x20a15a=_0x291f8f,_0x155119={'nZUbF':function(_0x57cd55){return _0x57cd55();},'dXWvv':function(_0x3ffc3e,_0x3948eb){return _0x3ffc3e+_0x3948eb;}};try{await createCloudProfile(_0x1c5e96,undefined,{'settings':_0x295cc6}),_0x155119[_0x20a15a(0x1e0)](warnCloudProfileSharedInOrg);}catch(_0x1c1323){_0x1c1323 instanceof ApiError&&_0x1c1323['status']===0x199&&console['error'](_0x155119[_0x20a15a(0x1ab)](_0x20a15a(0x197)+_0x1c5e96+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a',_0x20a15a(0x1cc)+_0x1c5e96));throw _0x1c1323;}}async function captureEnvLessProfile(_0x564c3b,_0x1222af,_0x27b5a7,_0x3518ae){const _0x4e2664=_0x291f8f,_0x3508c5={'rtHVU':_0x4e2664(0x1d9),'afmKq':_0x4e2664(0x209),'ffyZv':_0x4e2664(0x188),'JqXYn':function(_0x47c9e4,_0x1b9294){return _0x47c9e4===_0x1b9294;},'gJmGa':function(_0x399b4f,_0x4db029){return _0x399b4f+_0x4db029;},'iWaGW':function(_0x2cae1a){return _0x2cae1a();},'RtSbV':_0x4e2664(0x1d5)};if(!_0x27b5a7['yes']){const {capture:_0x270634}=await _0x474d25['prompt']([{'type':_0x4e2664(0x1f5),'name':_0x3508c5[_0x4e2664(0x1dd)],'message':_0x3508c5['afmKq'],'default':!![]}]);if(!_0x270634)return _0x3518ae?.[_0x4e2664(0x1d2)](_0x3508c5['ffyZv'],{'reason':'user_declined','profileName':_0x564c3b}),console[_0x4e2664(0x1c7)](_0x4e2664(0x1e5)+'\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.'),![];}const _0x4a5020={};if(_0x27b5a7[_0x4e2664(0x201)])for(const _0x52c14e of _0x27b5a7[_0x4e2664(0x201)]){const _0x3c5593=_0x52c14e[_0x4e2664(0x1c0)](':');if(_0x3508c5['JqXYn'](_0x3c5593,-0x1))continue;_0x4a5020[_0x52c14e[_0x4e2664(0x199)](0x0,_0x3c5593)['trim']()]=_0x52c14e['slice'](_0x3508c5['gJmGa'](_0x3c5593,0x1))[_0x4e2664(0x194)]();}const _0x4d5935={'baseUrl':_0x1222af};Object[_0x4e2664(0x1d6)](_0x4a5020)['length']>0x0&&(_0x4d5935['setupHeaders']=_0x4a5020);let _0x13a056;try{_0x13a056=await createCloudProfile(_0x564c3b,undefined,{'settings':_0x4d5935}),_0x3508c5['iWaGW'](warnCloudProfileSharedInOrg);}catch(_0x13538e){_0x13538e instanceof ApiError&&_0x13538e[_0x4e2664(0x19f)]===0x199&&console['error'](_0x4e2664(0x197)+_0x564c3b+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+(_0x4e2664(0x1cc)+_0x564c3b));throw _0x13538e;}return await manualBrowserLogin(_0x13a056,{'key':'','domains':[_0x1222af],'setupHeaders':Object['keys'](_0x4a5020)['length']>0x0?_0x4a5020:undefined}),console[_0x4e2664(0x1f8)]('\x0a✓\x20Profile\x20\x27'+_0x564c3b+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a'+('\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x564c3b)),await sweepOrphansBestEffort(_0x564c3b),_0x3518ae?.[_0x4e2664(0x1d2)](_0x3508c5['RtSbV'],{'envKey':null,'profileName':_0x564c3b}),!![];}export async function addEnv(_0x1c2670,_0x1118b0={},_0x4a692d){const _0x4e05a9=_0x291f8f,_0x438549={'ncaxP':function(_0x110fbd,_0x22512a){return _0x110fbd+_0x22512a;},'uHJaR':_0x4e05a9(0x1ee),'NlLbG':_0x4e05a9(0x207),'unRSo':_0x4e05a9(0x1a2),'WOrOn':function(_0x1f99e2,_0x17b414){return _0x1f99e2===_0x17b414;},'mhcCj':function(_0x44ed8d,_0x36052c){return _0x44ed8d!==_0x36052c;},'ktWIR':_0x4e05a9(0x1af),'JTFHO':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','JlcCW':_0x4e05a9(0x1aa),'Ktfwf':function(_0x11a5bb,_0x31a63c,_0x3ab376,_0x1bfcfe,_0x43cdff){return _0x11a5bb(_0x31a63c,_0x3ab376,_0x1bfcfe,_0x43cdff);},'AUSdu':'isElectron','uOiLC':function(_0x407fdf,_0x4dbaa3){return _0x407fdf(_0x4dbaa3);},'sFYOB':function(_0x4284fa,_0x2304da){return _0x4284fa(_0x2304da);},'YLZOl':function(_0x42eb3a,_0x39b5ac,_0x44af6f){return _0x42eb3a(_0x39b5ac,_0x44af6f);},'NkzbG':function(_0x1936a5,_0x4953fe){return _0x1936a5(_0x4953fe);},'LtMBO':'\x0a🌐\x20Profile\x20Setup\x0a','Pzaix':_0x4e05a9(0x205),'sZUbt':_0x4e05a9(0x1f0),'mSFil':_0x4e05a9(0x198),'rxaGb':function(_0x5d9cab,_0x23dcf1){return _0x5d9cab||_0x23dcf1;},'dYPkL':_0x4e05a9(0x1ad),'adLqY':'Continue\x20anyway','OYvzL':function(_0x382247,_0x169731){return _0x382247===_0x169731;},'WWiNt':_0x4e05a9(0x19a),'woFfy':function(_0x3792a6,_0x491e00,_0x350f28,_0x23e12a,_0x1b4bcc,_0xabc48){return _0x3792a6(_0x491e00,_0x350f28,_0x23e12a,_0x1b4bcc,_0xabc48);},'TFLvL':function(_0x47245b,_0x3fe4e2){return _0x47245b(_0x3fe4e2);}};_0x1118b0['ci']&&(console[_0x4e05a9(0x1c7)](_0x438549[_0x4e05a9(0x1d1)](_0x438549['ncaxP'](_0x438549[_0x4e05a9(0x1d1)]('The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a'+_0x4e05a9(0x1c5),'\x0a')+_0x438549['uHJaR']+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a',_0x438549['NlLbG']),_0x438549[_0x4e05a9(0x1e3)])),process[_0x4e05a9(0x1da)](0x1));const _0x2ec69a={};if(_0x1118b0[_0x4e05a9(0x201)])for(const _0x143c71 of _0x1118b0['setupHeader']){const _0x11ab23=_0x143c71['indexOf'](':');if(_0x438549['WOrOn'](_0x11ab23,-0x1))throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x143c71+'\x22.\x20Expected\x20\x22Name:\x20Value\x22.');const _0x4b00ee=_0x143c71['slice'](0x0,_0x11ab23)[_0x4e05a9(0x194)](),_0x279bbe=_0x143c71[_0x4e05a9(0x199)](_0x438549['ncaxP'](_0x11ab23,0x1))['trim']();_0x2ec69a[_0x4b00ee]=_0x279bbe;}if(_0x438549[_0x4e05a9(0x1df)](_0x1118b0['cdpEndpoint'],undefined)&&_0x1118b0['cdpEndpoint']['trim']()==='')throw new Error(_0x438549[_0x4e05a9(0x19d)]);if(_0x1118b0[_0x4e05a9(0x18c)]&&_0x1118b0['url'])throw new Error(_0x438549[_0x4e05a9(0x1bc)]);if(_0x1118b0[_0x4e05a9(0x1ca)]&&_0x1118b0[_0x4e05a9(0x1bd)])throw new Error('--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.');if(_0x1118b0['authEnv']&&_0x1118b0['cdpEndpoint'])throw new Error(_0x4e05a9(0x1ac));const _0x238b30=Boolean(_0x1118b0['cdpEndpoint']),_0x57dfc1=isInteractive();if(!_0x57dfc1&&!_0x1118b0['url']&&!_0x238b30&&!_0x1118b0[_0x4e05a9(0x1bd)])throw new Error('Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000');if(_0x238b30){const _0x4435cb=_0x1118b0['cdpEndpoint'];console[_0x4e05a9(0x1f8)](_0x438549['JlcCW']),console[_0x4e05a9(0x1f8)](_0x4e05a9(0x1ea)+_0x4435cb);const _0x217ed9={'cdpEndpoint':_0x4435cb,'isElectron':!![]};Object['keys'](_0x2ec69a)['length']>0x0&&(_0x217ed9[_0x4e05a9(0x18f)]=_0x2ec69a);await createUnconfiguredCloudProfile(_0x1c2670,_0x217ed9);try{_0x438549[_0x4e05a9(0x1bf)](setProfileOverride,process[_0x4e05a9(0x189)](),_0x1c2670,_0x4e05a9(0x18c),_0x4435cb),_0x438549['Ktfwf'](setProfileOverride,process['cwd'](),_0x1c2670,_0x438549['AUSdu'],!![]);}catch(_0x1b0655){console[_0x4e05a9(0x1c7)](_0x4e05a9(0x1b8)+(_0x1b0655 instanceof Error?_0x1b0655[_0x4e05a9(0x1b5)]:_0x438549[_0x4e05a9(0x1fd)](String,_0x1b0655)));}console[_0x4e05a9(0x1f8)](_0x4e05a9(0x19b)+_0x1c2670+'\x27\x20created\x20(CDP).'),await sweepOrphansBestEffort(_0x1c2670),await _0x438549['sFYOB'](markActive,_0x1c2670);return;}if(_0x1118b0['skipAuth']){const _0x426c94={};_0x1118b0['url']&&(_0x426c94[_0x4e05a9(0x1f0)]=_0x1118b0[_0x4e05a9(0x1f1)]);Object[_0x4e05a9(0x1d6)](_0x2ec69a)['length']>0x0&&(_0x426c94[_0x4e05a9(0x18f)]=_0x2ec69a);await _0x438549[_0x4e05a9(0x1d4)](createUnconfiguredCloudProfile,_0x1c2670,_0x426c94),console[_0x4e05a9(0x1f8)](_0x4e05a9(0x191)+_0x1c2670+'\x27\x20created\x20(no\x20session).\x0a'+('\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x1c2670+_0x4e05a9(0x1db))),await sweepOrphansBestEffort(_0x1c2670),await markActive(_0x1c2670);return;}if(_0x1118b0[_0x4e05a9(0x1f1)]){const _0x138b26=_0x1118b0['url'],_0x14a8fa=await _0x438549['NkzbG'](checkUrlReachability,_0x138b26);if(!_0x14a8fa['ok']&&!_0x1118b0['force'])throw new Error(_0x4e05a9(0x1b0)+_0x138b26+':\x20'+_0x14a8fa['error']+_0x4e05a9(0x1b6));!_0x14a8fa['ok']&&_0x1118b0['force']&&console['log']('⚠\x20Could\x20not\x20reach\x20'+_0x138b26+':\x20'+_0x14a8fa['error']+'\x20(continuing\x20with\x20--force)');}else{console[_0x4e05a9(0x1f8)](_0x438549[_0x4e05a9(0x18a)]),console['log'](_0x438549[_0x4e05a9(0x1f3)]),console[_0x4e05a9(0x1f8)]('\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a');let _0x5b1979='',_0xe2518=![];while(!![]){const _0x6e83d9=await _0x474d25[_0x4e05a9(0x1e2)]([{'type':_0x4e05a9(0x1cd),'name':_0x438549['sZUbt'],'message':_0xe2518?_0x4e05a9(0x1fb):_0x438549[_0x4e05a9(0x1b2)],'default':_0x438549[_0x4e05a9(0x1dc)](_0x5b1979,_0x4e05a9(0x20d))}]);_0x5b1979=_0x6e83d9['baseUrl'];const _0x484917=await checkUrlReachability(_0x5b1979);if(_0x484917['ok'])break;const _0x34f2b3=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x5b1979),_0x2bf5d5=_0x484917['isProtocolError']&&!_0x34f2b3,_0x36a9f0=_0x2bf5d5?'http://'+_0x5b1979:null;_0xe2518=!![],console['log'](_0x4e05a9(0x1c4)+_0x5b1979+':\x20'+_0x484917['error']);_0x36a9f0&&console[_0x4e05a9(0x1f8)](_0x4e05a9(0x1a7)+_0x36a9f0+'?');const {action:_0x38965e}=await _0x474d25['prompt']([{'type':'list','name':_0x4e05a9(0x1a1),'message':_0x4e05a9(0x1be),'choices':[..._0x36a9f0?[{'name':_0x4e05a9(0x204)+_0x36a9f0,'value':_0x4e05a9(0x1e6)}]:[],{'name':_0x438549[_0x4e05a9(0x1e7)],'value':_0x4e05a9(0x1a6)},{'name':_0x438549[_0x4e05a9(0x1e8)],'value':'continue'}]}]);if(_0x38965e==='use_suggestion'&&_0x36a9f0){_0x5b1979=_0x36a9f0;const _0x447329=await _0x438549['NkzbG'](checkUrlReachability,_0x5b1979);if(_0x447329['ok'])break;console[_0x4e05a9(0x1f8)]('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x5b1979+':\x20'+_0x447329['error']);}else{if(_0x438549['OYvzL'](_0x38965e,_0x438549['WWiNt']))break;}}_0x1118b0={..._0x1118b0,'url':_0x5b1979};}let _0x5d5c50=![];try{_0x5d5c50=await _0x438549['woFfy'](tryAutoRouteCloudProfile,_0x1c2670,_0x1118b0['url'],_0x1118b0,_0x57dfc1,_0x4a692d);}catch(_0x3e452d){console[_0x4e05a9(0x1c7)]('\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22'+_0x1c2670+'\x22:\x20'+(_0x3e452d instanceof Error?_0x3e452d[_0x4e05a9(0x1b5)]:_0x438549[_0x4e05a9(0x1c1)](String,_0x3e452d))),process[_0x4e05a9(0x1da)](0x1);}!_0x5d5c50&&process['exit'](0x1),await markActive(_0x1c2670);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x4d6d(){var _0x1534f0=['4476185vSMltv','177DGAxQT','320451XPKvsF','error','gUQdT','2585241lDcQGF','30xVYZKH','2586CjpjcC','session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','KKeEq','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','tQUiC','433264GreWQY','122124NpISAk','2744976LrFodZ','hXvsq'];_0x4d6d=function(){return _0x1534f0;};return _0x4d6d();}function _0x2cc0(_0x4567ea,_0x416f70){_0x4567ea=_0x4567ea-0x9f;var _0x4d6d64=_0x4d6d();var _0x2cc0cd=_0x4d6d64[_0x4567ea];return _0x2cc0cd;}(function(_0x2d40e3,_0xefe5c8){var _0x48ef0a=_0x2cc0,_0x1c01de=_0x2d40e3();while(!![]){try{var _0x11a851=-parseInt(_0x48ef0a(0xaa))/0x1*(parseInt(_0x48ef0a(0x9f))/0x2)+-parseInt(_0x48ef0a(0xab))/0x3+parseInt(_0x48ef0a(0xa5))/0x4+-parseInt(_0x48ef0a(0xaf))/0x5*(parseInt(_0x48ef0a(0xa6))/0x6)+parseInt(_0x48ef0a(0xa9))/0x7+parseInt(_0x48ef0a(0xa7))/0x8+-parseInt(_0x48ef0a(0xae))/0x9;if(_0x11a851===_0xefe5c8)break;else _0x1c01de['push'](_0x1c01de['shift']());}catch(_0x5e7b01){_0x1c01de['push'](_0x1c01de['shift']());}}}(_0x4d6d,0x546f2));export async function authEncrypt(_0x549861){var _0x596fc2=_0x2cc0,_0x124ba3={'tQUiC':function(_0xe063b6,_0x271232){return _0xe063b6+_0x271232;},'FlbKR':function(_0x77c605,_0x1e9f3e){return _0x77c605+_0x1e9f3e;},'GKiJc':function(_0xebf0d5,_0x138bbc){return _0xebf0d5+_0x138bbc;},'TjXrW':function(_0x3e1e9c,_0x3b321d){return _0x3e1e9c+_0x3b321d;},'daUAD':'ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','gUQdT':_0x596fc2(0xa0),'hXvsq':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','FKhLd':_0x596fc2(0xa1),'KAHWj':_0x596fc2(0xa3),'KKeEq':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console[_0x596fc2(0xac)](_0x124ba3[_0x596fc2(0xa4)](_0x124ba3['tQUiC'](_0x124ba3['FlbKR'](_0x124ba3['GKiJc'](_0x124ba3['TjXrW'](_0x124ba3['daUAD'],_0x124ba3[_0x596fc2(0xad)]),'\x0a')+_0x124ba3[_0x596fc2(0xa8)],_0x124ba3['FKhLd']),'\x0a'),_0x124ba3['KAHWj'])+_0x124ba3[_0x596fc2(0xa2)]),process['exit'](0x1);}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x364c33,_0x3749d0){const _0x2367fe=_0x3d5f,_0x5bfa77=_0x364c33();while(!![]){try{const _0x5b5a37=-parseInt(_0x2367fe(0x98))/0x1*(-parseInt(_0x2367fe(0x7e))/0x2)+parseInt(_0x2367fe(0x6c))/0x3+parseInt(_0x2367fe(0x76))/0x4+-parseInt(_0x2367fe(0x97))/0x5+parseInt(_0x2367fe(0x6a))/0x6+parseInt(_0x2367fe(0x6e))/0x7+parseInt(_0x2367fe(0x7b))/0x8*(-parseInt(_0x2367fe(0x95))/0x9);if(_0x5b5a37===_0x3749d0)break;else _0x5bfa77['push'](_0x5bfa77['shift']());}catch(_0x386cdd){_0x5bfa77['push'](_0x5bfa77['shift']());}}}(_0x7447,0x4802d));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';function _0x7447(){const _0x11a721=['plugin','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','marketplace','trailhead','764888NvPpMF','claude','JXPAA','230226BPCxnJ','BxPtG','RSeYN','project','oRTnW','error','DBoDF','Mcfnr','NcnLC','akiTA','qqdly','filter','✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','zHdwO','bUwOY','remove','✓\x20Removed\x20user\x20skill:\x20','✓\x20Removed\x20trailhead\x20marketplace','parse','Qgwim','drDtK','sDoRF','uninstall','90VdTgjt','HwgRH','1204510dMlAqg','2LeEXdx','fRiTW','Nothing\x20to\x20clean\x20up.\x0a','✓\x20Removed\x20.ranger/\x20directory','✓\x20Removed\x20project\x20skill:\x20','replace','length','etqSn','ranger@trailhead','XTasY','3004164eIQdtW','QEZYJ','532902pxRjLW','oZTUP','1813434QxaWJu','✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','ZdWTW','log','SLQMv','win32','ignore','oKMjm','1297412wpLMrR'];_0x7447=function(){return _0x11a721;};return _0x7447();}import{existsSync}from'fs';function _0x3d5f(_0x5010d8,_0x47dbc9){_0x5010d8=_0x5010d8-0x64;const _0x744718=_0x7447();let _0x3d5f61=_0x744718[_0x5010d8];return _0x3d5f61;}import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=['ranger','feature-tracker','bug-bash','e2e-test-recommender'],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x392504){const _0x595429=_0x3d5f,_0x5a67ae=_0x392504['replace'](/\/\*[\s\S]*?\*\//g,''),_0x2221e6=_0x5a67ae[_0x595429(0x65)](/^\s*\/\/.*$/gm,''),_0x2b103e=_0x2221e6[_0x595429(0x65)](/,\s*([}\]])/g,'$1');return JSON[_0x595429(0x90)](_0x2b103e);}async function removeOpencodePluginConfig(_0x388523){const _0x35610e=_0x3d5f,_0x2b6ec3={'yYFmn':function(_0x2f1fa7,_0x340edd){return _0x2f1fa7!==_0x340edd;},'NkHfU':'string','twKRk':function(_0x4ccb21,_0x5560a9){return _0x4ccb21(_0x5560a9);},'RNeRq':function(_0x2d9efc,_0x5dbb98){return _0x2d9efc(_0x5dbb98);},'nmSEs':function(_0x40d65e,_0x573029){return _0x40d65e===_0x573029;},'qqdly':function(_0x2cc1ed,_0x2db6ab,_0x4c8190){return _0x2cc1ed(_0x2db6ab,_0x4c8190);}};if(!_0x2b6ec3['twKRk'](existsSync,_0x388523))return![];let _0x15f19d;try{const _0x66b576=await readFile(_0x388523,'utf-8');_0x15f19d=_0x2b6ec3['RNeRq'](parseJsonc,_0x66b576);}catch{return![];}const _0x52452c=Array['isArray'](_0x15f19d[_0x35610e(0x77)])?_0x15f19d['plugin']:[];if(_0x2b6ec3['nmSEs'](_0x52452c['length'],0x0))return![];const _0x3af7b6=_0x52452c[_0x35610e(0x89)](_0x5489f5=>{if(_0x2b6ec3['yYFmn'](typeof _0x5489f5,_0x2b6ec3['NkHfU']))return!![];return _0x5489f5!==opencodePluginName;});if(_0x3af7b6[_0x35610e(0x66)]===_0x52452c['length'])return![];return _0x3af7b6[_0x35610e(0x66)]===0x0?delete _0x15f19d[_0x35610e(0x77)]:_0x15f19d[_0x35610e(0x77)]=_0x3af7b6,await _0x2b6ec3[_0x35610e(0x88)](writeFile,_0x388523,JSON['stringify'](_0x15f19d,null,0x2)+'\x0a'),!![];}async function uninstallClaudePlugin(_0x41e19c){const _0x35f2be=_0x3d5f,_0x3f290b={'nghdK':function(_0x5f42ed,_0x4a3f92){return _0x5f42ed(_0x4a3f92);},'QSrrr':_0x35f2be(0x94),'DBoDF':_0x35f2be(0x68),'mNbGW':'--scope','JlWSF':function(_0xb7c89,_0x3c6777,_0x578040,_0x4b02fd){return _0xb7c89(_0x3c6777,_0x578040,_0x4b02fd);},'oKMjm':_0x35f2be(0x7c),'ynFIc':_0x35f2be(0x74),'PeymD':function(_0x3b58a7,_0x3ecbe1){return _0x3b58a7===_0x3ecbe1;},'NcnLC':_0x35f2be(0x73),'bUwOY':'close','bcKUJ':'error'};return new Promise(_0x5ca947=>{const _0xfd4e49=_0x35f2be,_0x1a08b1={'Mcfnr':function(_0x59efe4,_0x1c54a9){return _0x3f290b['nghdK'](_0x59efe4,_0x1c54a9);}},_0x36af3f=[_0xfd4e49(0x77),_0x3f290b['QSrrr'],_0x3f290b[_0xfd4e49(0x84)]];_0x41e19c&&_0x36af3f['push'](_0x3f290b['mNbGW'],_0x41e19c);const _0x5b4a5a=_0x3f290b['JlWSF'](spawn,_0x3f290b[_0xfd4e49(0x75)],_0x36af3f,{'stdio':['ignore',_0x3f290b['ynFIc'],'ignore'],'cwd':_0x41e19c?getProjectRoot():undefined,'shell':_0x3f290b['PeymD'](process['platform'],_0x3f290b[_0xfd4e49(0x86)])});_0x5b4a5a['on'](_0x3f290b[_0xfd4e49(0x8c)],_0x1b1a96=>{_0x5ca947(_0x1b1a96===0x0);}),_0x5b4a5a['on'](_0x3f290b['bcKUJ'],()=>{const _0x425fa8=_0xfd4e49;_0x1a08b1[_0x425fa8(0x85)](_0x5ca947,![]);});});}async function removeMarketplace(){const _0x10045a=_0x3d5f,_0x203e3b={'TvyRV':function(_0x29b07d,_0x220ce1){return _0x29b07d===_0x220ce1;},'SLQMv':function(_0x21884f,_0x5c4f9a,_0x15beb1,_0x4c5f19){return _0x21884f(_0x5c4f9a,_0x15beb1,_0x4c5f19);},'sDoRF':'claude','akiTA':'plugin','RSeYN':_0x10045a(0x79),'nFhcA':_0x10045a(0x8d),'oRTnW':_0x10045a(0x74),'BxPtG':_0x10045a(0x73),'oZTUP':_0x10045a(0x83)};return new Promise(_0x186296=>{const _0x24a93c=_0x10045a,_0x4c1f29=_0x203e3b[_0x24a93c(0x72)](spawn,_0x203e3b[_0x24a93c(0x93)],[_0x203e3b[_0x24a93c(0x87)],_0x203e3b[_0x24a93c(0x80)],_0x203e3b['nFhcA'],_0x24a93c(0x7a)],{'stdio':[_0x203e3b[_0x24a93c(0x82)],_0x24a93c(0x74),'ignore'],'shell':process['platform']===_0x203e3b[_0x24a93c(0x7f)]});_0x4c1f29['on']('close',_0x3ea228=>{_0x186296(_0x203e3b['TvyRV'](_0x3ea228,0x0));}),_0x4c1f29['on'](_0x203e3b[_0x24a93c(0x6d)],()=>{_0x186296(![]);});});}export async function clean(){const _0x434fce=_0x3d5f,_0x2d4e50={'etqSn':'\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','Qgwim':'✓\x20Removed\x20stored\x20credentials','fRiTW':function(_0x1c6554){return _0x1c6554();},'XTasY':function(_0x11f7bc,_0xdea873){return _0x11f7bc(_0xdea873);},'Vastt':function(_0xff5201,_0x3a481d,_0x459c49){return _0xff5201(_0x3a481d,_0x459c49);},'rJhsG':_0x434fce(0x9b),'JXPAA':function(_0xefd814){return _0xefd814();},'QEZYJ':function(_0x16c4fd,_0x1bc714){return _0x16c4fd(_0x1bc714);},'zHdwO':function(_0x27578d,_0x4685e3,_0x4d1c38){return _0x27578d(_0x4685e3,_0x4d1c38);},'HwgRH':function(_0x58add1,_0x3b7f2f,_0x22190d){return _0x58add1(_0x3b7f2f,_0x22190d);},'ZdWTW':'user','WLMNp':function(_0x5d70dc,_0x45ce05,_0x565393){return _0x5d70dc(_0x45ce05,_0x565393);},'CmdtC':function(_0xcd5eea,_0x302849){return _0xcd5eea(_0x302849);},'SCsok':'opencode.json','drDtK':function(_0x412402,_0xd15940,_0x2a36ac){return _0x412402(_0xd15940,_0x2a36ac);},'NVutN':'✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','RjGyH':function(_0xd55069){return _0xd55069();},'dZpBC':_0x434fce(0x9a)};console[_0x434fce(0x71)](_0x2d4e50[_0x434fce(0x67)]);let _0x5e226e=![];try{await deleteAllCredentials(),console[_0x434fce(0x71)](_0x2d4e50[_0x434fce(0x91)]),_0x5e226e=!![];}catch{}const _0x51eda4=_0x2d4e50['fRiTW'](getCacheFile);existsSync(_0x51eda4)&&(await _0x2d4e50['XTasY'](rm,_0x51eda4),_0x5e226e=!![]);const _0x387c26=_0x2d4e50['fRiTW'](getRangerDir);_0x2d4e50[_0x434fce(0x69)](existsSync,_0x387c26)&&(await _0x2d4e50['Vastt'](rm,_0x387c26,{'recursive':!![]}),console[_0x434fce(0x71)](_0x2d4e50['rJhsG']),_0x5e226e=!![]);const _0x51f128=_0x2d4e50[_0x434fce(0x7d)](getProjectSkillsDir);for(const _0x3a92aa of skillsToRemove){const _0x351e3f=_0x2d4e50['Vastt'](join,_0x51f128,_0x3a92aa);_0x2d4e50['QEZYJ'](existsSync,_0x351e3f)&&(await rm(_0x351e3f,{'recursive':!![]}),console['log'](_0x434fce(0x64)+_0x3a92aa),_0x5e226e=!![]);}const _0x1bc6b8=_0x2d4e50[_0x434fce(0x99)](getUserSkillsDir);for(const _0x55a9e5 of skillsToRemove){const _0x4de271=_0x2d4e50[_0x434fce(0x8b)](join,_0x1bc6b8,_0x55a9e5);_0x2d4e50[_0x434fce(0x6b)](existsSync,_0x4de271)&&(await rm(_0x4de271,{'recursive':!![]}),console[_0x434fce(0x71)](_0x434fce(0x8e)+_0x55a9e5),_0x5e226e=!![]);}const _0x48a9c4=getOpencodeSkillsDir('project');for(const _0x54ceb2 of skillsToRemove){const _0x133a47=_0x2d4e50['zHdwO'](join,_0x48a9c4,_0x54ceb2);existsSync(_0x133a47)&&(await _0x2d4e50[_0x434fce(0x96)](rm,_0x133a47,{'recursive':!![]}),console[_0x434fce(0x71)](_0x434fce(0x78)+_0x54ceb2),_0x5e226e=!![]);}const _0x57b8e1=getOpencodeSkillsDir(_0x2d4e50[_0x434fce(0x70)]);for(const _0x178fc0 of skillsToRemove){const _0x2a2aa4=_0x2d4e50['WLMNp'](join,_0x57b8e1,_0x178fc0);_0x2d4e50['CmdtC'](existsSync,_0x2a2aa4)&&(await rm(_0x2a2aa4,{'recursive':!![]}),console['log']('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x178fc0),_0x5e226e=!![]);}const _0x52246b=join(getOpencodeConfigDir(_0x434fce(0x81)),_0x2d4e50['SCsok']);await removeOpencodePluginConfig(_0x52246b)&&(console[_0x434fce(0x71)]('✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)'),_0x5e226e=!![]);const _0xb8ab7b=_0x2d4e50[_0x434fce(0x92)](join,getOpencodeConfigDir(_0x2d4e50['ZdWTW']),_0x2d4e50['SCsok']);await _0x2d4e50[_0x434fce(0x6b)](removeOpencodePluginConfig,_0xb8ab7b)&&(console['log'](_0x2d4e50['NVutN']),_0x5e226e=!![]);const _0x1f1465=await _0x2d4e50['RjGyH'](uninstallClaudePlugin);_0x1f1465&&(console['log'](_0x434fce(0x6f)),_0x5e226e=!![]);const _0x50e5c8=await uninstallClaudePlugin(_0x434fce(0x81));_0x50e5c8&&(console[_0x434fce(0x71)](_0x434fce(0x8a)),_0x5e226e=!![]);const _0x12b4fd=await _0x2d4e50['RjGyH'](removeMarketplace);_0x12b4fd&&(console[_0x434fce(0x71)](_0x434fce(0x8f)),_0x5e226e=!![]),_0x5e226e?console[_0x434fce(0x71)]('\x0a✅\x20Cleanup\x20complete!\x0a'):console['log'](_0x2d4e50['dZpBC']);}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x576a7e=_0x444d;(function(_0x52d19e,_0x2e0fd2){const _0x5c396c=_0x444d,_0x4b7cad=_0x52d19e();while(!![]){try{const _0x944ba4=-parseInt(_0x5c396c(0x1f3))/0x1*(-parseInt(_0x5c396c(0x208))/0x2)+parseInt(_0x5c396c(0x1f1))/0x3+parseInt(_0x5c396c(0x1fc))/0x4+-parseInt(_0x5c396c(0x20b))/0x5+-parseInt(_0x5c396c(0x20e))/0x6*(parseInt(_0x5c396c(0x1f7))/0x7)+parseInt(_0x5c396c(0x217))/0x8+parseInt(_0x5c396c(0x213))/0x9*(-parseInt(_0x5c396c(0x1ee))/0xa);if(_0x944ba4===_0x2e0fd2)break;else _0x4b7cad['push'](_0x4b7cad['shift']());}catch(_0xb3e289){_0x4b7cad['push'](_0x4b7cad['shift']());}}}(_0x2f6a,0xaf8b5));import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x576a7e(0x200),_0x576a7e(0x209),_0x576a7e(0x1ff)];function parseLocalValue(_0x2bc58a,_0x2cc529){const _0x1cbb7b=_0x576a7e,_0x5be45a={'tFmNb':function(_0xf9d30f,_0x315eea){return _0xf9d30f===_0x315eea;},'FJTqo':'false'};if(BOOLEAN_KEYS[_0x1cbb7b(0x1ef)](_0x2bc58a)){if(_0x2cc529==='true')return!![];if(_0x5be45a[_0x1cbb7b(0x210)](_0x2cc529,_0x5be45a['FJTqo']))return![];throw new Error('Invalid\x20value\x20for\x20'+_0x2bc58a+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x2cc529;}function parseOverrideValue(_0x11dc7f){const _0x1c25e6=_0x576a7e,_0x435818={'NwLgO':function(_0x43661f,_0x5a8b40){return _0x43661f===_0x5a8b40;},'APhKd':_0x1c25e6(0x215),'OpxIL':'undefined','BrZHO':function(_0x264d77,_0x2884ca){return _0x264d77(_0x2884ca);}};if(_0x435818[_0x1c25e6(0x1fe)](_0x11dc7f,_0x435818['APhKd']))return!![];if(_0x11dc7f===_0x1c25e6(0x216))return![];if(_0x11dc7f===_0x1c25e6(0x204))return null;if(_0x435818[_0x1c25e6(0x1fe)](_0x11dc7f,_0x435818[_0x1c25e6(0x211)]))return undefined;if(/^-?\d+$/['test'](_0x11dc7f)){const _0xf2411b=_0x435818[_0x1c25e6(0x1f8)](Number,_0x11dc7f);if(Number['isSafeInteger'](_0xf2411b))return _0xf2411b;}if(/^-?\d+\.\d+$/['test'](_0x11dc7f)){const _0x46ef15=_0x435818['BrZHO'](Number,_0x11dc7f);if(!Number['isNaN'](_0x46ef15))return _0x46ef15;}const _0xaf7eb3=_0x11dc7f[_0x1c25e6(0x21d)]();if(_0xaf7eb3[_0x1c25e6(0x1fd)]('{')&&_0xaf7eb3['endsWith']('}')||_0xaf7eb3['startsWith']('[')&&_0xaf7eb3['endsWith'](']'))try{return JSON['parse'](_0xaf7eb3);}catch{}return _0x11dc7f;}async function resolveProfileTarget(_0x1fce55){const _0x899b32=_0x576a7e,_0x111085={'WHEmn':function(_0x3343cb,_0x5a79f9){return _0x3343cb(_0x5a79f9);},'onQNs':function(_0xd457d0,_0x4c0b1b){return _0xd457d0(_0x4c0b1b);},'YMRdZ':'local'},_0xd5c76e=existsSync(_0x111085['WHEmn'](getEnvDir,_0x1fce55));let _0x2afba2=![];try{const _0x54b784=await _0x111085['onQNs'](fetchCloudProfile,_0x1fce55);_0x2afba2=Boolean(_0x54b784);}catch{}if(_0x2afba2)return{'kind':'cloud','alsoExistsElsewhere':_0xd5c76e};if(_0xd5c76e)return{'kind':_0x111085[_0x899b32(0x1f5)],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x1fce55+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x1fce55);}function _0x444d(_0x5aa33b,_0x418bd9){_0x5aa33b=_0x5aa33b-0x1ee;const _0x2f6a0e=_0x2f6a();let _0x444d48=_0x2f6a0e[_0x5aa33b];return _0x444d48;}function printDualExistsHint(_0x1e7f92){const _0x11be7a=_0x576a7e;console['log'](_0x11be7a(0x207)+_0x1e7f92+_0x11be7a(0x21e));}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x2376d7){const _0x39304b={'WlZtk':function(_0x37a189,_0x14bb39){return _0x37a189(_0x14bb39);}},_0x1fe291=await _0x39304b['WlZtk'](fetchCloudProfile,_0x2376d7),_0x2eae20=readProfileOverrides(getProjectPath(),_0x2376d7);return mergeCloudProfileSettings(_0x1fe291?.['settings']??{},_0x2eae20??undefined);}function _0x2f6a(){const _0x151f44=['BrZHO','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','length','kind','3825776JXIrkG','startsWith','NwLgO','forceLogin','headless','Key\x20\x22','object','(not\x20set)','null','No\x20configuration\x20set\x20for\x20\x22','piVAo','\x20\x20Note:\x20\x22','2zjuUAE','allowInsecureLocalhost','KjflE','6902080lDOcJN','rsHsU','Removed\x20','18wcAnqV','Dffiy','tFmNb','OpxIL','cloud','3132306HlEnTy','yUXBp','true','false','3190984RVHrWw','\x20for\x20\x22','\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.','WYOue','psmOp','Set\x20','trim','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','20ikumvj','includes','log','3860340vFWwon','\x20=\x20','419201neXVox','\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22','YMRdZ','stringify','620165AbvFTA'];_0x2f6a=function(){return _0x151f44;};return _0x2f6a();}export async function configSet(_0x309910,_0x3b9d00,_0x5c3b0f){const _0x56f87b=_0x576a7e,_0x3b844c={'HAGDr':function(_0x4444f2,_0x423791){return _0x4444f2(_0x423791);},'rsHsU':function(_0x277adf,_0x4626c6){return _0x277adf===_0x4626c6;},'CRUIu':_0x56f87b(0x212),'faojP':function(_0x1e2898,_0x5bab33,_0x340bea,_0xfc88f9,_0x4a8bee){return _0x1e2898(_0x5bab33,_0x340bea,_0xfc88f9,_0x4a8bee);},'YRPuL':function(_0x4dd68e,_0x394ef9,_0x417eca){return _0x4dd68e(_0x394ef9,_0x417eca);},'piVAo':function(_0xf4e50d){return _0xf4e50d();}},_0x4114b5=await _0x3b844c['HAGDr'](resolveProfileTarget,_0x309910);if(_0x3b844c[_0x56f87b(0x20c)](_0x4114b5['kind'],_0x3b844c['CRUIu'])){if(_0x4114b5['alsoExistsElsewhere'])printDualExistsHint(_0x309910);const _0x2cc762=parseOverrideValue(_0x5c3b0f);_0x3b844c['faojP'](setProfileOverride,getProjectPath(),_0x309910,_0x3b9d00,_0x2cc762),console['log'](_0x56f87b(0x21c)+_0x3b9d00+_0x56f87b(0x1f2)+JSON[_0x56f87b(0x1f6)](_0x2cc762)+_0x56f87b(0x218)+_0x309910+'\x22');return;}const _0xe96074=_0x3b844c['YRPuL'](parseLocalValue,_0x3b9d00,_0x5c3b0f);setProfileOverride(_0x3b844c[_0x56f87b(0x206)](getProjectPath),_0x309910,_0x3b9d00,_0xe96074),console['log'](_0x56f87b(0x21c)+_0x3b9d00+'\x20=\x20'+_0xe96074+_0x56f87b(0x218)+_0x309910+'\x22');}export async function configGet(_0x3aa5c1,_0x4273a0){const _0x178c66=_0x576a7e,_0xccd180={'WYOue':function(_0x26d79f,_0x3d8c95){return _0x26d79f(_0x3d8c95);},'gAyaq':function(_0x2215d2,_0x105fa2){return _0x2215d2===_0x105fa2;},'htIRz':'cloud','yUXBp':function(_0x697c58,_0x14d82e,_0x528099){return _0x697c58(_0x14d82e,_0x528099);}},_0x2e35c5=await _0xccd180['WYOue'](resolveProfileTarget,_0x3aa5c1);if(_0xccd180['gAyaq'](_0x2e35c5[_0x178c66(0x1fb)],_0xccd180['htIRz'])){const _0x142971=await _0xccd180[_0x178c66(0x21a)](loadEffectiveCloudSettings,_0x3aa5c1),_0x48342c=_0xccd180[_0x178c66(0x214)](getNestedValue,_0x142971,_0x4273a0);if(_0x48342c===undefined)console[_0x178c66(0x1f0)]('(not\x20set)');else typeof _0x48342c==='object'?console['log'](JSON['stringify'](_0x48342c,null,0x2)):console['log'](_0x48342c);return;}const _0xc40574=await loadSettings(_0x3aa5c1),_0x2084fc=getNestedValue(_0xc40574,_0x4273a0);if(_0x2084fc===undefined)console[_0x178c66(0x1f0)](_0x178c66(0x203));else typeof _0x2084fc===_0x178c66(0x202)?console['log'](JSON[_0x178c66(0x1f6)](_0x2084fc,null,0x2)):console['log'](_0x2084fc);}export async function configList(_0x114c0e){const _0x19aebc=_0x576a7e,_0x5e5e40={'psmOp':function(_0xe29cea,_0x399b2a){return _0xe29cea===_0x399b2a;},'hYRGa':function(_0x3e9cc1,_0x24e659){return _0x3e9cc1(_0x24e659);},'KjflE':function(_0x82741f,_0x261229){return _0x82741f===_0x261229;}},_0x1a600f=await resolveProfileTarget(_0x114c0e);if(_0x5e5e40[_0x19aebc(0x21b)](_0x1a600f[_0x19aebc(0x1fb)],'cloud')){const _0x2ce7d9=await _0x5e5e40['hYRGa'](loadEffectiveCloudSettings,_0x114c0e);if(!_0x2ce7d9||_0x5e5e40[_0x19aebc(0x20a)](Object['keys'](_0x2ce7d9)[_0x19aebc(0x1fa)],0x0)){console[_0x19aebc(0x1f0)]('No\x20configuration\x20set\x20for\x20\x22'+_0x114c0e+'\x22');return;}console['log'](JSON['stringify'](_0x2ce7d9,null,0x2));return;}const _0x63a802=getSettingsPath(_0x114c0e);if(!existsSync(_0x63a802)){console['log'](_0x19aebc(0x205)+_0x114c0e+'\x22');return;}const _0x2f65bf=await loadSettings(_0x114c0e),_0x4794fc=_0x5e5e40['hYRGa'](formatSettings,_0x2f65bf);!_0x4794fc?console['log'](_0x19aebc(0x205)+_0x114c0e+'\x22'):console[_0x19aebc(0x1f0)](_0x4794fc);}export async function configUnset(_0x47a13b,_0x51a1dd){const _0x346346=_0x576a7e,_0x3c9cf5={'Dffiy':function(_0x771758,_0x29b4b9){return _0x771758(_0x29b4b9);},'zXMuZ':function(_0x2e0dc6,_0x41e65e){return _0x2e0dc6===_0x41e65e;}},_0x2b6589=await _0x3c9cf5['Dffiy'](resolveProfileTarget,_0x47a13b);if(_0x3c9cf5['zXMuZ'](_0x2b6589['kind'],_0x346346(0x212))){if(_0x2b6589['alsoExistsElsewhere'])_0x3c9cf5['Dffiy'](printDualExistsHint,_0x47a13b);const _0x211df2=unsetProfileOverride(getProjectPath(),_0x47a13b,_0x51a1dd);_0x211df2?console[_0x346346(0x1f0)]('Removed\x20'+_0x51a1dd+_0x346346(0x218)+_0x47a13b+'\x22'):console[_0x346346(0x1f0)](_0x346346(0x201)+_0x51a1dd+'\x22\x20not\x20found');return;}const _0x1718c8=unsetProfileOverride(getProjectPath(),_0x47a13b,_0x51a1dd);if(_0x1718c8){console[_0x346346(0x1f0)](_0x346346(0x20d)+_0x51a1dd);return;}const _0x261da9=await _0x3c9cf5[_0x346346(0x20f)](loadSettings,_0x47a13b),_0x38f405=deleteNestedValue(_0x261da9,_0x51a1dd);_0x38f405?console['log']('Key\x20\x22'+_0x51a1dd+_0x346346(0x1f4)+_0x47a13b+_0x346346(0x219)):console[_0x346346(0x1f0)]('Key\x20\x22'+_0x51a1dd+'\x22\x20not\x20found');}export async function configReset(_0x2b3519){const _0x469edf=_0x576a7e,_0x304a1f={'grnyI':function(_0x3db1e1,_0x1071e3){return _0x3db1e1===_0x1071e3;},'pmMjn':function(_0x4c31fd){return _0x4c31fd();}},_0x6993dc=await resolveProfileTarget(_0x2b3519);if(_0x304a1f['grnyI'](_0x6993dc[_0x469edf(0x1fb)],'cloud')){resetProfileOverrides(_0x304a1f['pmMjn'](getProjectPath),_0x2b3519),console['log']('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x2b3519+'\x22');return;}console[_0x469edf(0x1f0)]('\x22'+_0x2b3519+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x2b3519+_0x469edf(0x1f9));}
|
|
1
|
+
const _0x59d069=_0x2e89;function _0x2e89(_0x29e18c,_0x5e5d40){_0x29e18c=_0x29e18c-0x12c;const _0x213c2e=_0x213c();let _0x2e891f=_0x213c2e[_0x29e18c];return _0x2e891f;}(function(_0xc47005,_0x1102c8){const _0x45f7fa=_0x2e89,_0x19828b=_0xc47005();while(!![]){try{const _0x5972f6=parseInt(_0x45f7fa(0x13a))/0x1*(parseInt(_0x45f7fa(0x15a))/0x2)+parseInt(_0x45f7fa(0x143))/0x3*(-parseInt(_0x45f7fa(0x134))/0x4)+-parseInt(_0x45f7fa(0x148))/0x5*(parseInt(_0x45f7fa(0x152))/0x6)+-parseInt(_0x45f7fa(0x157))/0x7+parseInt(_0x45f7fa(0x151))/0x8+parseInt(_0x45f7fa(0x15f))/0x9+parseInt(_0x45f7fa(0x153))/0xa;if(_0x5972f6===_0x1102c8)break;else _0x19828b['push'](_0x19828b['shift']());}catch(_0x1e2fba){_0x19828b['push'](_0x19828b['shift']());}}}(_0x213c,0xc004c));import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';function _0x213c(){const _0x4306ad=['5298704SaTVUB','329694lNjuZG','13021030sUVefq','YEzEd','keys','stringify','1903853bzJzTg','Key\x20\x22','gvbJz','136mqDzZO','undefined','cloud','fKwQd','NqAjP','3818016toLPFT','rsKyP','cqKVL','true','Removed\x20','(not\x20set)','tIKsT','log','HfgXo','\x20=\x20','Cleared\x20local\x20overrides\x20for\x20\x22','alsoExistsElsewhere','bQQLt','68iAjBnB','ctwSu','Invalid\x20value\x20for\x20','ZYjbA','isSafeInteger','ichAt','6565pLRVIz','test','No\x20configuration\x20set\x20for\x20\x22','FXdhE','false','headless','null','includes','kind','90489stIdOR','isNaN','\x20for\x20\x22','QDggf','EjFXx','115fJWTYD','sdLvW','\x20\x20Note:\x20\x22','PreBI','\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20','XCdyA','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','forceLogin','iSQAQ'];_0x213c=function(){return _0x4306ad;};return _0x213c();}import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x59d069(0x13f),'allowInsecureLocalhost',_0x59d069(0x14f)];function parseLocalValue(_0x50e7fa,_0x26a0c6){const _0x2e4baa=_0x59d069;if(BOOLEAN_KEYS[_0x2e4baa(0x141)](_0x50e7fa)){if(_0x26a0c6===_0x2e4baa(0x162))return!![];if(_0x26a0c6===_0x2e4baa(0x13e))return![];throw new Error(_0x2e4baa(0x136)+_0x50e7fa+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x26a0c6;}function parseOverrideValue(_0x3c1c42){const _0x497f9f=_0x59d069,_0x1068b8={'ctwSu':function(_0x4d7bc6,_0x167139){return _0x4d7bc6===_0x167139;},'OQPLK':function(_0x3a78b2,_0x1a6adb){return _0x3a78b2===_0x1a6adb;},'bQQLt':function(_0x1032bf,_0x1304f5){return _0x1032bf(_0x1304f5);}};if(_0x1068b8['ctwSu'](_0x3c1c42,'true'))return!![];if(_0x1068b8[_0x497f9f(0x135)](_0x3c1c42,_0x497f9f(0x13e)))return![];if(_0x1068b8['OQPLK'](_0x3c1c42,_0x497f9f(0x140)))return null;if(_0x3c1c42===_0x497f9f(0x15b))return undefined;if(/^-?\d+$/[_0x497f9f(0x13b)](_0x3c1c42)){const _0x381977=Number(_0x3c1c42);if(Number[_0x497f9f(0x138)](_0x381977))return _0x381977;}if(/^-?\d+\.\d+$/[_0x497f9f(0x13b)](_0x3c1c42)){const _0x443273=_0x1068b8[_0x497f9f(0x133)](Number,_0x3c1c42);if(!Number[_0x497f9f(0x144)](_0x443273))return _0x443273;}const _0xfbace2=_0x3c1c42['trim']();if(_0xfbace2['startsWith']('{')&&_0xfbace2['endsWith']('}')||_0xfbace2['startsWith']('[')&&_0xfbace2['endsWith'](']'))try{return JSON['parse'](_0xfbace2);}catch{}return _0x3c1c42;}async function resolveProfileTarget(_0x5a7c9f){const _0x57f706=_0x59d069,_0x32f045={'iSQAQ':function(_0x3ced10,_0x3475c9){return _0x3ced10(_0x3475c9);},'mpdwR':function(_0x35c11f,_0xd709de){return _0x35c11f(_0xd709de);},'SXCUe':'cloud'},_0x137230=_0x32f045[_0x57f706(0x150)](existsSync,_0x32f045['mpdwR'](getEnvDir,_0x5a7c9f));let _0x1c3c83=![];try{const _0x157724=await fetchCloudProfile(_0x5a7c9f);_0x1c3c83=Boolean(_0x157724);}catch{}if(_0x1c3c83)return{'kind':_0x32f045['SXCUe'],'alsoExistsElsewhere':_0x137230};if(_0x137230)return{'kind':'local','alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x5a7c9f+_0x57f706(0x14c)+_0x5a7c9f);}function printDualExistsHint(_0x1102d6){const _0x32bb6e=_0x59d069;console['log'](_0x32bb6e(0x14a)+_0x1102d6+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x3b6430){const _0x41f55a=_0x59d069,_0x1e074e={'FXdhE':function(_0x19eb20,_0x52cd20){return _0x19eb20(_0x52cd20);},'iFlOb':function(_0x37ed51){return _0x37ed51();},'QDggf':function(_0x39601,_0x164f72){return _0x39601??_0x164f72;}},_0xde29a9=await _0x1e074e[_0x41f55a(0x13d)](fetchCloudProfile,_0x3b6430),_0x1033c4=readProfileOverrides(_0x1e074e['iFlOb'](getProjectPath),_0x3b6430);return mergeCloudProfileSettings(_0xde29a9?.['settings']??{},_0x1e074e[_0x41f55a(0x146)](_0x1033c4,undefined));}export async function configSet(_0x42f3b8,_0x39bc22,_0x13b92c){const _0x3f7414=_0x59d069,_0x4497d7={'YEzEd':function(_0x31fd31,_0x366542){return _0x31fd31(_0x366542);},'EjFXx':function(_0x49e179,_0xd4f559){return _0x49e179===_0xd4f559;},'tIKsT':function(_0x36c1e1,_0x221590){return _0x36c1e1(_0x221590);},'sdLvW':function(_0x1e8b2a){return _0x1e8b2a();},'PreBI':function(_0x731072,_0x365fae,_0x2258fc){return _0x731072(_0x365fae,_0x2258fc);}},_0x35b38a=await _0x4497d7[_0x3f7414(0x154)](resolveProfileTarget,_0x42f3b8);if(_0x4497d7[_0x3f7414(0x147)](_0x35b38a['kind'],'cloud')){if(_0x35b38a['alsoExistsElsewhere'])printDualExistsHint(_0x42f3b8);const _0x2543a6=_0x4497d7[_0x3f7414(0x12d)](parseOverrideValue,_0x13b92c);setProfileOverride(_0x4497d7[_0x3f7414(0x149)](getProjectPath),_0x42f3b8,_0x39bc22,_0x2543a6),console[_0x3f7414(0x12e)]('Set\x20'+_0x39bc22+_0x3f7414(0x130)+JSON['stringify'](_0x2543a6)+'\x20for\x20\x22'+_0x42f3b8+'\x22');return;}const _0x1c9f1b=_0x4497d7[_0x3f7414(0x14b)](parseLocalValue,_0x39bc22,_0x13b92c);setProfileOverride(_0x4497d7['sdLvW'](getProjectPath),_0x42f3b8,_0x39bc22,_0x1c9f1b),console['log']('Set\x20'+_0x39bc22+'\x20=\x20'+_0x1c9f1b+_0x3f7414(0x145)+_0x42f3b8+'\x22');}export async function configGet(_0x5ac288,_0x3ae5a4){const _0x42c701=_0x59d069,_0x5e861c={'FEdKV':function(_0x1fadd2,_0xc08e71){return _0x1fadd2(_0xc08e71);},'JMuwr':_0x42c701(0x15c),'NqAjP':function(_0x648ce2,_0x22d602,_0x38d156){return _0x648ce2(_0x22d602,_0x38d156);},'HfgXo':function(_0x59cc24,_0x5f54cb){return _0x59cc24===_0x5f54cb;},'fKwQd':'object'},_0x4c85be=await _0x5e861c['FEdKV'](resolveProfileTarget,_0x5ac288);if(_0x4c85be['kind']===_0x5e861c['JMuwr']){const _0x2f7130=await loadEffectiveCloudSettings(_0x5ac288),_0x4f1c3b=_0x5e861c[_0x42c701(0x15e)](getNestedValue,_0x2f7130,_0x3ae5a4);if(_0x5e861c[_0x42c701(0x12f)](_0x4f1c3b,undefined))console['log'](_0x42c701(0x12c));else _0x5e861c[_0x42c701(0x12f)](typeof _0x4f1c3b,_0x5e861c[_0x42c701(0x15d)])?console['log'](JSON['stringify'](_0x4f1c3b,null,0x2)):console[_0x42c701(0x12e)](_0x4f1c3b);return;}const _0x5f215d=await loadSettings(_0x5ac288),_0x1da07a=getNestedValue(_0x5f215d,_0x3ae5a4);if(_0x5e861c[_0x42c701(0x12f)](_0x1da07a,undefined))console['log'](_0x42c701(0x12c));else typeof _0x1da07a==='object'?console['log'](JSON[_0x42c701(0x156)](_0x1da07a,null,0x2)):console[_0x42c701(0x12e)](_0x1da07a);}export async function configList(_0x1773a5){const _0x479856=_0x59d069,_0x18084f={'ichAt':function(_0x4b64e2,_0x149c6f){return _0x4b64e2(_0x149c6f);},'cqKVL':'cloud','gvbJz':function(_0x4638b6,_0x46b1f5){return _0x4638b6(_0x46b1f5);},'FHrAW':function(_0x282d48,_0x4cd596){return _0x282d48(_0x4cd596);}},_0x45bb6e=await _0x18084f[_0x479856(0x139)](resolveProfileTarget,_0x1773a5);if(_0x45bb6e[_0x479856(0x142)]===_0x18084f[_0x479856(0x161)]){const _0x557b46=await loadEffectiveCloudSettings(_0x1773a5);if(!_0x557b46||Object[_0x479856(0x155)](_0x557b46)['length']===0x0){console[_0x479856(0x12e)](_0x479856(0x13c)+_0x1773a5+'\x22');return;}console['log'](JSON['stringify'](_0x557b46,null,0x2));return;}const _0x3eb336=getSettingsPath(_0x1773a5);if(!_0x18084f[_0x479856(0x159)](existsSync,_0x3eb336)){console[_0x479856(0x12e)](_0x479856(0x13c)+_0x1773a5+'\x22');return;}const _0x131653=await _0x18084f['FHrAW'](loadSettings,_0x1773a5),_0x46d1cc=formatSettings(_0x131653);!_0x46d1cc?console['log'](_0x479856(0x13c)+_0x1773a5+'\x22'):console['log'](_0x46d1cc);}export async function configUnset(_0x31ef6c,_0x3aa139){const _0x1c1753=_0x59d069,_0x356ae9={'uDBcx':function(_0x1a9a79,_0x3545d5){return _0x1a9a79(_0x3545d5);},'BomwP':function(_0x5bf314,_0x1d6145){return _0x5bf314===_0x1d6145;},'oPUmZ':'cloud','iBKhs':function(_0xe4c370){return _0xe4c370();},'ZYjbA':function(_0x548253,_0x4f39a9,_0x5e02a1,_0x864fb3){return _0x548253(_0x4f39a9,_0x5e02a1,_0x864fb3);},'rsKyP':function(_0x4fa473){return _0x4fa473();},'KwwYz':function(_0x24ddae,_0x367b79,_0x445cb6){return _0x24ddae(_0x367b79,_0x445cb6);}},_0x3a2582=await _0x356ae9['uDBcx'](resolveProfileTarget,_0x31ef6c);if(_0x356ae9['BomwP'](_0x3a2582[_0x1c1753(0x142)],_0x356ae9['oPUmZ'])){if(_0x3a2582[_0x1c1753(0x132)])printDualExistsHint(_0x31ef6c);const _0xd6b51c=unsetProfileOverride(_0x356ae9['iBKhs'](getProjectPath),_0x31ef6c,_0x3aa139);_0xd6b51c?console['log']('Removed\x20'+_0x3aa139+_0x1c1753(0x145)+_0x31ef6c+'\x22'):console[_0x1c1753(0x12e)]('Key\x20\x22'+_0x3aa139+'\x22\x20not\x20found');return;}const _0x243c1a=_0x356ae9[_0x1c1753(0x137)](unsetProfileOverride,_0x356ae9[_0x1c1753(0x160)](getProjectPath),_0x31ef6c,_0x3aa139);if(_0x243c1a){console['log'](_0x1c1753(0x163)+_0x3aa139);return;}const _0x35ec8e=await loadSettings(_0x31ef6c),_0x7f23ae=_0x356ae9['KwwYz'](deleteNestedValue,_0x35ec8e,_0x3aa139);_0x7f23ae?console[_0x1c1753(0x12e)](_0x1c1753(0x158)+_0x3aa139+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0x31ef6c+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console[_0x1c1753(0x12e)](_0x1c1753(0x158)+_0x3aa139+'\x22\x20not\x20found');}export async function configReset(_0x4dc06f){const _0x24c204=_0x59d069,_0x4b1d3c={'zYPJX':function(_0x42d0c3,_0x3a6545){return _0x42d0c3===_0x3a6545;},'XCdyA':function(_0x5767e8){return _0x5767e8();}},_0x42e1c3=await resolveProfileTarget(_0x4dc06f);if(_0x4b1d3c['zYPJX'](_0x42e1c3[_0x24c204(0x142)],_0x24c204(0x15c))){resetProfileOverrides(_0x4b1d3c[_0x24c204(0x14d)](getProjectPath),_0x4dc06f),console[_0x24c204(0x12e)](_0x24c204(0x131)+_0x4dc06f+'\x22');return;}console['log']('\x22'+_0x4dc06f+_0x24c204(0x14e)+_0x4dc06f+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x553919,_0x462574){const _0x1538e1=_0x3181,_0x471d4f=_0x553919();while(!![]){try{const _0x2c7e5=-parseInt(_0x1538e1(0x121))/0x1*(parseInt(_0x1538e1(0x126))/0x2)+-parseInt(_0x1538e1(0x11d))/0x3+parseInt(_0x1538e1(0x127))/0x4+parseInt(_0x1538e1(0x122))/0x5*(parseInt(_0x1538e1(0x123))/0x6)+-parseInt(_0x1538e1(0x11a))/0x7*(-parseInt(_0x1538e1(0x128))/0x8)+-parseInt(_0x1538e1(0x120))/0x9+-parseInt(_0x1538e1(0x117))/0xa*(-parseInt(_0x1538e1(0x119))/0xb);if(_0x2c7e5===_0x462574)break;else _0x471d4f['push'](_0x471d4f['shift']());}catch(_0x4de3bb){_0x471d4f['push'](_0x471d4f['shift']());}}}(_0x3874,0x97d7b));function _0x3874(){const _0x7588c3=['2740buEVKl','input','20746hMnVlB','175hzywgy','log','prompt','994896qRVTnB','yes','\x22\x20to\x20confirm\x20deletion:','3317733iZURtp','12942LAILWq','440xPrxBG','22056PswyMa','Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.','cwd','74YLPCsJ','3798972iQVrGg','3544lQlypN','VXJzb'];_0x3874=function(){return _0x7588c3;};return _0x3874();}import _0x1540bf from'inquirer';function _0x3181(_0x4a493f,_0x2b6f6a){_0x4a493f=_0x4a493f-0x117;const _0x3874d1=_0x3874();let _0x31812f=_0x3874d1[_0x4a493f];return _0x31812f;}import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';export async function deleteProfile(_0x235a12,_0x4011f6={}){const _0x37c60f=_0x3181,_0x150d82={'FuvsD':_0x37c60f(0x118),'tpMjM':function(_0x29ab20,_0x34d964){return _0x29ab20!==_0x34d964;},'yaGtj':'Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.','VXJzb':function(_0x126903,_0x1245fd,_0x238cb6){return _0x126903(_0x1245fd,_0x238cb6);}},_0x2a9b52=await fetchCloudProfile(_0x235a12);if(!_0x2a9b52)throw new Error('Cloud\x20profile\x20\x22'+_0x235a12+'\x22\x20not\x20found.');if(!_0x4011f6[_0x37c60f(0x11e)]&&!isInteractive())throw new Error(_0x37c60f(0x124));console['log']('\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22'+_0x235a12+'\x22\x20for\x20everyone\x20in\x20your\x20organization.');if(!_0x4011f6['yes']){const {confirmation:_0x29e63d}=await _0x1540bf[_0x37c60f(0x11c)]([{'type':_0x150d82['FuvsD'],'name':'confirmation','message':'Type\x20\x22'+_0x235a12+_0x37c60f(0x11f)}]);if(_0x150d82['tpMjM'](_0x29e63d,_0x235a12))throw new Error(_0x150d82['yaGtj']);}await deleteCloudProfile(_0x235a12),_0x150d82[_0x37c60f(0x129)](resetProfileOverrides,process[_0x37c60f(0x125)](),_0x235a12),clearLastProfile(process['cwd'](),_0x235a12),console[_0x37c60f(0x11b)]('✓\x20Deleted\x20cloud\x20profile\x20\x22'+_0x235a12+'\x22.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x462d0a=_0x3c00;(function(_0x2ae554,_0x1b00b4){const _0x25a4a5=_0x3c00,_0x555c46=_0x2ae554();while(!![]){try{const _0x532a1e=parseInt(_0x25a4a5(0x9e))/0x1+parseInt(_0x25a4a5(0xad))/0x2*(-parseInt(_0x25a4a5(0xb3))/0x3)+parseInt(_0x25a4a5(0x98))/0x4*(parseInt(_0x25a4a5(0xa0))/0x5)+parseInt(_0x25a4a5(0xa4))/0x6*(-parseInt(_0x25a4a5(0xa3))/0x7)+-parseInt(_0x25a4a5(0xa9))/0x8*(-parseInt(_0x25a4a5(0xa5))/0x9)+-parseInt(_0x25a4a5(0xbd))/0xa+parseInt(_0x25a4a5(0x9b))/0xb*(parseInt(_0x25a4a5(0xa8))/0xc);if(_0x532a1e===_0x1b00b4)break;else _0x555c46['push'](_0x555c46['shift']());}catch(_0x2916fd){_0x555c46['push'](_0x555c46['shift']());}}}(_0x4f7c,0xcf3f7));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{getRangerDir}from'./utils/rangerRoot.js';import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';import{getToken}from'./utils/keychain.js';import{listCloudProfiles}from'./utils/cloudProfile.js';function _0x3c00(_0x12a0cb,_0x4de359){_0x12a0cb=_0x12a0cb-0x8e;const _0x4f7c12=_0x4f7c();let _0x3c0035=_0x4f7c12[_0x12a0cb];return _0x3c0035;}const NON_ENV_DIRS=['sessions','bug-bashes',_0x462d0a(0x90),'local','ci'];export function shouldGroupByEnvironment(_0x5c18a2){const _0x1b4886=_0x462d0a;return _0x5c18a2[_0x1b4886(0xbe)](_0x58f0b2=>_0x58f0b2[_0x1b4886(0x9c)]);}export function groupCloudProfilesByEnvironment(_0x2cd0fd){const _0x4e7293=_0x462d0a,_0x60283f={'YjtGp':function(_0x5ad5ff,_0x15814d){return _0x5ad5ff===_0x15814d;},'opKQj':function(_0x54922a,_0x3c11c8){return _0x54922a===_0x3c11c8;}},_0x31e1a3=new Map();for(const _0x40b898 of _0x2cd0fd){const _0x5166b9=_0x40b898[_0x4e7293(0x9c)]??null,_0x33b942=_0x31e1a3['get'](_0x5166b9);if(_0x33b942)_0x33b942['push'](_0x40b898);else _0x31e1a3[_0x4e7293(0xa2)](_0x5166b9,[_0x40b898]);}const _0x482945=[..._0x31e1a3['keys']()]['sort']((_0x530437,_0x25958e)=>{const _0x12aaa5=_0x4e7293;if(_0x60283f['YjtGp'](_0x530437,null))return 0x1;if(_0x60283f[_0x12aaa5(0xaf)](_0x25958e,null))return-0x1;return _0x530437['localeCompare'](_0x25958e);});return _0x482945[_0x4e7293(0x8e)](_0x290c10=>({'environmentKey':_0x290c10,'profiles':_0x31e1a3[_0x4e7293(0xb9)](_0x290c10)['sort']((_0x9d32cd,_0x3612d7)=>_0x9d32cd['name'][_0x4e7293(0x99)](_0x3612d7[_0x4e7293(0x92)]))}));}export async function getEnvNames(){const _0x2d9919=_0x462d0a,_0x38f110={'FdHHQ':function(_0x31a322,_0x241d1d,_0x4b025b){return _0x31a322(_0x241d1d,_0x4b025b);},'Khhwo':function(_0x30eba4,_0x55a3d8){return _0x30eba4(_0x55a3d8);},'SKNhd':function(_0x15ddc7,_0x3b480,_0x223fe1){return _0x15ddc7(_0x3b480,_0x223fe1);},'SlVCP':'local','qOhip':function(_0xb3e5df,_0x6a68a6){return _0xb3e5df(_0x6a68a6);},'NOYWU':'.txt','NqqRh':_0x2d9919(0x94)},_0x5f0087=getRangerDir();if(!existsSync(_0x5f0087))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x5c417f=await readActiveProfileName(),_0x475736=[],_0x176229={},_0xdaf119=_0x38f110[_0x2d9919(0xbc)](join,_0x5f0087,'local');if(existsSync(_0xdaf119)){const _0x1b4cc8=await _0x38f110[_0x2d9919(0xb1)](readdir,_0xdaf119);for(const _0x2b1ff3 of _0x1b4cc8){const _0x3a7052=_0x38f110[_0x2d9919(0xae)](join,_0xdaf119,_0x2b1ff3),_0x363e0c=await _0x38f110['Khhwo'](stat,_0x3a7052);_0x363e0c[_0x2d9919(0xb6)]()&&(_0x475736[_0x2d9919(0x95)](_0x2b1ff3),_0x176229[_0x2b1ff3]=_0x38f110['SlVCP']);}}const _0x31185b=_0x38f110[_0x2d9919(0xbc)](join,_0x5f0087,'ci');if(existsSync(_0x31185b)){const _0x73f0f9=await readdir(_0x31185b);for(const _0x149399 of _0x73f0f9){const _0x369524=_0x38f110[_0x2d9919(0xbc)](join,_0x31185b,_0x149399),_0x562a41=await _0x38f110['qOhip'](stat,_0x369524);_0x562a41['isDirectory']()&&(_0x475736['push'](_0x149399),_0x176229[_0x149399]='ci');}}const _0x240532=await readdir(_0x5f0087);for(const _0x4cbb50 of _0x240532){if(NON_ENV_DIRS[_0x2d9919(0xa7)](_0x4cbb50))continue;if(_0x4cbb50['startsWith']('.'))continue;if(_0x4cbb50['endsWith'](_0x38f110['NOYWU']))continue;const _0x42ced3=_0x38f110[_0x2d9919(0xae)](join,_0x5f0087,_0x4cbb50),_0x33d4cc=await stat(_0x42ced3);_0x33d4cc[_0x2d9919(0xb6)]()&&_0x38f110[_0x2d9919(0x9a)](existsSync,_0x38f110['SKNhd'](join,_0x42ced3,'settings.json'))&&(!_0x475736[_0x2d9919(0xa7)](_0x4cbb50)&&(_0x475736[_0x2d9919(0x95)](_0x4cbb50),_0x176229[_0x4cbb50]=_0x38f110[_0x2d9919(0xb7)]));}return{'envNames':_0x475736,'activeEnv':_0x5c417f,'envTypes':_0x176229};}function _0x4f7c(){const _0x5766e6=['108TLQPiH','48AePfHE','length','profiles','KCzBZ','2FouyTp','SKNhd','opKQj','\x20\x20\x20\x20Session:\x20','Khhwo','hiIOY','131289ImIZKF','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20','has','isDirectory','NqqRh','\x20\x20\x20\x20\x20\x20Details:\x20','get','dmwki','\x0a\x20\x20','FdHHQ','12927300IjdYnV','some','wqdXe','\x0aCloud\x20Profiles:','map','message','reports','log','name','dNbar','legacy','push','(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)','\x20\x20\x20\x20','78244zdSvbl','localeCompare','qOhip','245597SyNnqO','environmentKey','environmentDetails','1025787GMUMfT','sort','385cnNCMp','\x0aCloud\x20Profiles\x20(by\x20environment):','set','7jEvFoW','7603842aKQfcV','1079640RkhxKr','\x0aLocal\x20Profiles\x20(legacy):','includes'];_0x4f7c=function(){return _0x5766e6;};return _0x4f7c();}export async function envList(){const _0x3cdbff=_0x462d0a,_0x35bee0={'yBBDb':function(_0x3e4e0b,_0xb49466){return _0x3e4e0b===_0xb49466;},'yAWuO':'Run:\x20ranger\x20profile\x20add\x20<profile-name>','hiIOY':function(_0x41299c,_0x2d0273){return _0x41299c>_0x2d0273;},'lYoLe':function(_0x488c3a,_0x590c08){return _0x488c3a===_0x590c08;},'KCzBZ':function(_0x48096d,_0x3b46bf){return _0x48096d(_0x3b46bf);},'dNbar':_0x3cdbff(0x94),'dgVze':_0x3cdbff(0xa1),'FTBMa':_0x3cdbff(0x96),'dmwki':function(_0x1b5273,_0x5dea83,_0x5bd957){return _0x1b5273(_0x5dea83,_0x5bd957);},'wqdXe':_0x3cdbff(0x97),'mjZbB':_0x3cdbff(0xc0),'fotsA':function(_0x364708,_0x12b9dd,_0x12cea1){return _0x364708(_0x12b9dd,_0x12cea1);}},{envNames:_0x41b85e,activeEnv:_0x591028,envTypes:_0x4412dd}=await getEnvNames();let _0x17907b=[];const _0x579b82=await getToken();if(_0x579b82)try{_0x17907b=await listCloudProfiles();}catch(_0x25ff17){console['error'](_0x3cdbff(0xb4)+(_0x25ff17 instanceof Error?_0x25ff17[_0x3cdbff(0x8f)]:String(_0x25ff17)));}if(_0x35bee0['yBBDb'](_0x41b85e['length'],0x0)&&_0x17907b[_0x3cdbff(0xaa)]===0x0){console[_0x3cdbff(0x91)]('\x0aNo\x20profiles\x20found.'),console[_0x3cdbff(0x91)](_0x35bee0['yAWuO']);return;}const _0x290576=new Set(_0x17907b['map'](_0x3abd56=>_0x3abd56['name']));if(_0x35bee0[_0x3cdbff(0xb2)](_0x41b85e['length'],0x0)){console['log'](_0x3cdbff(0xa6));for(const _0x434c45 of _0x41b85e[_0x3cdbff(0x9f)]()){const _0x349124=_0x35bee0['lYoLe'](_0x434c45,_0x591028)&&!_0x290576[_0x3cdbff(0xb5)](_0x434c45),_0x1020f5=_0x4412dd[_0x434c45]||'local',_0x47bcfd=await _0x35bee0[_0x3cdbff(0xac)](loadSettings,_0x434c45),_0x27414a=_0x1020f5===_0x35bee0[_0x3cdbff(0x93)]?'':'\x20['+_0x1020f5+']';console[_0x3cdbff(0x91)]('\x20\x20'+(_0x349124?'*\x20':'\x20\x20')+_0x434c45+_0x27414a),_0x47bcfd['baseUrl']&&console[_0x3cdbff(0x91)]('\x20\x20\x20\x20\x20\x20URL:\x20'+_0x47bcfd['baseUrl']),_0x47bcfd[_0x3cdbff(0x9d)]&&console['log'](_0x3cdbff(0xb8)+_0x47bcfd['environmentDetails']);}}const _0x1fad50=(_0x580a00,_0xc17808)=>{const _0x2ad071=_0x3cdbff,_0x174c11=_0x580a00['name']===_0x591028,_0x289e0f=_0x580a00['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x580a00['sessionUpdatedAt']+')':'no\x20session';console['log'](''+_0xc17808+(_0x174c11?'*\x20':'\x20\x20')+_0x580a00[_0x2ad071(0x92)]),console['log'](_0xc17808+_0x2ad071(0xb0)+_0x289e0f);};if(_0x17907b[_0x3cdbff(0xaa)]>0x0){if(_0x35bee0['KCzBZ'](shouldGroupByEnvironment,_0x17907b)){console[_0x3cdbff(0x91)](_0x35bee0['dgVze']);for(const _0x3bdb2e of groupCloudProfilesByEnvironment(_0x17907b)){const _0xd8c1a=_0x3bdb2e[_0x3cdbff(0x9c)]??_0x35bee0['FTBMa'];console['log'](_0x3cdbff(0xbb)+_0xd8c1a);for(const _0xb97311 of _0x3bdb2e[_0x3cdbff(0xab)]){_0x35bee0[_0x3cdbff(0xba)](_0x1fad50,_0xb97311,_0x35bee0[_0x3cdbff(0xbf)]);}}}else{console[_0x3cdbff(0x91)](_0x35bee0['mjZbB']);for(const _0x950ba0 of[..._0x17907b]['sort']((_0x475c46,_0x228ee2)=>_0x475c46[_0x3cdbff(0x92)]['localeCompare'](_0x228ee2[_0x3cdbff(0x92)]))){_0x35bee0['fotsA'](_0x1fad50,_0x950ba0,'\x20\x20');}}}_0x591028&&console['log']('\x0a*\x20=\x20active\x20profile');}
|