@ranger-testing/ranger-cli 3.1.7-alpha.9f8e190-62 → 3.1.7-alpha.be2850d-64
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/actors.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/build/skills/ranger/SKILL.md +8 -0
- package/package.json +1 -1
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x20f7d7,_0x2be8db){const _0x20de62=_0x3aa3,_0x496ba8=_0x20f7d7();while(!![]){try{const _0x5c9200=parseInt(_0x20de62(0x1b3))/0x1*(-parseInt(_0x20de62(0x1a3))/0x2)+parseInt(_0x20de62(0x1cd))/0x3+parseInt(_0x20de62(0x206))/0x4*(parseInt(_0x20de62(0x1de))/0x5)+parseInt(_0x20de62(0x1ef))/0x6+parseInt(_0x20de62(0x1ac))/0x7+-parseInt(_0x20de62(0x1aa))/0x8*(parseInt(_0x20de62(0x18e))/0x9)+-parseInt(_0x20de62(0x1e4))/0xa*(parseInt(_0x20de62(0x1ca))/0xb);if(_0x5c9200===_0x2be8db)break;else _0x496ba8['push'](_0x496ba8['shift']());}catch(_0x4815fb){_0x496ba8['push'](_0x496ba8['shift']());}}}(_0x2d18,0xae39f));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x1b2fad from'inquirer';function _0x3aa3(_0x4c6e81,_0x3e6089){_0x4c6e81=_0x4c6e81-0x186;const _0x2d180a=_0x2d18();let _0x3aa3f3=_0x2d180a[_0x4c6e81];return _0x3aa3f3;}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';function _0x2d18(){const _0x19c14f=['saveToCloud','profile.add.autoRouted','length','1818ozwPhh','no_match','✓\x20Profile\x20\x27','lJMmT','JRtwf','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','.tmp-','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','retry','HEAD','\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20','name','join','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','rGAUf','\x0a\x20\x20Could\x20not\x20reach\x20','nGAJm','tfxKQ','error','signal','1606282otbVzB','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','isProtocolError','use_suggestion','JLgHw','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','confirm','31352gkJmLq','profile.add.autoRouteSkipped','6693078oihXzs','keys','abort','list','\x22\x20not\x20found.','ZJBLb','origin','1WuGelp','--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','manual','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','bOJkt','trackPhaseEnd','trim','baseUrl','RiIoL','The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','isTTY','\x27\x20created.\x0a','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','TgmKR','setupHeader','skipAuth','zJRut','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','url','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','\x27\x20created\x20(CDP).','GxvVF','904585PHMsPf','Enter\x20a\x20different\x20URL','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','3535245ENYxaH','Invalid\x20--setup-header\x20format:\x20\x22','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','WVxCZ','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','\x0a\x20\x20A\x20profile\x20named\x20\x22','HZGqi','KpsJa','startsWith','nRvjC','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','log','\x27\x20matching\x20','env','bESKF','pqTWY','stdout','10QjQGGT','RUPCs','indexOf','environments','nkVMc','kbrLw','120vnCzzn','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','pqqbW','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','\x27\x20created\x20(no\x20session).\x0a','yes','\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','message','\x22:\x20','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','1949154IkwHzz','--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','\x20\x20Did\x20you\x20mean\x20','LQbjY','lBNZD','cdpEndpoint','slice','RhJDV','LGTpF','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','authEnv','prompt','eSfka','YQusU','JiJRz','\x20--skip-auth\x0a','action','xetVF','gZgtK','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20','status','rHEWb','1671604DLSbJa','eBFbH','YsJMJ','exit','user_declined','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','LvWsp','yyWjO','RARcT','lzqUp'];_0x2d18=function(){return _0x19c14f;};return _0x2d18();}import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING='This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization';function warnCloudProfileSharedInOrg(){const _0x131e09=_0x3aa3;if(!process[_0x131e09(0x1dd)][_0x131e09(0x1bd)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x3201f3){const _0xfffc33=_0x3aa3,_0x51f9bb={'bpyQC':_0xfffc33(0x1b5),'lFWrY':function(_0x7d5061,_0x3a43cd){return _0x7d5061(_0x3a43cd);},'GxvVF':function(_0x1c1317,_0x3c44cc){return _0x1c1317<_0x3c44cc;}};try{const _0x5450c9=new AbortController(),_0x1815d1=setTimeout(()=>_0x5450c9[_0xfffc33(0x1ae)](),0x1388),_0xb767aa={'method':_0xfffc33(0x198),'signal':_0x5450c9[_0xfffc33(0x1a2)],'redirect':_0x51f9bb['bpyQC']};/^https:\/\/localhost(:\d+)?/i['test'](_0x3201f3)&&(process[_0xfffc33(0x1da)]['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x4395eb=await fetch(_0x3201f3,_0xb767aa);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],_0x51f9bb['lFWrY'](clearTimeout,_0x1815d1);if(_0x51f9bb[_0xfffc33(0x1c9)](_0x4395eb['status'],0x190))return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x4395eb['status']};}catch(_0x284d5f){delete process[_0xfffc33(0x1da)]['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x34559a=_0x284d5f,_0x3b5126=_0x34559a['message']||_0x51f9bb['lFWrY'](String,_0x284d5f),_0x265964=_0x3b5126['includes']('Invalid\x20URL')||_0x34559a[_0xfffc33(0x19a)]==='TypeError'||_0x3b5126['includes']('fetch\x20failed');return{'ok':![],'error':_0x3b5126,'isProtocolError':_0x265964};}}async function sweepOrphanLocalProfile(_0x54c685,_0xf9a2ad,_0x12f9d1){const _0x204279=_0x3aa3,_0x23561b={'pqqbW':function(_0x238c26,_0xd42f15,_0x36da72){return _0x238c26(_0xd42f15,_0x36da72);},'LvWsp':'local','cBjLd':function(_0x224c32,_0x5995b9){return _0x224c32(_0x5995b9);}},_0x386ad9=_0x23561b[_0x204279(0x1e6)](join,_0xf9a2ad,_0x23561b[_0x204279(0x187)]),_0x2fe7c4=_0x23561b[_0x204279(0x1e6)](join,_0x386ad9,_0x54c685);existsSync(_0x2fe7c4)&&(_0x12f9d1&&await isPathGitTracked(_0x2fe7c4)?console['log'](_0x204279(0x1d7)+_0x2fe7c4+'\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'):(await rm(_0x2fe7c4,{'recursive':!![],'force':!![]}),console['log']('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x2fe7c4)));if(_0x23561b['cBjLd'](existsSync,_0x386ad9)){let _0x12eacb=[];try{_0x12eacb=await readdir(_0x386ad9);}catch{return;}const _0x4e69a2=_0x204279(0x194)+_0x54c685+'-';for(const _0x559f4b of _0x12eacb){if(!_0x559f4b[_0x204279(0x1d5)](_0x4e69a2))continue;const _0x588004=_0x23561b[_0x204279(0x1e6)](join,_0x386ad9,_0x559f4b);await _0x23561b[_0x204279(0x1e6)](rm,_0x588004,{'recursive':!![],'force':!![]}),console[_0x204279(0x1d8)](_0x204279(0x1e7)+_0x588004);}}}async function sweepOrphansBestEffort(_0x3d9ae9){const _0x712e12=_0x3aa3,_0x275d13={'lzqUp':function(_0x5a95be,_0x15dc53){return _0x5a95be!==_0x15dc53;},'LUIGg':function(_0x127906,_0x538cee,_0x57f954,_0x366efd){return _0x127906(_0x538cee,_0x57f954,_0x366efd);},'uLiCs':function(_0x53d887,_0x3a86ae){return _0x53d887(_0x3a86ae);}};try{await sweepOrphanLocalProfile(_0x3d9ae9,getRangerHomeDir(),![]);const _0x3a2b20=getRangerDir();_0x275d13[_0x712e12(0x18a)](_0x3a2b20,getRangerHomeDir())&&await _0x275d13['LUIGg'](sweepOrphanLocalProfile,_0x3d9ae9,_0x3a2b20,!![]);}catch(_0x240969){console[_0x712e12(0x1d8)]('\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20('+(_0x240969 instanceof Error?_0x240969[_0x712e12(0x1ec)]:_0x275d13['uLiCs'](String,_0x240969))+').');}}async function markActive(_0x2ba40c){const _0x2fde6f=_0x3aa3,_0x49dff1={'eXCln':function(_0x2299ff,_0x102268){return _0x2299ff(_0x102268);},'zRRzq':_0x2fde6f(0x1bf)};try{await _0x49dff1['eXCln'](writeActiveProfileName,_0x2ba40c),console['log']('\x20\x20Set\x20active\x20profile:\x20'+_0x2ba40c);}catch{console['log'](_0x49dff1['zRRzq']);}}async function tryAutoRouteCloudProfile(_0x1a08fd,_0x3977fa,_0x1dfacf,_0x274cff,_0x359bab){const _0x4e334b=_0x3aa3,_0x1dc62d={'rGAUf':'no_auth_config','ncBwA':function(_0x4f98c7,_0x4fea7d){return _0x4f98c7 instanceof _0x4fea7d;},'lBNZD':function(_0x174744,_0x3587ad){return _0x174744(_0x3587ad);},'ZJBLb':function(_0x5eaaad,_0x3b717b){return _0x5eaaad===_0x3b717b;},'nRvjC':'profile.add.autoRouteSkipped','eBFbH':function(_0x4e0e89,_0x406484){return _0x4e0e89+_0x406484;},'NLlwp':function(_0x3db472,_0x327153){return _0x3db472+_0x327153;},'VNUPI':'\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','qdhjW':'\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','jAcaN':_0x4e334b(0x1cc),'nkVMc':function(_0x49334e,_0x4bcb37,_0x4bb035){return _0x49334e(_0x4bcb37,_0x4bb035);},'yyWjO':'confirm','JyVwb':_0x4e334b(0x18b),'pEvBv':_0x4e334b(0x1e8),'JLgHw':function(_0x14d54c,_0x577fa9,_0x5051ba,_0x6881f6){return _0x14d54c(_0x577fa9,_0x5051ba,_0x6881f6);},'gZgtK':function(_0xa2ff7c){return _0xa2ff7c();},'bOJkt':function(_0x772f24,_0xcd4a0c){return _0x772f24===_0xcd4a0c;},'ZAKJs':function(_0x11e8cc,_0x208dcd){return _0x11e8cc+_0x208dcd;}};let _0x25f818;try{_0x25f818=await fetchAuthConfig();}catch(_0x236918){return _0x359bab?.['trackPhaseEnd'](_0x4e334b(0x1ab),{'reason':_0x1dc62d[_0x4e334b(0x19d)],'profileName':_0x1a08fd}),console[_0x4e334b(0x1a1)](_0x4e334b(0x199)+(_0x1dc62d['ncBwA'](_0x236918,Error)?_0x236918[_0x4e334b(0x1ec)]:_0x1dc62d[_0x4e334b(0x1f3)](String,_0x236918))),![];}if((!_0x25f818||!_0x25f818['environments']||_0x1dc62d[_0x4e334b(0x1b1)](Object[_0x4e334b(0x1ad)](_0x25f818[_0x4e334b(0x1e1)])[_0x4e334b(0x18d)],0x0))&&!_0x1dfacf['authEnv']){if(_0x274cff)return await captureEnvLessProfile(_0x1a08fd,_0x3977fa,_0x1dfacf,_0x359bab);return _0x359bab?.[_0x4e334b(0x1b8)](_0x1dc62d['nRvjC'],{'reason':_0x1dc62d[_0x4e334b(0x19d)],'profileName':_0x1a08fd}),console['error'](_0x1dc62d[_0x4e334b(0x207)](_0x1dc62d['NLlwp'](_0x1dc62d['VNUPI'],'\x0a')+_0x1dc62d['qdhjW'],'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x1a08fd+'\x20--url\x20'+_0x3977fa+_0x4e334b(0x1fe))+'\x0a'+'\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a'+_0x1dc62d['jAcaN']),![];}let _0x287c3e;if(_0x1dfacf['authEnv']){if(!_0x25f818?.[_0x4e334b(0x1e1)]?.[_0x1dfacf['authEnv']]){const _0x13b908=Object[_0x4e334b(0x1ad)](_0x25f818?.['environments']??{});return _0x359bab?.[_0x4e334b(0x1b8)](_0x1dc62d[_0x4e334b(0x1d6)],{'reason':'env_not_found','profileName':_0x1a08fd}),console[_0x4e334b(0x1a1)](_0x1dc62d['NLlwp']('\x0a\x20\x20Auth\x20environment\x20\x22'+_0x1dfacf[_0x4e334b(0x1f9)]+_0x4e334b(0x1b0),_0x13b908['length']?'\x20Configured\x20envs:\x20'+_0x13b908[_0x4e334b(0x19b)](',\x20')+'.':_0x4e334b(0x1f8))),![];}_0x287c3e=_0x1dfacf[_0x4e334b(0x1f9)];}else _0x287c3e=_0x1dc62d[_0x4e334b(0x1e2)](matchAuthEnvironment,_0x3977fa,_0x25f818);if(!_0x287c3e)return _0x359bab?.[_0x4e334b(0x1b8)](_0x4e334b(0x1ab),{'reason':_0x4e334b(0x18f),'profileName':_0x1a08fd}),console['error']('\x0a\x20\x20No\x20auth\x20env\x20matches\x20'+_0x3977fa+_0x4e334b(0x193)+Object[_0x4e334b(0x1ad)](_0x25f818?.[_0x4e334b(0x1e1)]??{})['join'](',\x20')+'.'),![];const _0x892aa0=_0x25f818?.['environments']?.[_0x287c3e],_0x46a1dd=_0x892aa0?.['domains']??[];if(_0x274cff&&!_0x1dfacf[_0x4e334b(0x1ea)]){const {saveToCloud:_0x4f9b5a}=await _0x1b2fad[_0x4e334b(0x1fa)]([{'type':_0x1dc62d[_0x4e334b(0x188)],'name':_0x1dc62d['JyVwb'],'message':'Found\x20auth\x20environment\x20\x27'+_0x287c3e+_0x4e334b(0x1d9)+_0x3977fa+'\x0a\x20\x20(domains:\x20'+_0x46a1dd[_0x4e334b(0x19b)](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x1a08fd+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x4f9b5a)return _0x359bab?.[_0x4e334b(0x1b8)](_0x1dc62d[_0x4e334b(0x1d6)],{'reason':'user_declined','profileName':_0x1a08fd}),console['error'](_0x1dc62d['pEvBv']),![];}const _0x24253c=_0x46a1dd['some'](_0x7a50d8=>{const _0x7de898=_0x4e334b;try{return new URL(_0x7a50d8)[_0x7de898(0x1b2)]===new URL(_0x3977fa)['origin'];}catch{return![];}}),_0x51f88c={};!_0x24253c&&(_0x51f88c['baseUrl']=_0x3977fa);try{await _0x1dc62d[_0x4e334b(0x1a7)](createCloudProfile,_0x1a08fd,_0x287c3e,{'settings':_0x51f88c}),_0x1dc62d[_0x4e334b(0x201)](warnCloudProfileSharedInOrg);}catch(_0xada6c5){if(_0xada6c5 instanceof ApiError&&_0x1dc62d[_0x4e334b(0x1b7)](_0xada6c5['status'],0x199)){console['error'](_0x1dc62d['ZAKJs'](_0x4e334b(0x1d2)+_0x1a08fd+_0x4e334b(0x1a4),_0x4e334b(0x186)+_0x1a08fd));throw _0xada6c5;}throw _0xada6c5;}return console[_0x4e334b(0x1d8)](_0x1dc62d['NLlwp']('✓\x20Profile\x20\x27'+_0x1a08fd+_0x4e334b(0x1be),'\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x1a08fd)),await sweepOrphansBestEffort(_0x1a08fd),_0x359bab?.[_0x4e334b(0x1b8)](_0x4e334b(0x18c),{'envKey':_0x287c3e,'profileName':_0x1a08fd}),!![];}async function createUnconfiguredCloudProfile(_0x5cdcef,_0xb6a7ee){const _0x3f0dc2=_0x3aa3,_0x3008c8={'RUPCs':function(_0x27c835,_0x2e0aaa,_0x2415ac,_0xf644d2){return _0x27c835(_0x2e0aaa,_0x2415ac,_0xf644d2);},'fGtuz':function(_0x45ca3f){return _0x45ca3f();},'bQBFV':function(_0x64c190,_0x29aded){return _0x64c190 instanceof _0x29aded;},'bESKF':function(_0x31d806,_0x37e3f1){return _0x31d806+_0x37e3f1;}};try{await _0x3008c8[_0x3f0dc2(0x1df)](createCloudProfile,_0x5cdcef,undefined,{'settings':_0xb6a7ee}),_0x3008c8['fGtuz'](warnCloudProfileSharedInOrg);}catch(_0xe4186){_0x3008c8['bQBFV'](_0xe4186,ApiError)&&_0xe4186[_0x3f0dc2(0x204)]===0x199&&console[_0x3f0dc2(0x1a1)](_0x3008c8[_0x3f0dc2(0x1db)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x5cdcef+_0x3f0dc2(0x1a4),_0x3f0dc2(0x186)+_0x5cdcef));throw _0xe4186;}}async function captureEnvLessProfile(_0x523f13,_0x12d8a4,_0xd0f4b2,_0x436957){const _0x685db6=_0x3aa3,_0x14be16={'LGTpF':'capture','HZGqi':_0x685db6(0x19c),'eSfka':_0x685db6(0x20a),'TgmKR':function(_0x51b447,_0x45f569){return _0x51b447+_0x45f569;},'ZoOIU':function(_0x4907a8,_0x303087){return _0x4907a8===_0x303087;},'aVaur':function(_0x5c6dac,_0x1de19f,_0x774787,_0x448cb5){return _0x5c6dac(_0x1de19f,_0x774787,_0x448cb5);},'LQbjY':function(_0x567a36,_0x19ce1a){return _0x567a36 instanceof _0x19ce1a;},'GXduX':function(_0x4409da,_0x151ced){return _0x4409da+_0x151ced;},'iJBDL':_0x685db6(0x18c)};if(!_0xd0f4b2['yes']){const {capture:_0xa431a6}=await _0x1b2fad['prompt']([{'type':_0x685db6(0x1a9),'name':_0x14be16[_0x685db6(0x1f7)],'message':_0x14be16[_0x685db6(0x1d3)],'default':!![]}]);if(!_0xa431a6)return _0x436957?.[_0x685db6(0x1b8)](_0x685db6(0x1ab),{'reason':_0x14be16[_0x685db6(0x1fb)],'profileName':_0x523f13}),console['error'](_0x14be16[_0x685db6(0x1c1)](_0x685db6(0x1e5),'\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.')),![];}const _0xf09a3b={};if(_0xd0f4b2[_0x685db6(0x1c2)])for(const _0xe6df4f of _0xd0f4b2[_0x685db6(0x1c2)]){const _0x2b70d1=_0xe6df4f[_0x685db6(0x1e0)](':');if(_0x14be16['ZoOIU'](_0x2b70d1,-0x1))continue;_0xf09a3b[_0xe6df4f[_0x685db6(0x1f5)](0x0,_0x2b70d1)[_0x685db6(0x1b9)]()]=_0xe6df4f[_0x685db6(0x1f5)](_0x2b70d1+0x1)[_0x685db6(0x1b9)]();}const _0x345f8c={'baseUrl':_0x12d8a4};Object[_0x685db6(0x1ad)](_0xf09a3b)['length']>0x0&&(_0x345f8c['setupHeaders']=_0xf09a3b);let _0x1721e0;try{_0x1721e0=await _0x14be16['aVaur'](createCloudProfile,_0x523f13,undefined,{'settings':_0x345f8c}),warnCloudProfileSharedInOrg();}catch(_0x408dbd){_0x14be16[_0x685db6(0x1f2)](_0x408dbd,ApiError)&&_0x408dbd[_0x685db6(0x204)]===0x199&&console['error'](_0x685db6(0x1d2)+_0x523f13+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+(_0x685db6(0x186)+_0x523f13));throw _0x408dbd;}return await manualBrowserLogin(_0x1721e0,{'key':'','domains':[_0x12d8a4],'setupHeaders':Object[_0x685db6(0x1ad)](_0xf09a3b)[_0x685db6(0x18d)]>0x0?_0xf09a3b:undefined}),console['log'](_0x14be16['GXduX']('\x0a✓\x20Profile\x20\x27'+_0x523f13+_0x685db6(0x1eb),_0x685db6(0x1cf)+_0x523f13)),await sweepOrphansBestEffort(_0x523f13),_0x436957?.['trackPhaseEnd'](_0x14be16['iJBDL'],{'envKey':null,'profileName':_0x523f13}),!![];}export async function addEnv(_0x47ff45,_0x50b235={},_0x36b3cc){const _0x2131db=_0x3aa3,_0x5985e5={'tfxKQ':function(_0x5ab758,_0x57a5c9){return _0x5ab758+_0x57a5c9;},'CjxnA':function(_0xc7d83,_0x1b3004){return _0xc7d83+_0x1b3004;},'ZiyRB':function(_0x58b6ef,_0x4bac01){return _0x58b6ef+_0x4bac01;},'JiJRz':function(_0x152d92,_0x1034f2){return _0x152d92+_0x1034f2;},'RhJDV':_0x2131db(0x1bc),'wUuba':'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','vgxbd':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','xetVF':_0x2131db(0x1b6),'RiIoL':function(_0x4d8635){return _0x4d8635();},'kbrLw':function(_0xf410df,_0x2eda15){return _0xf410df>_0x2eda15;},'XMMnv':function(_0x20843e,_0x15bebe,_0x1131ce){return _0x20843e(_0x15bebe,_0x1131ce);},'YsJMJ':function(_0x1f4948,_0x40401c,_0x2f10e0,_0x4eb797,_0x579a5b){return _0x1f4948(_0x40401c,_0x2f10e0,_0x4eb797,_0x579a5b);},'qAEIh':'isElectron','pqTWY':function(_0x443ca9,_0x1809f8){return _0x443ca9 instanceof _0x1809f8;},'fMYCf':function(_0x58c34c,_0x4a94a0){return _0x58c34c(_0x4a94a0);},'RARcT':function(_0x3ce53b,_0xea022d){return _0x3ce53b(_0xea022d);},'lJMmT':function(_0x35768b,_0x3973b9){return _0x35768b(_0x3973b9);},'nGAJm':function(_0xe8fef3,_0x33c3e1){return _0xe8fef3(_0x33c3e1);},'JRtwf':_0x2131db(0x1a8),'LCpMC':_0x2131db(0x1c0),'hMRLQ':_0x2131db(0x1ba),'zJRut':_0x2131db(0x1c5),'wMsJI':_0x2131db(0x1af),'kUrgm':_0x2131db(0x1ff),'rHEWb':'What\x20would\x20you\x20like\x20to\x20do?','WVxCZ':'continue','KpsJa':_0x2131db(0x1a6),'YQusU':function(_0xad59a5,_0x54874d,_0x1d6dcd,_0x5bf600,_0x285476,_0x11978e){return _0xad59a5(_0x54874d,_0x1d6dcd,_0x5bf600,_0x285476,_0x11978e);}};_0x50b235['ci']&&(console[_0x2131db(0x1a1)](_0x5985e5['tfxKQ'](_0x5985e5['CjxnA'](_0x5985e5['ZiyRB'](_0x5985e5[_0x2131db(0x1a0)](_0x5985e5[_0x2131db(0x1fd)](_0x5985e5[_0x2131db(0x1f6)],_0x5985e5['wUuba']),'\x0a')+'To\x20set\x20up\x20a\x20profile,\x20run:\x0a'+_0x5985e5['vgxbd'],'\x0a'),'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'),'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process['exit'](0x1));const _0x5e3bac={};if(_0x50b235['setupHeader'])for(const _0x344cb5 of _0x50b235[_0x2131db(0x1c2)]){const _0x47ceb4=_0x344cb5[_0x2131db(0x1e0)](':');if(_0x47ceb4===-0x1)throw new Error(_0x2131db(0x1ce)+_0x344cb5+_0x2131db(0x202));const _0x5cc6db=_0x344cb5[_0x2131db(0x1f5)](0x0,_0x47ceb4)['trim'](),_0x1e052b=_0x344cb5[_0x2131db(0x1f5)](_0x5985e5[_0x2131db(0x1fd)](_0x47ceb4,0x1))[_0x2131db(0x1b9)]();_0x5e3bac[_0x5cc6db]=_0x1e052b;}if(_0x50b235[_0x2131db(0x1f4)]!==undefined&&_0x50b235[_0x2131db(0x1f4)][_0x2131db(0x1b9)]()==='')throw new Error(_0x2131db(0x1d1));if(_0x50b235['cdpEndpoint']&&_0x50b235['url'])throw new Error(_0x2131db(0x1f0));if(_0x50b235[_0x2131db(0x1f9)]&&_0x50b235['skipAuth'])throw new Error(_0x2131db(0x1b4));if(_0x50b235[_0x2131db(0x1f9)]&&_0x50b235[_0x2131db(0x1f4)])throw new Error(_0x5985e5[_0x2131db(0x200)]);const _0x51418f=Boolean(_0x50b235[_0x2131db(0x1f4)]),_0x43e494=_0x5985e5[_0x2131db(0x1bb)](isInteractive);if(!_0x43e494&&!_0x50b235[_0x2131db(0x1c6)]&&!_0x51418f&&!_0x50b235[_0x2131db(0x1c3)])throw new Error(_0x2131db(0x1c7));if(_0x51418f){const _0x6f9fa6=_0x50b235[_0x2131db(0x1f4)];console['log'](_0x2131db(0x1ee)),console[_0x2131db(0x1d8)]('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x6f9fa6);const _0x3f3d63={'cdpEndpoint':_0x6f9fa6,'isElectron':!![]};_0x5985e5[_0x2131db(0x1e3)](Object['keys'](_0x5e3bac)['length'],0x0)&&(_0x3f3d63['setupHeaders']=_0x5e3bac);await _0x5985e5['XMMnv'](createUnconfiguredCloudProfile,_0x47ff45,_0x3f3d63);try{_0x5985e5[_0x2131db(0x208)](setProfileOverride,process['cwd'](),_0x47ff45,'cdpEndpoint',_0x6f9fa6),setProfileOverride(process['cwd'](),_0x47ff45,_0x5985e5['qAEIh'],!![]);}catch(_0x358e43){console[_0x2131db(0x1a1)](_0x2131db(0x203)+(_0x5985e5[_0x2131db(0x1dc)](_0x358e43,Error)?_0x358e43[_0x2131db(0x1ec)]:_0x5985e5['fMYCf'](String,_0x358e43)));}console['log']('✓\x20Cloud\x20profile\x20\x27'+_0x47ff45+_0x2131db(0x1c8)),await _0x5985e5[_0x2131db(0x189)](sweepOrphansBestEffort,_0x47ff45),await _0x5985e5['RARcT'](markActive,_0x47ff45);return;}if(_0x50b235[_0x2131db(0x1c3)]){const _0x47f165={};_0x50b235[_0x2131db(0x1c6)]&&(_0x47f165[_0x2131db(0x1ba)]=_0x50b235['url']);_0x5985e5['kbrLw'](Object[_0x2131db(0x1ad)](_0x5e3bac)['length'],0x0)&&(_0x47f165['setupHeaders']=_0x5e3bac);await createUnconfiguredCloudProfile(_0x47ff45,_0x47f165),console[_0x2131db(0x1d8)](_0x2131db(0x190)+_0x47ff45+_0x2131db(0x1e9)+('\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x47ff45+'`\x20again\x20without\x20--skip-auth.')),await sweepOrphansBestEffort(_0x47ff45),await _0x5985e5[_0x2131db(0x191)](markActive,_0x47ff45);return;}if(_0x50b235['url']){const _0x44ede0=_0x50b235[_0x2131db(0x1c6)],_0x59e6ac=await _0x5985e5[_0x2131db(0x19f)](checkUrlReachability,_0x44ede0);if(!_0x59e6ac['ok']&&!_0x50b235['force'])throw new Error('Could\x20not\x20reach\x20'+_0x44ede0+':\x20'+_0x59e6ac['error']+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x59e6ac['ok']&&_0x50b235['force']&&console['log']('⚠\x20Could\x20not\x20reach\x20'+_0x44ede0+':\x20'+_0x59e6ac['error']+'\x20(continuing\x20with\x20--force)');}else{console['log']('\x0a🌐\x20Profile\x20Setup\x0a'),console[_0x2131db(0x1d8)](_0x5985e5[_0x2131db(0x192)]),console['log'](_0x5985e5['LCpMC']);let _0x50165a='',_0x4a8e87=![];while(!![]){const _0x445480=await _0x1b2fad['prompt']([{'type':'input','name':_0x5985e5['hMRLQ'],'message':_0x4a8e87?_0x5985e5[_0x2131db(0x1c4)]:_0x2131db(0x195),'default':_0x50165a||'http://localhost:3000'}]);_0x50165a=_0x445480['baseUrl'];const _0x20204c=await checkUrlReachability(_0x50165a);if(_0x20204c['ok'])break;const _0x3a4b29=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x50165a),_0x1f4c66=_0x20204c[_0x2131db(0x1a5)]&&!_0x3a4b29,_0x52fa28=_0x1f4c66?'http://'+_0x50165a:null;_0x4a8e87=!![],console[_0x2131db(0x1d8)](_0x2131db(0x19e)+_0x50165a+':\x20'+_0x20204c[_0x2131db(0x1a1)]);_0x52fa28&&console['log'](_0x2131db(0x1f1)+_0x52fa28+'?');const {action:_0x54e0d7}=await _0x1b2fad[_0x2131db(0x1fa)]([{'type':_0x5985e5['wMsJI'],'name':_0x5985e5['kUrgm'],'message':_0x5985e5[_0x2131db(0x205)],'choices':[..._0x52fa28?[{'name':'Use\x20'+_0x52fa28,'value':'use_suggestion'}]:[],{'name':_0x2131db(0x1cb),'value':_0x2131db(0x197)},{'name':'Continue\x20anyway','value':_0x5985e5['WVxCZ']}]}]);if(_0x54e0d7===_0x5985e5[_0x2131db(0x1d4)]&&_0x52fa28){_0x50165a=_0x52fa28;const _0x3296c9=await checkUrlReachability(_0x50165a);if(_0x3296c9['ok'])break;console['log']('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x50165a+':\x20'+_0x3296c9[_0x2131db(0x1a1)]);}else{if(_0x54e0d7===_0x5985e5[_0x2131db(0x1d0)])break;}}_0x50b235={..._0x50b235,'url':_0x50165a};}let _0x1875c4=![];try{_0x1875c4=await _0x5985e5[_0x2131db(0x1fc)](tryAutoRouteCloudProfile,_0x47ff45,_0x50b235[_0x2131db(0x1c6)],_0x50b235,_0x43e494,_0x36b3cc);}catch(_0x1312ab){console['error'](_0x2131db(0x196)+_0x47ff45+_0x2131db(0x1ed)+(_0x1312ab instanceof Error?_0x1312ab['message']:_0x5985e5[_0x2131db(0x191)](String,_0x1312ab))),process[_0x2131db(0x209)](0x1);}!_0x1875c4&&process['exit'](0x1),await _0x5985e5['RARcT'](markActive,_0x47ff45);}
|
|
1
|
+
const _0x126944=_0x498d;(function(_0xcd30b7,_0x1e61a3){const _0x4d4b71=_0x498d,_0x5ad7b=_0xcd30b7();while(!![]){try{const _0x2cfee2=parseInt(_0x4d4b71(0x151))/0x1*(-parseInt(_0x4d4b71(0x1b1))/0x2)+-parseInt(_0x4d4b71(0x1c4))/0x3+parseInt(_0x4d4b71(0x164))/0x4*(-parseInt(_0x4d4b71(0x170))/0x5)+-parseInt(_0x4d4b71(0x179))/0x6*(-parseInt(_0x4d4b71(0x15c))/0x7)+parseInt(_0x4d4b71(0x167))/0x8*(parseInt(_0x4d4b71(0x19f))/0x9)+parseInt(_0x4d4b71(0x190))/0xa*(-parseInt(_0x4d4b71(0x188))/0xb)+parseInt(_0x4d4b71(0x13d))/0xc*(parseInt(_0x4d4b71(0x1a8))/0xd);if(_0x2cfee2===_0x1e61a3)break;else _0x5ad7b['push'](_0x5ad7b['shift']());}catch(_0x2c42ea){_0x5ad7b['push'](_0x5ad7b['shift']());}}}(_0x2ad1,0x3334f));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0xe21165 from'inquirer';function _0x2ad1(){const _0x31c50c=['TypeError','kMVTZ','65jwYAxf','afOuo','env_not_found','manual','\x20\x20Set\x20active\x20profile:\x20','agziy','profile.add.autoRouted','action','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','2HpFJra','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','fetch\x20failed','for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','PLtFV','xRcsx','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','nzfQQ','Invalid\x20URL','error','OTiax','\x0a\x20\x20A\x20profile\x20named\x20\x22','HEAD','The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','HTTP\x20','message','OEbNZ','env','286008xtBDgj','baseUrl','TzkTY','1371576QDwhcU','KybpP','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','.tmp-','url','HOKGr','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.','KsSyp','wywwR','\x0a\x20\x20(domains:\x20','XZSje','RdMOr','`\x20again\x20without\x20--skip-auth.','VtpxL','trim','\x27\x20matching\x20','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','pzTSa','--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','\x27\x20created.\x0a','384911VdjgCz','ywUma','skipAuth','RckKQ','tyJuI','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','test','NODE_TLS_REJECT_UNAUTHORIZED','kPTGi','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','flZSx','82999LpJeZb','user_declined','log','indexOf','no_match','setupHeaders','UGyMP','profile.add.autoRouteSkipped','8HbFdDH','yes','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','24ZoeMEn','UerOJ','setupHeader','startsWith','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','force','slice','ysUwX','DtPlV','365270TLBFTR','join','oNKGm','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','YbeBX','yQwFm','cXSlh','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','120RnlTEN','trackPhaseEnd','eQqgq','NQmKC','✓\x20Cloud\x20profile\x20\x27','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20','prompt','PWCUI','egqGp','status','cdpEndpoint','keys','environments','\x20\x20https://docs.ranger.net/main/concepts/profiles','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','3465033NUNbRe','length','MNEzk','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','bZtSo','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','origin','continue','10sZEclw','toQdf','exit','no_auth_config','Use\x20','\x0a\x20\x20Could\x20not\x20reach\x20','authEnv','capture','Sqsay','confirm','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20',')\x0a\x20\x20Save\x20\x27','dppnZ','tJpLt','GuDJV','1027413DiJZLH','http://localhost:3000','VyKUf','This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','cwd','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20'];_0x2ad1=function(){return _0x31c50c;};return _0x2ad1();}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=_0x126944(0x1a2);function warnCloudProfileSharedInOrg(){if(!process['stdout']['isTTY'])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x112a1c){const _0x4cf492=_0x126944,_0x4a408f={'ZhdgM':function(_0x3b464b,_0x3d6137,_0x5050eb){return _0x3b464b(_0x3d6137,_0x5050eb);},'NQmKC':_0x4cf492(0x1be),'OTiax':_0x4cf492(0x1ab),'toQdf':function(_0x25a38c,_0x28ed89){return _0x25a38c<_0x28ed89;},'VyKUf':function(_0x520f6f,_0x85ee0d){return _0x520f6f(_0x85ee0d);},'wywwR':_0x4cf492(0x1ba),'KybpP':function(_0x4fbbe4,_0x2367d1){return _0x4fbbe4===_0x2367d1;}};try{const _0x3718fd=new AbortController(),_0x575057=_0x4a408f['ZhdgM'](setTimeout,()=>_0x3718fd['abort'](),0x1388),_0xf20c88={'method':_0x4a408f[_0x4cf492(0x17c)],'signal':_0x3718fd['signal'],'redirect':_0x4a408f[_0x4cf492(0x1bc)]};/^https:\/\/localhost(:\d+)?/i[_0x4cf492(0x157)](_0x112a1c)&&(process[_0x4cf492(0x1c3)]['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0xb8d321=await fetch(_0x112a1c,_0xf20c88);delete process[_0x4cf492(0x1c3)][_0x4cf492(0x158)],clearTimeout(_0x575057);if(_0x4a408f[_0x4cf492(0x191)](_0xb8d321['status'],0x190))return{'ok':!![]};return{'ok':![],'error':_0x4cf492(0x1c0)+_0xb8d321[_0x4cf492(0x182)]};}catch(_0x1e21e5){delete process[_0x4cf492(0x1c3)]['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x492935=_0x1e21e5,_0x327f91=_0x492935['message']||_0x4a408f[_0x4cf492(0x1a1)](String,_0x1e21e5),_0x413ab3=_0x327f91['includes'](_0x4a408f[_0x4cf492(0x145)])||_0x4a408f[_0x4cf492(0x13e)](_0x492935['name'],_0x4cf492(0x1a6))||_0x327f91['includes'](_0x4cf492(0x1b3));return{'ok':![],'error':_0x327f91,'isProtocolError':_0x413ab3};}}async function sweepOrphanLocalProfile(_0x2624be,_0x45f721,_0x2b10b4){const _0x15a917=_0x126944,_0x3b71bb={'RdMOr':function(_0x33506b,_0x5da304,_0x2642b5){return _0x33506b(_0x5da304,_0x2642b5);},'KTtrZ':function(_0x5dfc8f,_0x23efb2){return _0x5dfc8f(_0x23efb2);},'tJpLt':function(_0x5ee40c,_0x2cdb91){return _0x5ee40c(_0x2cdb91);},'Xcaxq':function(_0x1020a1,_0x4049fb,_0x5596d0){return _0x1020a1(_0x4049fb,_0x5596d0);}},_0x232fd3=_0x3b71bb['RdMOr'](join,_0x45f721,'local'),_0x29a69a=join(_0x232fd3,_0x2624be);existsSync(_0x29a69a)&&(_0x2b10b4&&await isPathGitTracked(_0x29a69a)?console[_0x15a917(0x15e)]('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x29a69a+_0x15a917(0x187)):(await rm(_0x29a69a,{'recursive':!![],'force':!![]}),console[_0x15a917(0x15e)](_0x15a917(0x1b2)+_0x29a69a)));if(_0x3b71bb['KTtrZ'](existsSync,_0x232fd3)){let _0x4d480b=[];try{_0x4d480b=await _0x3b71bb[_0x15a917(0x19d)](readdir,_0x232fd3);}catch{return;}const _0xf07e2d=_0x15a917(0x140)+_0x2624be+'-';for(const _0x328fda of _0x4d480b){if(!_0x328fda[_0x15a917(0x16a)](_0xf07e2d))continue;const _0x3766b8=_0x3b71bb['Xcaxq'](join,_0x232fd3,_0x328fda);await _0x3b71bb[_0x15a917(0x148)](rm,_0x3766b8,{'recursive':!![],'force':!![]}),console[_0x15a917(0x15e)]('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x3766b8);}}}async function sweepOrphansBestEffort(_0x1897e2){const _0x148ae6=_0x126944,_0x4bc9d1={'PWCUI':function(_0x1d94b2,_0x166baa,_0x77a32,_0x46ce5b){return _0x1d94b2(_0x166baa,_0x77a32,_0x46ce5b);},'MNEzk':function(_0x5dd321){return _0x5dd321();},'UerOJ':function(_0x396d2f,_0x13c76e,_0x410484,_0x603613){return _0x396d2f(_0x13c76e,_0x410484,_0x603613);}};try{await _0x4bc9d1[_0x148ae6(0x180)](sweepOrphanLocalProfile,_0x1897e2,_0x4bc9d1['MNEzk'](getRangerHomeDir),![]);const _0xc1ac0a=getRangerDir();_0xc1ac0a!==_0x4bc9d1[_0x148ae6(0x18a)](getRangerHomeDir)&&await _0x4bc9d1[_0x148ae6(0x168)](sweepOrphanLocalProfile,_0x1897e2,_0xc1ac0a,!![]);}catch(_0x106b69){console[_0x148ae6(0x15e)]('\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20('+(_0x106b69 instanceof Error?_0x106b69['message']:String(_0x106b69))+').');}}async function markActive(_0x29286a){const _0x23210d=_0x126944,_0x4c33ae={'mcYaq':function(_0x402471,_0x4e926a){return _0x402471(_0x4e926a);}};try{await _0x4c33ae['mcYaq'](writeActiveProfileName,_0x29286a),console[_0x23210d(0x15e)](_0x23210d(0x1ac)+_0x29286a);}catch{console['log']('Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.');}}async function tryAutoRouteCloudProfile(_0x7db0ee,_0x327238,_0x327a1f,_0x1f54b5,_0x190be4){const _0x41c8b3=_0x126944,_0x31be7d={'EgHsW':function(_0x2208f3,_0x5bf40a){return _0x2208f3===_0x5bf40a;},'bZtSo':function(_0x1bcc8e){return _0x1bcc8e();},'nzfQQ':function(_0x1f2a3c,_0xf3f3a3){return _0x1f2a3c instanceof _0xf3f3a3;},'XgWyR':function(_0x356f88,_0x2db120){return _0x356f88===_0x2db120;},'kPTGi':function(_0x1c2420,_0x170a9f,_0x34802f,_0x2ac69f,_0xde18bc){return _0x1c2420(_0x170a9f,_0x34802f,_0x2ac69f,_0xde18bc);},'JcqZj':_0x41c8b3(0x193),'VtpxL':function(_0x161ce8,_0x2f8994){return _0x161ce8+_0x2f8994;},'RhtWD':function(_0x14c667,_0x1fb24c){return _0x14c667+_0x1fb24c;},'egqGp':_0x41c8b3(0x166),'GuDJV':'\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','UGyMP':_0x41c8b3(0x1aa),'KsSyp':_0x41c8b3(0x160),'hGegC':function(_0x1eba44,_0x231605,_0x394c75,_0x37e649){return _0x1eba44(_0x231605,_0x394c75,_0x37e649);},'IXLMi':function(_0xb374c2){return _0xb374c2();},'BUCmQ':function(_0x52f642,_0x6a2f85){return _0x52f642+_0x6a2f85;}};let _0x24b915;try{_0x24b915=await _0x31be7d[_0x41c8b3(0x18c)](fetchAuthConfig);}catch(_0x22a2a0){return _0x190be4?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':'no_auth_config','profileName':_0x7db0ee}),console[_0x41c8b3(0x1bb)]('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x31be7d[_0x41c8b3(0x1b9)](_0x22a2a0,Error)?_0x22a2a0[_0x41c8b3(0x1c1)]:String(_0x22a2a0))),![];}if((!_0x24b915||!_0x24b915['environments']||_0x31be7d['XgWyR'](Object[_0x41c8b3(0x184)](_0x24b915[_0x41c8b3(0x185)])['length'],0x0))&&!_0x327a1f[_0x41c8b3(0x196)]){if(_0x1f54b5)return await _0x31be7d[_0x41c8b3(0x159)](captureEnvLessProfile,_0x7db0ee,_0x327238,_0x327a1f,_0x190be4);return _0x190be4?.['trackPhaseEnd'](_0x41c8b3(0x163),{'reason':_0x31be7d['JcqZj'],'profileName':_0x7db0ee}),console['error'](_0x31be7d[_0x41c8b3(0x14a)](_0x31be7d['VtpxL'](_0x31be7d['RhtWD']('\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')+_0x31be7d[_0x41c8b3(0x181)],'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x7db0ee+'\x20--url\x20'+_0x327238+'\x20--skip-auth\x0a')+'\x0a',_0x31be7d[_0x41c8b3(0x19e)])+_0x41c8b3(0x174)),![];}let _0x5c94bf;if(_0x327a1f['authEnv']){if(!_0x24b915?.['environments']?.[_0x327a1f[_0x41c8b3(0x196)]]){const _0x31772e=Object['keys'](_0x24b915?.['environments']??{});return _0x190be4?.['trackPhaseEnd'](_0x41c8b3(0x163),{'reason':_0x31be7d[_0x41c8b3(0x162)],'profileName':_0x7db0ee}),console[_0x41c8b3(0x1bb)](_0x31be7d['VtpxL']('\x0a\x20\x20Auth\x20environment\x20\x22'+_0x327a1f['authEnv']+'\x22\x20not\x20found.',_0x31772e[_0x41c8b3(0x189)]?'\x20Configured\x20envs:\x20'+_0x31772e[_0x41c8b3(0x171)](',\x20')+'.':_0x41c8b3(0x173))),![];}_0x5c94bf=_0x327a1f[_0x41c8b3(0x196)];}else _0x5c94bf=matchAuthEnvironment(_0x327238,_0x24b915);if(!_0x5c94bf)return _0x190be4?.[_0x41c8b3(0x17a)]('profile.add.autoRouteSkipped',{'reason':_0x31be7d[_0x41c8b3(0x144)],'profileName':_0x7db0ee}),console[_0x41c8b3(0x1bb)]('\x0a\x20\x20No\x20auth\x20env\x20matches\x20'+_0x327238+_0x41c8b3(0x1a5)+Object['keys'](_0x24b915?.[_0x41c8b3(0x185)]??{})['join'](',\x20')+'.'),![];const _0x9a60f8=_0x24b915?.['environments']?.[_0x5c94bf],_0x5f204a=_0x9a60f8?.['domains']??[];if(_0x1f54b5&&!_0x327a1f[_0x41c8b3(0x165)]){const {saveToCloud:_0x5593f6}=await _0xe21165[_0x41c8b3(0x17f)]([{'type':_0x41c8b3(0x199),'name':'saveToCloud','message':'Found\x20auth\x20environment\x20\x27'+_0x5c94bf+_0x41c8b3(0x14c)+_0x327238+_0x41c8b3(0x146)+_0x5f204a[_0x41c8b3(0x171)](',\x20')+_0x41c8b3(0x19b)+_0x7db0ee+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x5593f6)return _0x190be4?.[_0x41c8b3(0x17a)](_0x41c8b3(0x163),{'reason':_0x41c8b3(0x15d),'profileName':_0x7db0ee}),console[_0x41c8b3(0x1bb)](_0x41c8b3(0x18b)),![];}const _0x273273=_0x5f204a['some'](_0x1ea56e=>{const _0x5caca7=_0x41c8b3;try{return _0x31be7d['EgHsW'](new URL(_0x1ea56e)[_0x5caca7(0x18e)],new URL(_0x327238)['origin']);}catch{return![];}}),_0x3ddc86={};!_0x273273&&(_0x3ddc86[_0x41c8b3(0x1c5)]=_0x327238);try{await _0x31be7d['hGegC'](createCloudProfile,_0x7db0ee,_0x5c94bf,{'settings':_0x3ddc86}),_0x31be7d['IXLMi'](warnCloudProfileSharedInOrg);}catch(_0x54566b){if(_0x54566b instanceof ApiError&&_0x54566b[_0x41c8b3(0x182)]===0x199){console['error'](_0x31be7d['BUCmQ'](_0x41c8b3(0x1bd)+_0x7db0ee+_0x41c8b3(0x178),_0x41c8b3(0x1a3)+_0x7db0ee));throw _0x54566b;}throw _0x54566b;}return console['log']('✓\x20Profile\x20\x27'+_0x7db0ee+_0x41c8b3(0x150)+(_0x41c8b3(0x15a)+_0x7db0ee)),await sweepOrphansBestEffort(_0x7db0ee),_0x190be4?.[_0x41c8b3(0x17a)]('profile.add.autoRouted',{'envKey':_0x5c94bf,'profileName':_0x7db0ee}),!![];}function _0x498d(_0x56462b,_0x2aef2d){_0x56462b=_0x56462b-0x13c;const _0x2ad1d5=_0x2ad1();let _0x498d5c=_0x2ad1d5[_0x56462b];return _0x498d5c;}async function createUnconfiguredCloudProfile(_0x35e1b2,_0x339bda){const _0x10819d=_0x126944,_0x3575f1={'oEejV':function(_0x533714){return _0x533714();},'xRcsx':function(_0x632443,_0xa48266){return _0x632443 instanceof _0xa48266;},'OuGFC':function(_0x51691c,_0x5a1339){return _0x51691c===_0x5a1339;},'afOuo':function(_0x4383d4,_0xdd795d){return _0x4383d4+_0xdd795d;}};try{await createCloudProfile(_0x35e1b2,undefined,{'settings':_0x339bda}),_0x3575f1['oEejV'](warnCloudProfileSharedInOrg);}catch(_0x5948b1){_0x3575f1[_0x10819d(0x1b6)](_0x5948b1,ApiError)&&_0x3575f1['OuGFC'](_0x5948b1['status'],0x199)&&console['error'](_0x3575f1[_0x10819d(0x1a9)](_0x10819d(0x1bd)+_0x35e1b2+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x35e1b2));throw _0x5948b1;}}async function captureEnvLessProfile(_0x7ad8b2,_0x52874c,_0x2c3ce,_0x23c954){const _0x3fdfe9=_0x126944,_0x1a3000={'QNHyU':_0x3fdfe9(0x197),'yQwFm':'profile.add.autoRouteSkipped','DtPlV':function(_0x2ea923,_0x27687d){return _0x2ea923+_0x27687d;},'agziy':function(_0x52a569,_0x583430){return _0x52a569===_0x583430;},'XGgEh':function(_0x17cd6e,_0x6ce1e5){return _0x17cd6e>_0x6ce1e5;},'mMbWC':function(_0x329014,_0x31037f,_0x51daaf,_0x5bd402){return _0x329014(_0x31037f,_0x51daaf,_0x5bd402);},'OEbNZ':function(_0x9f3ba,_0x1a2c25){return _0x9f3ba instanceof _0x1a2c25;},'tLUJT':function(_0x3ad6eb,_0x4df909,_0x592ae2){return _0x3ad6eb(_0x4df909,_0x592ae2);},'ztkXz':function(_0x5b0345,_0x511f4b){return _0x5b0345(_0x511f4b);}};if(!_0x2c3ce['yes']){const {capture:_0x368d05}=await _0xe21165[_0x3fdfe9(0x17f)]([{'type':_0x3fdfe9(0x199),'name':_0x1a3000['QNHyU'],'message':_0x3fdfe9(0x16b),'default':!![]}]);if(!_0x368d05)return _0x23c954?.['trackPhaseEnd'](_0x1a3000[_0x3fdfe9(0x176)],{'reason':'user_declined','profileName':_0x7ad8b2}),console['error'](_0x1a3000[_0x3fdfe9(0x16f)]('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a',_0x3fdfe9(0x143))),![];}const _0x22e6c2={};if(_0x2c3ce['setupHeader'])for(const _0x5ef5f7 of _0x2c3ce[_0x3fdfe9(0x169)]){const _0x1d943f=_0x5ef5f7['indexOf'](':');if(_0x1a3000[_0x3fdfe9(0x1ad)](_0x1d943f,-0x1))continue;_0x22e6c2[_0x5ef5f7[_0x3fdfe9(0x16d)](0x0,_0x1d943f)['trim']()]=_0x5ef5f7[_0x3fdfe9(0x16d)](_0x1d943f+0x1)['trim']();}const _0x445a48={'baseUrl':_0x52874c};_0x1a3000['XGgEh'](Object[_0x3fdfe9(0x184)](_0x22e6c2)['length'],0x0)&&(_0x445a48[_0x3fdfe9(0x161)]=_0x22e6c2);let _0x47027f;try{_0x47027f=await _0x1a3000['mMbWC'](createCloudProfile,_0x7ad8b2,undefined,{'settings':_0x445a48}),warnCloudProfileSharedInOrg();}catch(_0x50dcf8){_0x1a3000[_0x3fdfe9(0x1c2)](_0x50dcf8,ApiError)&&_0x50dcf8[_0x3fdfe9(0x182)]===0x199&&console['error'](_0x1a3000['DtPlV']('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x7ad8b2+_0x3fdfe9(0x178),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x7ad8b2));throw _0x50dcf8;}return await _0x1a3000['tLUJT'](manualBrowserLogin,_0x47027f,{'key':'','domains':[_0x52874c],'setupHeaders':Object['keys'](_0x22e6c2)[_0x3fdfe9(0x189)]>0x0?_0x22e6c2:undefined}),console['log']('\x0a✓\x20Profile\x20\x27'+_0x7ad8b2+_0x3fdfe9(0x1b8)+('\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x7ad8b2)),await _0x1a3000['ztkXz'](sweepOrphansBestEffort,_0x7ad8b2),_0x23c954?.[_0x3fdfe9(0x17a)](_0x3fdfe9(0x1ae),{'envKey':null,'profileName':_0x7ad8b2}),!![];}export async function addEnv(_0x165c38,_0x520212={},_0x2c28d9){const _0x552c44=_0x126944,_0x4ff41d={'ysUwX':function(_0x526801,_0xe10694){return _0x526801+_0xe10694;},'Sqsay':function(_0x32ce61,_0x555bdc){return _0x32ce61+_0x555bdc;},'SDKJZ':function(_0x2df2b9,_0x20c468){return _0x2df2b9+_0x20c468;},'kMVTZ':_0x552c44(0x1bf),'robFj':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','HOKGr':'--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','MmfLk':_0x552c44(0x14f),'JtpTS':function(_0x225708,_0x599fb8){return _0x225708(_0x599fb8);},'cXSlh':function(_0x20dae3,_0x42bb29){return _0x20dae3>_0x42bb29;},'tykoj':function(_0x46c5d0,_0x166c65,_0x2e76c7){return _0x46c5d0(_0x166c65,_0x2e76c7);},'YbeBX':function(_0x109cc8,_0x3b9040,_0x2acc60,_0x19996c,_0x370bb7){return _0x109cc8(_0x3b9040,_0x2acc60,_0x19996c,_0x370bb7);},'GMHRm':_0x552c44(0x183),'JfeYj':function(_0x4c4730,_0x5c81f8){return _0x4c4730(_0x5c81f8);},'PRnwv':function(_0x469c42,_0x1e72a3){return _0x469c42>_0x1e72a3;},'pzTSa':function(_0x52925d,_0x25a481){return _0x52925d+_0x25a481;},'RckKQ':function(_0x4b82ed,_0x1227e5){return _0x4b82ed(_0x1227e5);},'flZSx':'\x0a🌐\x20Profile\x20Setup\x0a','XZSje':_0x552c44(0x156),'XRZUf':'baseUrl','edpKV':_0x552c44(0x18d),'oNKGm':_0x552c44(0x1a0),'FxeKj':'list','TzkTY':'What\x20would\x20you\x20like\x20to\x20do?','PLtFV':_0x552c44(0x18f),'dppnZ':function(_0x5c41e0,_0x3e6876){return _0x5c41e0===_0x3e6876;},'eQqgq':function(_0x1de72c,_0x5a9c96,_0x10b241,_0x2423f6,_0x4fbad5,_0x2aa5ed){return _0x1de72c(_0x5a9c96,_0x10b241,_0x2423f6,_0x4fbad5,_0x2aa5ed);},'tyJuI':function(_0x4eaa32,_0xc34d52){return _0x4eaa32 instanceof _0xc34d52;},'ywUma':function(_0x48981a,_0x3cafac){return _0x48981a(_0x3cafac);}};_0x520212['ci']&&(console['error'](_0x4ff41d[_0x552c44(0x16e)](_0x4ff41d[_0x552c44(0x16e)](_0x4ff41d['ysUwX'](_0x4ff41d[_0x552c44(0x198)](_0x4ff41d['SDKJZ'](_0x4ff41d[_0x552c44(0x1a7)],_0x552c44(0x1b4))+'\x0a','To\x20set\x20up\x20a\x20profile,\x20run:\x0a'),_0x4ff41d['robFj'])+'\x0a',_0x552c44(0x1b0)),_0x552c44(0x186))),process[_0x552c44(0x192)](0x1));const _0x483fb7={};if(_0x520212['setupHeader'])for(const _0x99cce7 of _0x520212[_0x552c44(0x169)]){const _0x28f39e=_0x99cce7[_0x552c44(0x15f)](':');if(_0x28f39e===-0x1)throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x99cce7+'\x22.\x20Expected\x20\x22Name:\x20Value\x22.');const _0x214763=_0x99cce7[_0x552c44(0x16d)](0x0,_0x28f39e)['trim'](),_0x40b50b=_0x99cce7['slice'](_0x28f39e+0x1)[_0x552c44(0x14b)]();_0x483fb7[_0x214763]=_0x40b50b;}if(_0x520212[_0x552c44(0x183)]!==undefined&&_0x520212[_0x552c44(0x183)]['trim']()==='')throw new Error(_0x4ff41d[_0x552c44(0x142)]);if(_0x520212['cdpEndpoint']&&_0x520212[_0x552c44(0x141)])throw new Error(_0x4ff41d['MmfLk']);if(_0x520212[_0x552c44(0x196)]&&_0x520212[_0x552c44(0x153)])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(_0x520212[_0x552c44(0x196)]&&_0x520212[_0x552c44(0x183)])throw new Error('--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.');const _0x692db7=_0x4ff41d['JtpTS'](Boolean,_0x520212['cdpEndpoint']),_0x426bdb=isInteractive();if(!_0x426bdb&&!_0x520212[_0x552c44(0x141)]&&!_0x692db7&&!_0x520212[_0x552c44(0x153)])throw new Error(_0x552c44(0x13f));if(_0x692db7){const _0x55b0de=_0x520212[_0x552c44(0x183)];console[_0x552c44(0x15e)]('\x0a🔌\x20CDP\x20Profile\x20Setup\x0a'),console['log'](_0x552c44(0x19a)+_0x55b0de);const _0x4e9b5d={'cdpEndpoint':_0x55b0de,'isElectron':!![]};_0x4ff41d[_0x552c44(0x177)](Object[_0x552c44(0x184)](_0x483fb7)[_0x552c44(0x189)],0x0)&&(_0x4e9b5d['setupHeaders']=_0x483fb7);await _0x4ff41d['tykoj'](createUnconfiguredCloudProfile,_0x165c38,_0x4e9b5d);try{_0x4ff41d[_0x552c44(0x175)](setProfileOverride,process['cwd'](),_0x165c38,_0x4ff41d['GMHRm'],_0x55b0de),setProfileOverride(process[_0x552c44(0x1a4)](),_0x165c38,'isElectron',!![]);}catch(_0x3f804b){console['error']('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x3f804b instanceof Error?_0x3f804b[_0x552c44(0x1c1)]:_0x4ff41d['JfeYj'](String,_0x3f804b)));}console['log'](_0x552c44(0x17d)+_0x165c38+'\x27\x20created\x20(CDP).'),await sweepOrphansBestEffort(_0x165c38),await markActive(_0x165c38);return;}if(_0x520212[_0x552c44(0x153)]){const _0x39667b={};_0x520212['url']&&(_0x39667b[_0x552c44(0x1c5)]=_0x520212['url']);_0x4ff41d['PRnwv'](Object[_0x552c44(0x184)](_0x483fb7)['length'],0x0)&&(_0x39667b[_0x552c44(0x161)]=_0x483fb7);await _0x4ff41d['tykoj'](createUnconfiguredCloudProfile,_0x165c38,_0x39667b),console['log'](_0x4ff41d[_0x552c44(0x14e)]('✓\x20Profile\x20\x27'+_0x165c38+'\x27\x20created\x20(no\x20session).\x0a',_0x552c44(0x17e)+_0x165c38+_0x552c44(0x149))),await sweepOrphansBestEffort(_0x165c38),await markActive(_0x165c38);return;}if(_0x520212[_0x552c44(0x141)]){const _0xbb6a8d=_0x520212['url'],_0x248bd9=await _0x4ff41d[_0x552c44(0x154)](checkUrlReachability,_0xbb6a8d);if(!_0x248bd9['ok']&&!_0x520212[_0x552c44(0x16c)])throw new Error('Could\x20not\x20reach\x20'+_0xbb6a8d+':\x20'+_0x248bd9[_0x552c44(0x1bb)]+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x248bd9['ok']&&_0x520212['force']&&console['log']('⚠\x20Could\x20not\x20reach\x20'+_0xbb6a8d+':\x20'+_0x248bd9[_0x552c44(0x1bb)]+'\x20(continuing\x20with\x20--force)');}else{console['log'](_0x4ff41d[_0x552c44(0x15b)]),console[_0x552c44(0x15e)](_0x4ff41d[_0x552c44(0x147)]),console['log']('\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a');let _0x18a1ca='',_0x524d82=![];while(!![]){const _0x50eb1d=await _0xe21165['prompt']([{'type':'input','name':_0x4ff41d['XRZUf'],'message':_0x524d82?_0x4ff41d['edpKV']:_0x552c44(0x1b7),'default':_0x18a1ca||_0x4ff41d[_0x552c44(0x172)]}]);_0x18a1ca=_0x50eb1d['baseUrl'];const _0x313a7c=await _0x4ff41d['JfeYj'](checkUrlReachability,_0x18a1ca);if(_0x313a7c['ok'])break;const _0x473974=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x18a1ca),_0x2c7dde=_0x313a7c['isProtocolError']&&!_0x473974,_0x2bffcf=_0x2c7dde?'http://'+_0x18a1ca:null;_0x524d82=!![],console['log'](_0x552c44(0x195)+_0x18a1ca+':\x20'+_0x313a7c[_0x552c44(0x1bb)]);_0x2bffcf&&console[_0x552c44(0x15e)]('\x20\x20Did\x20you\x20mean\x20'+_0x2bffcf+'?');const {action:_0x39bae3}=await _0xe21165['prompt']([{'type':_0x4ff41d['FxeKj'],'name':_0x552c44(0x1af),'message':_0x4ff41d[_0x552c44(0x13c)],'choices':[..._0x2bffcf?[{'name':_0x552c44(0x194)+_0x2bffcf,'value':'use_suggestion'}]:[],{'name':'Enter\x20a\x20different\x20URL','value':'retry'},{'name':'Continue\x20anyway','value':_0x4ff41d[_0x552c44(0x1b5)]}]}]);if(_0x4ff41d[_0x552c44(0x19c)](_0x39bae3,'use_suggestion')&&_0x2bffcf){_0x18a1ca=_0x2bffcf;const _0x3941dc=await _0x4ff41d[_0x552c44(0x154)](checkUrlReachability,_0x18a1ca);if(_0x3941dc['ok'])break;console[_0x552c44(0x15e)]('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x18a1ca+':\x20'+_0x3941dc['error']);}else{if(_0x39bae3==='continue')break;}}_0x520212={..._0x520212,'url':_0x18a1ca};}let _0x55948f=![];try{_0x55948f=await _0x4ff41d[_0x552c44(0x17b)](tryAutoRouteCloudProfile,_0x165c38,_0x520212['url'],_0x520212,_0x426bdb,_0x2c28d9);}catch(_0x1a2d4b){console[_0x552c44(0x1bb)](_0x552c44(0x14d)+_0x165c38+'\x22:\x20'+(_0x4ff41d[_0x552c44(0x155)](_0x1a2d4b,Error)?_0x1a2d4b[_0x552c44(0x1c1)]:_0x4ff41d[_0x552c44(0x152)](String,_0x1a2d4b))),process[_0x552c44(0x192)](0x1);}!_0x55948f&&process['exit'](0x1),await _0x4ff41d['JfeYj'](markActive,_0x165c38);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xfb937b,_0x887c2a){var _0x2f9da0=_0x4136,_0x4461dc=_0xfb937b();while(!![]){try{var _0x4b4d85=-parseInt(_0x2f9da0(0x121))/0x1+-parseInt(_0x2f9da0(0x129))/0x2*(-parseInt(_0x2f9da0(0x124))/0x3)+-parseInt(_0x2f9da0(0x133))/0x4*(-parseInt(_0x2f9da0(0x131))/0x5)+-parseInt(_0x2f9da0(0x12a))/0x6+parseInt(_0x2f9da0(0x126))/0x7+parseInt(_0x2f9da0(0x12f))/0x8*(-parseInt(_0x2f9da0(0x125))/0x9)+parseInt(_0x2f9da0(0x123))/0xa;if(_0x4b4d85===_0x887c2a)break;else _0x4461dc['push'](_0x4461dc['shift']());}catch(_0xf1099a){_0x4461dc['push'](_0x4461dc['shift']());}}}(_0x47e1,0x7d523));export async function authEncrypt(_0x1a82dd){var _0x4168d1=_0x4136,_0x48fd43={'ArKfk':function(_0x1f143e,_0x3c4bd2){return _0x1f143e+_0x3c4bd2;},'TGuuo':function(_0x59570f,_0x4916a9){return _0x59570f+_0x4916a9;},'ExKwA':_0x4168d1(0x12d),'YDxFa':_0x4168d1(0x132)};console['error'](_0x48fd43[_0x4168d1(0x128)](_0x48fd43[_0x4168d1(0x128)](_0x48fd43['ArKfk'](_0x48fd43[_0x4168d1(0x12b)](_0x48fd43['ExKwA']+_0x48fd43[_0x4168d1(0x127)]+'\x0a',_0x4168d1(0x12c)),_0x4168d1(0x12e)),'\x0a'),'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a')+_0x4168d1(0x122)),process[_0x4168d1(0x130)](0x1);}function _0x4136(_0x309b6b,_0x5b8a3e){_0x309b6b=_0x309b6b-0x121;var _0x47e11f=_0x47e1();var _0x41365a=_0x47e11f[_0x309b6b];return _0x41365a;}function _0x47e1(){var _0x41faaf=['3017217avCMUm','YDxFa','ArKfk','120imDnmN','3336648ZXeYtS','TGuuo','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','8JAqDht','exit','275830ZrPsMT','session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a','36soYIpZ','214076gYDsYT','\x20\x20https://docs.ranger.net/main/concepts/profiles','9356190LAyHLx','10746jpjkLg','7151085rezaez'];_0x47e1=function(){return _0x41faaf;};return _0x47e1();}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x21a125=_0x365f;(function(_0x54bfe5,_0x588d3b){const _0x37491e=_0x365f,_0x353c4a=_0x54bfe5();while(!![]){try{const _0x4c321a=parseInt(_0x37491e(0xca))/0x1*(parseInt(_0x37491e(0xcc))/0x2)+-parseInt(_0x37491e(0xee))/0x3*(-parseInt(_0x37491e(0xf9))/0x4)+parseInt(_0x37491e(0xd9))/0x5+parseInt(_0x37491e(0xf6))/0x6*(-parseInt(_0x37491e(0xe2))/0x7)+parseInt(_0x37491e(0xe8))/0x8*(-parseInt(_0x37491e(0xc8))/0x9)+parseInt(_0x37491e(0xce))/0xa+parseInt(_0x37491e(0xfc))/0xb*(parseInt(_0x37491e(0xfa))/0xc);if(_0x4c321a===_0x588d3b)break;else _0x353c4a['push'](_0x353c4a['shift']());}catch(_0x553515){_0x353c4a['push'](_0x353c4a['shift']());}}}(_0x5856,0x45912));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x5856(){const _0x1710f7=['XUAxM','uninstall','yIahp','RBEhY','✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','952AYhzFc','feature-tracker','replace','\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','user','win32','48qzIfDW','\x0a✅\x20Cleanup\x20complete!\x0a','rsgQj','GsiBd','cUhDr','claude','386031ouvKID','utf-8','SWoTv','GVbXQ','mEEXg','pkuDb','kMtBP','string','9294nPtsPU','log','close','4aUbFZp','12168qzKULl','project','4576SVAtPH','length','806958bwhJXc','plugin','254BxBhJk','marketplace','1654KIfMGq','error','1208420ORqkLL','EuQXu','platform','tBirp','McHhB','MKheO','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','remove','JmiMd','jBbQR','trailhead','760905ISCbjd','push','ranger@trailhead','hDtCN'];_0x5856=function(){return _0x1710f7;};return _0x5856();}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',_0x21a125(0xe3),'bug-bash','e2e-test-recommender'],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x13c98a){const _0x252e9f=_0x21a125,_0xc286d2=_0x13c98a[_0x252e9f(0xe4)](/\/\*[\s\S]*?\*\//g,''),_0x45fc07=_0xc286d2[_0x252e9f(0xe4)](/^\s*\/\/.*$/gm,''),_0x345b2b=_0x45fc07['replace'](/,\s*([}\]])/g,'$1');return JSON['parse'](_0x345b2b);}async function removeOpencodePluginConfig(_0x1577e3){const _0x58a144=_0x21a125,_0x236891={'TaBnG':function(_0x431f30,_0x29f124){return _0x431f30!==_0x29f124;},'GQlvE':function(_0x5bd874,_0x2a714d,_0x3f09a4){return _0x5bd874(_0x2a714d,_0x3f09a4);},'gzjoj':_0x58a144(0xef),'XUAxM':function(_0x3cfcaf,_0x2b06fb){return _0x3cfcaf(_0x2b06fb);}};if(!existsSync(_0x1577e3))return![];let _0x410816;try{const _0x204226=await _0x236891['GQlvE'](readFile,_0x1577e3,_0x236891['gzjoj']);_0x410816=_0x236891[_0x58a144(0xdd)](parseJsonc,_0x204226);}catch{return![];}const _0x1ac2e2=Array['isArray'](_0x410816['plugin'])?_0x410816['plugin']:[];if(_0x1ac2e2[_0x58a144(0xfd)]===0x0)return![];const _0x5f5344=_0x1ac2e2['filter'](_0xeacc84=>{const _0x5c6012=_0x58a144;if(_0x236891['TaBnG'](typeof _0xeacc84,_0x5c6012(0xf5)))return!![];return _0xeacc84!==opencodePluginName;});if(_0x5f5344['length']===_0x1ac2e2['length'])return![];return _0x5f5344[_0x58a144(0xfd)]===0x0?delete _0x410816['plugin']:_0x410816['plugin']=_0x5f5344,await writeFile(_0x1577e3,JSON['stringify'](_0x410816,null,0x2)+'\x0a'),!![];}async function uninstallClaudePlugin(_0xf2c4bb){const _0x3303f3={'tBirp':function(_0x138b5f,_0x6310da){return _0x138b5f(_0x6310da);},'APknR':'--scope','MKheO':function(_0x1711ef){return _0x1711ef();},'JmiMd':function(_0x333ddb,_0x13aca5){return _0x333ddb===_0x13aca5;}};return new Promise(_0x59f8d7=>{const _0x387a13=_0x365f,_0x4a99a1=[_0x387a13(0xc9),_0x387a13(0xde),_0x387a13(0xdb)];_0xf2c4bb&&_0x4a99a1[_0x387a13(0xda)](_0x3303f3['APknR'],_0xf2c4bb);const _0x14a453=spawn(_0x387a13(0xed),_0x4a99a1,{'stdio':['ignore','ignore','ignore'],'cwd':_0xf2c4bb?_0x3303f3[_0x387a13(0xd3)](getProjectRoot):undefined,'shell':_0x3303f3[_0x387a13(0xd6)](process[_0x387a13(0xd0)],_0x387a13(0xe7))});_0x14a453['on'](_0x387a13(0xf8),_0x186743=>{const _0x45c2e9=_0x387a13;_0x3303f3[_0x45c2e9(0xd1)](_0x59f8d7,_0x186743===0x0);}),_0x14a453['on'](_0x387a13(0xcd),()=>{_0x59f8d7(![]);});});}function _0x365f(_0x406673,_0x51e59d){_0x406673=_0x406673-0xc8;const _0x58560e=_0x5856();let _0x365fe7=_0x58560e[_0x406673];return _0x365fe7;}async function removeMarketplace(){const _0x232d1b=_0x21a125,_0x151f1e={'pkuDb':function(_0x1a60da,_0x5418b9){return _0x1a60da(_0x5418b9);},'jBbQR':function(_0x5f578d,_0x1fc103){return _0x5f578d===_0x1fc103;},'LPDDq':_0x232d1b(0xcb),'OEiBL':_0x232d1b(0xd5),'ZXFPe':_0x232d1b(0xd8),'EuQXu':'ignore','yIahp':'close'};return new Promise(_0x3f11cc=>{const _0x3947ef=_0x232d1b,_0x3f799f=spawn('claude',[_0x3947ef(0xc9),_0x151f1e['LPDDq'],_0x151f1e['OEiBL'],_0x151f1e['ZXFPe']],{'stdio':[_0x151f1e[_0x3947ef(0xcf)],_0x151f1e[_0x3947ef(0xcf)],_0x151f1e['EuQXu']],'shell':process['platform']==='win32'});_0x3f799f['on'](_0x151f1e[_0x3947ef(0xdf)],_0x32f0cf=>{const _0x349df4=_0x3947ef;_0x151f1e[_0x349df4(0xf3)](_0x3f11cc,_0x151f1e[_0x349df4(0xd7)](_0x32f0cf,0x0));}),_0x3f799f['on']('error',()=>{_0x3f11cc(![]);});});}export async function clean(){const _0x5acbc1=_0x21a125,_0x5e0bc4={'FrEAQ':_0x5acbc1(0xe5),'mEEXg':function(_0x4acb09){return _0x4acb09();},'SWoTv':function(_0x3ad758,_0x3806f1){return _0x3ad758(_0x3806f1);},'McHhB':function(_0x21bfa0,_0x37dc2f){return _0x21bfa0(_0x37dc2f);},'kMtBP':function(_0x467167,_0x370be6,_0x1663b9){return _0x467167(_0x370be6,_0x1663b9);},'ljqmL':function(_0xe07773,_0x346d91,_0x218af6){return _0xe07773(_0x346d91,_0x218af6);},'GsiBd':function(_0x225421,_0x139527){return _0x225421(_0x139527);},'cUhDr':_0x5acbc1(0xfb),'RBEhY':_0x5acbc1(0xe6),'GVbXQ':'opencode.json','rsgQj':function(_0x55a4fa,_0x847ead){return _0x55a4fa(_0x847ead);},'dbESo':_0x5acbc1(0xd4),'JtUEX':_0x5acbc1(0xe1),'hDtCN':'✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','ZSUkL':function(_0x13389c,_0x401c42){return _0x13389c(_0x401c42);},'xPVyG':'✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)'};console['log'](_0x5e0bc4['FrEAQ']);let _0x1d301d=![];try{await _0x5e0bc4[_0x5acbc1(0xf2)](deleteAllCredentials),console[_0x5acbc1(0xf7)]('✓\x20Removed\x20stored\x20credentials'),_0x1d301d=!![];}catch{}const _0x3b5b47=getCacheFile();_0x5e0bc4[_0x5acbc1(0xf0)](existsSync,_0x3b5b47)&&(await _0x5e0bc4['McHhB'](rm,_0x3b5b47),_0x1d301d=!![]);const _0x5cc920=getRangerDir();existsSync(_0x5cc920)&&(await rm(_0x5cc920,{'recursive':!![]}),console[_0x5acbc1(0xf7)]('✓\x20Removed\x20.ranger/\x20directory'),_0x1d301d=!![]);const _0x3dcfd5=getProjectSkillsDir();for(const _0x2ac53f of skillsToRemove){const _0x2e6623=_0x5e0bc4[_0x5acbc1(0xf4)](join,_0x3dcfd5,_0x2ac53f);existsSync(_0x2e6623)&&(await _0x5e0bc4['ljqmL'](rm,_0x2e6623,{'recursive':!![]}),console['log']('✓\x20Removed\x20project\x20skill:\x20'+_0x2ac53f),_0x1d301d=!![]);}const _0x445721=getUserSkillsDir();for(const _0xc7c762 of skillsToRemove){const _0x2c417c=join(_0x445721,_0xc7c762);_0x5e0bc4[_0x5acbc1(0xeb)](existsSync,_0x2c417c)&&(await _0x5e0bc4['ljqmL'](rm,_0x2c417c,{'recursive':!![]}),console['log']('✓\x20Removed\x20user\x20skill:\x20'+_0xc7c762),_0x1d301d=!![]);}const _0x2a5db8=getOpencodeSkillsDir(_0x5e0bc4[_0x5acbc1(0xec)]);for(const _0x5331f0 of skillsToRemove){const _0x112148=_0x5e0bc4[_0x5acbc1(0xf4)](join,_0x2a5db8,_0x5331f0);existsSync(_0x112148)&&(await rm(_0x112148,{'recursive':!![]}),console['log']('✓\x20Removed\x20OpenCode\x20project\x20skill:\x20'+_0x5331f0),_0x1d301d=!![]);}const _0x2a16f3=_0x5e0bc4[_0x5acbc1(0xd2)](getOpencodeSkillsDir,_0x5e0bc4[_0x5acbc1(0xe0)]);for(const _0x5054cd of skillsToRemove){const _0x1fc48b=join(_0x2a16f3,_0x5054cd);_0x5e0bc4['SWoTv'](existsSync,_0x1fc48b)&&(await rm(_0x1fc48b,{'recursive':!![]}),console[_0x5acbc1(0xf7)]('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x5054cd),_0x1d301d=!![]);}const _0x33e5f2=join(getOpencodeConfigDir(_0x5e0bc4['cUhDr']),_0x5e0bc4[_0x5acbc1(0xf1)]);await _0x5e0bc4[_0x5acbc1(0xea)](removeOpencodePluginConfig,_0x33e5f2)&&(console['log'](_0x5e0bc4['dbESo']),_0x1d301d=!![]);const _0x12c062=join(getOpencodeConfigDir(_0x5e0bc4['RBEhY']),_0x5e0bc4[_0x5acbc1(0xf1)]);await removeOpencodePluginConfig(_0x12c062)&&(console['log'](_0x5e0bc4['JtUEX']),_0x1d301d=!![]);const _0x3b743e=await _0x5e0bc4['mEEXg'](uninstallClaudePlugin);_0x3b743e&&(console['log'](_0x5e0bc4[_0x5acbc1(0xdc)]),_0x1d301d=!![]);const _0x5ef28f=await _0x5e0bc4['ZSUkL'](uninstallClaudePlugin,_0x5e0bc4[_0x5acbc1(0xec)]);_0x5ef28f&&(console['log'](_0x5e0bc4['xPVyG']),_0x1d301d=!![]);const _0x4e0153=await removeMarketplace();_0x4e0153&&(console[_0x5acbc1(0xf7)]('✓\x20Removed\x20trailhead\x20marketplace'),_0x1d301d=!![]),_0x1d301d?console['log'](_0x5acbc1(0xe9)):console[_0x5acbc1(0xf7)]('Nothing\x20to\x20clean\x20up.\x0a');}
|
|
1
|
+
const _0x2e7629=_0x72d5;(function(_0x1f8fa9,_0x2681a5){const _0x3b53ec=_0x72d5,_0x3a7c3c=_0x1f8fa9();while(!![]){try{const _0x198dc2=parseInt(_0x3b53ec(0x136))/0x1*(-parseInt(_0x3b53ec(0x124))/0x2)+-parseInt(_0x3b53ec(0x129))/0x3+-parseInt(_0x3b53ec(0x125))/0x4+-parseInt(_0x3b53ec(0x127))/0x5*(-parseInt(_0x3b53ec(0x150))/0x6)+parseInt(_0x3b53ec(0x126))/0x7*(parseInt(_0x3b53ec(0x15b))/0x8)+-parseInt(_0x3b53ec(0x134))/0x9*(parseInt(_0x3b53ec(0x143))/0xa)+parseInt(_0x3b53ec(0x142))/0xb;if(_0x198dc2===_0x2681a5)break;else _0x3a7c3c['push'](_0x3a7c3c['shift']());}catch(_0x5032b2){_0x3a7c3c['push'](_0x3a7c3c['shift']());}}}(_0x59c3,0x44fa8));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';function _0x72d5(_0x39c443,_0x2e3d93){_0x39c443=_0x39c443-0x123;const _0x59c3cd=_0x59c3();let _0x72d525=_0x59c3cd[_0x39c443];return _0x72d525;}import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=['ranger','feature-tracker',_0x2e7629(0x152),_0x2e7629(0x15c)],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0xec7d79){const _0x569570=_0x2e7629,_0x3f3034=_0xec7d79[_0x569570(0x145)](/\/\*[\s\S]*?\*\//g,''),_0x52aad6=_0x3f3034['replace'](/^\s*\/\/.*$/gm,''),_0x842cf8=_0x52aad6[_0x569570(0x145)](/,\s*([}\]])/g,'$1');return JSON['parse'](_0x842cf8);}async function removeOpencodePluginConfig(_0x2efb18){const _0x1c47a8=_0x2e7629,_0x11c3ce={'FyjTa':function(_0x198316,_0x491d06){return _0x198316(_0x491d06);},'onsXG':function(_0x155ce2,_0x5bf207){return _0x155ce2===_0x5bf207;},'BosrB':function(_0x5b59ca,_0x5e98bc,_0x4e8209){return _0x5b59ca(_0x5e98bc,_0x4e8209);},'Byive':function(_0x106908,_0x45e902){return _0x106908+_0x45e902;}};if(!existsSync(_0x2efb18))return![];let _0x309d4c;try{const _0x246752=await readFile(_0x2efb18,'utf-8');_0x309d4c=_0x11c3ce['FyjTa'](parseJsonc,_0x246752);}catch{return![];}const _0x11d465=Array['isArray'](_0x309d4c[_0x1c47a8(0x14e)])?_0x309d4c['plugin']:[];if(_0x11c3ce['onsXG'](_0x11d465['length'],0x0))return![];const _0x4a3b30=_0x11d465[_0x1c47a8(0x159)](_0x368d11=>{if(typeof _0x368d11!=='string')return!![];return _0x368d11!==opencodePluginName;});if(_0x4a3b30[_0x1c47a8(0x132)]===_0x11d465['length'])return![];return _0x4a3b30[_0x1c47a8(0x132)]===0x0?delete _0x309d4c[_0x1c47a8(0x14e)]:_0x309d4c['plugin']=_0x4a3b30,await _0x11c3ce['BosrB'](writeFile,_0x2efb18,_0x11c3ce[_0x1c47a8(0x12d)](JSON['stringify'](_0x309d4c,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x38b3c4){const _0x7508b9=_0x2e7629,_0x2390e2={'kkpgN':function(_0x39f654,_0x2be44b){return _0x39f654(_0x2be44b);},'bhEsc':'uninstall','ZUiLr':_0x7508b9(0x13b),'kQmLL':_0x7508b9(0x133),'Hixyb':function(_0x36a71a,_0xf05841,_0x1a5f67,_0x90d994){return _0x36a71a(_0xf05841,_0x1a5f67,_0x90d994);},'VyQVi':'ignore','HVSgK':function(_0x354854,_0x3b564e){return _0x354854===_0x3b564e;},'VGoHt':_0x7508b9(0x144),'LmQER':_0x7508b9(0x13e),'JotDa':'error'};return new Promise(_0x3bf4b1=>{const _0x1df53e=_0x7508b9,_0x283e13=['plugin',_0x2390e2['bhEsc'],_0x2390e2['ZUiLr']];_0x38b3c4&&_0x283e13['push'](_0x2390e2[_0x1df53e(0x14d)],_0x38b3c4);const _0x3d50ca=_0x2390e2['Hixyb'](spawn,_0x1df53e(0x15a),_0x283e13,{'stdio':[_0x2390e2['VyQVi'],'ignore',_0x2390e2['VyQVi']],'cwd':_0x38b3c4?getProjectRoot():undefined,'shell':_0x2390e2[_0x1df53e(0x151)](process['platform'],_0x2390e2[_0x1df53e(0x147)])});_0x3d50ca['on'](_0x2390e2[_0x1df53e(0x15d)],_0x2b6a61=>{_0x3bf4b1(_0x2b6a61===0x0);}),_0x3d50ca['on'](_0x2390e2[_0x1df53e(0x12e)],()=>{const _0xe56da3=_0x1df53e;_0x2390e2[_0xe56da3(0x156)](_0x3bf4b1,![]);});});}function _0x59c3(){const _0xa429db=['dMCXl','✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','Byive','JotDa','vOMHy','Glejb','eHllA','length','--scope','12879bLZOFM','project','17PWQZsI','✓\x20Removed\x20user\x20skill:\x20','ahnFT','chlFb','user','ranger@trailhead','✓\x20Removed\x20OpenCode\x20user\x20skill:\x20','eSZHG','close','pJpac','xtzgz','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','8918415nQqnBB','3720TqWjKw','win32','replace','uwkuW','VGoHt','YBsgJ','ZyMmm','ufDhL','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','ignore','kQmLL','plugin','ZZUEP','432PluWGq','HVSgK','bug-bash','rVTZa','\x0a✅\x20Cleanup\x20complete!\x0a','PrOqy','kkpgN','LEryu','LmbSq','filter','claude','24aFgZgP','e2e-test-recommender','LmQER','✓\x20Removed\x20stored\x20credentials','ALEhD','remove','✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','✓\x20Removed\x20.ranger/\x20directory','46674ZzVoex','598796AJvtcB','496118fOWDOx','27925ysiatv','OlyQl','192633UjhqXt','log'];_0x59c3=function(){return _0xa429db;};return _0x59c3();}async function removeMarketplace(){const _0x48fb48=_0x2e7629,_0x56aa45={'YBsgJ':function(_0x4394ce,_0x4c5a3f){return _0x4394ce(_0x4c5a3f);},'ZKKxm':'marketplace','WnMVb':_0x48fb48(0x160),'ZyMmm':'trailhead','eHllA':_0x48fb48(0x14c),'SxOAK':function(_0x2dca40,_0x370013){return _0x2dca40===_0x370013;},'ufDhL':'close'};return new Promise(_0x21dcf8=>{const _0x37ed04=_0x48fb48,_0x2f788e={'LEryu':function(_0x4e7919,_0x1f1ff8){const _0x91c93f=_0x72d5;return _0x56aa45[_0x91c93f(0x148)](_0x4e7919,_0x1f1ff8);},'FMyYx':function(_0x29b880,_0x32a020){return _0x29b880===_0x32a020;}},_0x405b2a=spawn('claude',[_0x37ed04(0x14e),_0x56aa45['ZKKxm'],_0x56aa45['WnMVb'],_0x56aa45[_0x37ed04(0x149)]],{'stdio':[_0x37ed04(0x14c),_0x56aa45[_0x37ed04(0x131)],_0x37ed04(0x14c)],'shell':_0x56aa45['SxOAK'](process['platform'],'win32')});_0x405b2a['on'](_0x56aa45[_0x37ed04(0x14a)],_0x460c85=>{_0x2f788e['LEryu'](_0x21dcf8,_0x2f788e['FMyYx'](_0x460c85,0x0));}),_0x405b2a['on']('error',()=>{const _0x24e414=_0x37ed04;_0x2f788e[_0x24e414(0x157)](_0x21dcf8,![]);});});}export async function clean(){const _0x50e9df=_0x2e7629,_0x2bee4d={'CkYyC':'\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','NRnvJ':function(_0x5dab87){return _0x5dab87();},'eSZHG':_0x50e9df(0x15e),'uwkuW':function(_0x1fade7){return _0x1fade7();},'jAwoZ':function(_0x4e62b5){return _0x4e62b5();},'vOMHy':function(_0x4945d0,_0x3f1ccb,_0x2af3fa){return _0x4945d0(_0x3f1ccb,_0x2af3fa);},'Glejb':function(_0x382dc9,_0xc82870,_0x45d8e6){return _0x382dc9(_0xc82870,_0x45d8e6);},'rVTZa':function(_0x5ea8cf,_0x1a0178){return _0x5ea8cf(_0x1a0178);},'pJpac':_0x50e9df(0x135),'xLCaM':function(_0x44510a,_0x281d3b,_0x3d0cb3){return _0x44510a(_0x281d3b,_0x3d0cb3);},'LmbSq':function(_0x21dfe6,_0x2f4b70){return _0x21dfe6(_0x2f4b70);},'GupXa':_0x50e9df(0x13a),'jCWKE':function(_0x585201,_0x20bd4d,_0x4e551e){return _0x585201(_0x20bd4d,_0x4e551e);},'ZZUEP':function(_0x3290e0,_0x2a9502){return _0x3290e0(_0x2a9502);},'ahnFT':function(_0x13fec3,_0x3f5029,_0x4dcec1){return _0x13fec3(_0x3f5029,_0x4dcec1);},'dMCXl':function(_0x3f23c6,_0x6a75b7,_0x33b120){return _0x3f23c6(_0x6a75b7,_0x33b120);},'OlyQl':'opencode.json','hdObt':_0x50e9df(0x12c),'xtzgz':'✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','chlFb':_0x50e9df(0x161),'ALEhD':function(_0x3ae6c2){return _0x3ae6c2();},'PrOqy':_0x50e9df(0x154)};console['log'](_0x2bee4d['CkYyC']);let _0x299630=![];try{await _0x2bee4d['NRnvJ'](deleteAllCredentials),console['log'](_0x2bee4d[_0x50e9df(0x13d)]),_0x299630=!![];}catch{}const _0x4dbecc=_0x2bee4d[_0x50e9df(0x146)](getCacheFile);existsSync(_0x4dbecc)&&(await rm(_0x4dbecc),_0x299630=!![]);const _0x212d3f=_0x2bee4d['uwkuW'](getRangerDir);existsSync(_0x212d3f)&&(await rm(_0x212d3f,{'recursive':!![]}),console[_0x50e9df(0x12a)](_0x50e9df(0x123)),_0x299630=!![]);const _0x42b4ec=_0x2bee4d['jAwoZ'](getProjectSkillsDir);for(const _0x98e12a of skillsToRemove){const _0x626ac9=_0x2bee4d[_0x50e9df(0x12f)](join,_0x42b4ec,_0x98e12a);existsSync(_0x626ac9)&&(await _0x2bee4d[_0x50e9df(0x130)](rm,_0x626ac9,{'recursive':!![]}),console[_0x50e9df(0x12a)]('✓\x20Removed\x20project\x20skill:\x20'+_0x98e12a),_0x299630=!![]);}const _0x1b2619=getUserSkillsDir();for(const _0x3eda69 of skillsToRemove){const _0x3ba172=join(_0x1b2619,_0x3eda69);_0x2bee4d[_0x50e9df(0x153)](existsSync,_0x3ba172)&&(await _0x2bee4d[_0x50e9df(0x130)](rm,_0x3ba172,{'recursive':!![]}),console[_0x50e9df(0x12a)](_0x50e9df(0x137)+_0x3eda69),_0x299630=!![]);}const _0x1f5186=getOpencodeSkillsDir(_0x2bee4d[_0x50e9df(0x13f)]);for(const _0x2f1e0a of skillsToRemove){const _0x30eaf0=_0x2bee4d['xLCaM'](join,_0x1f5186,_0x2f1e0a);existsSync(_0x30eaf0)&&(await _0x2bee4d[_0x50e9df(0x12f)](rm,_0x30eaf0,{'recursive':!![]}),console[_0x50e9df(0x12a)](_0x50e9df(0x14b)+_0x2f1e0a),_0x299630=!![]);}const _0x130719=_0x2bee4d[_0x50e9df(0x158)](getOpencodeSkillsDir,_0x2bee4d['GupXa']);for(const _0x35bb70 of skillsToRemove){const _0x207aa5=_0x2bee4d['jCWKE'](join,_0x130719,_0x35bb70);_0x2bee4d[_0x50e9df(0x14f)](existsSync,_0x207aa5)&&(await _0x2bee4d[_0x50e9df(0x138)](rm,_0x207aa5,{'recursive':!![]}),console['log'](_0x50e9df(0x13c)+_0x35bb70),_0x299630=!![]);}const _0x15f376=_0x2bee4d[_0x50e9df(0x12b)](join,getOpencodeConfigDir(_0x2bee4d['pJpac']),_0x2bee4d[_0x50e9df(0x128)]);await removeOpencodePluginConfig(_0x15f376)&&(console[_0x50e9df(0x12a)](_0x50e9df(0x141)),_0x299630=!![]);const _0x2843bd=join(getOpencodeConfigDir(_0x50e9df(0x13a)),_0x2bee4d[_0x50e9df(0x128)]);await removeOpencodePluginConfig(_0x2843bd)&&(console[_0x50e9df(0x12a)](_0x2bee4d['hdObt']),_0x299630=!![]);const _0x53b84b=await uninstallClaudePlugin();_0x53b84b&&(console[_0x50e9df(0x12a)](_0x2bee4d[_0x50e9df(0x140)]),_0x299630=!![]);const _0x185e93=await _0x2bee4d[_0x50e9df(0x153)](uninstallClaudePlugin,'project');_0x185e93&&(console['log'](_0x2bee4d[_0x50e9df(0x139)]),_0x299630=!![]);const _0x3de851=await _0x2bee4d[_0x50e9df(0x15f)](removeMarketplace);_0x3de851&&(console[_0x50e9df(0x12a)]('✓\x20Removed\x20trailhead\x20marketplace'),_0x299630=!![]),_0x299630?console['log'](_0x2bee4d[_0x50e9df(0x155)]):console['log']('Nothing\x20to\x20clean\x20up.\x0a');}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x620c5=_0x56f4;(function(_0xf950d,_0x21c85e){const _0x5e2570=_0x56f4,_0xe7cdb8=_0xf950d();while(!![]){try{const _0x2bd804=-parseInt(_0x5e2570(0x11a))/0x1+-parseInt(_0x5e2570(0x10a))/0x2+parseInt(_0x5e2570(0x10b))/0x3+parseInt(_0x5e2570(0x11e))/0x4*(-parseInt(_0x5e2570(0x128))/0x5)+parseInt(_0x5e2570(0x124))/0x6+parseInt(_0x5e2570(0xfe))/0x7*(parseInt(_0x5e2570(0x102))/0x8)+parseInt(_0x5e2570(0xfa))/0x9*(parseInt(_0x5e2570(0xfd))/0xa);if(_0x2bd804===_0x21c85e)break;else _0xe7cdb8['push'](_0xe7cdb8['shift']());}catch(_0x551b46){_0xe7cdb8['push'](_0xe7cdb8['shift']());}}}(_0x2ded,0x77703));import{existsSync}from'fs';function _0x2ded(){const _0x46a59a=['forceLogin','isSafeInteger','dbOuU','XZFTE','alsoExistsElsewhere','isNaN','parse','uaAnR','object','166977ocgOKz','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','kind','310kWvvvA','7tAEDGu','vEYRE','Key\x20\x22','KCkoA','7024440MJhdNp','\x22\x20not\x20found','uZGLK','undefined','headless','PnwiL','keys','ddMPI','1318450FlClen','1130865mzOoHZ','bDTAS','false','\x20=\x20','No\x20configuration\x20set\x20for\x20\x22','test','log','QeZdS','YvsYm','(not\x20set)','gwEoM','cwd','gidpY','true','endsWith','621645FihNuT','WDrKt','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','HHyHP','19664rykKjA','dRWGh','cloud','Profile\x20\x22','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','LcoAE','3385608zqXnGS','nmIKx','Invalid\x20value\x20for\x20','yVNOY','635iargYZ','\x20for\x20\x22','\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'];_0x2ded=function(){return _0x46a59a;};return _0x2ded();}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=[_0x620c5(0x106),'allowInsecureLocalhost',_0x620c5(0x12b)];function _0x56f4(_0x378003,_0x511c45){_0x378003=_0x378003-0xf3;const _0x2dedf7=_0x2ded();let _0x56f419=_0x2dedf7[_0x378003];return _0x56f419;}function parseLocalValue(_0x532997,_0x54fb03){const _0x22b943=_0x620c5,_0x1c4069={'wCtdZ':_0x22b943(0x118),'bDTAS':_0x22b943(0x10d)};if(BOOLEAN_KEYS['includes'](_0x532997)){if(_0x54fb03===_0x1c4069['wCtdZ'])return!![];if(_0x54fb03===_0x1c4069[_0x22b943(0x10c)])return![];throw new Error(_0x22b943(0x126)+_0x532997+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x54fb03;}function parseOverrideValue(_0x28e7c0){const _0x2bc242=_0x620c5,_0x50a9b7={'bThfd':'true','YvsYm':'null','PTrYs':function(_0x456c0b,_0x154aa5){return _0x456c0b===_0x154aa5;},'gwEoM':function(_0x57d58c,_0x37aeb6){return _0x57d58c(_0x37aeb6);}};if(_0x28e7c0===_0x50a9b7['bThfd'])return!![];if(_0x28e7c0===_0x2bc242(0x10d))return![];if(_0x28e7c0===_0x50a9b7[_0x2bc242(0x113)])return null;if(_0x50a9b7['PTrYs'](_0x28e7c0,_0x2bc242(0x105)))return undefined;if(/^-?\d+$/[_0x2bc242(0x110)](_0x28e7c0)){const _0x3c13bd=_0x50a9b7[_0x2bc242(0x115)](Number,_0x28e7c0);if(Number[_0x2bc242(0x12c)](_0x3c13bd))return _0x3c13bd;}if(/^-?\d+\.\d+$/[_0x2bc242(0x110)](_0x28e7c0)){const _0x3c1df2=_0x50a9b7[_0x2bc242(0x115)](Number,_0x28e7c0);if(!Number[_0x2bc242(0xf6)](_0x3c1df2))return _0x3c1df2;}const _0x33e37c=_0x28e7c0['trim']();if(_0x33e37c['startsWith']('{')&&_0x33e37c['endsWith']('}')||_0x33e37c['startsWith']('[')&&_0x33e37c[_0x2bc242(0x119)](']'))try{return JSON[_0x2bc242(0xf7)](_0x33e37c);}catch{}return _0x28e7c0;}async function resolveProfileTarget(_0x1773ad){const _0x161601=_0x620c5,_0x19ee9c={'uZGLK':function(_0x24461b,_0x262b24){return _0x24461b(_0x262b24);}},_0x598649=_0x19ee9c[_0x161601(0x104)](existsSync,getEnvDir(_0x1773ad));let _0x5b3822=![];try{const _0x4e4223=await fetchCloudProfile(_0x1773ad);_0x5b3822=Boolean(_0x4e4223);}catch{}if(_0x5b3822)return{'kind':'cloud','alsoExistsElsewhere':_0x598649};if(_0x598649)return{'kind':'local','alsoExistsElsewhere':![]};throw new Error(_0x161601(0x121)+_0x1773ad+_0x161601(0x12a)+_0x1773ad);}function printDualExistsHint(_0x3e795e){const _0x264500=_0x620c5;console[_0x264500(0x111)]('\x20\x20Note:\x20\x22'+_0x3e795e+_0x264500(0xfb));}function getProjectPath(){const _0x4f57e2=_0x620c5;return process[_0x4f57e2(0x116)]();}async function loadEffectiveCloudSettings(_0x2343b7){const _0x316fc7=_0x620c5,_0x4dad9e={'dbOuU':function(_0x1cba8b,_0xadce7b,_0x1301c7){return _0x1cba8b(_0xadce7b,_0x1301c7);},'iTpeB':function(_0x2ea835){return _0x2ea835();}},_0xa57349=await fetchCloudProfile(_0x2343b7),_0x1c326f=_0x4dad9e[_0x316fc7(0xf3)](readProfileOverrides,_0x4dad9e['iTpeB'](getProjectPath),_0x2343b7);return _0x4dad9e[_0x316fc7(0xf3)](mergeCloudProfileSettings,_0xa57349?.['settings']??{},_0x1c326f??undefined);}export async function configSet(_0x56de46,_0x7cc54a,_0x4b2697){const _0x557a38=_0x620c5,_0x443d25={'QeZdS':function(_0x1962b4,_0x168b86){return _0x1962b4(_0x168b86);},'abNKQ':function(_0x171e45,_0x1a2ff4){return _0x171e45(_0x1a2ff4);},'dKlui':function(_0x240e93,_0x59aaa0){return _0x240e93(_0x59aaa0);},'CULbL':function(_0x5d1e6f){return _0x5d1e6f();},'WNLno':function(_0x2ecdb5,_0x25fb7,_0x5788a8,_0x2859e4,_0x2801f4){return _0x2ecdb5(_0x25fb7,_0x5788a8,_0x2859e4,_0x2801f4);},'KCkoA':function(_0x2119b7){return _0x2119b7();}},_0x37c660=await _0x443d25[_0x557a38(0x112)](resolveProfileTarget,_0x56de46);if(_0x37c660[_0x557a38(0xfc)]===_0x557a38(0x120)){if(_0x37c660[_0x557a38(0xf5)])_0x443d25['abNKQ'](printDualExistsHint,_0x56de46);const _0xce3f9b=_0x443d25['dKlui'](parseOverrideValue,_0x4b2697);setProfileOverride(_0x443d25['CULbL'](getProjectPath),_0x56de46,_0x7cc54a,_0xce3f9b),console[_0x557a38(0x111)]('Set\x20'+_0x7cc54a+_0x557a38(0x10e)+JSON['stringify'](_0xce3f9b)+'\x20for\x20\x22'+_0x56de46+'\x22');return;}const _0x49f1ed=parseLocalValue(_0x7cc54a,_0x4b2697);_0x443d25['WNLno'](setProfileOverride,_0x443d25[_0x557a38(0x101)](getProjectPath),_0x56de46,_0x7cc54a,_0x49f1ed),console['log']('Set\x20'+_0x7cc54a+'\x20=\x20'+_0x49f1ed+_0x557a38(0x129)+_0x56de46+'\x22');}export async function configGet(_0xb90a67,_0x30bebe){const _0xb791eb=_0x620c5,_0x436d62={'IlOxq':function(_0x5eea77,_0x40f3e1){return _0x5eea77===_0x40f3e1;},'XZFTE':function(_0x2d4789,_0x3de57a){return _0x2d4789(_0x3de57a);},'dRWGh':function(_0x2965a2,_0x2519bd,_0x40f9ef){return _0x2965a2(_0x2519bd,_0x40f9ef);},'nmIKx':function(_0x3366c1,_0x4db041){return _0x3366c1===_0x4db041;},'jBveF':_0xb791eb(0xf9),'PnwiL':function(_0x547baf,_0x4f1685){return _0x547baf===_0x4f1685;},'gidpY':function(_0x3d9e0f,_0x15505c){return _0x3d9e0f===_0x15505c;}},_0x8b7934=await resolveProfileTarget(_0xb90a67);if(_0x436d62['IlOxq'](_0x8b7934['kind'],'cloud')){const _0x5ce9bf=await _0x436d62[_0xb791eb(0xf4)](loadEffectiveCloudSettings,_0xb90a67),_0x512eb6=_0x436d62[_0xb791eb(0x11f)](getNestedValue,_0x5ce9bf,_0x30bebe);if(_0x512eb6===undefined)console['log'](_0xb791eb(0x114));else _0x436d62[_0xb791eb(0x125)](typeof _0x512eb6,_0x436d62['jBveF'])?console['log'](JSON['stringify'](_0x512eb6,null,0x2)):console[_0xb791eb(0x111)](_0x512eb6);return;}const _0x36aba3=await loadSettings(_0xb90a67),_0x3a3ea7=_0x436d62['dRWGh'](getNestedValue,_0x36aba3,_0x30bebe);if(_0x436d62[_0xb791eb(0x107)](_0x3a3ea7,undefined))console['log']('(not\x20set)');else _0x436d62[_0xb791eb(0x117)](typeof _0x3a3ea7,'object')?console[_0xb791eb(0x111)](JSON['stringify'](_0x3a3ea7,null,0x2)):console[_0xb791eb(0x111)](_0x3a3ea7);}export async function configList(_0x549386){const _0x4abeca=_0x620c5,_0x8e7813={'ddMPI':function(_0x5aafcc,_0x3d4fcf){return _0x5aafcc(_0x3d4fcf);},'WDrKt':function(_0x175d83,_0x105953){return _0x175d83(_0x105953);},'HHyHP':function(_0xc6dac9,_0x841488){return _0xc6dac9(_0x841488);}},_0x85beef=await resolveProfileTarget(_0x549386);if(_0x85beef['kind']==='cloud'){const _0x28df39=await _0x8e7813[_0x4abeca(0x109)](loadEffectiveCloudSettings,_0x549386);if(!_0x28df39||Object[_0x4abeca(0x108)](_0x28df39)['length']===0x0){console['log'](_0x4abeca(0x10f)+_0x549386+'\x22');return;}console['log'](JSON['stringify'](_0x28df39,null,0x2));return;}const _0x528550=_0x8e7813[_0x4abeca(0x11b)](getSettingsPath,_0x549386);if(!_0x8e7813['WDrKt'](existsSync,_0x528550)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x549386+'\x22');return;}const _0x1337db=await _0x8e7813[_0x4abeca(0x11d)](loadSettings,_0x549386),_0x55f86f=formatSettings(_0x1337db);!_0x55f86f?console[_0x4abeca(0x111)](_0x4abeca(0x10f)+_0x549386+'\x22'):console[_0x4abeca(0x111)](_0x55f86f);}export async function configUnset(_0xbe02a4,_0x45801b){const _0x29c499=_0x620c5,_0x1c5f5c={'LcoAE':'cloud','tYfdY':function(_0x1e3675,_0x175076){return _0x1e3675(_0x175076);},'uaAnR':function(_0x1fd39f,_0x372806,_0xff52ba,_0x235ab8){return _0x1fd39f(_0x372806,_0xff52ba,_0x235ab8);},'akHGi':function(_0x52b782){return _0x52b782();},'dFUhV':function(_0x386221,_0x26b9c3,_0x336a98,_0x26ad89){return _0x386221(_0x26b9c3,_0x336a98,_0x26ad89);},'vEYRE':function(_0x3eea51,_0x24282f){return _0x3eea51(_0x24282f);}},_0x1c5732=await resolveProfileTarget(_0xbe02a4);if(_0x1c5732['kind']===_0x1c5f5c[_0x29c499(0x123)]){if(_0x1c5732['alsoExistsElsewhere'])_0x1c5f5c['tYfdY'](printDualExistsHint,_0xbe02a4);const _0x4b7f6a=_0x1c5f5c[_0x29c499(0xf8)](unsetProfileOverride,_0x1c5f5c['akHGi'](getProjectPath),_0xbe02a4,_0x45801b);_0x4b7f6a?console[_0x29c499(0x111)]('Removed\x20'+_0x45801b+'\x20for\x20\x22'+_0xbe02a4+'\x22'):console['log']('Key\x20\x22'+_0x45801b+_0x29c499(0x103));return;}const _0x208edd=_0x1c5f5c['dFUhV'](unsetProfileOverride,getProjectPath(),_0xbe02a4,_0x45801b);if(_0x208edd){console[_0x29c499(0x111)]('Removed\x20'+_0x45801b);return;}const _0x265f07=await _0x1c5f5c[_0x29c499(0xff)](loadSettings,_0xbe02a4),_0x4a185d=deleteNestedValue(_0x265f07,_0x45801b);_0x4a185d?console['log'](_0x29c499(0x100)+_0x45801b+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0xbe02a4+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console[_0x29c499(0x111)]('Key\x20\x22'+_0x45801b+'\x22\x20not\x20found');}export async function configReset(_0x59519a){const _0x3c1e=_0x620c5,_0x40b99f={'fUZld':function(_0x3471fc,_0x2b919d){return _0x3471fc(_0x2b919d);},'yVNOY':function(_0x284f6f,_0x416a1c){return _0x284f6f===_0x416a1c;}},_0x4d8c88=await _0x40b99f['fUZld'](resolveProfileTarget,_0x59519a);if(_0x40b99f[_0x3c1e(0x127)](_0x4d8c88['kind'],'cloud')){resetProfileOverrides(getProjectPath(),_0x59519a),console['log']('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x59519a+'\x22');return;}console[_0x3c1e(0x111)]('\x22'+_0x59519a+_0x3c1e(0x11c)+_0x59519a+_0x3c1e(0x122));}
|
|
1
|
+
const _0x1a80b5=_0x29ed;(function(_0x15a35f,_0x4bd1b6){const _0x4f888b=_0x29ed,_0x558338=_0x15a35f();while(!![]){try{const _0x371142=-parseInt(_0x4f888b(0x14e))/0x1+parseInt(_0x4f888b(0x145))/0x2*(-parseInt(_0x4f888b(0x14c))/0x3)+-parseInt(_0x4f888b(0x149))/0x4*(parseInt(_0x4f888b(0x15f))/0x5)+-parseInt(_0x4f888b(0x166))/0x6*(-parseInt(_0x4f888b(0x16d))/0x7)+-parseInt(_0x4f888b(0x16b))/0x8*(-parseInt(_0x4f888b(0x174))/0x9)+parseInt(_0x4f888b(0x147))/0xa+-parseInt(_0x4f888b(0x169))/0xb*(-parseInt(_0x4f888b(0x175))/0xc);if(_0x371142===_0x4bd1b6)break;else _0x558338['push'](_0x558338['shift']());}catch(_0x332f3a){_0x558338['push'](_0x558338['shift']());}}}(_0x23a3,0xcda8b));import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';function _0x23a3(){const _0x175771=['\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22','NaWST','XmfqT','114154XBfTiF','sOaaH','10577580fYkfsc','length','18988LFLRNY','\x20\x20Note:\x20\x22','No\x20configuration\x20set\x20for\x20\x22','39cUlDDu','HgUUi','1126594INKsxs','\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.','uCKyV','rtetH','true','\x20=\x20','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','Key\x20\x22','zNbUO','XEcJR','dmWHr','cloud','startsWith','stringify','nRgPQ','Profile\x20\x22','(not\x20set)','395bTFsYb','WImyz','\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20','keys','object','\x20for\x20\x22','allowInsecureLocalhost','258882HjyGEG','kind','Removed\x20','4466wFUOVK','WGbgU','8WQQgcx','\x22\x20not\x20found','196ukNauL','test','ZrXrD','log','cnchP','PiJtx','includes','5459013GqAHhF','6312hNJGso','undefined','alsoExistsElsewhere','uQBjL','DCOnG','RIpvH'];_0x23a3=function(){return _0x175771;};return _0x23a3();}import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=['headless',_0x1a80b5(0x165),'forceLogin'];function parseLocalValue(_0x17bc0c,_0x284be3){const _0x1030fb=_0x1a80b5,_0x564b42={'RIpvH':_0x1030fb(0x152),'NDSkA':function(_0x1ba550,_0x27c9b5){return _0x1ba550===_0x27c9b5;},'YXjkN':'false'};if(BOOLEAN_KEYS[_0x1030fb(0x173)](_0x17bc0c)){if(_0x284be3===_0x564b42[_0x1030fb(0x141)])return!![];if(_0x564b42['NDSkA'](_0x284be3,_0x564b42['YXjkN']))return![];throw new Error('Invalid\x20value\x20for\x20'+_0x17bc0c+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x284be3;}function parseOverrideValue(_0x123d48){const _0x366cab=_0x1a80b5,_0xc85c8e={'sOZEt':function(_0x339c94,_0x58f01a){return _0x339c94===_0x58f01a;},'cnchP':'true','AKfNs':'null','NaWST':function(_0xd1cc25,_0xe43ceb){return _0xd1cc25===_0xe43ceb;},'ZrXrD':function(_0x16e7f5,_0x507c1b){return _0x16e7f5(_0x507c1b);}};if(_0xc85c8e['sOZEt'](_0x123d48,_0xc85c8e[_0x366cab(0x171)]))return!![];if(_0xc85c8e['sOZEt'](_0x123d48,'false'))return![];if(_0x123d48===_0xc85c8e['AKfNs'])return null;if(_0xc85c8e[_0x366cab(0x143)](_0x123d48,_0x366cab(0x176)))return undefined;if(/^-?\d+$/['test'](_0x123d48)){const _0x3afadb=Number(_0x123d48);if(Number['isSafeInteger'](_0x3afadb))return _0x3afadb;}if(/^-?\d+\.\d+$/[_0x366cab(0x16e)](_0x123d48)){const _0x16eb22=_0xc85c8e[_0x366cab(0x16f)](Number,_0x123d48);if(!Number['isNaN'](_0x16eb22))return _0x16eb22;}const _0x13af62=_0x123d48['trim']();if(_0x13af62[_0x366cab(0x15a)]('{')&&_0x13af62['endsWith']('}')||_0x13af62['startsWith']('[')&&_0x13af62['endsWith'](']'))try{return JSON['parse'](_0x13af62);}catch{}return _0x123d48;}async function resolveProfileTarget(_0x2f695e){const _0x52cf61=_0x1a80b5,_0x5628e8={'ZJumx':function(_0x42981d,_0x45ab52){return _0x42981d(_0x45ab52);},'WGbgU':function(_0x155ed0,_0x240e4e){return _0x155ed0(_0x240e4e);},'nRgPQ':'local'},_0x3e2526=_0x5628e8['ZJumx'](existsSync,_0x5628e8[_0x52cf61(0x16a)](getEnvDir,_0x2f695e));let _0xda73aa=![];try{const _0x4dcd83=await fetchCloudProfile(_0x2f695e);_0xda73aa=Boolean(_0x4dcd83);}catch{}if(_0xda73aa)return{'kind':_0x52cf61(0x159),'alsoExistsElsewhere':_0x3e2526};if(_0x3e2526)return{'kind':_0x5628e8[_0x52cf61(0x15c)],'alsoExistsElsewhere':![]};throw new Error(_0x52cf61(0x15d)+_0x2f695e+_0x52cf61(0x161)+_0x2f695e);}function printDualExistsHint(_0x265ee2){const _0x16dd65=_0x1a80b5;console[_0x16dd65(0x170)](_0x16dd65(0x14a)+_0x265ee2+_0x16dd65(0x154));}function _0x29ed(_0x383607,_0x5eb460){_0x383607=_0x383607-0x141;const _0x23a356=_0x23a3();let _0x29ed5a=_0x23a356[_0x383607];return _0x29ed5a;}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x51c81d){const _0x46cee1={'Kvbiz':function(_0x7b031e,_0x408610){return _0x7b031e(_0x408610);}},_0x2e2740=await _0x46cee1['Kvbiz'](fetchCloudProfile,_0x51c81d),_0x398aeb=readProfileOverrides(getProjectPath(),_0x51c81d);return mergeCloudProfileSettings(_0x2e2740?.['settings']??{},_0x398aeb??undefined);}export async function configSet(_0x1ba713,_0x260bef,_0x112220){const _0x5aeeb0=_0x1a80b5,_0x1b8a1c={'PiJtx':'cloud','KTqYb':function(_0x10cd55,_0x1483cd,_0x35c0ae,_0x22e62c,_0x2ed0e6){return _0x10cd55(_0x1483cd,_0x35c0ae,_0x22e62c,_0x2ed0e6);},'uQBjL':function(_0x44decf){return _0x44decf();}},_0xdd647f=await resolveProfileTarget(_0x1ba713);if(_0xdd647f['kind']===_0x1b8a1c[_0x5aeeb0(0x172)]){if(_0xdd647f[_0x5aeeb0(0x177)])printDualExistsHint(_0x1ba713);const _0x575eef=parseOverrideValue(_0x112220);setProfileOverride(getProjectPath(),_0x1ba713,_0x260bef,_0x575eef),console['log']('Set\x20'+_0x260bef+_0x5aeeb0(0x153)+JSON[_0x5aeeb0(0x15b)](_0x575eef)+'\x20for\x20\x22'+_0x1ba713+'\x22');return;}const _0x230809=parseLocalValue(_0x260bef,_0x112220);_0x1b8a1c['KTqYb'](setProfileOverride,_0x1b8a1c[_0x5aeeb0(0x178)](getProjectPath),_0x1ba713,_0x260bef,_0x230809),console['log']('Set\x20'+_0x260bef+_0x5aeeb0(0x153)+_0x230809+_0x5aeeb0(0x164)+_0x1ba713+'\x22');}export async function configGet(_0x12eaef,_0x2b22b9){const _0x3d35c6=_0x1a80b5,_0x3ecc8b={'HgUUi':function(_0x910962,_0x4768f9){return _0x910962===_0x4768f9;},'XmfqT':function(_0x3dcaae,_0x30d8d3){return _0x3dcaae(_0x30d8d3);},'sOaaH':function(_0x4382a9,_0xc2058,_0x33bf2d){return _0x4382a9(_0xc2058,_0x33bf2d);},'dmWHr':function(_0x35a4cc,_0x327b3c){return _0x35a4cc===_0x327b3c;}},_0x339b84=await resolveProfileTarget(_0x12eaef);if(_0x3ecc8b[_0x3d35c6(0x14d)](_0x339b84['kind'],'cloud')){const _0x3129a7=await _0x3ecc8b[_0x3d35c6(0x144)](loadEffectiveCloudSettings,_0x12eaef),_0x4b6ab9=getNestedValue(_0x3129a7,_0x2b22b9);if(_0x4b6ab9===undefined)console['log'](_0x3d35c6(0x15e));else typeof _0x4b6ab9===_0x3d35c6(0x163)?console['log'](JSON['stringify'](_0x4b6ab9,null,0x2)):console[_0x3d35c6(0x170)](_0x4b6ab9);return;}const _0x270965=await _0x3ecc8b[_0x3d35c6(0x144)](loadSettings,_0x12eaef),_0x1e62b2=_0x3ecc8b[_0x3d35c6(0x146)](getNestedValue,_0x270965,_0x2b22b9);if(_0x3ecc8b['HgUUi'](_0x1e62b2,undefined))console[_0x3d35c6(0x170)](_0x3d35c6(0x15e));else _0x3ecc8b[_0x3d35c6(0x158)](typeof _0x1e62b2,'object')?console['log'](JSON['stringify'](_0x1e62b2,null,0x2)):console[_0x3d35c6(0x170)](_0x1e62b2);}export async function configList(_0x530bb1){const _0x4d2756=_0x1a80b5,_0x41f8e9={'TcNnJ':function(_0x4f3b37,_0x152b28){return _0x4f3b37===_0x152b28;},'qzCLg':_0x4d2756(0x159),'WImyz':function(_0x347d09,_0x8c6e9c){return _0x347d09(_0x8c6e9c);},'DCOnG':function(_0x1c887f,_0x47bf4c){return _0x1c887f(_0x47bf4c);},'NCTdA':function(_0x5f2772,_0x3259dc){return _0x5f2772(_0x3259dc);}},_0x38cc7a=await resolveProfileTarget(_0x530bb1);if(_0x41f8e9['TcNnJ'](_0x38cc7a[_0x4d2756(0x167)],_0x41f8e9['qzCLg'])){const _0x3194a0=await loadEffectiveCloudSettings(_0x530bb1);if(!_0x3194a0||Object[_0x4d2756(0x162)](_0x3194a0)[_0x4d2756(0x148)]===0x0){console[_0x4d2756(0x170)]('No\x20configuration\x20set\x20for\x20\x22'+_0x530bb1+'\x22');return;}console['log'](JSON[_0x4d2756(0x15b)](_0x3194a0,null,0x2));return;}const _0x34cb08=_0x41f8e9[_0x4d2756(0x160)](getSettingsPath,_0x530bb1);if(!_0x41f8e9[_0x4d2756(0x179)](existsSync,_0x34cb08)){console['log'](_0x4d2756(0x14b)+_0x530bb1+'\x22');return;}const _0x51fb9b=await _0x41f8e9['NCTdA'](loadSettings,_0x530bb1),_0x26fc1c=_0x41f8e9['DCOnG'](formatSettings,_0x51fb9b);!_0x26fc1c?console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x530bb1+'\x22'):console[_0x4d2756(0x170)](_0x26fc1c);}export async function configUnset(_0x59edbd,_0x1a2d2f){const _0x57a503=_0x1a80b5,_0x574e5a={'IpQEt':function(_0x2cd205,_0x4ac3eb){return _0x2cd205(_0x4ac3eb);},'iIjco':function(_0x1bb46c,_0x476351){return _0x1bb46c===_0x476351;},'XEcJR':_0x57a503(0x159),'uCKyV':function(_0x3c6efd,_0x56b137){return _0x3c6efd(_0x56b137);},'FOPqn':function(_0x4e0e38,_0x2d6b81,_0x403182,_0x4d9137){return _0x4e0e38(_0x2d6b81,_0x403182,_0x4d9137);},'rtetH':function(_0x10ce9b){return _0x10ce9b();}},_0x563466=await _0x574e5a['IpQEt'](resolveProfileTarget,_0x59edbd);if(_0x574e5a['iIjco'](_0x563466['kind'],_0x574e5a[_0x57a503(0x157)])){if(_0x563466[_0x57a503(0x177)])_0x574e5a[_0x57a503(0x150)](printDualExistsHint,_0x59edbd);const _0x5b1a61=_0x574e5a['FOPqn'](unsetProfileOverride,_0x574e5a[_0x57a503(0x151)](getProjectPath),_0x59edbd,_0x1a2d2f);_0x5b1a61?console['log'](_0x57a503(0x168)+_0x1a2d2f+'\x20for\x20\x22'+_0x59edbd+'\x22'):console['log'](_0x57a503(0x155)+_0x1a2d2f+_0x57a503(0x16c));return;}const _0x5b8cc7=unsetProfileOverride(getProjectPath(),_0x59edbd,_0x1a2d2f);if(_0x5b8cc7){console['log'](_0x57a503(0x168)+_0x1a2d2f);return;}const _0x3bb738=await loadSettings(_0x59edbd),_0x780f00=deleteNestedValue(_0x3bb738,_0x1a2d2f);_0x780f00?console[_0x57a503(0x170)]('Key\x20\x22'+_0x1a2d2f+_0x57a503(0x142)+_0x59edbd+_0x57a503(0x14f)):console['log'](_0x57a503(0x155)+_0x1a2d2f+_0x57a503(0x16c));}export async function configReset(_0x64a77b){const _0x2dfef4=_0x1a80b5,_0x33e8d6={'zNbUO':function(_0x26ac6e,_0x32fe99){return _0x26ac6e===_0x32fe99;},'aqtGF':function(_0xe47267){return _0xe47267();}},_0x47fd81=await resolveProfileTarget(_0x64a77b);if(_0x33e8d6[_0x2dfef4(0x156)](_0x47fd81[_0x2dfef4(0x167)],'cloud')){resetProfileOverrides(_0x33e8d6['aqtGF'](getProjectPath),_0x64a77b),console[_0x2dfef4(0x170)]('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x64a77b+'\x22');return;}console['log']('\x22'+_0x64a77b+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x64a77b+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x508b17,_0x347e20){const _0x51a477=_0x3b95,_0x24d35c=_0x508b17();while(!![]){try{const _0x3546d7=-parseInt(_0x51a477(0x157))/0x1*(-parseInt(_0x51a477(0x165))/0x2)+-parseInt(_0x51a477(0x15c))/0x3*(-parseInt(_0x51a477(0x159))/0x4)+parseInt(_0x51a477(0x164))/0x5+parseInt(_0x51a477(0x15f))/0x6+-parseInt(_0x51a477(0x155))/0x7+-parseInt(_0x51a477(0x15b))/0x8+-parseInt(_0x51a477(0x163))/0x9;if(_0x3546d7===_0x347e20)break;else _0x24d35c['push'](_0x24d35c['shift']());}catch(_0x478f38){_0x24d35c['push'](_0x24d35c['shift']());}}}(_0x5d72,0x4a996));function _0x3b95(_0x49e7df,_0x210af7){_0x49e7df=_0x49e7df-0x154;const _0x5d72c3=_0x5d72();let _0x3b95d2=_0x5d72c3[_0x49e7df];return _0x3b95d2;}import _0x122f1e from'inquirer';function _0x5d72(){const _0x1b14e2=['SXAGW','7297245BXfOVD','1307440kCnkzE','4NePdhX','yes','MQUwL','\x22\x20to\x20confirm\x20deletion:','log','729743EyITcC','Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.','213013IYXWuq','prompt','12dfGYhn','\x22\x20for\x20everyone\x20in\x20your\x20organization.','2183896WfDpzj','441930zYfjrL','cwd','FhdTl','2184930oHTByh','\x22\x20not\x20found.','Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.'];_0x5d72=function(){return _0x1b14e2;};return _0x5d72();}import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';export async function deleteProfile(_0x3e1f7d,_0x34dbf4={}){const _0x4d34d6=_0x3b95,_0x330212={'SXAGW':'input','YmxGC':_0x4d34d6(0x161),'FhdTl':function(_0x3d4a7e,_0x2b64df){return _0x3d4a7e(_0x2b64df);},'MQUwL':function(_0x261d4c,_0x98b481,_0x122bc9){return _0x261d4c(_0x98b481,_0x122bc9);}},_0x33ccd2=await fetchCloudProfile(_0x3e1f7d);if(!_0x33ccd2)throw new Error('Cloud\x20profile\x20\x22'+_0x3e1f7d+_0x4d34d6(0x160));if(!_0x34dbf4[_0x4d34d6(0x166)]&&!isInteractive())throw new Error(_0x4d34d6(0x156));console[_0x4d34d6(0x154)]('\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22'+_0x3e1f7d+_0x4d34d6(0x15a));if(!_0x34dbf4[_0x4d34d6(0x166)]){const {confirmation:_0x2f18f6}=await _0x122f1e[_0x4d34d6(0x158)]([{'type':_0x330212[_0x4d34d6(0x162)],'name':'confirmation','message':'Type\x20\x22'+_0x3e1f7d+_0x4d34d6(0x168)}]);if(_0x2f18f6!==_0x3e1f7d)throw new Error(_0x330212['YmxGC']);}await _0x330212[_0x4d34d6(0x15e)](deleteCloudProfile,_0x3e1f7d),resetProfileOverrides(process[_0x4d34d6(0x15d)](),_0x3e1f7d),_0x330212[_0x4d34d6(0x167)](clearLastProfile,process[_0x4d34d6(0x15d)](),_0x3e1f7d),console[_0x4d34d6(0x154)]('✓\x20Deleted\x20cloud\x20profile\x20\x22'+_0x3e1f7d+'\x22.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x146f45,_0xc47d9){const _0xce5b56=_0xe91e,_0x47bd32=_0x146f45();while(!![]){try{const _0x20b4d0=-parseInt(_0xce5b56(0xa5))/0x1+parseInt(_0xce5b56(0x7b))/0x2*(parseInt(_0xce5b56(0x81))/0x3)+parseInt(_0xce5b56(0x9e))/0x4+parseInt(_0xce5b56(0x9a))/0x5+-parseInt(_0xce5b56(0x76))/0x6*(parseInt(_0xce5b56(0x89))/0x7)+parseInt(_0xce5b56(0x91))/0x8*(-parseInt(_0xce5b56(0x80))/0x9)+parseInt(_0xce5b56(0x92))/0xa;if(_0x20b4d0===_0xc47d9)break;else _0x47bd32['push'](_0x47bd32['shift']());}catch(_0x1a4ab9){_0x47bd32['push'](_0x47bd32['shift']());}}}(_0x4475,0x536d0));function _0xe91e(_0x54f83a,_0x2e2cd3){_0x54f83a=_0x54f83a-0x75;const _0x447582=_0x4475();let _0xe91ea5=_0x447582[_0x54f83a];return _0xe91ea5;}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{fetchAuthConfig,fetchCloudProfile,listCloudProfiles}from'./utils/cloudProfile.js';import{resolveAuthEnvironmentLocally}from'./utils/cloudProfileSession.js';import{readProfileOverrides}from'./utils/projectsConfig.js';import{resolveProfileUrl}from'./utils/resolveProfileUrl.js';import{resolveEnvVars}from'./utils/settings.js';const NON_ENV_DIRS=['sessions','bug-bashes','reports','local','ci'];export function shouldGroupByEnvironment(_0xf1d224){return _0xf1d224['some'](_0x4fcf47=>_0x4fcf47['environmentKey']);}export function groupCloudProfilesByEnvironment(_0x8c1180){const _0x5160b7=_0xe91e,_0x1f2307=new Map();for(const _0x5f6e19 of _0x8c1180){const _0x51bd36=_0x5f6e19[_0x5160b7(0x7c)]??null,_0x4c4ab3=_0x1f2307['get'](_0x51bd36);if(_0x4c4ab3)_0x4c4ab3[_0x5160b7(0x88)](_0x5f6e19);else _0x1f2307[_0x5160b7(0x8c)](_0x51bd36,[_0x5f6e19]);}const _0x221b09=[..._0x1f2307['keys']()][_0x5160b7(0xae)]((_0xf591e5,_0x417efe)=>{const _0x3efa18=_0x5160b7;if(_0xf591e5===null)return 0x1;if(_0x417efe===null)return-0x1;return _0xf591e5[_0x3efa18(0x75)](_0x417efe);});return _0x221b09['map'](_0x5e0b44=>({'environmentKey':_0x5e0b44,'profiles':_0x1f2307['get'](_0x5e0b44)[_0x5160b7(0xae)]((_0x4296cd,_0x1e6cd3)=>_0x4296cd[_0x5160b7(0x78)]['localeCompare'](_0x1e6cd3['name']))}));}function expandString(_0x440486){const _0x2d0ea5=_0xe91e,_0x537823={'iKuER':function(_0x5bc827,_0x460637){return _0x5bc827(_0x460637);}};if(!_0x440486)return undefined;return _0x537823[_0x2d0ea5(0x83)](resolveEnvVars,_0x440486);}function _0x4475(){const _0x2b8ab7=['\x20\x20\x20\x20','projectOverrides','no\x20session','includes','kdrEy','sort','isDirectory','hTpKj','\x20\x20\x20\x20URL:\x20','\x20\x20\x20\x20\x20\x20URL:\x20','environmentDetails','localeCompare','48JEXdjU','Run:\x20ranger\x20profile\x20add\x20<profile-name>','name','TvYss','\x22:\x20','22yhdMpt','environmentKey','ecZSA','SvBkZ','hNhhn','259317shXGFB','29481BhXRud','has','iKuER','juSim','map','baseUrl','ETamS','push','538370iJGxWN','LRuZe','neXrX','set','error','cached\x20(updated\x20','sessionUpdatedAt','rjDgv','112DCejFt','15648680fveMOD','cwd','UplxV','ocQjn','huEOc','\x0aCloud\x20Profiles:','UQSBC','\x0aCloud\x20Profiles\x20(by\x20environment):','992240XGJUIH','legacy','\x0aNo\x20profiles\x20found.','message','435308QocUFg','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20','BTNtW','AwcyV','log','uusDI','JUoal','619866YLBboG','nChxw','length','ydcEG'];_0x4475=function(){return _0x2b8ab7;};return _0x4475();}function expandProfileOverrides(_0x2337c9){const _0x57bcff=_0xe91e,_0x2364f8={'hTpKj':function(_0x15353f,_0x323cc5){return _0x15353f(_0x323cc5);}};if(!_0x2337c9)return null;return{..._0x2337c9,'baseUrl':expandString(_0x2337c9['baseUrl']),'startPath':_0x2364f8[_0x57bcff(0xb0)](expandString,_0x2337c9['startPath'])};}export function resolveCloudProfileListUrl(_0x285696,_0x23f97f={}){const _0x27ce41=_0xe91e,_0xbd20d9={'nChxw':function(_0x4a914b,_0x1dbff1,_0x1bf971){return _0x4a914b(_0x1dbff1,_0x1bf971);},'mOVxV':function(_0x267b47,_0x9c92b0){return _0x267b47(_0x9c92b0);},'gwKib':function(_0x38b17a,_0x76254a){return _0x38b17a(_0x76254a);}},_0x14c312=_0x285696['settings']??{},_0x4dc8ae=_0x23f97f['authConfig']?_0xbd20d9[_0x27ce41(0xa6)](resolveAuthEnvironmentLocally,_0x23f97f['authConfig'],_0x285696['environmentKey']):null,_0x1b51c7=_0xbd20d9['mOVxV'](resolveProfileUrl,{'projectOverrides':expandProfileOverrides(_0x23f97f[_0x27ce41(0xaa)]??null),'cloudSettings':{'baseUrl':expandString(_0x14c312[_0x27ce41(0x86)]),'startPath':_0xbd20d9['gwKib'](expandString,_0x14c312['startPath'])},'authEnvironmentDomain':_0x4dc8ae?.['domains']?.[0x0]});return{'baseUrl':_0x1b51c7[_0x27ce41(0x86)],'source':_0x1b51c7['baseUrlSource']};}async function loadCloudProfileListUrls(_0x540da9){const _0x2757f9=_0xe91e,_0xd4ab84={'UplxV':function(_0x290ffa,_0x10e03b){return _0x290ffa instanceof _0x10e03b;},'BTNtW':function(_0x18f604,_0x1e24dc){return _0x18f604(_0x1e24dc);},'SvBkZ':function(_0x59e8b8,_0x292bba){return _0x59e8b8===_0x292bba;}},_0x5cef1e=new Map();if(_0xd4ab84[_0x2757f9(0x7e)](_0x540da9['length'],0x0))return _0x5cef1e;const _0x784f38=await fetchAuthConfig();return await Promise['all'](_0x540da9[_0x2757f9(0x85)](async _0x3ddbd9=>{const _0x2344e0=_0x2757f9;try{const _0x42440d=await fetchCloudProfile(_0x3ddbd9[_0x2344e0(0x78)]);if(!_0x42440d)return;_0x5cef1e['set'](_0x3ddbd9['name'],resolveCloudProfileListUrl(_0x42440d,{'authConfig':_0x784f38,'projectOverrides':readProfileOverrides(process['cwd'](),_0x3ddbd9['name'])}));}catch(_0x279041){console[_0x2344e0(0x8d)]('\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profile\x20\x22'+_0x3ddbd9[_0x2344e0(0x78)]+_0x2344e0(0x7a)+(_0xd4ab84[_0x2344e0(0x94)](_0x279041,Error)?_0x279041['message']:_0xd4ab84[_0x2344e0(0xa0)](String,_0x279041)));}})),_0x5cef1e;}export async function getEnvNames(){const _0x2faed5=_0xe91e,_0x2665eb={'vSjsC':function(_0x353748,_0x28bf1a){return _0x353748(_0x28bf1a);},'juSim':function(_0x127eb2,_0x31aec5){return _0x127eb2(_0x31aec5);},'AwcyV':'local','VPnwg':function(_0xc5a361,_0x2184ac){return _0xc5a361(_0x2184ac);},'TvYss':function(_0x438e2b,_0x2bcd45,_0x27082c){return _0x438e2b(_0x2bcd45,_0x27082c);},'TIRAI':function(_0x103789,_0x30eb75){return _0x103789(_0x30eb75);},'GexCK':'.txt','HkArT':function(_0x1a83d5,_0x36779b,_0x252f0a){return _0x1a83d5(_0x36779b,_0x252f0a);},'ocQjn':function(_0x482da5,_0x569257){return _0x482da5(_0x569257);},'rjDgv':'legacy'},_0x4e3298=getRangerDir();if(!_0x2665eb['vSjsC'](existsSync,_0x4e3298))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x4eff68=await readActiveProfileName(),_0x156109=[],_0x1cc691={},_0x53719b=join(_0x4e3298,'local');if(existsSync(_0x53719b)){const _0x428337=await readdir(_0x53719b);for(const _0xe42057 of _0x428337){const _0x19cfa4=join(_0x53719b,_0xe42057),_0xac64b9=await _0x2665eb[_0x2faed5(0x84)](stat,_0x19cfa4);_0xac64b9['isDirectory']()&&(_0x156109['push'](_0xe42057),_0x1cc691[_0xe42057]=_0x2665eb[_0x2faed5(0xa1)]);}}const _0x3d0bfa=join(_0x4e3298,'ci');if(existsSync(_0x3d0bfa)){const _0x1248b1=await _0x2665eb['VPnwg'](readdir,_0x3d0bfa);for(const _0x28b953 of _0x1248b1){const _0x5af09d=_0x2665eb[_0x2faed5(0x79)](join,_0x3d0bfa,_0x28b953),_0x402049=await _0x2665eb['TIRAI'](stat,_0x5af09d);_0x402049[_0x2faed5(0xaf)]()&&(_0x156109[_0x2faed5(0x88)](_0x28b953),_0x1cc691[_0x28b953]='ci');}}const _0x1695ac=await _0x2665eb['VPnwg'](readdir,_0x4e3298);for(const _0x419e19 of _0x1695ac){if(NON_ENV_DIRS[_0x2faed5(0xac)](_0x419e19))continue;if(_0x419e19['startsWith']('.'))continue;if(_0x419e19['endsWith'](_0x2665eb['GexCK']))continue;const _0x26bd47=_0x2665eb['HkArT'](join,_0x4e3298,_0x419e19),_0x3073ae=await stat(_0x26bd47);_0x3073ae[_0x2faed5(0xaf)]()&&_0x2665eb[_0x2faed5(0x95)](existsSync,_0x2665eb[_0x2faed5(0x79)](join,_0x26bd47,'settings.json'))&&(!_0x156109['includes'](_0x419e19)&&(_0x156109[_0x2faed5(0x88)](_0x419e19),_0x1cc691[_0x419e19]=_0x2665eb[_0x2faed5(0x90)]));}return{'envNames':_0x156109,'activeEnv':_0x4eff68,'envTypes':_0x1cc691};}export async function envList(){const _0x267f45=_0xe91e,_0x22ee4d={'paqLW':function(_0x5a9ca3,_0xb925f2){return _0x5a9ca3===_0xb925f2;},'UQSBC':function(_0x419648){return _0x419648();},'LRuZe':function(_0x1f50d5){return _0x1f50d5();},'hNhhn':function(_0x2f0052){return _0x2f0052();},'neXrX':function(_0x292539,_0x27320e){return _0x292539(_0x27320e);},'KNYjS':function(_0x16c84e,_0x59a041){return _0x16c84e instanceof _0x59a041;},'ydcEG':_0x267f45(0x9c),'bVrjL':_0x267f45(0x77),'uusDI':function(_0x44b2ee,_0x2eebd4){return _0x44b2ee>_0x2eebd4;},'fQcRF':'\x0aLocal\x20Profiles\x20(legacy):','huEOc':_0x267f45(0x9b),'kdrEy':function(_0x1d340d,_0x1de9cb){return _0x1d340d(_0x1de9cb);},'ecZSA':_0x267f45(0x99),'ETamS':'(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)','cdjsz':function(_0x492c33,_0xcd0199,_0x3467d6){return _0x492c33(_0xcd0199,_0x3467d6);},'JUoal':_0x267f45(0xa9),'IxmzV':_0x267f45(0x97)},{envNames:_0x4fa202,activeEnv:_0x14bcfb,envTypes:_0x3078ff}=await _0x22ee4d[_0x267f45(0x98)](getEnvNames);let _0xa80edd=[],_0x29b69c=new Map();const _0x168ce8=await _0x22ee4d[_0x267f45(0x8a)](getToken);if(_0x168ce8)try{_0xa80edd=await _0x22ee4d[_0x267f45(0x7f)](listCloudProfiles),_0x29b69c=await _0x22ee4d[_0x267f45(0x8b)](loadCloudProfileListUrls,_0xa80edd);}catch(_0xf00617){console[_0x267f45(0x8d)](_0x267f45(0x9f)+(_0x22ee4d['KNYjS'](_0xf00617,Error)?_0xf00617[_0x267f45(0x9d)]:_0x22ee4d['neXrX'](String,_0xf00617)));}if(_0x4fa202[_0x267f45(0xa7)]===0x0&&_0x22ee4d['paqLW'](_0xa80edd[_0x267f45(0xa7)],0x0)){console['log'](_0x22ee4d[_0x267f45(0xa8)]),console['log'](_0x22ee4d['bVrjL']);return;}const _0x518060=new Set(_0xa80edd[_0x267f45(0x85)](_0x3dde8d=>_0x3dde8d[_0x267f45(0x78)]));if(_0x22ee4d[_0x267f45(0xa3)](_0x4fa202['length'],0x0)){console[_0x267f45(0xa2)](_0x22ee4d['fQcRF']);for(const _0x53512a of _0x4fa202['sort']()){const _0x166909=_0x53512a===_0x14bcfb&&!_0x518060[_0x267f45(0x82)](_0x53512a),_0x2d93cc=_0x3078ff[_0x53512a]||'local',_0x3bca55=await _0x22ee4d['neXrX'](loadSettings,_0x53512a),_0x8547b3=resolveProfileUrl({'localSettingsBaseUrl':expandString(_0x3bca55['baseUrl']),'projectOverrides':expandProfileOverrides(readProfileOverrides(process[_0x267f45(0x93)](),_0x53512a))}),_0x3c0fa3=_0x2d93cc===_0x22ee4d[_0x267f45(0x96)]?'':'\x20['+_0x2d93cc+']';console[_0x267f45(0xa2)]('\x20\x20'+(_0x166909?'*\x20':'\x20\x20')+_0x53512a+_0x3c0fa3),_0x8547b3[_0x267f45(0x86)]&&console[_0x267f45(0xa2)](_0x267f45(0xb2)+_0x8547b3[_0x267f45(0x86)]),_0x3bca55['environmentDetails']&&console['log']('\x20\x20\x20\x20\x20\x20Details:\x20'+_0x3bca55[_0x267f45(0xb3)]);}}const _0x1343e3=(_0x411bd6,_0x39133a)=>{const _0x53d4b7=_0x267f45,_0x226ae9=_0x22ee4d['paqLW'](_0x411bd6[_0x53d4b7(0x78)],_0x14bcfb),_0x23d227=_0x411bd6[_0x53d4b7(0x8f)]?_0x53d4b7(0x8e)+_0x411bd6[_0x53d4b7(0x8f)]+')':_0x53d4b7(0xab),_0x41b69f=_0x29b69c['get'](_0x411bd6['name']);console[_0x53d4b7(0xa2)](''+_0x39133a+(_0x226ae9?'*\x20':'\x20\x20')+_0x411bd6['name']),_0x41b69f?.['baseUrl']&&console[_0x53d4b7(0xa2)](_0x39133a+_0x53d4b7(0xb1)+_0x41b69f[_0x53d4b7(0x86)]),console[_0x53d4b7(0xa2)](_0x39133a+'\x20\x20\x20\x20Session:\x20'+_0x23d227);};if(_0xa80edd[_0x267f45(0xa7)]>0x0){if(_0x22ee4d[_0x267f45(0xad)](shouldGroupByEnvironment,_0xa80edd)){console[_0x267f45(0xa2)](_0x22ee4d[_0x267f45(0x7d)]);for(const _0x98d58a of _0x22ee4d[_0x267f45(0xad)](groupCloudProfilesByEnvironment,_0xa80edd)){const _0x1cdb7d=_0x98d58a['environmentKey']??_0x22ee4d[_0x267f45(0x87)];console[_0x267f45(0xa2)]('\x0a\x20\x20'+_0x1cdb7d);for(const _0x3f1a28 of _0x98d58a['profiles']){_0x22ee4d['cdjsz'](_0x1343e3,_0x3f1a28,_0x22ee4d[_0x267f45(0xa4)]);}}}else{console['log'](_0x22ee4d['IxmzV']);for(const _0x239980 of[..._0xa80edd]['sort']((_0x551e18,_0xe9b109)=>_0x551e18[_0x267f45(0x78)]['localeCompare'](_0xe9b109[_0x267f45(0x78)]))){_0x22ee4d['cdjsz'](_0x1343e3,_0x239980,'\x20\x20');}}}_0x14bcfb&&console['log']('\x0a*\x20=\x20active\x20profile');}
|
|
1
|
+
function _0x3116(){const _0x30ac9a=['localeCompare','baseUrl','VKvOz','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profile\x20\x22','environmentKey','8Aeykvz','map','cwd','message','8EZVsDB','domains','FeYnf','projectOverrides','log','kVFZi','authConfig','sort','keys','environmentDetails','35438bXDyIr','\x0a*\x20=\x20active\x20profile','\x0aCloud\x20Profiles\x20(by\x20environment):','local','sIuQO','\x0aLocal\x20Profiles\x20(legacy):','LTzHI','5601060wfieMW','\x0aNo\x20profiles\x20found.','isDirectory','QQdSH','startsWith','\x0a\x20\x20','has','5609328QtxzlN','bNyja','4079957BlJlkW','get','push','JumiK','set','sessions','length','error','\x20\x20\x20\x20\x20\x20Details:\x20','reports','settings.json','startPath','sessionUpdatedAt','2756835iqHaAh','\x0aCloud\x20Profiles:','23148950yKCLJA','3xzcUYF','\x22:\x20','Vjvnw','YQMIh','MkMOv','name','settings','801663mGUehX'];_0x3116=function(){return _0x30ac9a;};return _0x3116();}const _0x401db4=_0x2391;(function(_0x5d3436,_0x5380b4){const _0x5d2a25=_0x2391,_0x5a419d=_0x5d3436();while(!![]){try{const _0x2884da=parseInt(_0x5d2a25(0x155))/0x1*(-parseInt(_0x5d2a25(0x170))/0x2)+-parseInt(_0x5d2a25(0x15c))/0x3*(parseInt(_0x5d2a25(0x162))/0x4)+-parseInt(_0x5d2a25(0x177))/0x5+-parseInt(_0x5d2a25(0x17e))/0x6+parseInt(_0x5d2a25(0x180))/0x7*(parseInt(_0x5d2a25(0x166))/0x8)+parseInt(_0x5d2a25(0x152))/0x9+parseInt(_0x5d2a25(0x154))/0xa;if(_0x2884da===_0x5380b4)break;else _0x5a419d['push'](_0x5a419d['shift']());}catch(_0x58f900){_0x5a419d['push'](_0x5a419d['shift']());}}}(_0x3116,0x890d2));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{fetchAuthConfig,fetchCloudProfile,listCloudProfiles}from'./utils/cloudProfile.js';import{resolveAuthEnvironmentLocally}from'./utils/cloudProfileSession.js';import{readProfileOverrides}from'./utils/projectsConfig.js';import{resolveProfileUrl}from'./utils/resolveProfileUrl.js';import{resolveEnvVars}from'./utils/settings.js';function _0x2391(_0x145f42,_0x20feb4){_0x145f42=_0x145f42-0x14b;const _0x3116a1=_0x3116();let _0x23915d=_0x3116a1[_0x145f42];return _0x23915d;}const NON_ENV_DIRS=[_0x401db4(0x185),'bug-bashes',_0x401db4(0x14e),_0x401db4(0x173),'ci'];export function shouldGroupByEnvironment(_0x114f01){const _0x44e3d0=_0x401db4;return _0x114f01['some'](_0x5be55d=>_0x5be55d[_0x44e3d0(0x161)]);}export function groupCloudProfilesByEnvironment(_0x16d287){const _0x150e17=_0x401db4,_0x3a8431={'FmXxK':function(_0x66dcbb,_0x3a882c){return _0x66dcbb===_0x3a882c;}},_0x22e472=new Map();for(const _0x455bc0 of _0x16d287){const _0x16b1da=_0x455bc0[_0x150e17(0x161)]??null,_0x825f07=_0x22e472['get'](_0x16b1da);if(_0x825f07)_0x825f07['push'](_0x455bc0);else _0x22e472[_0x150e17(0x184)](_0x16b1da,[_0x455bc0]);}const _0x48417b=[..._0x22e472[_0x150e17(0x16e)]()]['sort']((_0x141668,_0x26bfca)=>{const _0x55488f=_0x150e17;if(_0x3a8431['FmXxK'](_0x141668,null))return 0x1;if(_0x3a8431['FmXxK'](_0x26bfca,null))return-0x1;return _0x141668[_0x55488f(0x15d)](_0x26bfca);});return _0x48417b[_0x150e17(0x163)](_0x24c604=>({'environmentKey':_0x24c604,'profiles':_0x22e472['get'](_0x24c604)['sort']((_0x156343,_0x2f1e8f)=>_0x156343['name']['localeCompare'](_0x2f1e8f[_0x150e17(0x15a)]))}));}function expandString(_0x374d3f){if(!_0x374d3f)return undefined;return resolveEnvVars(_0x374d3f);}function expandProfileOverrides(_0x1d3e4a){const _0x4e25f5=_0x401db4,_0x2713de={'gNzrZ':function(_0x393916,_0xb89282){return _0x393916(_0xb89282);}};if(!_0x1d3e4a)return null;return{..._0x1d3e4a,'baseUrl':_0x2713de['gNzrZ'](expandString,_0x1d3e4a[_0x4e25f5(0x15e)]),'startPath':expandString(_0x1d3e4a[_0x4e25f5(0x150)])};}export function resolveCloudProfileListUrl(_0x5c7ece,_0x4117c8={}){const _0x5d49e0=_0x401db4,_0x44d7f9=_0x5c7ece[_0x5d49e0(0x15b)]??{},_0x2e3e54=_0x4117c8[_0x5d49e0(0x16c)]?resolveAuthEnvironmentLocally(_0x4117c8['authConfig'],_0x5c7ece[_0x5d49e0(0x161)]):null,_0x130194=resolveProfileUrl({'projectOverrides':expandProfileOverrides(_0x4117c8[_0x5d49e0(0x169)]??null),'cloudSettings':{'baseUrl':expandString(_0x44d7f9['baseUrl']),'startPath':expandString(_0x44d7f9[_0x5d49e0(0x150)])},'authEnvironmentDomain':_0x2e3e54?.[_0x5d49e0(0x167)]?.[0x0]});return{'baseUrl':_0x130194['baseUrl'],'source':_0x130194['baseUrlSource']};}async function loadCloudProfileListUrls(_0x5f5a1e){const _0x189a3c=_0x401db4,_0x4c5287={'QQdSH':function(_0x2b38fc,_0x41e6ce){return _0x2b38fc(_0x41e6ce);},'gXHqB':function(_0x35e51c){return _0x35e51c();}},_0x1bfcac=new Map();if(_0x5f5a1e[_0x189a3c(0x14b)]===0x0)return _0x1bfcac;const _0x2ae223=await _0x4c5287['gXHqB'](fetchAuthConfig);return await Promise['all'](_0x5f5a1e['map'](async _0x391c1b=>{const _0x28be5c=_0x189a3c;try{const _0xb0ceb3=await _0x4c5287[_0x28be5c(0x17a)](fetchCloudProfile,_0x391c1b['name']);if(!_0xb0ceb3)return;_0x1bfcac['set'](_0x391c1b[_0x28be5c(0x15a)],resolveCloudProfileListUrl(_0xb0ceb3,{'authConfig':_0x2ae223,'projectOverrides':readProfileOverrides(process[_0x28be5c(0x164)](),_0x391c1b['name'])}));}catch(_0x49bdcf){console[_0x28be5c(0x14c)](_0x28be5c(0x160)+_0x391c1b['name']+_0x28be5c(0x156)+(_0x49bdcf instanceof Error?_0x49bdcf[_0x28be5c(0x165)]:String(_0x49bdcf)));}})),_0x1bfcac;}export async function getEnvNames(){const _0x2cd166=_0x401db4,_0x4fe22c={'MkMOv':function(_0x55d378,_0x446058){return _0x55d378(_0x446058);},'oIrPV':function(_0x3f6a70,_0x42c562,_0x53ef42){return _0x3f6a70(_0x42c562,_0x53ef42);},'fLXPf':_0x2cd166(0x173),'VKvOz':function(_0x887f66,_0x2a7958){return _0x887f66(_0x2a7958);},'Xdenr':function(_0x558749,_0x46029d){return _0x558749(_0x46029d);},'OlBGX':_0x2cd166(0x14f)},_0x219430=getRangerDir();if(!_0x4fe22c['MkMOv'](existsSync,_0x219430))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x4f231c=await readActiveProfileName(),_0x2ef288=[],_0xb4985e={},_0x57bf20=_0x4fe22c['oIrPV'](join,_0x219430,_0x4fe22c['fLXPf']);if(existsSync(_0x57bf20)){const _0x38442d=await _0x4fe22c[_0x2cd166(0x159)](readdir,_0x57bf20);for(const _0x2e7100 of _0x38442d){const _0x112c12=join(_0x57bf20,_0x2e7100),_0x2a056c=await _0x4fe22c[_0x2cd166(0x159)](stat,_0x112c12);_0x2a056c['isDirectory']()&&(_0x2ef288[_0x2cd166(0x182)](_0x2e7100),_0xb4985e[_0x2e7100]=_0x2cd166(0x173));}}const _0x3b2a6e=join(_0x219430,'ci');if(_0x4fe22c['MkMOv'](existsSync,_0x3b2a6e)){const _0x38c5eb=await readdir(_0x3b2a6e);for(const _0x1a6563 of _0x38c5eb){const _0x252a16=join(_0x3b2a6e,_0x1a6563),_0x8a91ad=await stat(_0x252a16);_0x8a91ad['isDirectory']()&&(_0x2ef288[_0x2cd166(0x182)](_0x1a6563),_0xb4985e[_0x1a6563]='ci');}}const _0x51b80a=await readdir(_0x219430);for(const _0x5c1692 of _0x51b80a){if(NON_ENV_DIRS['includes'](_0x5c1692))continue;if(_0x5c1692[_0x2cd166(0x17b)]('.'))continue;if(_0x5c1692['endsWith']('.txt'))continue;const _0x1a938b=join(_0x219430,_0x5c1692),_0x7d9e03=await _0x4fe22c[_0x2cd166(0x15f)](stat,_0x1a938b);_0x7d9e03[_0x2cd166(0x179)]()&&_0x4fe22c['Xdenr'](existsSync,join(_0x1a938b,_0x4fe22c['OlBGX']))&&(!_0x2ef288['includes'](_0x5c1692)&&(_0x2ef288['push'](_0x5c1692),_0xb4985e[_0x5c1692]='legacy'));}return{'envNames':_0x2ef288,'activeEnv':_0x4f231c,'envTypes':_0xb4985e};}export async function envList(){const _0x41a8fa=_0x401db4,_0x5e0b46={'kVFZi':'no\x20session','sIuQO':function(_0x226f26){return _0x226f26();},'bNyja':function(_0x33cd5f,_0x5210bb){return _0x33cd5f(_0x5210bb);},'IAESa':function(_0x20e5ba,_0x3b1123){return _0x20e5ba instanceof _0x3b1123;},'JumiK':function(_0x4a78eb,_0x5d67b0){return _0x4a78eb===_0x5d67b0;},'mpvUQ':_0x41a8fa(0x178),'FeYnf':'Run:\x20ranger\x20profile\x20add\x20<profile-name>','LTzHI':function(_0x2ba663,_0x35b2d6){return _0x2ba663(_0x35b2d6);},'ivqHf':function(_0x45a89d,_0x57a330,_0x500fc2){return _0x45a89d(_0x57a330,_0x500fc2);},'EYNkF':'legacy','ZFskw':_0x41a8fa(0x172),'YQMIh':'(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)','Vjvnw':'\x20\x20\x20\x20'},{envNames:_0x521824,activeEnv:_0x4f8d1d,envTypes:_0x5be35a}=await _0x5e0b46['sIuQO'](getEnvNames);let _0x2ea6cd=[],_0x5d7a86=new Map();const _0xd9488c=await getToken();if(_0xd9488c)try{_0x2ea6cd=await _0x5e0b46[_0x41a8fa(0x174)](listCloudProfiles),_0x5d7a86=await _0x5e0b46[_0x41a8fa(0x17f)](loadCloudProfileListUrls,_0x2ea6cd);}catch(_0x2aa46a){console['error']('\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20'+(_0x5e0b46['IAESa'](_0x2aa46a,Error)?_0x2aa46a['message']:String(_0x2aa46a)));}if(_0x5e0b46[_0x41a8fa(0x183)](_0x521824[_0x41a8fa(0x14b)],0x0)&&_0x2ea6cd[_0x41a8fa(0x14b)]===0x0){console['log'](_0x5e0b46['mpvUQ']),console['log'](_0x5e0b46[_0x41a8fa(0x168)]);return;}const _0x27108b=new Set(_0x2ea6cd[_0x41a8fa(0x163)](_0x16aebd=>_0x16aebd[_0x41a8fa(0x15a)]));if(_0x521824['length']>0x0){console['log'](_0x41a8fa(0x175));for(const _0x7cc26e of _0x521824['sort']()){const _0x5f1c66=_0x5e0b46[_0x41a8fa(0x183)](_0x7cc26e,_0x4f8d1d)&&!_0x27108b[_0x41a8fa(0x17d)](_0x7cc26e),_0x587bd2=_0x5be35a[_0x7cc26e]||'local',_0x334cd8=await _0x5e0b46['bNyja'](loadSettings,_0x7cc26e),_0x5cd28f=resolveProfileUrl({'localSettingsBaseUrl':expandString(_0x334cd8['baseUrl']),'projectOverrides':_0x5e0b46[_0x41a8fa(0x176)](expandProfileOverrides,_0x5e0b46['ivqHf'](readProfileOverrides,process[_0x41a8fa(0x164)](),_0x7cc26e))}),_0x5b4be4=_0x587bd2===_0x5e0b46['EYNkF']?'':'\x20['+_0x587bd2+']';console[_0x41a8fa(0x16a)]('\x20\x20'+(_0x5f1c66?'*\x20':'\x20\x20')+_0x7cc26e+_0x5b4be4),_0x5cd28f[_0x41a8fa(0x15e)]&&console['log']('\x20\x20\x20\x20\x20\x20URL:\x20'+_0x5cd28f['baseUrl']),_0x334cd8['environmentDetails']&&console[_0x41a8fa(0x16a)](_0x41a8fa(0x14d)+_0x334cd8[_0x41a8fa(0x16f)]);}}const _0x5fc114=(_0x25d5e0,_0x398c48)=>{const _0x5253af=_0x41a8fa,_0x39a8cc=_0x25d5e0[_0x5253af(0x15a)]===_0x4f8d1d,_0x22226a=_0x25d5e0['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x25d5e0[_0x5253af(0x151)]+')':_0x5e0b46[_0x5253af(0x16b)],_0xc4b78b=_0x5d7a86[_0x5253af(0x181)](_0x25d5e0['name']);console[_0x5253af(0x16a)](''+_0x398c48+(_0x39a8cc?'*\x20':'\x20\x20')+_0x25d5e0['name']),_0xc4b78b?.[_0x5253af(0x15e)]&&console[_0x5253af(0x16a)](_0x398c48+'\x20\x20\x20\x20URL:\x20'+_0xc4b78b['baseUrl']),console['log'](_0x398c48+'\x20\x20\x20\x20Session:\x20'+_0x22226a);};if(_0x2ea6cd['length']>0x0){if(shouldGroupByEnvironment(_0x2ea6cd)){console[_0x41a8fa(0x16a)](_0x5e0b46['ZFskw']);for(const _0x503e66 of groupCloudProfilesByEnvironment(_0x2ea6cd)){const _0x115022=_0x503e66[_0x41a8fa(0x161)]??_0x5e0b46[_0x41a8fa(0x158)];console['log'](_0x41a8fa(0x17c)+_0x115022);for(const _0xdc272e of _0x503e66['profiles']){_0x5fc114(_0xdc272e,_0x5e0b46[_0x41a8fa(0x157)]);}}}else{console[_0x41a8fa(0x16a)](_0x41a8fa(0x153));for(const _0x28e8cc of[..._0x2ea6cd][_0x41a8fa(0x16d)]((_0x469c55,_0x46ff51)=>_0x469c55[_0x41a8fa(0x15a)][_0x41a8fa(0x15d)](_0x46ff51['name']))){_0x5fc114(_0x28e8cc,'\x20\x20');}}}_0x4f8d1d&&console[_0x41a8fa(0x16a)](_0x41a8fa(0x171));}
|