@ranger-testing/ranger-cli 3.1.7-alpha.9ed0a8d-59 → 3.1.7-alpha.a5be4ca-60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/scenarioOriginCheck.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +14 -5
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x26451a,_0x591dba){const _0x15a7f7=_0x24da,_0x288265=_0x26451a();while(!![]){try{const _0x51b465=-parseInt(_0x15a7f7(0x18b))/0x1+-parseInt(_0x15a7f7(0x162))/0x2+parseInt(_0x15a7f7(0x150))/0x3+parseInt(_0x15a7f7(0x1ac))/0x4*(parseInt(_0x15a7f7(0x19d))/0x5)+-parseInt(_0x15a7f7(0x14d))/0x6+parseInt(_0x15a7f7(0x1bc))/0x7*(-parseInt(_0x15a7f7(0x16c))/0x8)+parseInt(_0x15a7f7(0x19a))/0x9;if(_0x51b465===_0x591dba)break;else _0x288265['push'](_0x288265['shift']());}catch(_0x1a2410){_0x288265['push'](_0x288265['shift']());}}}(_0x118d,0x4b872));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x1cf43e from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0x24da(_0xac8190,_0x3cd624){_0xac8190=_0xac8190-0x139;const _0x118d27=_0x118d();let _0x24da27=_0x118d27[_0xac8190];return _0x24da27;}import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';function _0x118d(){const _0x2f7c16=['QsUFV','skipAuth','setupHeaders','HEAD','keys','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','\x20--skip-auth\x0a','trackPhaseEnd','status','DnuaN','\x0a\x20\x20A\x20profile\x20named\x20\x22','LBjLK','153730OrryOz','http://','ekEDA','environments','uFpUx','baseUrl','iOoRt','AoJWI','Rppxi','DMhLn','stdout','\x20\x20https://docs.ranger.net/main/concepts/profiles','use_suggestion','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','Continue\x20anyway','10341819tcmSmw','exit','join','3645INXTqw','capture','env_not_found','cdpEndpoint','\x27\x20to\x20the\x20cloud?','fetch\x20failed','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','AISPe','PNAkp','xFcSB','ViZyK','umygI','Could\x20not\x20reach\x20','cwd','\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','1704ZUHuvn','✓\x20Profile\x20\x27','list','trim','indexOf','nUAPL','Sfcbd','setupHeader','Xrchi','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','`\x20again\x20without\x20--skip-auth.','message','prompt','some','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','917ffrkVk','\x0a\x20\x20Could\x20not\x20reach\x20','confirm','ipyqG','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','hBFOy','includes','NODE_TLS_REJECT_UNAUTHORIZED','BWZSs','YlFzE','What\x20would\x20you\x20like\x20to\x20do?','log','HTTP\x20','RzhEg','\x20--url\x20','jtUqh','⚠\x20Could\x20not\x20reach\x20','JIjvs','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','OnRhl','TJQID','nlJGt','3384018BRRySH','saveToCloud','error','188559zRkhGZ','HwhiU','\x22\x20not\x20found.','for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','user_declined','pXYXf','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','JCLYJ','startsWith','KBApb','rNuqT','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','BKRcZ','tyMHP','Invalid\x20--setup-header\x20format:\x20\x22','Found\x20auth\x20environment\x20\x27','origin','279738WvTnFm','manual','length','yEmbF','To\x20set\x20up\x20a\x20profile,\x20run:\x0a','http://localhost:3000','slice','url','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','\x20\x20Did\x20you\x20mean\x20','21712rGhgvh','VHnFZ','profile.add.autoRouteSkipped','retry','authEnv','force','Enxsf','TzXBR','blowG','Enter\x20a\x20different\x20URL','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','profile.add.autoRouted','nGsrC','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','continue','zHSgH','no_auth_config','\x20(continuing\x20with\x20--force)','env'];_0x118d=function(){return _0x2f7c16;};return _0x118d();}const CLOUD_PROFILE_SHARING_WARNING='This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization';function warnCloudProfileSharedInOrg(){const _0x25271e=_0x24da;if(!process[_0x25271e(0x195)]['isTTY'])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x456f82){const _0x43a2ee=_0x24da,_0x31f31b={'QmNBa':_0x43a2ee(0x163),'NJfpe':function(_0x3eb469,_0x1252eb){return _0x3eb469(_0x1252eb);},'HBceU':function(_0xe18322,_0x3b730d){return _0xe18322<_0x3b730d;},'ViZyK':function(_0x48f48a,_0x2309f9){return _0x48f48a(_0x2309f9);}};try{const _0x4dfea6=new AbortController(),_0x79384e=setTimeout(()=>_0x4dfea6['abort'](),0x1388),_0x1de996={'method':_0x43a2ee(0x182),'signal':_0x4dfea6['signal'],'redirect':_0x31f31b['QmNBa']};/^https:\/\/localhost(:\d+)?/i['test'](_0x456f82)&&(process[_0x43a2ee(0x17e)]['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x5414d6=await fetch(_0x456f82,_0x1de996);delete process[_0x43a2ee(0x17e)][_0x43a2ee(0x13e)],_0x31f31b['NJfpe'](clearTimeout,_0x79384e);if(_0x31f31b['HBceU'](_0x5414d6[_0x43a2ee(0x187)],0x190))return{'ok':!![]};return{'ok':![],'error':_0x43a2ee(0x143)+_0x5414d6['status']};}catch(_0x417b39){delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x30fd26=_0x417b39,_0x3d087e=_0x30fd26[_0x43a2ee(0x1b8)]||_0x31f31b[_0x43a2ee(0x1a7)](String,_0x417b39),_0x9de8c0=_0x3d087e[_0x43a2ee(0x13d)]('Invalid\x20URL')||_0x30fd26['name']==='TypeError'||_0x3d087e[_0x43a2ee(0x13d)](_0x43a2ee(0x1a2));return{'ok':![],'error':_0x3d087e,'isProtocolError':_0x9de8c0};}}async function sweepOrphanLocalProfile(_0x4bab9e,_0x2dd526,_0x50f96e){const _0x2b73b8=_0x24da,_0x35ae3e={'LBjLK':function(_0x54393a,_0x511d9d,_0x5ba33e){return _0x54393a(_0x511d9d,_0x5ba33e);},'DjTYl':function(_0x2ff15b,_0x2fd530){return _0x2ff15b(_0x2fd530);},'AISPe':function(_0x3b7cf2,_0x864cd0){return _0x3b7cf2(_0x864cd0);},'EUEHR':function(_0x1a712a,_0x290cb4,_0x40f0a){return _0x1a712a(_0x290cb4,_0x40f0a);},'SyqGl':function(_0xd36e5e,_0x2c6726){return _0xd36e5e(_0x2c6726);},'blowG':function(_0x2575e3,_0x5390c9,_0x5df90c){return _0x2575e3(_0x5390c9,_0x5df90c);}},_0x3c4d14=_0x35ae3e[_0x2b73b8(0x18a)](join,_0x2dd526,'local'),_0x2a50ce=join(_0x3c4d14,_0x4bab9e);_0x35ae3e['DjTYl'](existsSync,_0x2a50ce)&&(_0x50f96e&&await _0x35ae3e[_0x2b73b8(0x1a4)](isPathGitTracked,_0x2a50ce)?console[_0x2b73b8(0x142)]('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x2a50ce+'\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'):(await _0x35ae3e['EUEHR'](rm,_0x2a50ce,{'recursive':!![],'force':!![]}),console['log']('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x2a50ce)));if(existsSync(_0x3c4d14)){let _0x135bf6=[];try{_0x135bf6=await _0x35ae3e['SyqGl'](readdir,_0x3c4d14);}catch{return;}const _0x332cb7='.tmp-'+_0x4bab9e+'-';for(const _0x2f3e60 of _0x135bf6){if(!_0x2f3e60[_0x2b73b8(0x159)](_0x332cb7))continue;const _0x34bbd5=join(_0x3c4d14,_0x2f3e60);await _0x35ae3e[_0x2b73b8(0x174)](rm,_0x34bbd5,{'recursive':!![],'force':!![]}),console['log'](_0x2b73b8(0x149)+_0x34bbd5);}}}async function sweepOrphansBestEffort(_0x1074f0){const _0x17b274=_0x24da,_0x463c43={'hBFOy':function(_0xca9147,_0x19ae5c){return _0xca9147!==_0x19ae5c;},'NwNXm':function(_0x52047f){return _0x52047f();},'ekEDA':function(_0x4e00aa,_0x339ec4,_0x1a182c,_0x4e5cc7){return _0x4e00aa(_0x339ec4,_0x1a182c,_0x4e5cc7);}};try{await sweepOrphanLocalProfile(_0x1074f0,getRangerHomeDir(),![]);const _0x178427=getRangerDir();_0x463c43[_0x17b274(0x13c)](_0x178427,_0x463c43['NwNXm'](getRangerHomeDir))&&await _0x463c43[_0x17b274(0x18d)](sweepOrphanLocalProfile,_0x1074f0,_0x178427,!![]);}catch(_0x4412c1){console[_0x17b274(0x142)]('\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20('+(_0x4412c1 instanceof Error?_0x4412c1['message']:String(_0x4412c1))+').');}}async function markActive(_0x14c693){const _0x1e9ae2=_0x24da,_0x1c2b62={'DnuaN':function(_0x1b58ff,_0x19d9d0){return _0x1b58ff(_0x19d9d0);},'AoJWI':'Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.'};try{await _0x1c2b62[_0x1e9ae2(0x188)](writeActiveProfileName,_0x14c693),console[_0x1e9ae2(0x142)]('\x20\x20Set\x20active\x20profile:\x20'+_0x14c693);}catch{console['log'](_0x1c2b62[_0x1e9ae2(0x192)]);}}async function tryAutoRouteCloudProfile(_0x15468b,_0x25a447,_0x3d03ab,_0x32dd91,_0x9b8c99){const _0x1583a0=_0x24da,_0x914f57={'DMhLn':function(_0x525fb1){return _0x525fb1();},'RzhEg':_0x1583a0(0x16e),'QzCKm':_0x1583a0(0x17c),'JXiQn':function(_0x33fcda,_0x5e6cdd){return _0x33fcda(_0x5e6cdd);},'QsUFV':function(_0x279ae6,_0x34e5b5){return _0x279ae6===_0x34e5b5;},'lASoB':function(_0x5bde63,_0xa8e028,_0x25b053,_0x1d18aa,_0x38fe97){return _0x5bde63(_0xa8e028,_0x25b053,_0x1d18aa,_0x38fe97);},'JIjvs':function(_0x35327b,_0x12eadd){return _0x35327b+_0x12eadd;},'Rppxi':function(_0x23ea75,_0x5286b4){return _0x23ea75+_0x5286b4;},'eGzWV':_0x1583a0(0x1ab),'xFcSB':_0x1583a0(0x13b),'rTLKn':'\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','AHzVV':_0x1583a0(0x19f),'PNAkp':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','LmWbJ':function(_0x1598db,_0x42927a,_0x80c4db){return _0x1598db(_0x42927a,_0x80c4db);},'JCLYJ':'no_match','umygI':'confirm','Zixzw':'user_declined','jtUqh':'\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','WvuNe':function(_0x55de43,_0x433779){return _0x55de43+_0x433779;}};let _0x403402;try{_0x403402=await _0x914f57[_0x1583a0(0x194)](fetchAuthConfig);}catch(_0x5d525a){return _0x9b8c99?.[_0x1583a0(0x186)](_0x914f57['RzhEg'],{'reason':_0x914f57['QzCKm'],'profileName':_0x15468b}),console['error']('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x5d525a instanceof Error?_0x5d525a['message']:_0x914f57['JXiQn'](String,_0x5d525a))),![];}if((!_0x403402||!_0x403402['environments']||_0x914f57[_0x1583a0(0x17f)](Object[_0x1583a0(0x183)](_0x403402['environments'])['length'],0x0))&&!_0x3d03ab[_0x1583a0(0x170)]){if(_0x32dd91)return await _0x914f57['lASoB'](captureEnvLessProfile,_0x15468b,_0x25a447,_0x3d03ab,_0x9b8c99);return _0x9b8c99?.['trackPhaseEnd'](_0x1583a0(0x16e),{'reason':_0x914f57['QzCKm'],'profileName':_0x15468b}),console[_0x1583a0(0x14f)](_0x914f57[_0x1583a0(0x148)](_0x914f57['JIjvs'](_0x914f57[_0x1583a0(0x193)](_0x914f57['eGzWV'],'\x0a'),_0x914f57[_0x1583a0(0x1a6)])+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x15468b+_0x1583a0(0x145)+_0x25a447+_0x1583a0(0x185))+'\x0a'+_0x1583a0(0x157),_0x914f57['rTLKn'])),![];}let _0x2f43cf;if(_0x3d03ab[_0x1583a0(0x170)]){if(!_0x403402?.['environments']?.[_0x3d03ab[_0x1583a0(0x170)]]){const _0x45f0a9=Object['keys'](_0x403402?.[_0x1583a0(0x18e)]??{});return _0x9b8c99?.['trackPhaseEnd'](_0x1583a0(0x16e),{'reason':_0x914f57['AHzVV'],'profileName':_0x15468b}),console['error']('\x0a\x20\x20Auth\x20environment\x20\x22'+_0x3d03ab[_0x1583a0(0x170)]+_0x1583a0(0x152)+(_0x45f0a9['length']?'\x20Configured\x20envs:\x20'+_0x45f0a9['join'](',\x20')+'.':_0x914f57[_0x1583a0(0x1a5)])),![];}_0x2f43cf=_0x3d03ab[_0x1583a0(0x170)];}else _0x2f43cf=_0x914f57['LmWbJ'](matchAuthEnvironment,_0x25a447,_0x403402);if(!_0x2f43cf)return _0x9b8c99?.[_0x1583a0(0x186)](_0x1583a0(0x16e),{'reason':_0x914f57[_0x1583a0(0x158)],'profileName':_0x15468b}),console[_0x1583a0(0x14f)]('\x0a\x20\x20No\x20auth\x20env\x20matches\x20'+_0x25a447+_0x1583a0(0x179)+Object[_0x1583a0(0x183)](_0x403402?.[_0x1583a0(0x18e)]??{})['join'](',\x20')+'.'),![];const _0x2602a9=_0x403402?.['environments']?.[_0x2f43cf],_0x4a41f4=_0x2602a9?.['domains']??[];if(_0x32dd91&&!_0x3d03ab['yes']){const {saveToCloud:_0x282abe}=await _0x1cf43e[_0x1583a0(0x1b9)]([{'type':_0x914f57[_0x1583a0(0x1a8)],'name':_0x1583a0(0x14e),'message':_0x1583a0(0x160)+_0x2f43cf+'\x27\x20matching\x20'+_0x25a447+'\x0a\x20\x20(domains:\x20'+_0x4a41f4[_0x1583a0(0x19c)](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x15468b+_0x1583a0(0x1a1),'default':!![]}]);if(!_0x282abe)return _0x9b8c99?.[_0x1583a0(0x186)](_0x914f57[_0x1583a0(0x144)],{'reason':_0x914f57['Zixzw'],'profileName':_0x15468b}),console[_0x1583a0(0x14f)](_0x914f57[_0x1583a0(0x146)]),![];}const _0x21f24c=_0x4a41f4[_0x1583a0(0x1ba)](_0x2beaea=>{const _0x2f25eb=_0x1583a0;try{return new URL(_0x2beaea)[_0x2f25eb(0x161)]===new URL(_0x25a447)[_0x2f25eb(0x161)];}catch{return![];}}),_0xd71602={};!_0x21f24c&&(_0xd71602['baseUrl']=_0x25a447);try{await createCloudProfile(_0x15468b,_0x2f43cf,{'settings':_0xd71602}),warnCloudProfileSharedInOrg();}catch(_0x228b43){if(_0x228b43 instanceof ApiError&&_0x228b43['status']===0x199){console['error'](_0x914f57['WvuNe'](_0x1583a0(0x189)+_0x15468b+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a',_0x1583a0(0x176)+_0x15468b));throw _0x228b43;}throw _0x228b43;}return console[_0x1583a0(0x142)]('✓\x20Profile\x20\x27'+_0x15468b+'\x27\x20created.\x0a'+(_0x1583a0(0x1a3)+_0x15468b)),await sweepOrphansBestEffort(_0x15468b),_0x9b8c99?.['trackPhaseEnd'](_0x1583a0(0x177),{'envKey':_0x2f43cf,'profileName':_0x15468b}),!![];}async function createUnconfiguredCloudProfile(_0x84dd4f,_0x177d5d){const _0x1575c4=_0x24da,_0x2df8f5={'TzXBR':function(_0x346eeb){return _0x346eeb();},'xFaha':function(_0x41501d,_0xbf2c7a){return _0x41501d===_0xbf2c7a;},'BjZHZ':function(_0x49a9e3,_0x49b370){return _0x49a9e3+_0x49b370;}};try{await createCloudProfile(_0x84dd4f,undefined,{'settings':_0x177d5d}),_0x2df8f5[_0x1575c4(0x173)](warnCloudProfileSharedInOrg);}catch(_0x2fcc5){_0x2fcc5 instanceof ApiError&&_0x2df8f5['xFaha'](_0x2fcc5['status'],0x199)&&console['error'](_0x2df8f5['BjZHZ'](_0x1575c4(0x189)+_0x84dd4f+_0x1575c4(0x198),_0x1575c4(0x176)+_0x84dd4f));throw _0x2fcc5;}}async function captureEnvLessProfile(_0x166fd4,_0x36a355,_0xd40fc0,_0x48c5d9){const _0x51ae37=_0x24da,_0x1bde73={'tApBK':'Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','VHnFZ':function(_0x25ba39,_0x204e53){return _0x25ba39+_0x204e53;},'BKRcZ':function(_0x43bf48,_0x6bd8f4){return _0x43bf48+_0x6bd8f4;},'fyiOW':function(_0x2a23ad){return _0x2a23ad();},'yEmbF':function(_0x10a0f7,_0x47b09a){return _0x10a0f7 instanceof _0x47b09a;},'mtgEA':function(_0x1c68c3,_0x1772a2){return _0x1c68c3===_0x1772a2;}};if(!_0xd40fc0['yes']){const {capture:_0x55964d}=await _0x1cf43e[_0x51ae37(0x1b9)]([{'type':_0x51ae37(0x139),'name':_0x51ae37(0x19e),'message':_0x1bde73['tApBK'],'default':!![]}]);if(!_0x55964d)return _0x48c5d9?.[_0x51ae37(0x186)](_0x51ae37(0x16e),{'reason':_0x51ae37(0x155),'profileName':_0x166fd4}),console[_0x51ae37(0x14f)](_0x1bde73[_0x51ae37(0x16d)]('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.')),![];}const _0x4957ea={};if(_0xd40fc0[_0x51ae37(0x1b3)])for(const _0x95a2dc of _0xd40fc0[_0x51ae37(0x1b3)]){const _0x3fda67=_0x95a2dc[_0x51ae37(0x1b0)](':');if(_0x3fda67===-0x1)continue;_0x4957ea[_0x95a2dc['slice'](0x0,_0x3fda67)[_0x51ae37(0x1af)]()]=_0x95a2dc['slice'](_0x1bde73[_0x51ae37(0x15d)](_0x3fda67,0x1))['trim']();}const _0x441a43={'baseUrl':_0x36a355};Object[_0x51ae37(0x183)](_0x4957ea)[_0x51ae37(0x164)]>0x0&&(_0x441a43[_0x51ae37(0x181)]=_0x4957ea);let _0x1b2ca4;try{_0x1b2ca4=await createCloudProfile(_0x166fd4,undefined,{'settings':_0x441a43}),_0x1bde73['fyiOW'](warnCloudProfileSharedInOrg);}catch(_0x55052f){_0x1bde73[_0x51ae37(0x165)](_0x55052f,ApiError)&&_0x1bde73['mtgEA'](_0x55052f[_0x51ae37(0x187)],0x199)&&console[_0x51ae37(0x14f)](_0x1bde73['VHnFZ']('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x166fd4+_0x51ae37(0x198),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x166fd4));throw _0x55052f;}return await manualBrowserLogin(_0x1b2ca4,{'key':'','domains':[_0x36a355],'setupHeaders':Object[_0x51ae37(0x183)](_0x4957ea)[_0x51ae37(0x164)]>0x0?_0x4957ea:undefined}),console[_0x51ae37(0x142)](_0x1bde73['BKRcZ']('\x0a✓\x20Profile\x20\x27'+_0x166fd4+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x166fd4)),await sweepOrphansBestEffort(_0x166fd4),_0x48c5d9?.[_0x51ae37(0x186)]('profile.add.autoRouted',{'envKey':null,'profileName':_0x166fd4}),!![];}export async function addEnv(_0x4f23cc,_0x538e0e={},_0x2bfc80){const _0x3abad4=_0x24da,_0x89db01={'YuPEJ':function(_0x384a86,_0x8548da){return _0x384a86+_0x8548da;},'zHSgH':_0x3abad4(0x153),'OnRhl':_0x3abad4(0x184),'Enxsf':_0x3abad4(0x196),'nGsrC':function(_0x28ff3a,_0x516b4b){return _0x28ff3a===_0x516b4b;},'HwhiU':'--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','Xrchi':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','uFpUx':'--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','tnmQT':function(_0x316fe8,_0x595a4d){return _0x316fe8(_0x595a4d);},'nUAPL':function(_0x3724d7,_0x17c7c0){return _0x3724d7>_0x17c7c0;},'Sfcbd':function(_0x29f693,_0x8e547d,_0x4c6e72){return _0x29f693(_0x8e547d,_0x4c6e72);},'nlJGt':function(_0x65d2fb,_0x863456,_0x46ea4d,_0x505bac,_0x184aed){return _0x65d2fb(_0x863456,_0x46ea4d,_0x505bac,_0x184aed);},'tyMHP':_0x3abad4(0x1a0),'KBApb':'isElectron','ipyqG':function(_0x57aa89,_0x4e82dc){return _0x57aa89(_0x4e82dc);},'TJQID':function(_0x168302,_0xfe03fb,_0x5a7041){return _0x168302(_0xfe03fb,_0x5a7041);},'BWZSs':'\x0a🌐\x20Profile\x20Setup\x0a','zhDxy':_0x3abad4(0x190),'IAlxH':function(_0xff56c0,_0x2147da){return _0xff56c0(_0x2147da);},'OVssg':_0x3abad4(0x1ae),'WUTyf':'action','PUakl':_0x3abad4(0x141),'YlFzE':'use_suggestion','rNuqT':_0x3abad4(0x175),'pXYXf':_0x3abad4(0x199),'iOoRt':function(_0x12cf40,_0x45e1a0){return _0x12cf40(_0x45e1a0);},'nEhoh':function(_0x3f7ce5,_0x16d471,_0x143cbe,_0x1f7cc1,_0x3cfdb7,_0x3b98a2){return _0x3f7ce5(_0x16d471,_0x143cbe,_0x1f7cc1,_0x3cfdb7,_0x3b98a2);},'hWkZH':function(_0x26251e,_0x2308d4){return _0x26251e instanceof _0x2308d4;}};_0x538e0e['ci']&&(console['error'](_0x89db01['YuPEJ'](_0x89db01['YuPEJ'](_0x89db01['YuPEJ'](_0x89db01['YuPEJ']('The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a',_0x89db01[_0x3abad4(0x17b)]),'\x0a')+_0x3abad4(0x166)+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a',_0x89db01[_0x3abad4(0x14a)]),_0x89db01[_0x3abad4(0x172)])),process[_0x3abad4(0x19b)](0x1));const _0x2a2c07={};if(_0x538e0e['setupHeader'])for(const _0x366fc9 of _0x538e0e['setupHeader']){const _0x53377d=_0x366fc9[_0x3abad4(0x1b0)](':');if(_0x89db01[_0x3abad4(0x178)](_0x53377d,-0x1))throw new Error(_0x3abad4(0x15f)+_0x366fc9+_0x3abad4(0x1b6));const _0x2703b1=_0x366fc9[_0x3abad4(0x168)](0x0,_0x53377d)[_0x3abad4(0x1af)](),_0x51ff81=_0x366fc9[_0x3abad4(0x168)](_0x53377d+0x1)[_0x3abad4(0x1af)]();_0x2a2c07[_0x2703b1]=_0x51ff81;}if(_0x538e0e['cdpEndpoint']!==undefined&&_0x89db01[_0x3abad4(0x178)](_0x538e0e[_0x3abad4(0x1a0)]['trim'](),''))throw new Error(_0x89db01[_0x3abad4(0x151)]);if(_0x538e0e['cdpEndpoint']&&_0x538e0e[_0x3abad4(0x169)])throw new Error(_0x89db01[_0x3abad4(0x1b4)]);if(_0x538e0e['authEnv']&&_0x538e0e[_0x3abad4(0x180)])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(_0x538e0e['authEnv']&&_0x538e0e['cdpEndpoint'])throw new Error(_0x89db01[_0x3abad4(0x18f)]);const _0x5e2ed0=_0x89db01['tnmQT'](Boolean,_0x538e0e[_0x3abad4(0x1a0)]),_0xd497c=isInteractive();if(!_0xd497c&&!_0x538e0e['url']&&!_0x5e2ed0&&!_0x538e0e[_0x3abad4(0x180)])throw new Error('Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000');if(_0x5e2ed0){const _0x498cf4=_0x538e0e[_0x3abad4(0x1a0)];console['log']('\x0a🔌\x20CDP\x20Profile\x20Setup\x0a'),console[_0x3abad4(0x142)](_0x3abad4(0x15c)+_0x498cf4);const _0x5674a3={'cdpEndpoint':_0x498cf4,'isElectron':!![]};_0x89db01[_0x3abad4(0x1b1)](Object['keys'](_0x2a2c07)['length'],0x0)&&(_0x5674a3[_0x3abad4(0x181)]=_0x2a2c07);await _0x89db01[_0x3abad4(0x1b2)](createUnconfiguredCloudProfile,_0x4f23cc,_0x5674a3);try{_0x89db01[_0x3abad4(0x14c)](setProfileOverride,process[_0x3abad4(0x1aa)](),_0x4f23cc,_0x89db01[_0x3abad4(0x15e)],_0x498cf4),setProfileOverride(process[_0x3abad4(0x1aa)](),_0x4f23cc,_0x89db01[_0x3abad4(0x15a)],!![]);}catch(_0x1b8d55){console['error']('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x1b8d55 instanceof Error?_0x1b8d55[_0x3abad4(0x1b8)]:String(_0x1b8d55)));}console['log']('✓\x20Cloud\x20profile\x20\x27'+_0x4f23cc+'\x27\x20created\x20(CDP).'),await _0x89db01[_0x3abad4(0x13a)](sweepOrphansBestEffort,_0x4f23cc),await markActive(_0x4f23cc);return;}if(_0x538e0e['skipAuth']){const _0x464a8f={};_0x538e0e['url']&&(_0x464a8f['baseUrl']=_0x538e0e[_0x3abad4(0x169)]);Object[_0x3abad4(0x183)](_0x2a2c07)['length']>0x0&&(_0x464a8f['setupHeaders']=_0x2a2c07);await _0x89db01[_0x3abad4(0x14b)](createUnconfiguredCloudProfile,_0x4f23cc,_0x464a8f),console['log'](_0x3abad4(0x1ad)+_0x4f23cc+'\x27\x20created\x20(no\x20session).\x0a'+('\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x4f23cc+_0x3abad4(0x1b7))),await sweepOrphansBestEffort(_0x4f23cc),await markActive(_0x4f23cc);return;}if(_0x538e0e['url']){const _0x581d51=_0x538e0e[_0x3abad4(0x169)],_0x46f2bd=await checkUrlReachability(_0x581d51);if(!_0x46f2bd['ok']&&!_0x538e0e[_0x3abad4(0x171)])throw new Error(_0x3abad4(0x1a9)+_0x581d51+':\x20'+_0x46f2bd[_0x3abad4(0x14f)]+_0x3abad4(0x154));!_0x46f2bd['ok']&&_0x538e0e['force']&&console[_0x3abad4(0x142)](_0x3abad4(0x147)+_0x581d51+':\x20'+_0x46f2bd['error']+_0x3abad4(0x17d));}else{console[_0x3abad4(0x142)](_0x89db01[_0x3abad4(0x13f)]),console['log'](_0x3abad4(0x16a)),console['log']('\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a');let _0x342e79='',_0x5158f8=![];while(!![]){const _0xc356fd=await _0x1cf43e[_0x3abad4(0x1b9)]([{'type':'input','name':_0x89db01['zhDxy'],'message':_0x5158f8?_0x3abad4(0x1b5):'What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','default':_0x342e79||_0x3abad4(0x167)}]);_0x342e79=_0xc356fd[_0x3abad4(0x190)];const _0x5d710d=await _0x89db01['IAlxH'](checkUrlReachability,_0x342e79);if(_0x5d710d['ok'])break;const _0x4838dc=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x342e79),_0x5cd937=_0x5d710d['isProtocolError']&&!_0x4838dc,_0xeb78ee=_0x5cd937?_0x3abad4(0x18c)+_0x342e79:null;_0x5158f8=!![],console['log'](_0x3abad4(0x1bd)+_0x342e79+':\x20'+_0x5d710d[_0x3abad4(0x14f)]);_0xeb78ee&&console['log'](_0x3abad4(0x16b)+_0xeb78ee+'?');const {action:_0x31017a}=await _0x1cf43e[_0x3abad4(0x1b9)]([{'type':_0x89db01['OVssg'],'name':_0x89db01['WUTyf'],'message':_0x89db01['PUakl'],'choices':[..._0xeb78ee?[{'name':'Use\x20'+_0xeb78ee,'value':_0x89db01[_0x3abad4(0x140)]}]:[],{'name':_0x89db01[_0x3abad4(0x15b)],'value':_0x3abad4(0x16f)},{'name':_0x89db01[_0x3abad4(0x156)],'value':_0x3abad4(0x17a)}]}]);if(_0x89db01[_0x3abad4(0x178)](_0x31017a,_0x3abad4(0x197))&&_0xeb78ee){_0x342e79=_0xeb78ee;const _0x9142b2=await _0x89db01[_0x3abad4(0x191)](checkUrlReachability,_0x342e79);if(_0x9142b2['ok'])break;console['log'](_0x3abad4(0x1bb)+_0x342e79+':\x20'+_0x9142b2['error']);}else{if(_0x31017a===_0x3abad4(0x17a))break;}}_0x538e0e={..._0x538e0e,'url':_0x342e79};}let _0x254b2b=![];try{_0x254b2b=await _0x89db01['nEhoh'](tryAutoRouteCloudProfile,_0x4f23cc,_0x538e0e[_0x3abad4(0x169)],_0x538e0e,_0xd497c,_0x2bfc80);}catch(_0x4d9a21){console['error']('\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22'+_0x4f23cc+'\x22:\x20'+(_0x89db01['hWkZH'](_0x4d9a21,Error)?_0x4d9a21['message']:String(_0x4d9a21))),process['exit'](0x1);}!_0x254b2b&&process['exit'](0x1),await markActive(_0x4f23cc);}
|
|
1
|
+
const _0x3ece7a=_0x5a4c;(function(_0x52b8d4,_0x1b2907){const _0x317c4c=_0x5a4c,_0x4aee4f=_0x52b8d4();while(!![]){try{const _0x31fcf7=-parseInt(_0x317c4c(0x256))/0x1+parseInt(_0x317c4c(0x247))/0x2*(-parseInt(_0x317c4c(0x251))/0x3)+-parseInt(_0x317c4c(0x261))/0x4*(-parseInt(_0x317c4c(0x228))/0x5)+-parseInt(_0x317c4c(0x21c))/0x6*(parseInt(_0x317c4c(0x26b))/0x7)+-parseInt(_0x317c4c(0x20c))/0x8+parseInt(_0x317c4c(0x227))/0x9*(parseInt(_0x317c4c(0x21d))/0xa)+-parseInt(_0x317c4c(0x209))/0xb*(-parseInt(_0x317c4c(0x20b))/0xc);if(_0x31fcf7===_0x1b2907)break;else _0x4aee4f['push'](_0x4aee4f['shift']());}catch(_0xfbf38e){_0x4aee4f['push'](_0x4aee4f['shift']());}}}(_0x1ab8,0xab7a9));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x24b349 from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING=_0x3ece7a(0x230);function warnCloudProfileSharedInOrg(){const _0x4969b5=_0x3ece7a;if(!process['stdout'][_0x4969b5(0x205)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x5d6bb2){const _0x8b68f8=_0x3ece7a,_0x1886d9={'lxkUG':function(_0x343f12,_0x56c90b,_0x1e5bca){return _0x343f12(_0x56c90b,_0x1e5bca);},'GUcUa':function(_0x3e0c3b,_0x189c91){return _0x3e0c3b(_0x189c91);},'Inqiy':function(_0x30017b,_0x508fc7){return _0x30017b<_0x508fc7;},'NiUSU':_0x8b68f8(0x270)};try{const _0x42aa90=new AbortController(),_0x4155d4=setTimeout(()=>_0x42aa90[_0x8b68f8(0x211)](),0x1388),_0x399b37={'method':'HEAD','signal':_0x42aa90['signal'],'redirect':_0x8b68f8(0x210)};/^https:\/\/localhost(:\d+)?/i[_0x8b68f8(0x262)](_0x5d6bb2)&&(process[_0x8b68f8(0x229)]['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x4bd635=await _0x1886d9['lxkUG'](fetch,_0x5d6bb2,_0x399b37);delete process[_0x8b68f8(0x229)]['NODE_TLS_REJECT_UNAUTHORIZED'],_0x1886d9[_0x8b68f8(0x1f1)](clearTimeout,_0x4155d4);if(_0x1886d9[_0x8b68f8(0x266)](_0x4bd635[_0x8b68f8(0x22c)],0x190))return{'ok':!![]};return{'ok':![],'error':_0x8b68f8(0x1f7)+_0x4bd635['status']};}catch(_0x1e613f){delete process['env'][_0x8b68f8(0x250)];const _0x3a8f0b=_0x1e613f,_0x54ca2a=_0x3a8f0b['message']||String(_0x1e613f),_0x3d5200=_0x54ca2a['includes'](_0x8b68f8(0x225))||_0x3a8f0b['name']===_0x1886d9[_0x8b68f8(0x263)]||_0x54ca2a[_0x8b68f8(0x246)](_0x8b68f8(0x25f));return{'ok':![],'error':_0x54ca2a,'isProtocolError':_0x3d5200};}}function _0x1ab8(){const _0x4be5cb=['27056JMVOmA','test','NiUSU','⚠\x20Could\x20not\x20reach\x20','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','Inqiy','\x20Configured\x20envs:\x20','roGde','RQQwu','✓\x20Cloud\x20profile\x20\x27','10262PyERNL','wfujh','fvPOB','\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20','SUfOR','TypeError','\x27\x20created\x20(CDP).','tZXoj','GUcUa','indexOf','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','origin','IzHHt','keys','HTTP\x20','\x27\x20matching\x20','\x22:\x20','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','retry','\x0a🌐\x20Profile\x20Setup\x0a','--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','profile.add.autoRouteSkipped','slice','rPIXW','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','url','zQVtm','length','isTTY','\x27\x20to\x20the\x20cloud?','✓\x20Profile\x20\x27','capture','847uNpyAp','\x0a\x20\x20Auth\x20environment\x20\x22','496776hPoLeP','5404360gKSDAo','message','confirm','error','manual','abort','Could\x20not\x20reach\x20','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20','mtJIw','DLRou','no_auth_config','\x20--skip-auth\x0a','trackPhaseEnd','Use\x20','env_not_found','setupHeader','4938VaGBZg','15900lCsflx','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','Found\x20auth\x20environment\x20\x27','skipAuth','pfvNC','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','ZKewH','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','Invalid\x20URL','RRMFE','4572RKENka','190CjvpZj','env','\x27\x20created.\x0a','join','status','\x20(continuing\x20with\x20--force)','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','\x20--url\x20','This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','prompt','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','\x0a\x20\x20A\x20profile\x20named\x20\x22','cdpEndpoint','wFphM','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','exit','trim','http://localhost:3000','yZAjd','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','Bncly','OsVRq','continue','dHUbQ','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','authEnv','includes','3118iPAIDA','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','force','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','jGvZZ','Enter\x20a\x20different\x20URL','cxpEU','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','NODE_TLS_REJECT_UNAUTHORIZED','2379pXKKMC','xhJkh','domains','vZBWs','HRJDn','431671AtYoRP','environments','YhyWg','log','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.','yes','GyWcB','TtOKx','\x0a\x20\x20Could\x20not\x20reach\x20','fetch\x20failed','\x0a\x20\x20(domains:\x20'];_0x1ab8=function(){return _0x4be5cb;};return _0x1ab8();}async function sweepOrphanLocalProfile(_0x37ee0f,_0x7e2144,_0x3de50f){const _0x31d918=_0x3ece7a,_0x44adbb={'ggzvj':'local','HIqHU':function(_0x2b54da,_0x3b30bc,_0x194673){return _0x2b54da(_0x3b30bc,_0x194673);},'Rfbvq':function(_0x24fc3d,_0x25b5ff){return _0x24fc3d(_0x25b5ff);},'DLRou':function(_0x55b58b,_0x47824d){return _0x55b58b(_0x47824d);}},_0x382f49=join(_0x7e2144,_0x44adbb['ggzvj']),_0x4d11f3=_0x44adbb['HIqHU'](join,_0x382f49,_0x37ee0f);existsSync(_0x4d11f3)&&(_0x3de50f&&await _0x44adbb['Rfbvq'](isPathGitTracked,_0x4d11f3)?console[_0x31d918(0x259)](_0x31d918(0x224)+_0x4d11f3+'\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'):(await rm(_0x4d11f3,{'recursive':!![],'force':!![]}),console[_0x31d918(0x259)](_0x31d918(0x22e)+_0x4d11f3)));if(existsSync(_0x382f49)){let _0x3b6bd0=[];try{_0x3b6bd0=await _0x44adbb[_0x31d918(0x215)](readdir,_0x382f49);}catch{return;}const _0x2149c1='.tmp-'+_0x37ee0f+'-';for(const _0x47f44a of _0x3b6bd0){if(!_0x47f44a['startsWith'](_0x2149c1))continue;const _0x11bb59=join(_0x382f49,_0x47f44a);await rm(_0x11bb59,{'recursive':!![],'force':!![]}),console[_0x31d918(0x259)](_0x31d918(0x22e)+_0x11bb59);}}}async function sweepOrphansBestEffort(_0x2bba01){const _0x32d4f2=_0x3ece7a,_0x1fc9cb={'TtOKx':function(_0x2239c6){return _0x2239c6();},'GyWcB':function(_0x5a9d28){return _0x5a9d28();},'tmauq':function(_0x4151fc,_0x3092b8,_0x484ec3,_0x341565){return _0x4151fc(_0x3092b8,_0x484ec3,_0x341565);},'pfvNC':function(_0x14d1bf,_0x46b764){return _0x14d1bf(_0x46b764);}};try{await sweepOrphanLocalProfile(_0x2bba01,_0x1fc9cb[_0x32d4f2(0x25d)](getRangerHomeDir),![]);const _0x37e054=_0x1fc9cb[_0x32d4f2(0x25c)](getRangerDir);_0x37e054!==getRangerHomeDir()&&await _0x1fc9cb['tmauq'](sweepOrphanLocalProfile,_0x2bba01,_0x37e054,!![]);}catch(_0x58429b){console[_0x32d4f2(0x259)](_0x32d4f2(0x24a)+(_0x58429b instanceof Error?_0x58429b['message']:_0x1fc9cb[_0x32d4f2(0x221)](String,_0x58429b))+').');}}async function markActive(_0x35a316){const _0x11922e=_0x3ece7a;try{await writeActiveProfileName(_0x35a316),console[_0x11922e(0x259)]('\x20\x20Set\x20active\x20profile:\x20'+_0x35a316);}catch{console['log']('Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.');}}async function tryAutoRouteCloudProfile(_0x23457c,_0x43d5be,_0x30b096,_0x7e0c1e,_0x4d81a3){const _0xf6d85b=_0x3ece7a,_0x520918={'QWdPv':function(_0x5662a3,_0x2d4bb3){return _0x5662a3===_0x2d4bb3;},'UbDtR':function(_0x3d4d19){return _0x3d4d19();},'vZBWs':_0xf6d85b(0x1fe),'ktVAR':'no_auth_config','KDdOH':function(_0x2998ce,_0x358b7c){return _0x2998ce instanceof _0x358b7c;},'ChsWX':function(_0x20a294,_0x554502){return _0x20a294(_0x554502);},'jGvZZ':function(_0x28af84,_0x22d198){return _0x28af84===_0x22d198;},'tZXoj':function(_0x2264e1,_0x5a2126){return _0x2264e1+_0x5a2126;},'YhyWg':function(_0x4453a0,_0x7f097e){return _0x4453a0+_0x7f097e;},'IzHHt':_0xf6d85b(0x23e),'HYjDY':'\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','omIKQ':function(_0x5ec320,_0x1145da,_0x4be00f){return _0x5ec320(_0x1145da,_0x4be00f);},'ultZU':'no_match','RRMFE':'saveToCloud','wfujh':'user_declined','nuTxK':function(_0x2845b2,_0x57aca7,_0x252d0d,_0x58c73e){return _0x2845b2(_0x57aca7,_0x252d0d,_0x58c73e);},'wQAdQ':function(_0x10fc10){return _0x10fc10();},'mtJIw':function(_0x45e3cc,_0x18266b){return _0x45e3cc instanceof _0x18266b;},'QvTMy':function(_0x2c8fb2,_0x5caea3){return _0x2c8fb2(_0x5caea3);}};let _0x5a1a1a;try{_0x5a1a1a=await _0x520918['UbDtR'](fetchAuthConfig);}catch(_0x393621){return _0x4d81a3?.['trackPhaseEnd'](_0x520918[_0xf6d85b(0x254)],{'reason':_0x520918['ktVAR'],'profileName':_0x23457c}),console[_0xf6d85b(0x20f)](_0xf6d85b(0x26e)+(_0x520918['KDdOH'](_0x393621,Error)?_0x393621['message']:_0x520918['ChsWX'](String,_0x393621))),![];}if((!_0x5a1a1a||!_0x5a1a1a[_0xf6d85b(0x257)]||_0x520918[_0xf6d85b(0x24b)](Object[_0xf6d85b(0x1f6)](_0x5a1a1a[_0xf6d85b(0x257)])[_0xf6d85b(0x204)],0x0))&&!_0x30b096[_0xf6d85b(0x245)]){if(_0x7e0c1e)return await captureEnvLessProfile(_0x23457c,_0x43d5be,_0x30b096,_0x4d81a3);return _0x4d81a3?.[_0xf6d85b(0x218)](_0xf6d85b(0x1fe),{'reason':_0xf6d85b(0x216),'profileName':_0x23457c}),console[_0xf6d85b(0x20f)](_0x520918[_0xf6d85b(0x1f0)](_0x520918['tZXoj'](_0x520918[_0xf6d85b(0x258)]('\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'+_0x520918[_0xf6d85b(0x1f5)],'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x23457c+_0xf6d85b(0x22f)+_0x43d5be+_0xf6d85b(0x217)),'\x0a')+_0x520918['HYjDY'],_0xf6d85b(0x248))),![];}let _0x3bf2b1;if(_0x30b096[_0xf6d85b(0x245)]){if(!_0x5a1a1a?.[_0xf6d85b(0x257)]?.[_0x30b096[_0xf6d85b(0x245)]]){const _0x54b3df=Object['keys'](_0x5a1a1a?.[_0xf6d85b(0x257)]??{});return _0x4d81a3?.[_0xf6d85b(0x218)](_0x520918[_0xf6d85b(0x254)],{'reason':_0xf6d85b(0x21a),'profileName':_0x23457c}),console['error'](_0x520918['tZXoj'](_0xf6d85b(0x20a)+_0x30b096[_0xf6d85b(0x245)]+'\x22\x20not\x20found.',_0x54b3df[_0xf6d85b(0x204)]?_0xf6d85b(0x267)+_0x54b3df[_0xf6d85b(0x22b)](',\x20')+'.':_0xf6d85b(0x231))),![];}_0x3bf2b1=_0x30b096['authEnv'];}else _0x3bf2b1=_0x520918['omIKQ'](matchAuthEnvironment,_0x43d5be,_0x5a1a1a);if(!_0x3bf2b1)return _0x4d81a3?.['trackPhaseEnd'](_0x520918['vZBWs'],{'reason':_0x520918['ultZU'],'profileName':_0x23457c}),console['error']('\x0a\x20\x20No\x20auth\x20env\x20matches\x20'+_0x43d5be+_0xf6d85b(0x24e)+Object[_0xf6d85b(0x1f6)](_0x5a1a1a?.[_0xf6d85b(0x257)]??{})['join'](',\x20')+'.'),![];const _0x1a28d6=_0x5a1a1a?.[_0xf6d85b(0x257)]?.[_0x3bf2b1],_0x38e880=_0x1a28d6?.[_0xf6d85b(0x253)]??[];if(_0x7e0c1e&&!_0x30b096[_0xf6d85b(0x25b)]){const {saveToCloud:_0x283c08}=await _0x24b349['prompt']([{'type':'confirm','name':_0x520918[_0xf6d85b(0x226)],'message':_0xf6d85b(0x21f)+_0x3bf2b1+_0xf6d85b(0x1f8)+_0x43d5be+_0xf6d85b(0x260)+_0x38e880['join'](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x23457c+_0xf6d85b(0x206),'default':!![]}]);if(!_0x283c08)return _0x4d81a3?.['trackPhaseEnd'](_0x520918['vZBWs'],{'reason':_0x520918[_0xf6d85b(0x26c)],'profileName':_0x23457c}),console['error'](_0xf6d85b(0x1fa)),![];}const _0x47d911=_0x38e880['some'](_0x25d992=>{const _0x538596=_0xf6d85b;try{return _0x520918['QWdPv'](new URL(_0x25d992)['origin'],new URL(_0x43d5be)[_0x538596(0x1f4)]);}catch{return![];}}),_0xa9b3dd={};!_0x47d911&&(_0xa9b3dd['baseUrl']=_0x43d5be);try{await _0x520918['nuTxK'](createCloudProfile,_0x23457c,_0x3bf2b1,{'settings':_0xa9b3dd}),_0x520918['wQAdQ'](warnCloudProfileSharedInOrg);}catch(_0x3c44a3){if(_0x520918[_0xf6d85b(0x214)](_0x3c44a3,ApiError)&&_0x3c44a3[_0xf6d85b(0x22c)]===0x199){console['error'](_0xf6d85b(0x236)+_0x23457c+_0xf6d85b(0x244)+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x23457c));throw _0x3c44a3;}throw _0x3c44a3;}return console[_0xf6d85b(0x259)](_0xf6d85b(0x207)+_0x23457c+_0xf6d85b(0x22a)+('\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x23457c)),await _0x520918['QvTMy'](sweepOrphansBestEffort,_0x23457c),_0x4d81a3?.[_0xf6d85b(0x218)]('profile.add.autoRouted',{'envKey':_0x3bf2b1,'profileName':_0x23457c}),!![];}function _0x5a4c(_0x2d6f3d,_0xe33cb5){_0x2d6f3d=_0x2d6f3d-0x1f0;const _0x1ab811=_0x1ab8();let _0x5a4ce4=_0x1ab811[_0x2d6f3d];return _0x5a4ce4;}async function createUnconfiguredCloudProfile(_0x15e32f,_0x3eb410){const _0xeed991=_0x3ece7a,_0x40c3c0={'rPIXW':function(_0x48ebde,_0x426cad){return _0x48ebde instanceof _0x426cad;},'RQQwu':function(_0x248833,_0x2ba864){return _0x248833===_0x2ba864;},'ZkBec':function(_0x396cc2,_0x1d05c8){return _0x396cc2+_0x1d05c8;}};try{await createCloudProfile(_0x15e32f,undefined,{'settings':_0x3eb410}),warnCloudProfileSharedInOrg();}catch(_0x9b4e59){_0x40c3c0[_0xeed991(0x200)](_0x9b4e59,ApiError)&&_0x40c3c0[_0xeed991(0x269)](_0x9b4e59[_0xeed991(0x22c)],0x199)&&console['error'](_0x40c3c0['ZkBec'](_0xeed991(0x236)+_0x15e32f+_0xeed991(0x244),_0xeed991(0x21e)+_0x15e32f));throw _0x9b4e59;}}async function captureEnvLessProfile(_0x2b725a,_0x4506d9,_0x52a15f,_0x1e9ffd){const _0x33fbf6=_0x3ece7a,_0x19b6d6={'SUfOR':_0x33fbf6(0x20e),'ZKewH':_0x33fbf6(0x235),'roGde':function(_0x58f795,_0x3a1a15,_0x535b1c,_0x5bff5e){return _0x58f795(_0x3a1a15,_0x535b1c,_0x5bff5e);},'dgSuf':function(_0x41acf4,_0x1bbec3){return _0x41acf4 instanceof _0x1bbec3;},'RCSTa':function(_0x46c7b7,_0x2ef3b6){return _0x46c7b7===_0x2ef3b6;},'cxpEU':function(_0x3903b0,_0x18e18c,_0x59ba27){return _0x3903b0(_0x18e18c,_0x59ba27);},'dHUbQ':function(_0x241b2c,_0x2f359e){return _0x241b2c(_0x2f359e);},'yZAjd':'profile.add.autoRouted'};if(!_0x52a15f[_0x33fbf6(0x25b)]){const {capture:_0x4295ad}=await _0x24b349[_0x33fbf6(0x233)]([{'type':_0x19b6d6[_0x33fbf6(0x26f)],'name':_0x33fbf6(0x208),'message':_0x19b6d6[_0x33fbf6(0x223)],'default':!![]}]);if(!_0x4295ad)return _0x1e9ffd?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':'user_declined','profileName':_0x2b725a}),console['error']('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a'+_0x33fbf6(0x25a)),![];}const _0x56834e={};if(_0x52a15f[_0x33fbf6(0x21b)])for(const _0x101bdf of _0x52a15f['setupHeader']){const _0x240954=_0x101bdf['indexOf'](':');if(_0x240954===-0x1)continue;_0x56834e[_0x101bdf['slice'](0x0,_0x240954)['trim']()]=_0x101bdf[_0x33fbf6(0x1ff)](_0x240954+0x1)['trim']();}const _0x295405={'baseUrl':_0x4506d9};Object[_0x33fbf6(0x1f6)](_0x56834e)['length']>0x0&&(_0x295405['setupHeaders']=_0x56834e);let _0x168acd;try{_0x168acd=await _0x19b6d6[_0x33fbf6(0x268)](createCloudProfile,_0x2b725a,undefined,{'settings':_0x295405}),warnCloudProfileSharedInOrg();}catch(_0x381ad4){_0x19b6d6['dgSuf'](_0x381ad4,ApiError)&&_0x19b6d6['RCSTa'](_0x381ad4['status'],0x199)&&console[_0x33fbf6(0x20f)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x2b725a+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+(_0x33fbf6(0x21e)+_0x2b725a));throw _0x381ad4;}return await _0x19b6d6[_0x33fbf6(0x24d)](manualBrowserLogin,_0x168acd,{'key':'','domains':[_0x4506d9],'setupHeaders':Object['keys'](_0x56834e)['length']>0x0?_0x56834e:undefined}),console['log']('\x0a✓\x20Profile\x20\x27'+_0x2b725a+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a'+('\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x2b725a)),await _0x19b6d6[_0x33fbf6(0x242)](sweepOrphansBestEffort,_0x2b725a),_0x1e9ffd?.['trackPhaseEnd'](_0x19b6d6[_0x33fbf6(0x23d)],{'envKey':null,'profileName':_0x2b725a}),!![];}export async function addEnv(_0x465e21,_0x3ee680={},_0xc26e05){const _0x5b2af3=_0x3ece7a,_0x4dc8c2={'bvDJi':function(_0x220f1e,_0x4fd16f){return _0x220f1e+_0x4fd16f;},'fvPOB':function(_0x40559a,_0x18a70c){return _0x40559a+_0x18a70c;},'wFphM':function(_0x203217,_0x335ec5){return _0x203217+_0x335ec5;},'DRjio':'To\x20set\x20up\x20a\x20profile,\x20run:\x0a','Bncly':_0x5b2af3(0x222),'ggznw':_0x5b2af3(0x239),'mFRbw':function(_0x457fde){return _0x457fde();},'JaKvz':_0x5b2af3(0x1f3),'AOdLy':function(_0x1f051b,_0x442326){return _0x1f051b>_0x442326;},'TSSKs':function(_0x5e0c8,_0x541163,_0x534cec){return _0x5e0c8(_0x541163,_0x534cec);},'BxfDk':'cdpEndpoint','zQVtm':function(_0x20ed82,_0x5a2d8d){return _0x20ed82(_0x5a2d8d);},'zIyBz':_0x5b2af3(0x1fc),'GVziQ':'\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','OsVRq':_0x5b2af3(0x243),'HRJDn':'use_suggestion','ItiWq':_0x5b2af3(0x24c),'vztRi':_0x5b2af3(0x1fb),'YoeAR':function(_0x58e09e,_0x479967){return _0x58e09e===_0x479967;},'lBfcI':function(_0x1efecb,_0x3d18e7){return _0x1efecb(_0x3d18e7);},'xhJkh':_0x5b2af3(0x241),'NVNDC':function(_0x39b205,_0x2ffaa5,_0x2a2b35,_0x1ed748,_0x2979a6,_0x36fcdc){return _0x39b205(_0x2ffaa5,_0x2a2b35,_0x1ed748,_0x2979a6,_0x36fcdc);}};_0x3ee680['ci']&&(console['error'](_0x4dc8c2['bvDJi'](_0x4dc8c2[_0x5b2af3(0x26d)](_0x4dc8c2[_0x5b2af3(0x238)]('The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a'+'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a'+'\x0a',_0x4dc8c2['DRjio'])+_0x5b2af3(0x232),'\x0a'),'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a')+'\x20\x20https://docs.ranger.net/main/concepts/profiles'),process[_0x5b2af3(0x23a)](0x1));const _0x4da3dc={};if(_0x3ee680[_0x5b2af3(0x21b)])for(const _0x554447 of _0x3ee680[_0x5b2af3(0x21b)]){const _0x145b3c=_0x554447[_0x5b2af3(0x1f2)](':');if(_0x145b3c===-0x1)throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x554447+_0x5b2af3(0x234));const _0x1323c9=_0x554447[_0x5b2af3(0x1ff)](0x0,_0x145b3c)[_0x5b2af3(0x23b)](),_0x3e66dc=_0x554447['slice'](_0x145b3c+0x1)['trim']();_0x4da3dc[_0x1323c9]=_0x3e66dc;}if(_0x3ee680['cdpEndpoint']!==undefined&&_0x3ee680['cdpEndpoint'][_0x5b2af3(0x23b)]()==='')throw new Error(_0x4dc8c2[_0x5b2af3(0x23f)]);if(_0x3ee680['cdpEndpoint']&&_0x3ee680[_0x5b2af3(0x202)])throw new Error(_0x5b2af3(0x1fd));if(_0x3ee680[_0x5b2af3(0x245)]&&_0x3ee680[_0x5b2af3(0x220)])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(_0x3ee680['authEnv']&&_0x3ee680['cdpEndpoint'])throw new Error(_0x4dc8c2['ggznw']);const _0x46af0a=Boolean(_0x3ee680['cdpEndpoint']),_0x2cc7cf=_0x4dc8c2['mFRbw'](isInteractive);if(!_0x2cc7cf&&!_0x3ee680['url']&&!_0x46af0a&&!_0x3ee680[_0x5b2af3(0x220)])throw new Error('Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000');if(_0x46af0a){const _0x4296ac=_0x3ee680[_0x5b2af3(0x237)];console[_0x5b2af3(0x259)](_0x4dc8c2['JaKvz']),console['log'](_0x5b2af3(0x24f)+_0x4296ac);const _0x28875e={'cdpEndpoint':_0x4296ac,'isElectron':!![]};_0x4dc8c2['AOdLy'](Object[_0x5b2af3(0x1f6)](_0x4da3dc)[_0x5b2af3(0x204)],0x0)&&(_0x28875e['setupHeaders']=_0x4da3dc);await _0x4dc8c2['TSSKs'](createUnconfiguredCloudProfile,_0x465e21,_0x28875e);try{setProfileOverride(process['cwd'](),_0x465e21,_0x4dc8c2['BxfDk'],_0x4296ac),setProfileOverride(process['cwd'](),_0x465e21,'isElectron',!![]);}catch(_0x54feed){console['error']('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x54feed instanceof Error?_0x54feed['message']:_0x4dc8c2[_0x5b2af3(0x203)](String,_0x54feed)));}console[_0x5b2af3(0x259)](_0x5b2af3(0x26a)+_0x465e21+_0x5b2af3(0x271)),await _0x4dc8c2[_0x5b2af3(0x203)](sweepOrphansBestEffort,_0x465e21),await markActive(_0x465e21);return;}if(_0x3ee680[_0x5b2af3(0x220)]){const _0x27f0e9={};_0x3ee680['url']&&(_0x27f0e9['baseUrl']=_0x3ee680[_0x5b2af3(0x202)]);Object[_0x5b2af3(0x1f6)](_0x4da3dc)[_0x5b2af3(0x204)]>0x0&&(_0x27f0e9['setupHeaders']=_0x4da3dc);await createUnconfiguredCloudProfile(_0x465e21,_0x27f0e9),console['log']('✓\x20Profile\x20\x27'+_0x465e21+'\x27\x20created\x20(no\x20session).\x0a'+(_0x5b2af3(0x213)+_0x465e21+'`\x20again\x20without\x20--skip-auth.')),await _0x4dc8c2[_0x5b2af3(0x203)](sweepOrphansBestEffort,_0x465e21),await _0x4dc8c2[_0x5b2af3(0x203)](markActive,_0x465e21);return;}if(_0x3ee680[_0x5b2af3(0x202)]){const _0x53db48=_0x3ee680['url'],_0x306aa8=await _0x4dc8c2[_0x5b2af3(0x203)](checkUrlReachability,_0x53db48);if(!_0x306aa8['ok']&&!_0x3ee680[_0x5b2af3(0x249)])throw new Error(_0x5b2af3(0x212)+_0x53db48+':\x20'+_0x306aa8['error']+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x306aa8['ok']&&_0x3ee680['force']&&console[_0x5b2af3(0x259)](_0x5b2af3(0x264)+_0x53db48+':\x20'+_0x306aa8[_0x5b2af3(0x20f)]+_0x5b2af3(0x22d));}else{console[_0x5b2af3(0x259)](_0x4dc8c2['zIyBz']),console['log'](_0x4dc8c2['GVziQ']),console[_0x5b2af3(0x259)]('\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a');let _0x4bb42e='',_0x2d6f8e=![];while(!![]){const _0x6f7334=await _0x24b349[_0x5b2af3(0x233)]([{'type':'input','name':'baseUrl','message':_0x2d6f8e?_0x5b2af3(0x265):_0x4dc8c2[_0x5b2af3(0x240)],'default':_0x4bb42e||_0x5b2af3(0x23c)}]);_0x4bb42e=_0x6f7334['baseUrl'];const _0x4e121b=await checkUrlReachability(_0x4bb42e);if(_0x4e121b['ok'])break;const _0x5f46fc=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x4bb42e),_0x338a58=_0x4e121b['isProtocolError']&&!_0x5f46fc,_0x3db199=_0x338a58?'http://'+_0x4bb42e:null;_0x2d6f8e=!![],console['log'](_0x5b2af3(0x25e)+_0x4bb42e+':\x20'+_0x4e121b[_0x5b2af3(0x20f)]);_0x3db199&&console['log']('\x20\x20Did\x20you\x20mean\x20'+_0x3db199+'?');const {action:_0x4e5830}=await _0x24b349[_0x5b2af3(0x233)]([{'type':'list','name':'action','message':'What\x20would\x20you\x20like\x20to\x20do?','choices':[..._0x3db199?[{'name':_0x5b2af3(0x219)+_0x3db199,'value':_0x4dc8c2[_0x5b2af3(0x255)]}]:[],{'name':_0x4dc8c2['ItiWq'],'value':_0x4dc8c2['vztRi']},{'name':'Continue\x20anyway','value':'continue'}]}]);if(_0x4dc8c2['YoeAR'](_0x4e5830,'use_suggestion')&&_0x3db199){_0x4bb42e=_0x3db199;const _0x94a79f=await _0x4dc8c2['lBfcI'](checkUrlReachability,_0x4bb42e);if(_0x94a79f['ok'])break;console[_0x5b2af3(0x259)](_0x5b2af3(0x201)+_0x4bb42e+':\x20'+_0x94a79f[_0x5b2af3(0x20f)]);}else{if(_0x4e5830===_0x4dc8c2[_0x5b2af3(0x252)])break;}}_0x3ee680={..._0x3ee680,'url':_0x4bb42e};}let _0x418c80=![];try{_0x418c80=await _0x4dc8c2['NVNDC'](tryAutoRouteCloudProfile,_0x465e21,_0x3ee680[_0x5b2af3(0x202)],_0x3ee680,_0x2cc7cf,_0xc26e05);}catch(_0x316dbe){console['error']('\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22'+_0x465e21+_0x5b2af3(0x1f9)+(_0x316dbe instanceof Error?_0x316dbe[_0x5b2af3(0x20d)]:String(_0x316dbe))),process[_0x5b2af3(0x23a)](0x1);}!_0x418c80&&process['exit'](0x1),await _0x4dc8c2[_0x5b2af3(0x203)](markActive,_0x465e21);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4e683c,_0x2b8be7){var _0x3b343d=_0x4ea8,_0x5cf063=_0x4e683c();while(!![]){try{var _0x57234d=parseInt(_0x3b343d(0x17b))/0x1*(-parseInt(_0x3b343d(0x178))/0x2)+parseInt(_0x3b343d(0x17a))/0x3+parseInt(_0x3b343d(0x181))/0x4+parseInt(_0x3b343d(0x182))/0x5+-parseInt(_0x3b343d(0x187))/0x6*(-parseInt(_0x3b343d(0x186))/0x7)+-parseInt(_0x3b343d(0x17e))/0x8*(-parseInt(_0x3b343d(0x17c))/0x9)+-parseInt(_0x3b343d(0x188))/0xa*(parseInt(_0x3b343d(0x183))/0xb);if(_0x57234d===_0x2b8be7)break;else _0x5cf063['push'](_0x5cf063['shift']());}catch(_0x4da68a){_0x5cf063['push'](_0x5cf063['shift']());}}}(_0x1a78,0x227fc));function _0x1a78(){var _0x2850cf=['428994VIvrAN','3NjjfeE','9beupLQ','session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a','818256atfoSL','gYiio','ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','223132wbzAnp','1223265bPuZUz','4785704eejgtI','error','XGmHX','1398614LMAsSp','6LVtqTa','10qngPTO','exit','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','112764QAOfqF','SGWBl'];_0x1a78=function(){return _0x2850cf;};return _0x1a78();}function _0x4ea8(_0x535da2,_0x438d6c){_0x535da2=_0x535da2-0x178;var _0x1a781c=_0x1a78();var _0x4ea894=_0x1a781c[_0x535da2];return _0x4ea894;}export async function authEncrypt(_0x5fbc60){var _0x3386be=_0x4ea8,_0x22dc40={'SGWBl':function(_0x1d3707,_0x12bb50){return _0x1d3707+_0x12bb50;},'HCIIZ':_0x3386be(0x180),'XGmHX':_0x3386be(0x17d),'kjnMv':_0x3386be(0x18a),'gYiio':_0x3386be(0x18b)};console[_0x3386be(0x184)](_0x22dc40[_0x3386be(0x179)](_0x22dc40[_0x3386be(0x179)](_0x22dc40['HCIIZ']+_0x22dc40[_0x3386be(0x185)]+'\x0a'+_0x22dc40['kjnMv'],'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a'+_0x22dc40[_0x3386be(0x17f)],'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process[_0x3386be(0x189)](0x1);}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x31fb83=_0x1788;(function(_0x3ee91b,_0x2ffa9c){const _0x1c2cfa=_0x1788,_0x210638=_0x3ee91b();while(!![]){try{const _0x14dc4a=-parseInt(_0x1c2cfa(0x17a))/0x1*(parseInt(_0x1c2cfa(0x187))/0x2)+parseInt(_0x1c2cfa(0x17d))/0x3*(-parseInt(_0x1c2cfa(0x177))/0x4)+-parseInt(_0x1c2cfa(0x16b))/0x5+parseInt(_0x1c2cfa(0x18a))/0x6+-parseInt(_0x1c2cfa(0x190))/0x7*(-parseInt(_0x1c2cfa(0x198))/0x8)+-parseInt(_0x1c2cfa(0x170))/0x9+parseInt(_0x1c2cfa(0x179))/0xa;if(_0x14dc4a===_0x2ffa9c)break;else _0x210638['push'](_0x210638['shift']());}catch(_0x18d72c){_0x210638['push'](_0x210638['shift']());}}}(_0xf24c,0xb481a));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';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';function _0xf24c(){const _0x4ae201=['✓\x20Removed\x20OpenCode\x20user\x20skill:\x20','error','tWaGP','log','xCEPt','plugin','LYCYs','push','442960zFqWhm','UrByj','FcZeL','LVBKL','marketplace','8107056UoZwcl','isArray','parse','yMeUs','e2e-test-recommender','utf-8','pvGaV','68mwIEuL','ignore','31561920vftbCP','4cagTEi','HwurT','replace','224907mfEmuM','FoqVm','✓\x20Removed\x20stored\x20credentials','close','\x0a✅\x20Cleanup\x20complete!\x0a','sQGBc','umhqF','NvRbJ','YRCcL','✓\x20Removed\x20trailhead\x20marketplace','383522qpKYBW','QvCTY','opencode.json','1867464ZiGGOl','GoFJQ','NbVWr','pbjGo','length','gCqpC','7LJehKl','ranger','KxYqB','remove','RILlR','zsDsl','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','sosTR','2422488qdiqtm','bug-bash','✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','platform','--scope','trailhead'];_0xf24c=function(){return _0x4ae201;};return _0xf24c();}function _0x1788(_0x17a92c,_0x4a8f42){_0x17a92c=_0x17a92c-0x168;const _0xf24c76=_0xf24c();let _0x178875=_0xf24c76[_0x17a92c];return _0x178875;}import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=[_0x31fb83(0x191),'feature-tracker',_0x31fb83(0x199),_0x31fb83(0x174)],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x1dee25){const _0x179ebc=_0x31fb83,_0x555065=_0x1dee25[_0x179ebc(0x17c)](/\/\*[\s\S]*?\*\//g,''),_0x3b3cb3=_0x555065['replace'](/^\s*\/\/.*$/gm,''),_0x57f09f=_0x3b3cb3[_0x179ebc(0x17c)](/,\s*([}\]])/g,'$1');return JSON[_0x179ebc(0x172)](_0x57f09f);}async function removeOpencodePluginConfig(_0x2e0332){const _0x1b365a=_0x31fb83,_0x22e976={'tWaGP':function(_0x399647,_0x297585){return _0x399647(_0x297585);},'UrByj':function(_0x26cc29,_0x2324f8,_0x471ffd){return _0x26cc29(_0x2324f8,_0x471ffd);},'LYCYs':function(_0x2abc11,_0x24ba24){return _0x2abc11===_0x24ba24;},'NcgnU':function(_0x35805f,_0x3801d6){return _0x35805f+_0x3801d6;}};if(!_0x22e976['tWaGP'](existsSync,_0x2e0332))return![];let _0x484653;try{const _0x153199=await _0x22e976[_0x1b365a(0x16c)](readFile,_0x2e0332,_0x1b365a(0x175));_0x484653=_0x22e976[_0x1b365a(0x1a0)](parseJsonc,_0x153199);}catch{return![];}const _0x2eea6f=Array[_0x1b365a(0x171)](_0x484653[_0x1b365a(0x168)])?_0x484653['plugin']:[];if(_0x2eea6f[_0x1b365a(0x18e)]===0x0)return![];const _0x3d0ff5=_0x2eea6f['filter'](_0x2ea65a=>{if(typeof _0x2ea65a!=='string')return!![];return _0x2ea65a!==opencodePluginName;});if(_0x3d0ff5['length']===_0x2eea6f[_0x1b365a(0x18e)])return![];return _0x22e976[_0x1b365a(0x169)](_0x3d0ff5[_0x1b365a(0x18e)],0x0)?delete _0x484653[_0x1b365a(0x168)]:_0x484653[_0x1b365a(0x168)]=_0x3d0ff5,await writeFile(_0x2e0332,_0x22e976['NcgnU'](JSON['stringify'](_0x484653,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x4d5f81){const _0x41a24c=_0x31fb83,_0x507e04={'KxYqB':function(_0x275c74,_0x8efc42){return _0x275c74(_0x8efc42);},'HwurT':function(_0x79bf90,_0x50017b){return _0x79bf90(_0x50017b);},'BsJdz':function(_0x4d983a,_0x4478ca){return _0x4d983a===_0x4478ca;},'hUlUy':_0x41a24c(0x19c),'Ubmjz':function(_0x45f36b,_0x339c93,_0xbb790d,_0x21e785){return _0x45f36b(_0x339c93,_0xbb790d,_0x21e785);},'PoXQC':'claude','NbVWr':_0x41a24c(0x178),'FoqVm':function(_0x2ee339,_0x3543bd){return _0x2ee339===_0x3543bd;},'lbkAi':_0x41a24c(0x19f)};return new Promise(_0x3719c3=>{const _0xf9a68b=_0x41a24c,_0x156514={'sosTR':function(_0x9e750c,_0x566ebf){const _0x19495f=_0x1788;return _0x507e04[_0x19495f(0x17b)](_0x9e750c,_0x566ebf);},'xCEPt':function(_0x4a5f8f,_0x1cbc44){return _0x507e04['BsJdz'](_0x4a5f8f,_0x1cbc44);}},_0x5c6b62=['plugin','uninstall','ranger@trailhead'];_0x4d5f81&&_0x5c6b62[_0xf9a68b(0x16a)](_0x507e04['hUlUy'],_0x4d5f81);const _0x3d831b=_0x507e04['Ubmjz'](spawn,_0x507e04['PoXQC'],_0x5c6b62,{'stdio':[_0x507e04[_0xf9a68b(0x18c)],_0x507e04['NbVWr'],_0x507e04[_0xf9a68b(0x18c)]],'cwd':_0x4d5f81?getProjectRoot():undefined,'shell':_0x507e04[_0xf9a68b(0x17e)](process[_0xf9a68b(0x19b)],'win32')});_0x3d831b['on'](_0xf9a68b(0x180),_0x3eb142=>{const _0x3ce086=_0xf9a68b;_0x156514[_0x3ce086(0x197)](_0x3719c3,_0x156514[_0x3ce086(0x1a2)](_0x3eb142,0x0));}),_0x3d831b['on'](_0x507e04['lbkAi'],()=>{const _0x3d88ee=_0xf9a68b;_0x507e04[_0x3d88ee(0x192)](_0x3719c3,![]);});});}async function removeMarketplace(){const _0x1b5ebc=_0x31fb83,_0xf07077={'GoFJQ':function(_0x3043b1,_0x3ce83b){return _0x3043b1===_0x3ce83b;},'HonKg':function(_0x69db50,_0x3fd90c,_0xb26332,_0x4160f7){return _0x69db50(_0x3fd90c,_0xb26332,_0x4160f7);},'yOEeP':'claude','zsDsl':_0x1b5ebc(0x168),'FcZeL':_0x1b5ebc(0x16f),'CXgfZ':_0x1b5ebc(0x19d),'aQkNZ':_0x1b5ebc(0x178),'mDvKQ':'win32'};return new Promise(_0x970d1a=>{const _0x1cc430=_0x1b5ebc,_0x4d4b52={'sQGBc':function(_0x447df9,_0x1d71b9){const _0x4923b0=_0x1788;return _0xf07077[_0x4923b0(0x18b)](_0x447df9,_0x1d71b9);},'ZknyF':function(_0x54c7dc,_0xa7b8a7){return _0x54c7dc(_0xa7b8a7);}},_0x25dac6=_0xf07077['HonKg'](spawn,_0xf07077['yOEeP'],[_0xf07077[_0x1cc430(0x195)],_0xf07077[_0x1cc430(0x16d)],_0x1cc430(0x193),_0xf07077['CXgfZ']],{'stdio':['ignore',_0xf07077['aQkNZ'],_0xf07077['aQkNZ']],'shell':process['platform']===_0xf07077['mDvKQ']});_0x25dac6['on']('close',_0xf9c9d7=>{const _0x145567=_0x1cc430;_0x970d1a(_0x4d4b52[_0x145567(0x182)](_0xf9c9d7,0x0));}),_0x25dac6['on'](_0x1cc430(0x19f),()=>{_0x4d4b52['ZknyF'](_0x970d1a,![]);});});}export async function clean(){const _0x196589=_0x31fb83,_0x5d17c3={'CfKzD':'\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','PjLnQ':function(_0x19b5e2){return _0x19b5e2();},'Zhwnm':function(_0x454e8c){return _0x454e8c();},'LVBKL':function(_0x3cc402,_0x1f49fd){return _0x3cc402(_0x1f49fd);},'RILlR':function(_0x456af3){return _0x456af3();},'OIrph':function(_0x115ea5,_0x1dcb18){return _0x115ea5(_0x1dcb18);},'pbjGo':function(_0x498e93,_0x5c1193,_0x4399f0){return _0x498e93(_0x5c1193,_0x4399f0);},'YRCcL':function(_0x82c79){return _0x82c79();},'QvCTY':function(_0x54130e,_0x4847ea){return _0x54130e(_0x4847ea);},'yMeUs':'project','AHwWk':function(_0x5029fb,_0x1837cd,_0x1af90f){return _0x5029fb(_0x1837cd,_0x1af90f);},'NvRbJ':'user','umhqF':function(_0x50d52e,_0x401356){return _0x50d52e(_0x401356);},'sXkuG':function(_0x38dd21,_0xeff3b3,_0x531310){return _0x38dd21(_0xeff3b3,_0x531310);},'pvGaV':_0x196589(0x189),'fmjvo':function(_0x4c860c,_0x1cde1a,_0x39429e){return _0x4c860c(_0x1cde1a,_0x39429e);},'gCqpC':function(_0x7f33e,_0x12537b){return _0x7f33e(_0x12537b);},'GBCaF':_0x196589(0x19a),'DftHK':function(_0x44185e){return _0x44185e();}};console[_0x196589(0x1a1)](_0x5d17c3['CfKzD']);let _0x1751ca=![];try{await _0x5d17c3['PjLnQ'](deleteAllCredentials),console[_0x196589(0x1a1)](_0x196589(0x17f)),_0x1751ca=!![];}catch{}const _0x304e52=_0x5d17c3['Zhwnm'](getCacheFile);existsSync(_0x304e52)&&(await _0x5d17c3[_0x196589(0x16e)](rm,_0x304e52),_0x1751ca=!![]);const _0xbb24ae=_0x5d17c3[_0x196589(0x194)](getRangerDir);existsSync(_0xbb24ae)&&(await rm(_0xbb24ae,{'recursive':!![]}),console[_0x196589(0x1a1)]('✓\x20Removed\x20.ranger/\x20directory'),_0x1751ca=!![]);const _0x3796ab=_0x5d17c3['PjLnQ'](getProjectSkillsDir);for(const _0x1048c1 of skillsToRemove){const _0x58f801=join(_0x3796ab,_0x1048c1);_0x5d17c3['OIrph'](existsSync,_0x58f801)&&(await _0x5d17c3[_0x196589(0x18d)](rm,_0x58f801,{'recursive':!![]}),console['log']('✓\x20Removed\x20project\x20skill:\x20'+_0x1048c1),_0x1751ca=!![]);}const _0x519996=_0x5d17c3[_0x196589(0x185)](getUserSkillsDir);for(const _0x2f7200 of skillsToRemove){const _0x1b4779=_0x5d17c3[_0x196589(0x18d)](join,_0x519996,_0x2f7200);existsSync(_0x1b4779)&&(await rm(_0x1b4779,{'recursive':!![]}),console['log']('✓\x20Removed\x20user\x20skill:\x20'+_0x2f7200),_0x1751ca=!![]);}const _0x552191=_0x5d17c3[_0x196589(0x188)](getOpencodeSkillsDir,_0x5d17c3[_0x196589(0x173)]);for(const _0x4ce4d6 of skillsToRemove){const _0xf979df=_0x5d17c3['AHwWk'](join,_0x552191,_0x4ce4d6);_0x5d17c3['QvCTY'](existsSync,_0xf979df)&&(await rm(_0xf979df,{'recursive':!![]}),console[_0x196589(0x1a1)](_0x196589(0x196)+_0x4ce4d6),_0x1751ca=!![]);}const _0x2585ab=getOpencodeSkillsDir(_0x5d17c3[_0x196589(0x184)]);for(const _0x5cbf45 of skillsToRemove){const _0x1ef69f=join(_0x2585ab,_0x5cbf45);_0x5d17c3[_0x196589(0x183)](existsSync,_0x1ef69f)&&(await _0x5d17c3['sXkuG'](rm,_0x1ef69f,{'recursive':!![]}),console['log'](_0x196589(0x19e)+_0x5cbf45),_0x1751ca=!![]);}const _0x514ef4=_0x5d17c3[_0x196589(0x18d)](join,getOpencodeConfigDir('project'),_0x5d17c3[_0x196589(0x176)]);await removeOpencodePluginConfig(_0x514ef4)&&(console[_0x196589(0x1a1)]('✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)'),_0x1751ca=!![]);const _0x5c88d6=_0x5d17c3['fmjvo'](join,_0x5d17c3[_0x196589(0x18f)](getOpencodeConfigDir,_0x5d17c3['NvRbJ']),_0x5d17c3[_0x196589(0x176)]);await removeOpencodePluginConfig(_0x5c88d6)&&(console[_0x196589(0x1a1)]('✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)'),_0x1751ca=!![]);const _0x188abe=await uninstallClaudePlugin();_0x188abe&&(console['log']('✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)'),_0x1751ca=!![]);const _0x71a083=await _0x5d17c3['OIrph'](uninstallClaudePlugin,_0x5d17c3[_0x196589(0x173)]);_0x71a083&&(console['log'](_0x5d17c3['GBCaF']),_0x1751ca=!![]);const _0x523d7b=await _0x5d17c3['DftHK'](removeMarketplace);_0x523d7b&&(console[_0x196589(0x1a1)](_0x196589(0x186)),_0x1751ca=!![]),_0x1751ca?console['log'](_0x196589(0x181)):console['log']('Nothing\x20to\x20clean\x20up.\x0a');}
|
|
1
|
+
const _0x305f73=_0x3767;(function(_0xbf701f,_0xf1944b){const _0xd749de=_0x3767,_0x327f8f=_0xbf701f();while(!![]){try{const _0x163f67=parseInt(_0xd749de(0xe1))/0x1+-parseInt(_0xd749de(0xc5))/0x2+parseInt(_0xd749de(0xe7))/0x3*(parseInt(_0xd749de(0xdd))/0x4)+-parseInt(_0xd749de(0xdc))/0x5*(-parseInt(_0xd749de(0xe5))/0x6)+parseInt(_0xd749de(0xd8))/0x7+parseInt(_0xd749de(0xde))/0x8*(-parseInt(_0xd749de(0xdb))/0x9)+-parseInt(_0xd749de(0xbd))/0xa;if(_0x163f67===_0xf1944b)break;else _0x327f8f['push'](_0x327f8f['shift']());}catch(_0x2ed8b3){_0x327f8f['push'](_0x327f8f['shift']());}}}(_0x2275,0x5ccd6));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';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=['ranger',_0x305f73(0xcb),'bug-bash','e2e-test-recommender'],opencodePluginName=_0x305f73(0xd5);function parseJsonc(_0x4e9f2b){const _0x4a61ca=_0x305f73,_0x537b3d=_0x4e9f2b['replace'](/\/\*[\s\S]*?\*\//g,''),_0x4e0fdf=_0x537b3d[_0x4a61ca(0xd1)](/^\s*\/\/.*$/gm,''),_0x29a751=_0x4e0fdf[_0x4a61ca(0xd1)](/,\s*([}\]])/g,'$1');return JSON['parse'](_0x29a751);}function _0x3767(_0x545367,_0x5f5cbf){_0x545367=_0x545367-0xb7;const _0x22750d=_0x2275();let _0x3767f3=_0x22750d[_0x545367];return _0x3767f3;}async function removeOpencodePluginConfig(_0x3e15a3){const _0x17dd55=_0x305f73,_0x51d36a={'sWaNC':_0x17dd55(0xce),'EZDor':function(_0x45a4b4,_0x14e5be){return _0x45a4b4!==_0x14e5be;},'raIxJ':function(_0x4d68f0,_0x457d94){return _0x4d68f0(_0x457d94);},'ouOll':function(_0x200f6c,_0x154cf0){return _0x200f6c===_0x154cf0;}};if(!existsSync(_0x3e15a3))return![];let _0x5d7d7f;try{const _0x5d5397=await readFile(_0x3e15a3,_0x17dd55(0xc9));_0x5d7d7f=_0x51d36a['raIxJ'](parseJsonc,_0x5d5397);}catch{return![];}const _0x4d6fba=Array['isArray'](_0x5d7d7f[_0x17dd55(0xe6)])?_0x5d7d7f[_0x17dd55(0xe6)]:[];if(_0x4d6fba[_0x17dd55(0xd9)]===0x0)return![];const _0x519620=_0x4d6fba['filter'](_0x2c7598=>{const _0x1cd5e9=_0x17dd55;if(typeof _0x2c7598!==_0x51d36a['sWaNC'])return!![];return _0x51d36a[_0x1cd5e9(0xda)](_0x2c7598,opencodePluginName);});if(_0x51d36a['ouOll'](_0x519620[_0x17dd55(0xd9)],_0x4d6fba[_0x17dd55(0xd9)]))return![];return _0x519620[_0x17dd55(0xd9)]===0x0?delete _0x5d7d7f[_0x17dd55(0xe6)]:_0x5d7d7f['plugin']=_0x519620,await writeFile(_0x3e15a3,JSON['stringify'](_0x5d7d7f,null,0x2)+'\x0a'),!![];}async function uninstallClaudePlugin(_0x5d0f27){const _0xc56f93=_0x305f73,_0x1b5ea6={'ykLdA':function(_0x393b42,_0x34517c){return _0x393b42===_0x34517c;},'VfJgR':function(_0x4c9f45,_0x5ec9ab){return _0x4c9f45(_0x5ec9ab);},'DBhJU':_0xc56f93(0xe6),'EHYXM':'uninstall','nqVXi':function(_0x24ec33,_0x134838,_0x341dbf,_0x4ec27a){return _0x24ec33(_0x134838,_0x341dbf,_0x4ec27a);},'WFXpe':'claude','spWfr':'ignore','WuvUE':'win32'};return new Promise(_0x29a951=>{const _0xbd92c0=_0xc56f93,_0x4b9771={'ziuib':function(_0x4284d6,_0x289cc9){const _0x5f175a=_0x3767;return _0x1b5ea6[_0x5f175a(0xbf)](_0x4284d6,_0x289cc9);},'qgiUs':function(_0x294c27,_0x319860){return _0x1b5ea6['VfJgR'](_0x294c27,_0x319860);}},_0x3b07ad=[_0x1b5ea6[_0xbd92c0(0xd3)],_0x1b5ea6['EHYXM'],_0xbd92c0(0xea)];_0x5d0f27&&_0x3b07ad['push']('--scope',_0x5d0f27);const _0x552b75=_0x1b5ea6['nqVXi'](spawn,_0x1b5ea6['WFXpe'],_0x3b07ad,{'stdio':['ignore',_0x1b5ea6[_0xbd92c0(0xdf)],_0xbd92c0(0xc0)],'cwd':_0x5d0f27?getProjectRoot():undefined,'shell':process['platform']===_0x1b5ea6[_0xbd92c0(0xbb)]});_0x552b75['on'](_0xbd92c0(0xe8),_0x1b65a1=>{const _0x12ae01=_0xbd92c0;_0x29a951(_0x4b9771[_0x12ae01(0xd2)](_0x1b65a1,0x0));}),_0x552b75['on']('error',()=>{_0x4b9771['qgiUs'](_0x29a951,![]);});});}function _0x2275(){const _0x12fc5d=['✓\x20Removed\x20trailhead\x20marketplace','\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','string','log','opencode.json','replace','ziuib','DBhJU','trailhead','@ranger-testing/opencode-plugin','tmRBP','KLnky','1963143SbXTgd','length','EZDor','171aMGBZS','20RYDfHy','1432388cQqIFI','25448YwaRIT','spWfr','TtFJV','484940iPZvwb','✓\x20Removed\x20.ranger/\x20directory','JrYYk','vZkVM','1123602cTmvSG','plugin','3iPviJL','close','rmZQH','ranger@trailhead','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','GWVdZ','Nothing\x20to\x20clean\x20up.\x0a','remove','qmPIB','WuvUE','\x0a✅\x20Cleanup\x20complete!\x0a','9190190CCcJIs','✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','ykLdA','ignore','user','marketplace','XblTD','yEwto','1025956ndlslD','JZojn','project','fdkDw','utf-8','LGtDx','feature-tracker'];_0x2275=function(){return _0x12fc5d;};return _0x2275();}async function removeMarketplace(){const _0x42a4c4=_0x305f73,_0x243a07={'GWVdZ':function(_0x5456ea,_0xdf5476,_0x4b7f36,_0x2f9e3b){return _0x5456ea(_0xdf5476,_0x4b7f36,_0x2f9e3b);},'KLnky':_0x42a4c4(0xc2),'LGtDx':_0x42a4c4(0xc0),'cYBBI':function(_0x322f79,_0x252dae){return _0x322f79===_0x252dae;},'JZojn':'close','CZGhp':'error'};return new Promise(_0x4619c5=>{const _0x4c84a0=_0x42a4c4,_0x5531d9=_0x243a07[_0x4c84a0(0xb7)](spawn,'claude',[_0x4c84a0(0xe6),_0x243a07[_0x4c84a0(0xd7)],_0x4c84a0(0xb9),_0x4c84a0(0xd4)],{'stdio':[_0x243a07[_0x4c84a0(0xca)],'ignore',_0x4c84a0(0xc0)],'shell':_0x243a07['cYBBI'](process['platform'],'win32')});_0x5531d9['on'](_0x243a07[_0x4c84a0(0xc6)],_0xbacc5a=>{_0x4619c5(_0xbacc5a===0x0);}),_0x5531d9['on'](_0x243a07['CZGhp'],()=>{_0x4619c5(![]);});});}export async function clean(){const _0x2119e1=_0x305f73,_0x4b4f26={'HZUDw':function(_0x4fc47b){return _0x4fc47b();},'tmRBP':function(_0xbb4a01){return _0xbb4a01();},'XblTD':_0x2119e1(0xe2),'fdkDw':function(_0x24e33c){return _0x24e33c();},'TtFJV':function(_0xfdefd8,_0x56065a,_0x1e0ec8){return _0xfdefd8(_0x56065a,_0x1e0ec8);},'JrYYk':_0x2119e1(0xc7),'vZkVM':function(_0xbfe7e1,_0x3065fd,_0x22e529){return _0xbfe7e1(_0x3065fd,_0x22e529);},'yEwto':function(_0x414453,_0x2f528a){return _0x414453(_0x2f528a);},'qmPIB':_0x2119e1(0xc1),'rmZQH':function(_0x415ee9,_0x4666f8){return _0x415ee9(_0x4666f8);},'GGMiY':function(_0x48d1aa,_0x43c651,_0x96a474){return _0x48d1aa(_0x43c651,_0x96a474);},'FKudW':'✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','sFlxE':_0x2119e1(0xbc)};console[_0x2119e1(0xcf)](_0x2119e1(0xcd));let _0x50f19c=![];try{await _0x4b4f26['HZUDw'](deleteAllCredentials),console['log']('✓\x20Removed\x20stored\x20credentials'),_0x50f19c=!![];}catch{}const _0x493d4a=getCacheFile();existsSync(_0x493d4a)&&(await rm(_0x493d4a),_0x50f19c=!![]);const _0x5abdc2=_0x4b4f26[_0x2119e1(0xd6)](getRangerDir);existsSync(_0x5abdc2)&&(await rm(_0x5abdc2,{'recursive':!![]}),console[_0x2119e1(0xcf)](_0x4b4f26[_0x2119e1(0xc3)]),_0x50f19c=!![]);const _0x273977=getProjectSkillsDir();for(const _0x4bd3b9 of skillsToRemove){const _0x4e608c=join(_0x273977,_0x4bd3b9);existsSync(_0x4e608c)&&(await rm(_0x4e608c,{'recursive':!![]}),console['log']('✓\x20Removed\x20project\x20skill:\x20'+_0x4bd3b9),_0x50f19c=!![]);}const _0x981b19=_0x4b4f26[_0x2119e1(0xc8)](getUserSkillsDir);for(const _0x2e3f7f of skillsToRemove){const _0x54587e=_0x4b4f26[_0x2119e1(0xe0)](join,_0x981b19,_0x2e3f7f);existsSync(_0x54587e)&&(await _0x4b4f26[_0x2119e1(0xe0)](rm,_0x54587e,{'recursive':!![]}),console['log']('✓\x20Removed\x20user\x20skill:\x20'+_0x2e3f7f),_0x50f19c=!![]);}const _0x4aa6f8=getOpencodeSkillsDir(_0x4b4f26['JrYYk']);for(const _0x13af1f of skillsToRemove){const _0x173d9b=_0x4b4f26[_0x2119e1(0xe4)](join,_0x4aa6f8,_0x13af1f);_0x4b4f26[_0x2119e1(0xc4)](existsSync,_0x173d9b)&&(await rm(_0x173d9b,{'recursive':!![]}),console['log'](_0x2119e1(0xeb)+_0x13af1f),_0x50f19c=!![]);}const _0x5e7872=getOpencodeSkillsDir(_0x4b4f26[_0x2119e1(0xba)]);for(const _0x3c27cc of skillsToRemove){const _0x110e43=join(_0x5e7872,_0x3c27cc);_0x4b4f26[_0x2119e1(0xe9)](existsSync,_0x110e43)&&(await _0x4b4f26[_0x2119e1(0xe4)](rm,_0x110e43,{'recursive':!![]}),console['log']('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x3c27cc),_0x50f19c=!![]);}const _0x4600b3=_0x4b4f26['GGMiY'](join,_0x4b4f26[_0x2119e1(0xc4)](getOpencodeConfigDir,_0x4b4f26[_0x2119e1(0xe3)]),_0x2119e1(0xd0));await _0x4b4f26['rmZQH'](removeOpencodePluginConfig,_0x4600b3)&&(console['log']('✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)'),_0x50f19c=!![]);const _0x108022=join(getOpencodeConfigDir(_0x4b4f26['qmPIB']),_0x2119e1(0xd0));await _0x4b4f26['rmZQH'](removeOpencodePluginConfig,_0x108022)&&(console[_0x2119e1(0xcf)]('✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)'),_0x50f19c=!![]);const _0x2d411e=await _0x4b4f26['fdkDw'](uninstallClaudePlugin);_0x2d411e&&(console['log'](_0x2119e1(0xbe)),_0x50f19c=!![]);const _0x3b8730=await _0x4b4f26[_0x2119e1(0xc4)](uninstallClaudePlugin,_0x4b4f26['JrYYk']);_0x3b8730&&(console['log'](_0x4b4f26['FKudW']),_0x50f19c=!![]);const _0xd8cc93=await _0x4b4f26[_0x2119e1(0xd6)](removeMarketplace);_0xd8cc93&&(console['log'](_0x2119e1(0xcc)),_0x50f19c=!![]),_0x50f19c?console['log'](_0x4b4f26['sFlxE']):console[_0x2119e1(0xcf)](_0x2119e1(0xb8));}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x42cd63=_0x5890;(function(_0x34b2a1,_0x2152f8){const _0x45ae41=_0x5890,_0x4f6fbd=_0x34b2a1();while(!![]){try{const _0x18c39b=parseInt(_0x45ae41(0x1fd))/0x1*(-parseInt(_0x45ae41(0x1f9))/0x2)+-parseInt(_0x45ae41(0x21a))/0x3+-parseInt(_0x45ae41(0x215))/0x4+-parseInt(_0x45ae41(0x210))/0x5+parseInt(_0x45ae41(0x20d))/0x6+-parseInt(_0x45ae41(0x1f2))/0x7+parseInt(_0x45ae41(0x1fc))/0x8;if(_0x18c39b===_0x2152f8)break;else _0x4f6fbd['push'](_0x4f6fbd['shift']());}catch(_0x28da12){_0x4f6fbd['push'](_0x4f6fbd['shift']());}}}(_0x2a58,0x6a0d6));function _0x2a58(){const _0x29176a=['alsoExistsElsewhere','lIySK','SaPkz','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','tPJAP','tMuwf','BLfCH',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','160881eZvtHr','zAOht','isSafeInteger','KOYPz','aUjgc','ivvHi','\x20=\x20','16yQubUF','lgowX','JUdeO','13515104wIQrPZ','75833yjIYnT','endsWith','startsWith','OaiMr','QsxcA','false','true','settings','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','parse','sjIyU','keys','Dbqpv','isNaN','Set\x20','wHgxQ','4012722dJzPmR','ohckB','kind','2740755EPEeKi','cloud','test','qXwao','Removed\x20','2142960vhbKHq','headless','stringify','forceLogin','NgVol','630741nrlOPS','log','YpTCl','null','udZwR','(not\x20set)','ChQct','Key\x20\x22','undefined','object'];_0x2a58=function(){return _0x29176a;};return _0x2a58();}import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x42cd63(0x216),'allowInsecureLocalhost',_0x42cd63(0x218)];function parseLocalValue(_0xfd9d3f,_0x5e0acb){const _0x3d41d5=_0x42cd63,_0x4737e9={'Dbqpv':function(_0x23387b,_0x293790){return _0x23387b===_0x293790;},'tMuwf':_0x3d41d5(0x203),'YpTCl':function(_0x504177,_0x1d81b9){return _0x504177===_0x1d81b9;}};if(BOOLEAN_KEYS['includes'](_0xfd9d3f)){if(_0x4737e9[_0x3d41d5(0x209)](_0x5e0acb,_0x4737e9[_0x3d41d5(0x1ef)]))return!![];if(_0x4737e9[_0x3d41d5(0x21c)](_0x5e0acb,'false'))return![];throw new Error('Invalid\x20value\x20for\x20'+_0xfd9d3f+_0x3d41d5(0x1f1));}return _0x5e0acb;}function parseOverrideValue(_0x29f0e5){const _0x114957=_0x42cd63,_0x52fbc9={'qXwao':function(_0x164107,_0x5743b0){return _0x164107===_0x5743b0;},'GvpFO':_0x114957(0x203),'vOreZ':_0x114957(0x21d),'KOYPz':function(_0xf13315,_0x5504de){return _0xf13315(_0x5504de);}};if(_0x52fbc9[_0x114957(0x213)](_0x29f0e5,_0x52fbc9['GvpFO']))return!![];if(_0x29f0e5===_0x114957(0x202))return![];if(_0x29f0e5===_0x52fbc9['vOreZ'])return null;if(_0x29f0e5===_0x114957(0x222))return undefined;if(/^-?\d+$/['test'](_0x29f0e5)){const _0x550d1c=_0x52fbc9[_0x114957(0x1f5)](Number,_0x29f0e5);if(Number[_0x114957(0x1f4)](_0x550d1c))return _0x550d1c;}if(/^-?\d+\.\d+$/[_0x114957(0x212)](_0x29f0e5)){const _0x461a66=Number(_0x29f0e5);if(!Number[_0x114957(0x20a)](_0x461a66))return _0x461a66;}const _0xb8ac91=_0x29f0e5['trim']();if(_0xb8ac91[_0x114957(0x1ff)]('{')&&_0xb8ac91[_0x114957(0x1fe)]('}')||_0xb8ac91[_0x114957(0x1ff)]('[')&&_0xb8ac91['endsWith'](']'))try{return JSON[_0x114957(0x206)](_0xb8ac91);}catch{}return _0x29f0e5;}async function resolveProfileTarget(_0x4dea82){const _0x3f6201=_0x42cd63,_0x133346={'JUdeO':function(_0x32b33b,_0x241cf3){return _0x32b33b(_0x241cf3);},'bozEc':'local'},_0x5675e7=existsSync(_0x133346[_0x3f6201(0x1fb)](getEnvDir,_0x4dea82));let _0x236479=![];try{const _0x43e981=await fetchCloudProfile(_0x4dea82);_0x236479=Boolean(_0x43e981);}catch{}if(_0x236479)return{'kind':_0x3f6201(0x211),'alsoExistsElsewhere':_0x5675e7};if(_0x5675e7)return{'kind':_0x133346['bozEc'],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x4dea82+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x4dea82);}function printDualExistsHint(_0x242983){const _0x42420f=_0x42cd63;console['log']('\x20\x20Note:\x20\x22'+_0x242983+_0x42420f(0x227));}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x31c7ae){const _0x1fc93b=_0x42cd63,_0x41b14d={'lIySK':function(_0x2548a4,_0x3078a9){return _0x2548a4(_0x3078a9);},'fCUpY':function(_0x1bce2d,_0xa0c279,_0x3459f5){return _0x1bce2d(_0xa0c279,_0x3459f5);},'NgVol':function(_0x3f6670,_0x25a61b,_0x97ac44){return _0x3f6670(_0x25a61b,_0x97ac44);}},_0x1e3d10=await _0x41b14d[_0x1fc93b(0x225)](fetchCloudProfile,_0x31c7ae),_0xe9caa1=_0x41b14d['fCUpY'](readProfileOverrides,getProjectPath(),_0x31c7ae);return _0x41b14d[_0x1fc93b(0x219)](mergeCloudProfileSettings,_0x1e3d10?.[_0x1fc93b(0x204)]??{},_0xe9caa1??undefined);}export async function configSet(_0x55faad,_0x484ce6,_0x44d1e2){const _0xc2778a=_0x42cd63,_0x8db9ab={'udZwR':function(_0x1c8d72,_0x53b400){return _0x1c8d72===_0x53b400;},'EcqtK':'cloud','tPJAP':function(_0x5dd795,_0x296f7f,_0x424521,_0x55b75b,_0x51760c){return _0x5dd795(_0x296f7f,_0x424521,_0x55b75b,_0x51760c);},'ohckB':function(_0x5d76fa){return _0x5d76fa();},'LgXus':function(_0x2dc823,_0x1374bc,_0x1d0803){return _0x2dc823(_0x1374bc,_0x1d0803);}},_0x1721eb=await resolveProfileTarget(_0x55faad);if(_0x8db9ab[_0xc2778a(0x21e)](_0x1721eb[_0xc2778a(0x20f)],_0x8db9ab['EcqtK'])){if(_0x1721eb[_0xc2778a(0x224)])printDualExistsHint(_0x55faad);const _0x543865=parseOverrideValue(_0x44d1e2);_0x8db9ab[_0xc2778a(0x1ee)](setProfileOverride,_0x8db9ab[_0xc2778a(0x20e)](getProjectPath),_0x55faad,_0x484ce6,_0x543865),console[_0xc2778a(0x21b)]('Set\x20'+_0x484ce6+_0xc2778a(0x1f8)+JSON[_0xc2778a(0x217)](_0x543865)+'\x20for\x20\x22'+_0x55faad+'\x22');return;}const _0x516c4b=_0x8db9ab['LgXus'](parseLocalValue,_0x484ce6,_0x44d1e2);_0x8db9ab['tPJAP'](setProfileOverride,_0x8db9ab['ohckB'](getProjectPath),_0x55faad,_0x484ce6,_0x516c4b),console['log'](_0xc2778a(0x20b)+_0x484ce6+'\x20=\x20'+_0x516c4b+'\x20for\x20\x22'+_0x55faad+'\x22');}function _0x5890(_0x43610b,_0x3915a1){_0x43610b=_0x43610b-0x1ee;const _0x2a58dc=_0x2a58();let _0x589022=_0x2a58dc[_0x43610b];return _0x589022;}export async function configGet(_0x44eda4,_0x37fc63){const _0x1c9bcb=_0x42cd63,_0x5abf8d={'sjIyU':function(_0x40b886,_0x4d0c4f){return _0x40b886===_0x4d0c4f;},'UPhQn':_0x1c9bcb(0x211),'SaPkz':function(_0x2dab9e,_0x38fde6,_0x3ad862){return _0x2dab9e(_0x38fde6,_0x3ad862);},'aUjgc':'object','ivvHi':function(_0x3d679f,_0xfcb731){return _0x3d679f===_0xfcb731;}},_0x142d6d=await resolveProfileTarget(_0x44eda4);if(_0x5abf8d[_0x1c9bcb(0x207)](_0x142d6d[_0x1c9bcb(0x20f)],_0x5abf8d['UPhQn'])){const _0x424724=await loadEffectiveCloudSettings(_0x44eda4),_0x37358d=_0x5abf8d[_0x1c9bcb(0x226)](getNestedValue,_0x424724,_0x37fc63);if(_0x37358d===undefined)console['log']('(not\x20set)');else typeof _0x37358d===_0x5abf8d[_0x1c9bcb(0x1f6)]?console['log'](JSON['stringify'](_0x37358d,null,0x2)):console['log'](_0x37358d);return;}const _0x13bb46=await loadSettings(_0x44eda4),_0x42d947=getNestedValue(_0x13bb46,_0x37fc63);if(_0x5abf8d['ivvHi'](_0x42d947,undefined))console['log'](_0x1c9bcb(0x21f));else _0x5abf8d[_0x1c9bcb(0x1f7)](typeof _0x42d947,_0x1c9bcb(0x223))?console[_0x1c9bcb(0x21b)](JSON['stringify'](_0x42d947,null,0x2)):console['log'](_0x42d947);}export async function configList(_0x5928b5){const _0x113336=_0x42cd63,_0x39a6c2={'zAOht':function(_0x52e1f2,_0x45e8c1){return _0x52e1f2===_0x45e8c1;},'BZbsd':_0x113336(0x211),'OaiMr':function(_0x4f554a,_0x1f753b){return _0x4f554a(_0x1f753b);},'faHZK':function(_0x58a494,_0xff0953){return _0x58a494(_0xff0953);}},_0x5e657f=await resolveProfileTarget(_0x5928b5);if(_0x39a6c2[_0x113336(0x1f3)](_0x5e657f['kind'],_0x39a6c2['BZbsd'])){const _0xd98ee5=await _0x39a6c2[_0x113336(0x200)](loadEffectiveCloudSettings,_0x5928b5);if(!_0xd98ee5||Object[_0x113336(0x208)](_0xd98ee5)['length']===0x0){console[_0x113336(0x21b)]('No\x20configuration\x20set\x20for\x20\x22'+_0x5928b5+'\x22');return;}console['log'](JSON['stringify'](_0xd98ee5,null,0x2));return;}const _0x37a7e1=_0x39a6c2['OaiMr'](getSettingsPath,_0x5928b5);if(!existsSync(_0x37a7e1)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x5928b5+'\x22');return;}const _0x586bb5=await loadSettings(_0x5928b5),_0x43eef0=_0x39a6c2['faHZK'](formatSettings,_0x586bb5);!_0x43eef0?console[_0x113336(0x21b)]('No\x20configuration\x20set\x20for\x20\x22'+_0x5928b5+'\x22'):console[_0x113336(0x21b)](_0x43eef0);}export async function configUnset(_0x1edba0,_0x4f584f){const _0x233b13=_0x42cd63,_0x174222={'lgowX':function(_0x5e8688,_0x19fb49){return _0x5e8688(_0x19fb49);},'wHgxQ':_0x233b13(0x211),'xNnWA':function(_0x517fbe,_0x2211d8){return _0x517fbe(_0x2211d8);},'yqDey':function(_0x55de2f,_0x36d91a,_0x1941f6,_0x57f725){return _0x55de2f(_0x36d91a,_0x1941f6,_0x57f725);},'QsxcA':function(_0xd81067){return _0xd81067();},'ChQct':function(_0x3f961d,_0x4eba1f){return _0x3f961d(_0x4eba1f);},'uxCTg':function(_0x31f0ca,_0x5dc3ba,_0xf6f02d){return _0x31f0ca(_0x5dc3ba,_0xf6f02d);}},_0x1dc2ab=await _0x174222[_0x233b13(0x1fa)](resolveProfileTarget,_0x1edba0);if(_0x1dc2ab['kind']===_0x174222[_0x233b13(0x20c)]){if(_0x1dc2ab['alsoExistsElsewhere'])_0x174222['xNnWA'](printDualExistsHint,_0x1edba0);const _0x3ced52=_0x174222['yqDey'](unsetProfileOverride,_0x174222[_0x233b13(0x201)](getProjectPath),_0x1edba0,_0x4f584f);_0x3ced52?console['log']('Removed\x20'+_0x4f584f+'\x20for\x20\x22'+_0x1edba0+'\x22'):console[_0x233b13(0x21b)]('Key\x20\x22'+_0x4f584f+'\x22\x20not\x20found');return;}const _0x28cb3d=unsetProfileOverride(getProjectPath(),_0x1edba0,_0x4f584f);if(_0x28cb3d){console[_0x233b13(0x21b)](_0x233b13(0x214)+_0x4f584f);return;}const _0x570997=await _0x174222[_0x233b13(0x220)](loadSettings,_0x1edba0),_0x397b52=_0x174222['uxCTg'](deleteNestedValue,_0x570997,_0x4f584f);_0x397b52?console[_0x233b13(0x21b)](_0x233b13(0x221)+_0x4f584f+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0x1edba0+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console[_0x233b13(0x21b)]('Key\x20\x22'+_0x4f584f+'\x22\x20not\x20found');}export async function configReset(_0xa2b59d){const _0x455a43=_0x42cd63,_0x1b23ae={'BLfCH':function(_0x1be398,_0x53046e){return _0x1be398===_0x53046e;},'QVmlP':function(_0x758c1d){return _0x758c1d();}},_0x49cb76=await resolveProfileTarget(_0xa2b59d);if(_0x1b23ae[_0x455a43(0x1f0)](_0x49cb76[_0x455a43(0x20f)],'cloud')){resetProfileOverrides(_0x1b23ae['QVmlP'](getProjectPath),_0xa2b59d),console[_0x455a43(0x21b)]('Cleared\x20local\x20overrides\x20for\x20\x22'+_0xa2b59d+'\x22');return;}console[_0x455a43(0x21b)]('\x22'+_0xa2b59d+_0x455a43(0x205)+_0xa2b59d+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
|
1
|
+
function _0xf1d4(){const _0x482cd5=['25YxlGgA','qDFDa','180678rqKTCX','alsoExistsElsewhere','22680nbGLym','headless','vPqfd','2744667YIHsXr','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','221740JCWsDf','FvdhK','allowInsecureLocalhost','cloud','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','Key\x20\x22','IcyOx','dpQuU','44CQYDPs','yYady','GSmEw','isSafeInteger','GneFV','YyEKF','log',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','exrIi','EvAjc','cRLsb','\x22\x20not\x20found','length','bTySL','thkCt','forceLogin','422696eorJfq','rZgWv','startsWith','\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22','stringify','aNrLe','settings','(not\x20set)','true','YkJQZ','35cMJdOy','kind','\x20=\x20','endsWith','1073170xDewMn','test','3pDkVNk','false','No\x20configuration\x20set\x20for\x20\x22','object','693006jKvicx'];_0xf1d4=function(){return _0x482cd5;};return _0xf1d4();}function _0x105a(_0x33418d,_0x22be9d){_0x33418d=_0x33418d-0xdd;const _0xf1d445=_0xf1d4();let _0x105aa0=_0xf1d445[_0x33418d];return _0x105aa0;}const _0x5bd86c=_0x105a;(function(_0x28a3e4,_0x192670){const _0x2d027e=_0x105a,_0x3b9818=_0x28a3e4();while(!![]){try{const _0x33aeaf=parseInt(_0x2d027e(0x102))/0x1+-parseInt(_0x2d027e(0xfd))/0x2*(-parseInt(_0x2d027e(0xf9))/0x3)+parseInt(_0x2d027e(0x107))/0x4+parseInt(_0x2d027e(0xfe))/0x5*(parseInt(_0x2d027e(0x100))/0x6)+-parseInt(_0x2d027e(0xf3))/0x7*(parseInt(_0x2d027e(0xe9))/0x8)+parseInt(_0x2d027e(0x105))/0x9+-parseInt(_0x2d027e(0xf7))/0xa*(parseInt(_0x2d027e(0x10f))/0xb);if(_0x33aeaf===_0x192670)break;else _0x3b9818['push'](_0x3b9818['shift']());}catch(_0x456d5c){_0x3b9818['push'](_0x3b9818['shift']());}}}(_0xf1d4,0x2d945));import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x5bd86c(0x103),_0x5bd86c(0x109),_0x5bd86c(0xe8)];function parseLocalValue(_0x3e9fb1,_0x4dd84e){const _0x3dfa44=_0x5bd86c,_0x4242f5={'rZgWv':function(_0x35b801,_0x3cd027){return _0x35b801===_0x3cd027;},'vpfVD':'false'};if(BOOLEAN_KEYS['includes'](_0x3e9fb1)){if(_0x4242f5[_0x3dfa44(0xea)](_0x4dd84e,'true'))return!![];if(_0x4dd84e===_0x4242f5['vpfVD'])return![];throw new Error('Invalid\x20value\x20for\x20'+_0x3e9fb1+_0x3dfa44(0xe0));}return _0x4dd84e;}function parseOverrideValue(_0x110820){const _0x1b2d08=_0x5bd86c,_0x10f9b7={'dpQuU':function(_0x592bdf,_0x21fc04){return _0x592bdf===_0x21fc04;},'qDFDa':function(_0x5b760b,_0x1129a1){return _0x5b760b(_0x1129a1);}};if(_0x110820===_0x1b2d08(0xf1))return!![];if(_0x10f9b7['dpQuU'](_0x110820,_0x1b2d08(0xfa)))return![];if(_0x110820==='null')return null;if(_0x10f9b7[_0x1b2d08(0x10e)](_0x110820,'undefined'))return undefined;if(/^-?\d+$/[_0x1b2d08(0xf8)](_0x110820)){const _0x532b04=_0x10f9b7[_0x1b2d08(0xff)](Number,_0x110820);if(Number[_0x1b2d08(0x112)](_0x532b04))return _0x532b04;}if(/^-?\d+\.\d+$/[_0x1b2d08(0xf8)](_0x110820)){const _0x1bc376=Number(_0x110820);if(!Number['isNaN'](_0x1bc376))return _0x1bc376;}const _0x1291be=_0x110820['trim']();if(_0x1291be[_0x1b2d08(0xeb)]('{')&&_0x1291be['endsWith']('}')||_0x1291be['startsWith']('[')&&_0x1291be[_0x1b2d08(0xf6)](']'))try{return JSON['parse'](_0x1291be);}catch{}return _0x110820;}async function resolveProfileTarget(_0x1a9f9e){const _0x4bc05c=_0x5bd86c,_0x17f640={'XIcBd':function(_0x3345c6,_0x2ae150){return _0x3345c6(_0x2ae150);},'cRLsb':function(_0x4ebc30,_0x49f24a){return _0x4ebc30(_0x49f24a);},'iWSuD':function(_0x4c834d,_0x18ea0e){return _0x4c834d(_0x18ea0e);}},_0x1ab0c6=existsSync(_0x17f640['XIcBd'](getEnvDir,_0x1a9f9e));let _0x255d7f=![];try{const _0x202c66=await _0x17f640[_0x4bc05c(0xe3)](fetchCloudProfile,_0x1a9f9e);_0x255d7f=_0x17f640['iWSuD'](Boolean,_0x202c66);}catch{}if(_0x255d7f)return{'kind':_0x4bc05c(0x10a),'alsoExistsElsewhere':_0x1ab0c6};if(_0x1ab0c6)return{'kind':'local','alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x1a9f9e+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x1a9f9e);}function printDualExistsHint(_0x4ccf1d){console['log']('\x20\x20Note:\x20\x22'+_0x4ccf1d+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x58581b){const _0x22f985=_0x5bd86c,_0x1dc3b1={'fCfZl':function(_0x192685){return _0x192685();},'bTySL':function(_0x363bff,_0x543b15,_0x3d1fe4){return _0x363bff(_0x543b15,_0x3d1fe4);},'thkCt':function(_0x335d7c,_0x360850){return _0x335d7c??_0x360850;}},_0x36d8f6=await fetchCloudProfile(_0x58581b),_0x1a061b=readProfileOverrides(_0x1dc3b1['fCfZl'](getProjectPath),_0x58581b);return _0x1dc3b1[_0x22f985(0xe6)](mergeCloudProfileSettings,_0x36d8f6?.[_0x22f985(0xef)]??{},_0x1dc3b1[_0x22f985(0xe7)](_0x1a061b,undefined));}export async function configSet(_0x2ac861,_0x4af39d,_0x459d0c){const _0x1f782d=_0x5bd86c,_0x3b5ed5={'zcjJy':function(_0x1ad092,_0x3e4b59){return _0x1ad092===_0x3e4b59;},'FvdhK':_0x1f782d(0x10a),'SCgns':function(_0x3b7261,_0x3431f5){return _0x3b7261(_0x3431f5);},'yYady':function(_0x247299,_0x5a320a){return _0x247299(_0x5a320a);},'YyEKF':function(_0x158aea){return _0x158aea();},'EvAjc':function(_0x369e00,_0xa7596,_0x418340,_0x43df26,_0x1cea82){return _0x369e00(_0xa7596,_0x418340,_0x43df26,_0x1cea82);}},_0x2fae62=await resolveProfileTarget(_0x2ac861);if(_0x3b5ed5['zcjJy'](_0x2fae62[_0x1f782d(0xf4)],_0x3b5ed5[_0x1f782d(0x108)])){if(_0x2fae62[_0x1f782d(0x101)])_0x3b5ed5['SCgns'](printDualExistsHint,_0x2ac861);const _0x3e9877=_0x3b5ed5[_0x1f782d(0x110)](parseOverrideValue,_0x459d0c);setProfileOverride(_0x3b5ed5[_0x1f782d(0xde)](getProjectPath),_0x2ac861,_0x4af39d,_0x3e9877),console[_0x1f782d(0xdf)]('Set\x20'+_0x4af39d+_0x1f782d(0xf5)+JSON[_0x1f782d(0xed)](_0x3e9877)+'\x20for\x20\x22'+_0x2ac861+'\x22');return;}const _0x50d2d9=parseLocalValue(_0x4af39d,_0x459d0c);_0x3b5ed5[_0x1f782d(0xe2)](setProfileOverride,_0x3b5ed5['YyEKF'](getProjectPath),_0x2ac861,_0x4af39d,_0x50d2d9),console['log']('Set\x20'+_0x4af39d+'\x20=\x20'+_0x50d2d9+'\x20for\x20\x22'+_0x2ac861+'\x22');}export async function configGet(_0x415b56,_0x4d2ac0){const _0x485b22=_0x5bd86c,_0x9e4db1={'XzNmr':function(_0x19ef11,_0x544c03){return _0x19ef11===_0x544c03;},'YkJQZ':_0x485b22(0x10a),'triGr':function(_0x28d757,_0x4b5801){return _0x28d757(_0x4b5801);},'IcyOx':function(_0x51ec57,_0x53dcd0,_0x38411d){return _0x51ec57(_0x53dcd0,_0x38411d);},'KkqRf':function(_0x3e30c6,_0x5b66d5,_0x2301e4){return _0x3e30c6(_0x5b66d5,_0x2301e4);},'vPqfd':_0x485b22(0xfc)},_0x1b67e2=await resolveProfileTarget(_0x415b56);if(_0x9e4db1['XzNmr'](_0x1b67e2['kind'],_0x9e4db1[_0x485b22(0xf2)])){const _0x293983=await _0x9e4db1['triGr'](loadEffectiveCloudSettings,_0x415b56),_0x1eed6f=_0x9e4db1[_0x485b22(0x10d)](getNestedValue,_0x293983,_0x4d2ac0);if(_0x9e4db1['XzNmr'](_0x1eed6f,undefined))console[_0x485b22(0xdf)](_0x485b22(0xf0));else _0x9e4db1['XzNmr'](typeof _0x1eed6f,'object')?console['log'](JSON['stringify'](_0x1eed6f,null,0x2)):console[_0x485b22(0xdf)](_0x1eed6f);return;}const _0x4c41cb=await _0x9e4db1['triGr'](loadSettings,_0x415b56),_0x46a6f8=_0x9e4db1['KkqRf'](getNestedValue,_0x4c41cb,_0x4d2ac0);if(_0x46a6f8===undefined)console[_0x485b22(0xdf)]('(not\x20set)');else typeof _0x46a6f8===_0x9e4db1[_0x485b22(0x104)]?console[_0x485b22(0xdf)](JSON['stringify'](_0x46a6f8,null,0x2)):console[_0x485b22(0xdf)](_0x46a6f8);}export async function configList(_0x4bff22){const _0x59e0e9=_0x5bd86c,_0x1cb904={'Hhfls':function(_0x3a2b06,_0x2db6d7){return _0x3a2b06===_0x2db6d7;},'GneFV':function(_0x5f4cb1,_0x4915c6){return _0x5f4cb1(_0x4915c6);}},_0x17a4c3=await resolveProfileTarget(_0x4bff22);if(_0x1cb904['Hhfls'](_0x17a4c3['kind'],_0x59e0e9(0x10a))){const _0x27e3fd=await _0x1cb904[_0x59e0e9(0xdd)](loadEffectiveCloudSettings,_0x4bff22);if(!_0x27e3fd||_0x1cb904['Hhfls'](Object['keys'](_0x27e3fd)[_0x59e0e9(0xe5)],0x0)){console[_0x59e0e9(0xdf)](_0x59e0e9(0xfb)+_0x4bff22+'\x22');return;}console['log'](JSON[_0x59e0e9(0xed)](_0x27e3fd,null,0x2));return;}const _0x27821b=getSettingsPath(_0x4bff22);if(!existsSync(_0x27821b)){console[_0x59e0e9(0xdf)]('No\x20configuration\x20set\x20for\x20\x22'+_0x4bff22+'\x22');return;}const _0x641a01=await _0x1cb904[_0x59e0e9(0xdd)](loadSettings,_0x4bff22),_0x73f61f=_0x1cb904[_0x59e0e9(0xdd)](formatSettings,_0x641a01);!_0x73f61f?console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x4bff22+'\x22'):console[_0x59e0e9(0xdf)](_0x73f61f);}export async function configUnset(_0x3a6695,_0x475adc){const _0x5f22cb=_0x5bd86c,_0x3cbfd4={'Bsfwj':function(_0x28f2c2,_0x3ba065){return _0x28f2c2(_0x3ba065);},'aNrLe':function(_0x2d0a5a,_0xfc4ffa){return _0x2d0a5a===_0xfc4ffa;},'zJJyJ':'cloud','EGCCs':function(_0x2b6375,_0x12ee3c){return _0x2b6375(_0x12ee3c);},'HZwAS':function(_0x27c46f,_0x6e8d47,_0x2ee818,_0x3f1a4c){return _0x27c46f(_0x6e8d47,_0x2ee818,_0x3f1a4c);},'acWFk':function(_0x276be9,_0x5ee300){return _0x276be9(_0x5ee300);},'ODqrV':function(_0x1073c8,_0x90676f,_0x22e584){return _0x1073c8(_0x90676f,_0x22e584);}},_0x40e757=await _0x3cbfd4['Bsfwj'](resolveProfileTarget,_0x3a6695);if(_0x3cbfd4[_0x5f22cb(0xee)](_0x40e757[_0x5f22cb(0xf4)],_0x3cbfd4['zJJyJ'])){if(_0x40e757[_0x5f22cb(0x101)])_0x3cbfd4['EGCCs'](printDualExistsHint,_0x3a6695);const _0x5cc25c=_0x3cbfd4['HZwAS'](unsetProfileOverride,getProjectPath(),_0x3a6695,_0x475adc);_0x5cc25c?console[_0x5f22cb(0xdf)]('Removed\x20'+_0x475adc+'\x20for\x20\x22'+_0x3a6695+'\x22'):console[_0x5f22cb(0xdf)](_0x5f22cb(0x10c)+_0x475adc+_0x5f22cb(0xe4));return;}const _0x57e361=_0x3cbfd4['HZwAS'](unsetProfileOverride,getProjectPath(),_0x3a6695,_0x475adc);if(_0x57e361){console[_0x5f22cb(0xdf)]('Removed\x20'+_0x475adc);return;}const _0x156f2c=await _0x3cbfd4['acWFk'](loadSettings,_0x3a6695),_0x43911d=_0x3cbfd4['ODqrV'](deleteNestedValue,_0x156f2c,_0x475adc);_0x43911d?console['log']('Key\x20\x22'+_0x475adc+_0x5f22cb(0xec)+_0x3a6695+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console[_0x5f22cb(0xdf)](_0x5f22cb(0x10c)+_0x475adc+'\x22\x20not\x20found');}export async function configReset(_0x8084f1){const _0x303cd5=_0x5bd86c,_0x1ca7de={'GSmEw':function(_0x5c68ea,_0x5f3a4c){return _0x5c68ea===_0x5f3a4c;},'OQFSU':function(_0x36e883,_0xd90cae,_0x255f3b){return _0x36e883(_0xd90cae,_0x255f3b);},'exrIi':function(_0x4b0824){return _0x4b0824();}},_0x2de76e=await resolveProfileTarget(_0x8084f1);if(_0x1ca7de[_0x303cd5(0x111)](_0x2de76e['kind'],'cloud')){_0x1ca7de['OQFSU'](resetProfileOverrides,_0x1ca7de[_0x303cd5(0xe1)](getProjectPath),_0x8084f1),console['log']('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x8084f1+'\x22');return;}console['log']('\x22'+_0x8084f1+_0x303cd5(0x10b)+_0x8084f1+_0x303cd5(0x106));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x43a3(){const _0x3aef96=['8765736NHyZlJ','560762FljAkJ','3200302YEUVQe','2873913bFdnRZ','Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.','57LYoNkc','\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22','wgusP','312440mKupSg','log','yes','prompt','cwd','confirmation','3841245CsFrFF','81rVrUre','✓\x20Deleted\x20cloud\x20profile\x20\x22','1575352IGGnXW','\x22\x20for\x20everyone\x20in\x20your\x20organization.'];_0x43a3=function(){return _0x3aef96;};return _0x43a3();}function _0xdc2e(_0x5f0fa4,_0x19c1a5){_0x5f0fa4=_0x5f0fa4-0x174;const _0x43a330=_0x43a3();let _0xdc2ed3=_0x43a330[_0x5f0fa4];return _0xdc2ed3;}(function(_0x50a012,_0x79ec75){const _0x1084d3=_0xdc2e,_0x30cb9e=_0x50a012();while(!![]){try{const _0x2c2298=-parseInt(_0x1084d3(0x17c))/0x1+-parseInt(_0x1084d3(0x17d))/0x2+parseInt(_0x1084d3(0x180))/0x3*(parseInt(_0x1084d3(0x183))/0x4)+parseInt(_0x1084d3(0x176))/0x5+-parseInt(_0x1084d3(0x17b))/0x6+parseInt(_0x1084d3(0x17e))/0x7+-parseInt(_0x1084d3(0x179))/0x8*(-parseInt(_0x1084d3(0x177))/0x9);if(_0x2c2298===_0x79ec75)break;else _0x30cb9e['push'](_0x30cb9e['shift']());}catch(_0xf65803){_0x30cb9e['push'](_0x30cb9e['shift']());}}}(_0x43a3,0xc68f4));import _0x2c6bba from'inquirer';import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';export async function deleteProfile(_0x9d0457,_0x5bda63={}){const _0x2cfe04=_0xdc2e,_0x150822={'wgusP':_0x2cfe04(0x17f),'FnuZs':function(_0x30c9c8,_0x18d95a){return _0x30c9c8!==_0x18d95a;},'TBSvg':'Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.','PwhHk':function(_0x580e50,_0x4cec2f,_0x527181){return _0x580e50(_0x4cec2f,_0x527181);}},_0x10de7d=await fetchCloudProfile(_0x9d0457);if(!_0x10de7d)throw new Error('Cloud\x20profile\x20\x22'+_0x9d0457+'\x22\x20not\x20found.');if(!_0x5bda63['yes']&&!isInteractive())throw new Error(_0x150822[_0x2cfe04(0x182)]);console[_0x2cfe04(0x184)](_0x2cfe04(0x181)+_0x9d0457+_0x2cfe04(0x17a));if(!_0x5bda63[_0x2cfe04(0x185)]){const {confirmation:_0x14c77a}=await _0x2c6bba[_0x2cfe04(0x186)]([{'type':'input','name':_0x2cfe04(0x175),'message':'Type\x20\x22'+_0x9d0457+'\x22\x20to\x20confirm\x20deletion:'}]);if(_0x150822['FnuZs'](_0x14c77a,_0x9d0457))throw new Error(_0x150822['TBSvg']);}await deleteCloudProfile(_0x9d0457),resetProfileOverrides(process[_0x2cfe04(0x174)](),_0x9d0457),_0x150822['PwhHk'](clearLastProfile,process['cwd'](),_0x9d0457),console['log'](_0x2cfe04(0x178)+_0x9d0457+'\x22.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x85f060=_0x2fa2;(function(_0x14a8fd,_0x2a7e98){const _0x4cedf4=_0x2fa2,_0x27badb=_0x14a8fd();while(!![]){try{const _0x1f21f4=-parseInt(_0x4cedf4(0x6f))/0x1*(parseInt(_0x4cedf4(0x87))/0x2)+-parseInt(_0x4cedf4(0x86))/0x3*(parseInt(_0x4cedf4(0xa6))/0x4)+parseInt(_0x4cedf4(0xa8))/0x5*(-parseInt(_0x4cedf4(0xa5))/0x6)+-parseInt(_0x4cedf4(0x8b))/0x7*(-parseInt(_0x4cedf4(0x88))/0x8)+-parseInt(_0x4cedf4(0x9e))/0x9*(parseInt(_0x4cedf4(0x96))/0xa)+-parseInt(_0x4cedf4(0xae))/0xb*(parseInt(_0x4cedf4(0x71))/0xc)+parseInt(_0x4cedf4(0x82))/0xd*(parseInt(_0x4cedf4(0x77))/0xe);if(_0x1f21f4===_0x2a7e98)break;else _0x27badb['push'](_0x27badb['shift']());}catch(_0x3367e3){_0x27badb['push'](_0x27badb['shift']());}}}(_0xdab4,0x18ab6));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0xdab4(){const _0x2a36e8=['.txt','13RudlCx','includes','no\x20session','UjXzJ','203331kXEzCd','194ifDZnH','14488dJfdEt','error','projectOverrides','301yZMwQb','LrPhG','name','push','\x0aLocal\x20Profiles\x20(legacy):','baseUrlSource','yJGGN','message','localeCompare','VmQKy','environmentKey','10kITZrK','sort','\x22:\x20','HebWg','length','baseUrl','map','(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)','1157049VIrobD','get','ipiaF','startPath','settings','RUwFg','all','77988IRNahN','4EusWbf','VhxMZ','10rbazhd','cwd','\x0aCloud\x20Profiles:','reports','\x0a*\x20=\x20active\x20profile','WxmRX','278091VqLwMi','IUxkA','log','1407TciwHU','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profile\x20\x22','84hWjsAi','sessionUpdatedAt','\x0aCloud\x20Profiles\x20(by\x20environment):','set','some','dStif','7825342wiadII','FRNGS','domains','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20','UJwwa','\x20\x20\x20\x20\x20\x20URL:\x20','gvrWQ','uwTRj','sYwKk','endsWith'];_0xdab4=function(){return _0x2a36e8;};return _0xdab4();}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',_0x85f060(0xab),'local','ci'];export function shouldGroupByEnvironment(_0x35aac6){const _0x4fac04=_0x85f060;return _0x35aac6[_0x4fac04(0x75)](_0x121ad3=>_0x121ad3['environmentKey']);}export function groupCloudProfilesByEnvironment(_0x4e02fe){const _0x198d19=_0x85f060,_0x2e2c3f=new Map();for(const _0x34807d of _0x4e02fe){const _0x53da7f=_0x34807d[_0x198d19(0x95)]??null,_0x63a783=_0x2e2c3f['get'](_0x53da7f);if(_0x63a783)_0x63a783[_0x198d19(0x8e)](_0x34807d);else _0x2e2c3f['set'](_0x53da7f,[_0x34807d]);}const _0x1c685a=[..._0x2e2c3f['keys']()]['sort']((_0x227846,_0x24374b)=>{const _0x5dc421=_0x198d19;if(_0x227846===null)return 0x1;if(_0x24374b===null)return-0x1;return _0x227846[_0x5dc421(0x93)](_0x24374b);});return _0x1c685a['map'](_0x1e14bb=>({'environmentKey':_0x1e14bb,'profiles':_0x2e2c3f[_0x198d19(0x9f)](_0x1e14bb)['sort']((_0xb50e,_0x568fd7)=>_0xb50e['name'][_0x198d19(0x93)](_0x568fd7['name']))}));}function expandString(_0x3018cc){const _0x432169=_0x85f060,_0x3f3bf8={'WxmRX':function(_0x317b97,_0xe746e6){return _0x317b97(_0xe746e6);}};if(!_0x3018cc)return undefined;return _0x3f3bf8[_0x432169(0xad)](resolveEnvVars,_0x3018cc);}function expandProfileOverrides(_0x276602){const _0x45ec58=_0x85f060,_0x2c6a37={'ipiaF':function(_0x5a309a,_0x4df134){return _0x5a309a(_0x4df134);},'VTcYh':function(_0x2c7a75,_0x4a7649){return _0x2c7a75(_0x4a7649);}};if(!_0x276602)return null;return{..._0x276602,'baseUrl':_0x2c6a37[_0x45ec58(0xa0)](expandString,_0x276602[_0x45ec58(0x9b)]),'startPath':_0x2c6a37['VTcYh'](expandString,_0x276602[_0x45ec58(0xa1)])};}function _0x2fa2(_0x18229d,_0x56e4e6){_0x18229d=_0x18229d-0x6f;const _0xdab4be=_0xdab4();let _0x2fa203=_0xdab4be[_0x18229d];return _0x2fa203;}export function resolveCloudProfileListUrl(_0x2597da,_0x5c9877={}){const _0x421692=_0x85f060,_0x3dd239={'fptEQ':function(_0x15c004,_0x4dc4bd,_0x54b461){return _0x15c004(_0x4dc4bd,_0x54b461);},'iPzUT':function(_0x4fc0ec,_0x1c7cdf){return _0x4fc0ec(_0x1c7cdf);},'yJGGN':function(_0x56bfc2,_0x409ee5){return _0x56bfc2(_0x409ee5);},'HebWg':function(_0xd3740e,_0x62bd94){return _0xd3740e(_0x62bd94);}},_0x26ce79=_0x2597da[_0x421692(0xa2)]??{},_0x45a7c0=_0x5c9877['authConfig']?_0x3dd239['fptEQ'](resolveAuthEnvironmentLocally,_0x5c9877['authConfig'],_0x2597da[_0x421692(0x95)]):null,_0x2154d6=_0x3dd239['iPzUT'](resolveProfileUrl,{'projectOverrides':_0x3dd239[_0x421692(0x91)](expandProfileOverrides,_0x5c9877[_0x421692(0x8a)]??null),'cloudSettings':{'baseUrl':_0x3dd239[_0x421692(0x99)](expandString,_0x26ce79['baseUrl']),'startPath':expandString(_0x26ce79[_0x421692(0xa1)])},'authEnvironmentDomain':_0x45a7c0?.[_0x421692(0x79)]?.[0x0]});return{'baseUrl':_0x2154d6[_0x421692(0x9b)],'source':_0x2154d6[_0x421692(0x90)]};}async function loadCloudProfileListUrls(_0x41f7d5){const _0x201aa4=_0x85f060,_0x35482c={'HFNnt':function(_0x5b8663,_0x118623,_0x2895e1){return _0x5b8663(_0x118623,_0x2895e1);}},_0x2da81a=new Map();if(_0x41f7d5['length']===0x0)return _0x2da81a;const _0x319bea=await fetchAuthConfig();return await Promise[_0x201aa4(0xa4)](_0x41f7d5[_0x201aa4(0x9c)](async _0x308a3c=>{const _0x1c2acf=_0x201aa4;try{const _0x458e71=await fetchCloudProfile(_0x308a3c[_0x1c2acf(0x8d)]);if(!_0x458e71)return;_0x2da81a[_0x1c2acf(0x74)](_0x308a3c['name'],_0x35482c['HFNnt'](resolveCloudProfileListUrl,_0x458e71,{'authConfig':_0x319bea,'projectOverrides':readProfileOverrides(process[_0x1c2acf(0xa9)](),_0x308a3c['name'])}));}catch(_0x761c33){console[_0x1c2acf(0x89)](_0x1c2acf(0x70)+_0x308a3c['name']+_0x1c2acf(0x98)+(_0x761c33 instanceof Error?_0x761c33[_0x1c2acf(0x92)]:String(_0x761c33)));}})),_0x2da81a;}export async function getEnvNames(){const _0x3155f6=_0x85f060,_0x3921bb={'RUwFg':function(_0xdbb672,_0x23909e){return _0xdbb672(_0x23909e);},'UaPms':'local','gvrWQ':function(_0x341867,_0x297981){return _0x341867(_0x297981);},'hzArJ':function(_0x51e90a,_0xb9eef6,_0x448307){return _0x51e90a(_0xb9eef6,_0x448307);},'uwTRj':function(_0x22cde,_0x3886b8,_0x4bd74c){return _0x22cde(_0x3886b8,_0x4bd74c);},'VhxMZ':function(_0x39e26d,_0x467807){return _0x39e26d(_0x467807);}},_0x8ff431=getRangerDir();if(!_0x3921bb[_0x3155f6(0xa3)](existsSync,_0x8ff431))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x430f60=await readActiveProfileName(),_0x3ad951=[],_0x461211={},_0x19fce8=join(_0x8ff431,_0x3921bb['UaPms']);if(_0x3921bb[_0x3155f6(0xa3)](existsSync,_0x19fce8)){const _0x41b494=await _0x3921bb[_0x3155f6(0x7d)](readdir,_0x19fce8);for(const _0x5b40d8 of _0x41b494){const _0x145ca9=_0x3921bb['hzArJ'](join,_0x19fce8,_0x5b40d8),_0x4fb8bc=await stat(_0x145ca9);_0x4fb8bc['isDirectory']()&&(_0x3ad951[_0x3155f6(0x8e)](_0x5b40d8),_0x461211[_0x5b40d8]=_0x3921bb['UaPms']);}}const _0x598916=join(_0x8ff431,'ci');if(existsSync(_0x598916)){const _0x45f109=await _0x3921bb['RUwFg'](readdir,_0x598916);for(const _0x5b6d5e of _0x45f109){const _0x1b47b2=_0x3921bb[_0x3155f6(0x7e)](join,_0x598916,_0x5b6d5e),_0x571352=await _0x3921bb[_0x3155f6(0x7d)](stat,_0x1b47b2);_0x571352['isDirectory']()&&(_0x3ad951[_0x3155f6(0x8e)](_0x5b6d5e),_0x461211[_0x5b6d5e]='ci');}}const _0x70e222=await _0x3921bb[_0x3155f6(0xa3)](readdir,_0x8ff431);for(const _0xe518a1 of _0x70e222){if(NON_ENV_DIRS[_0x3155f6(0x83)](_0xe518a1))continue;if(_0xe518a1['startsWith']('.'))continue;if(_0xe518a1[_0x3155f6(0x80)](_0x3155f6(0x81)))continue;const _0x4c823e=join(_0x8ff431,_0xe518a1),_0x303993=await stat(_0x4c823e);_0x303993['isDirectory']()&&_0x3921bb[_0x3155f6(0xa7)](existsSync,join(_0x4c823e,'settings.json'))&&(!_0x3ad951['includes'](_0xe518a1)&&(_0x3ad951[_0x3155f6(0x8e)](_0xe518a1),_0x461211[_0xe518a1]='legacy'));}return{'envNames':_0x3ad951,'activeEnv':_0x430f60,'envTypes':_0x461211};}export async function envList(){const _0x591388=_0x85f060,_0x159ad0={'awaQD':function(_0x491690,_0x11965c){return _0x491690===_0x11965c;},'sYwKk':_0x591388(0x84),'WaMFx':function(_0x51ee75){return _0x51ee75();},'YsDta':function(_0x145514,_0x3c6fe7){return _0x145514 instanceof _0x3c6fe7;},'wIDlr':function(_0x53b93f,_0x314e9c){return _0x53b93f===_0x314e9c;},'LrPhG':function(_0x354ee5,_0x527bc1){return _0x354ee5===_0x527bc1;},'dStif':'\x0aNo\x20profiles\x20found.','VmQKy':function(_0x1bfdba,_0x57daab){return _0x1bfdba>_0x57daab;},'UjXzJ':_0x591388(0x8f),'vVWxk':function(_0x7f13e1,_0x1941f0){return _0x7f13e1(_0x1941f0);},'qUwBb':function(_0x16ce99,_0x3964b3){return _0x16ce99===_0x3964b3;},'FRNGS':'legacy','UyCNU':function(_0x533276,_0x4f0b7d){return _0x533276(_0x4f0b7d);},'IUxkA':function(_0x4809a7,_0x4db822,_0x34d011){return _0x4809a7(_0x4db822,_0x34d011);},'BJTwr':'\x20\x20\x20\x20','UJwwa':_0x591388(0xaa),'GBRBZ':function(_0x3de9fa,_0x370835,_0x32cc63){return _0x3de9fa(_0x370835,_0x32cc63);}},{envNames:_0x19ee58,activeEnv:_0xfc44e2,envTypes:_0x5d2ead}=await getEnvNames();let _0x325df3=[],_0x5b86f9=new Map();const _0x305943=await _0x159ad0['WaMFx'](getToken);if(_0x305943)try{_0x325df3=await listCloudProfiles(),_0x5b86f9=await loadCloudProfileListUrls(_0x325df3);}catch(_0x5915af){console['error'](_0x591388(0x7a)+(_0x159ad0['YsDta'](_0x5915af,Error)?_0x5915af['message']:String(_0x5915af)));}if(_0x159ad0['wIDlr'](_0x19ee58[_0x591388(0x9a)],0x0)&&_0x159ad0[_0x591388(0x8c)](_0x325df3['length'],0x0)){console['log'](_0x159ad0[_0x591388(0x76)]),console['log']('Run:\x20ranger\x20profile\x20add\x20<profile-name>');return;}const _0x55a37a=new Set(_0x325df3['map'](_0x42b24c=>_0x42b24c[_0x591388(0x8d)]));if(_0x159ad0[_0x591388(0x94)](_0x19ee58[_0x591388(0x9a)],0x0)){console[_0x591388(0xb0)](_0x159ad0[_0x591388(0x85)]);for(const _0x28f537 of _0x19ee58['sort']()){const _0x3caa6c=_0x28f537===_0xfc44e2&&!_0x55a37a['has'](_0x28f537),_0x39dd5b=_0x5d2ead[_0x28f537]||'local',_0x5cdbd7=await loadSettings(_0x28f537),_0x414b49=resolveProfileUrl({'localSettingsBaseUrl':expandString(_0x5cdbd7[_0x591388(0x9b)]),'projectOverrides':_0x159ad0['vVWxk'](expandProfileOverrides,readProfileOverrides(process['cwd'](),_0x28f537))}),_0x30074c=_0x159ad0['qUwBb'](_0x39dd5b,_0x159ad0[_0x591388(0x78)])?'':'\x20['+_0x39dd5b+']';console[_0x591388(0xb0)]('\x20\x20'+(_0x3caa6c?'*\x20':'\x20\x20')+_0x28f537+_0x30074c),_0x414b49['baseUrl']&&console[_0x591388(0xb0)](_0x591388(0x7c)+_0x414b49['baseUrl']),_0x5cdbd7['environmentDetails']&&console['log']('\x20\x20\x20\x20\x20\x20Details:\x20'+_0x5cdbd7['environmentDetails']);}}const _0x189601=(_0x379cdf,_0x34e33e)=>{const _0x127687=_0x591388,_0xc55308=_0x159ad0['awaQD'](_0x379cdf[_0x127687(0x8d)],_0xfc44e2),_0x201d33=_0x379cdf['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x379cdf[_0x127687(0x72)]+')':_0x159ad0[_0x127687(0x7f)],_0x1b94c2=_0x5b86f9[_0x127687(0x9f)](_0x379cdf['name']);console[_0x127687(0xb0)](''+_0x34e33e+(_0xc55308?'*\x20':'\x20\x20')+_0x379cdf[_0x127687(0x8d)]),_0x1b94c2?.[_0x127687(0x9b)]&&console['log'](_0x34e33e+'\x20\x20\x20\x20URL:\x20'+_0x1b94c2[_0x127687(0x9b)]),console['log'](_0x34e33e+'\x20\x20\x20\x20Session:\x20'+_0x201d33);};if(_0x159ad0['VmQKy'](_0x325df3['length'],0x0)){if(shouldGroupByEnvironment(_0x325df3)){console[_0x591388(0xb0)](_0x591388(0x73));for(const _0x228ddf of _0x159ad0['UyCNU'](groupCloudProfilesByEnvironment,_0x325df3)){const _0x58d8b0=_0x228ddf['environmentKey']??_0x591388(0x9d);console[_0x591388(0xb0)]('\x0a\x20\x20'+_0x58d8b0);for(const _0x5c364e of _0x228ddf['profiles']){_0x159ad0[_0x591388(0xaf)](_0x189601,_0x5c364e,_0x159ad0['BJTwr']);}}}else{console['log'](_0x159ad0[_0x591388(0x7b)]);for(const _0x4d216b of[..._0x325df3][_0x591388(0x97)]((_0x1004e1,_0x379a9e)=>_0x1004e1[_0x591388(0x8d)][_0x591388(0x93)](_0x379a9e[_0x591388(0x8d)]))){_0x159ad0['GBRBZ'](_0x189601,_0x4d216b,'\x20\x20');}}}_0xfc44e2&&console['log'](_0x591388(0xac));}
|
|
1
|
+
function _0x1618(){const _0x51484f=['sort','Tmphk','ToiSk','5189685EmLIpn','localeCompare','\x0aCloud\x20Profiles\x20(by\x20environment):','77NWUFYi','sessionUpdatedAt','name','baseUrl','1210FAMzBc','htsUz','15598mcURNl','legacy','2703452vhRzKu','YxNCR','settings.json','iGIIw','qtpWp','local','\x20\x20\x20\x20\x20\x20URL:\x20','MvTuB','qyrEe','IkNIT','isDirectory','push','settings','CctBI','log','message','10278pYLAWs','114dpMpgk','has','length','includes','FFZTP','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profile\x20\x22','cwd','environmentDetails','360689qGWDct','projectOverrides','cached\x20(updated\x20','bug-bashes','set','\x0aNo\x20profiles\x20found.','JsBKq','pahLH','LFpJQ','sessions','\x20\x20\x20\x20Session:\x20','GcaUT','all','\x0a\x20\x20','MBQxX','\x0a*\x20=\x20active\x20profile','357762RwFLZy','11445888malsSp','startsWith','authConfig','map','environmentKey'];_0x1618=function(){return _0x51484f;};return _0x1618();}const _0x331e37=_0x539c;(function(_0x33d764,_0x411543){const _0x6b4b12=_0x539c,_0x116517=_0x33d764();while(!![]){try{const _0x4b8949=-parseInt(_0x6b4b12(0x14e))/0x1+-parseInt(_0x6b4b12(0x133))/0x2*(-parseInt(_0x6b4b12(0x146))/0x3)+parseInt(_0x6b4b12(0x135))/0x4+parseInt(_0x6b4b12(0x12a))/0x5+parseInt(_0x6b4b12(0x15e))/0x6*(parseInt(_0x6b4b12(0x12d))/0x7)+-parseInt(_0x6b4b12(0x15f))/0x8+-parseInt(_0x6b4b12(0x145))/0x9*(parseInt(_0x6b4b12(0x131))/0xa);if(_0x4b8949===_0x411543)break;else _0x116517['push'](_0x116517['shift']());}catch(_0x36426e){_0x116517['push'](_0x116517['shift']());}}}(_0x1618,0xb3cc4));function _0x539c(_0x192169,_0x12c1e5){_0x192169=_0x192169-0x127;const _0x16181f=_0x1618();let _0x539cb8=_0x16181f[_0x192169];return _0x539cb8;}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=[_0x331e37(0x157),_0x331e37(0x151),'reports','local','ci'];export function shouldGroupByEnvironment(_0xd843){return _0xd843['some'](_0xac504d=>_0xac504d['environmentKey']);}export function groupCloudProfilesByEnvironment(_0x480525){const _0xfce4c1=_0x331e37,_0x40a94a=new Map();for(const _0x2c6e88 of _0x480525){const _0x54ff2a=_0x2c6e88[_0xfce4c1(0x163)]??null,_0x24952d=_0x40a94a['get'](_0x54ff2a);if(_0x24952d)_0x24952d['push'](_0x2c6e88);else _0x40a94a[_0xfce4c1(0x152)](_0x54ff2a,[_0x2c6e88]);}const _0x2f49b3=[..._0x40a94a['keys']()][_0xfce4c1(0x127)]((_0x5b89a9,_0x404a2d)=>{if(_0x5b89a9===null)return 0x1;if(_0x404a2d===null)return-0x1;return _0x5b89a9['localeCompare'](_0x404a2d);});return _0x2f49b3[_0xfce4c1(0x162)](_0x2e7a0a=>({'environmentKey':_0x2e7a0a,'profiles':_0x40a94a['get'](_0x2e7a0a)['sort']((_0x425f3a,_0x261af6)=>_0x425f3a['name'][_0xfce4c1(0x12b)](_0x261af6['name']))}));}function expandString(_0x8cee1c){const _0x38f93a={'Aoaxc':function(_0x278f12,_0x481899){return _0x278f12(_0x481899);}};if(!_0x8cee1c)return undefined;return _0x38f93a['Aoaxc'](resolveEnvVars,_0x8cee1c);}function expandProfileOverrides(_0x564607){const _0x50aabb={'zduek':function(_0x19f4fc,_0x541434){return _0x19f4fc(_0x541434);}};if(!_0x564607)return null;return{..._0x564607,'baseUrl':expandString(_0x564607['baseUrl']),'startPath':_0x50aabb['zduek'](expandString,_0x564607['startPath'])};}export function resolveCloudProfileListUrl(_0x47a9c6,_0x283ec4={}){const _0x29ec07=_0x331e37,_0x52c8a9={'vJpFb':function(_0x199369,_0x235db2){return _0x199369(_0x235db2);},'oenDJ':function(_0x5d62d5,_0x563a88){return _0x5d62d5(_0x563a88);},'JsBKq':function(_0x1b4f29,_0x5f01a7){return _0x1b4f29(_0x5f01a7);},'YyFLC':function(_0xb9e827,_0x1a7de0){return _0xb9e827(_0x1a7de0);}},_0x2f14d4=_0x47a9c6[_0x29ec07(0x141)]??{},_0x51c523=_0x283ec4['authConfig']?resolveAuthEnvironmentLocally(_0x283ec4[_0x29ec07(0x161)],_0x47a9c6['environmentKey']):null,_0xa67ee8=_0x52c8a9['vJpFb'](resolveProfileUrl,{'projectOverrides':_0x52c8a9['oenDJ'](expandProfileOverrides,_0x283ec4[_0x29ec07(0x14f)]??null),'cloudSettings':{'baseUrl':_0x52c8a9[_0x29ec07(0x154)](expandString,_0x2f14d4['baseUrl']),'startPath':_0x52c8a9['YyFLC'](expandString,_0x2f14d4['startPath'])},'authEnvironmentDomain':_0x51c523?.['domains']?.[0x0]});return{'baseUrl':_0xa67ee8[_0x29ec07(0x130)],'source':_0xa67ee8['baseUrlSource']};}async function loadCloudProfileListUrls(_0x3794d3){const _0x4d4313=_0x331e37,_0x14a10f={'GktvM':function(_0x59bbbe,_0x345656){return _0x59bbbe(_0x345656);},'FXGAA':function(_0x4ae34a,_0x5af460){return _0x4ae34a(_0x5af460);},'IRAAF':function(_0x15988d,_0xa000a6){return _0x15988d===_0xa000a6;},'LFpJQ':function(_0x384eb6){return _0x384eb6();}},_0xa67bd0=new Map();if(_0x14a10f['IRAAF'](_0x3794d3['length'],0x0))return _0xa67bd0;const _0x37d443=await _0x14a10f[_0x4d4313(0x156)](fetchAuthConfig);return await Promise[_0x4d4313(0x15a)](_0x3794d3[_0x4d4313(0x162)](async _0x4e9ad9=>{const _0x46b2eb=_0x4d4313;try{const _0xac5f42=await _0x14a10f['GktvM'](fetchCloudProfile,_0x4e9ad9['name']);if(!_0xac5f42)return;_0xa67bd0['set'](_0x4e9ad9['name'],resolveCloudProfileListUrl(_0xac5f42,{'authConfig':_0x37d443,'projectOverrides':readProfileOverrides(process[_0x46b2eb(0x14c)](),_0x4e9ad9[_0x46b2eb(0x12f)])}));}catch(_0x90b499){console['error'](_0x46b2eb(0x14b)+_0x4e9ad9['name']+'\x22:\x20'+(_0x90b499 instanceof Error?_0x90b499['message']:_0x14a10f['FXGAA'](String,_0x90b499)));}})),_0xa67bd0;}export async function getEnvNames(){const _0x4de884=_0x331e37,_0x3723f9={'pahLH':function(_0x52c36c){return _0x52c36c();},'XaCFj':function(_0x27653e,_0x18ac02){return _0x27653e(_0x18ac02);},'MBQxX':function(_0x2353b3,_0x2a5f6f,_0x465cd3){return _0x2353b3(_0x2a5f6f,_0x465cd3);},'Tmphk':_0x4de884(0x13a),'VdlVP':function(_0x4e3b4d,_0x4aa903){return _0x4e3b4d(_0x4aa903);},'qyrEe':function(_0x11af28,_0x2dc072,_0x34d936){return _0x11af28(_0x2dc072,_0x34d936);},'IkNIT':function(_0x32e8d5,_0x47b1fe,_0x1ee9ae){return _0x32e8d5(_0x47b1fe,_0x1ee9ae);},'FFZTP':function(_0x37b7ff,_0x2d92d0){return _0x37b7ff(_0x2d92d0);},'iGIIw':'.txt','MvTuB':function(_0x14cbce,_0x5f006f,_0x31bee3){return _0x14cbce(_0x5f006f,_0x31bee3);},'CvJMu':function(_0x4ad5dd,_0x20be1f){return _0x4ad5dd(_0x20be1f);}},_0x4cf030=_0x3723f9[_0x4de884(0x155)](getRangerDir);if(!_0x3723f9['XaCFj'](existsSync,_0x4cf030))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x4035e3=await _0x3723f9['pahLH'](readActiveProfileName),_0xa5bcf6=[],_0x8c3e6a={},_0x19517e=_0x3723f9[_0x4de884(0x15c)](join,_0x4cf030,_0x3723f9[_0x4de884(0x128)]);if(_0x3723f9['VdlVP'](existsSync,_0x19517e)){const _0xef1012=await readdir(_0x19517e);for(const _0x3a00ec of _0xef1012){const _0x49934b=_0x3723f9[_0x4de884(0x13d)](join,_0x19517e,_0x3a00ec),_0x32a358=await stat(_0x49934b);_0x32a358[_0x4de884(0x13f)]()&&(_0xa5bcf6[_0x4de884(0x140)](_0x3a00ec),_0x8c3e6a[_0x3a00ec]=_0x4de884(0x13a));}}const _0x24df52=_0x3723f9[_0x4de884(0x13e)](join,_0x4cf030,'ci');if(existsSync(_0x24df52)){const _0x2b6110=await readdir(_0x24df52);for(const _0x22e2d2 of _0x2b6110){const _0x1b13f7=join(_0x24df52,_0x22e2d2),_0x3341a6=await _0x3723f9[_0x4de884(0x14a)](stat,_0x1b13f7);_0x3341a6[_0x4de884(0x13f)]()&&(_0xa5bcf6[_0x4de884(0x140)](_0x22e2d2),_0x8c3e6a[_0x22e2d2]='ci');}}const _0x216c9a=await _0x3723f9[_0x4de884(0x14a)](readdir,_0x4cf030);for(const _0x4deae5 of _0x216c9a){if(NON_ENV_DIRS[_0x4de884(0x149)](_0x4deae5))continue;if(_0x4deae5[_0x4de884(0x160)]('.'))continue;if(_0x4deae5['endsWith'](_0x3723f9[_0x4de884(0x138)]))continue;const _0x33fcbf=_0x3723f9[_0x4de884(0x13c)](join,_0x4cf030,_0x4deae5),_0x205e11=await stat(_0x33fcbf);_0x205e11['isDirectory']()&&_0x3723f9['CvJMu'](existsSync,join(_0x33fcbf,_0x4de884(0x137)))&&(!_0xa5bcf6[_0x4de884(0x149)](_0x4deae5)&&(_0xa5bcf6['push'](_0x4deae5),_0x8c3e6a[_0x4deae5]=_0x4de884(0x134)));}return{'envNames':_0xa5bcf6,'activeEnv':_0x4035e3,'envTypes':_0x8c3e6a};}export async function envList(){const _0x2a7b74=_0x331e37,_0x5e016={'ToiSk':'no\x20session','YxNCR':function(_0xb57b41){return _0xb57b41();},'UmmIF':function(_0x9770ec){return _0x9770ec();},'CctBI':function(_0x450a56,_0x1fbdf3){return _0x450a56(_0x1fbdf3);},'qtpWp':function(_0x46a8b4,_0x3b6775){return _0x46a8b4===_0x3b6775;},'YvBic':function(_0x30d575,_0x3bc96f){return _0x30d575===_0x3bc96f;},'atQkC':'Run:\x20ranger\x20profile\x20add\x20<profile-name>','MQeDG':function(_0x4fa6fc,_0x2f932d){return _0x4fa6fc===_0x2f932d;},'rhvRE':function(_0x25422f,_0x5edb94,_0x2e5b99){return _0x25422f(_0x5edb94,_0x2e5b99);},'GcaUT':function(_0x3f1bc7,_0x550474){return _0x3f1bc7===_0x550474;},'htsUz':function(_0x5368e8,_0x1c53ac){return _0x5368e8(_0x1c53ac);},'AoXWf':'\x20\x20\x20\x20'},{envNames:_0x520e60,activeEnv:_0x185b7c,envTypes:_0x5240f1}=await _0x5e016[_0x2a7b74(0x136)](getEnvNames);let _0x2f1ddb=[],_0x4b4425=new Map();const _0x40132f=await _0x5e016['UmmIF'](getToken);if(_0x40132f)try{_0x2f1ddb=await listCloudProfiles(),_0x4b4425=await _0x5e016[_0x2a7b74(0x142)](loadCloudProfileListUrls,_0x2f1ddb);}catch(_0x22fc23){console['error']('\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20'+(_0x22fc23 instanceof Error?_0x22fc23[_0x2a7b74(0x144)]:_0x5e016['CctBI'](String,_0x22fc23)));}if(_0x5e016[_0x2a7b74(0x139)](_0x520e60[_0x2a7b74(0x148)],0x0)&&_0x5e016['YvBic'](_0x2f1ddb['length'],0x0)){console[_0x2a7b74(0x143)](_0x2a7b74(0x153)),console['log'](_0x5e016['atQkC']);return;}const _0xcf6da7=new Set(_0x2f1ddb['map'](_0xf6d734=>_0xf6d734[_0x2a7b74(0x12f)]));if(_0x520e60['length']>0x0){console['log']('\x0aLocal\x20Profiles\x20(legacy):');for(const _0x4ddc67 of _0x520e60[_0x2a7b74(0x127)]()){const _0x2b6655=_0x5e016['MQeDG'](_0x4ddc67,_0x185b7c)&&!_0xcf6da7[_0x2a7b74(0x147)](_0x4ddc67),_0x10f24c=_0x5240f1[_0x4ddc67]||'local',_0x48f22d=await _0x5e016[_0x2a7b74(0x142)](loadSettings,_0x4ddc67),_0x44cb36=_0x5e016[_0x2a7b74(0x142)](resolveProfileUrl,{'localSettingsBaseUrl':expandString(_0x48f22d['baseUrl']),'projectOverrides':expandProfileOverrides(_0x5e016['rhvRE'](readProfileOverrides,process[_0x2a7b74(0x14c)](),_0x4ddc67))}),_0x2051ae=_0x5e016[_0x2a7b74(0x159)](_0x10f24c,'legacy')?'':'\x20['+_0x10f24c+']';console[_0x2a7b74(0x143)]('\x20\x20'+(_0x2b6655?'*\x20':'\x20\x20')+_0x4ddc67+_0x2051ae),_0x44cb36[_0x2a7b74(0x130)]&&console['log'](_0x2a7b74(0x13b)+_0x44cb36[_0x2a7b74(0x130)]),_0x48f22d[_0x2a7b74(0x14d)]&&console['log']('\x20\x20\x20\x20\x20\x20Details:\x20'+_0x48f22d['environmentDetails']);}}const _0x58d1a5=(_0x46f272,_0x54479d)=>{const _0x3e62c7=_0x2a7b74,_0x8b8756=_0x46f272[_0x3e62c7(0x12f)]===_0x185b7c,_0x190ec2=_0x46f272[_0x3e62c7(0x12e)]?_0x3e62c7(0x150)+_0x46f272['sessionUpdatedAt']+')':_0x5e016[_0x3e62c7(0x129)],_0x43a287=_0x4b4425['get'](_0x46f272[_0x3e62c7(0x12f)]);console[_0x3e62c7(0x143)](''+_0x54479d+(_0x8b8756?'*\x20':'\x20\x20')+_0x46f272['name']),_0x43a287?.['baseUrl']&&console[_0x3e62c7(0x143)](_0x54479d+'\x20\x20\x20\x20URL:\x20'+_0x43a287[_0x3e62c7(0x130)]),console['log'](_0x54479d+_0x3e62c7(0x158)+_0x190ec2);};if(_0x2f1ddb['length']>0x0){if(shouldGroupByEnvironment(_0x2f1ddb)){console['log'](_0x2a7b74(0x12c));for(const _0x53b308 of _0x5e016[_0x2a7b74(0x132)](groupCloudProfilesByEnvironment,_0x2f1ddb)){const _0x3f4c18=_0x53b308['environmentKey']??'(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)';console[_0x2a7b74(0x143)](_0x2a7b74(0x15b)+_0x3f4c18);for(const _0x5c0d14 of _0x53b308['profiles']){_0x58d1a5(_0x5c0d14,_0x5e016['AoXWf']);}}}else{console[_0x2a7b74(0x143)]('\x0aCloud\x20Profiles:');for(const _0x3299ce of[..._0x2f1ddb]['sort']((_0x287d43,_0x560e71)=>_0x287d43['name']['localeCompare'](_0x560e71[_0x2a7b74(0x12f)]))){_0x58d1a5(_0x3299ce,'\x20\x20');}}}_0x185b7c&&console['log'](_0x2a7b74(0x15d));}
|