@ranger-testing/ranger-cli 3.1.6-alpha.aca5f9c-53 → 3.1.6-alpha.e1ccb01-57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/scenarioOriginCheck.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +14 -5
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xe4ce29,_0x3d7cf3){const _0xa3da43=_0x2836,_0x475f0a=_0xe4ce29();while(!![]){try{const _0x144c88=parseInt(_0xa3da43(0x1c3))/0x1*(parseInt(_0xa3da43(0x212))/0x2)+parseInt(_0xa3da43(0x1e9))/0x3+parseInt(_0xa3da43(0x1fe))/0x4+parseInt(_0xa3da43(0x1d6))/0x5+parseInt(_0xa3da43(0x22a))/0x6*(-parseInt(_0xa3da43(0x21f))/0x7)+-parseInt(_0xa3da43(0x1bb))/0x8+-parseInt(_0xa3da43(0x235))/0x9;if(_0x144c88===_0x3d7cf3)break;else _0x475f0a['push'](_0x475f0a['shift']());}catch(_0x12359d){_0x475f0a['push'](_0x475f0a['shift']());}}}(_0x1a7b,0xf1c22));import{readdir,rm}from'fs/promises';function _0x2836(_0x35f9fc,_0x5a6160){_0x35f9fc=_0x35f9fc-0x1ac;const _0x1a7bc2=_0x1a7b();let _0x2836ea=_0x1a7bc2[_0x35f9fc];return _0x2836ea;}import{join}from'path';import{existsSync}from'fs';import _0x2b71a3 from'inquirer';function _0x1a7b(){const _0x4413df=['AFaIS','list','retry','TrHlR','log','DlRZh','yTxyZ','HEAD','name','6054388VVbbXu','xqbUp','profile.add.autoRouted','input','DeVfr','\x20\x20Did\x20you\x20mean\x20','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','prompt','trackPhaseEnd','\x0a✓\x20Profile\x20\x27','ERkpX','error','✓\x20Profile\x20\x27','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','lajQo','some','Found\x20auth\x20environment\x20\x27','isTTY','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','YIxyV','50822SArXNS','\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','profile.add.autoRouteSkipped','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20','url','TypeError','SSGEk','cdpEndpoint','startsWith','http://','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','pwfCf','42fBGeXF','ZmMvG','test','\x20--url\x20','QTdrF','JFivS','khMGp','\x0a\x20\x20Auth\x20environment\x20\x22','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','TzoMP','exit','911622GQikwB','ixoPh','VJYlH','RAnEi','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.','yes','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','Use\x20','XRmUP','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20','\x20Configured\x20envs:\x20','14320134njbmsn','XSNhz','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','baseUrl','\x27\x20to\x20the\x20cloud?','\x27\x20matching\x20','isElectron','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','message','\x22:\x20','boTnm','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','\x27\x20created\x20(no\x20session).\x0a','egKqa','no_auth_config','\x20--skip-auth\x0a','skipAuth','indexOf','\x27\x20created.\x0a','7055544MDwAJd','status','beREe','hUeCB','trim','BKmsG','xDRBN','zTsai','69WQZgGY','\x0a🌐\x20Profile\x20Setup\x0a','stdout','kEilj','\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','DZarU','isProtocolError','✓\x20Cloud\x20profile\x20\x27','KWEAc','gDhkw','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','cwd','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','no_match','\x20\x20Set\x20active\x20profile:\x20','2917980urbejO','Continue\x20anyway','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','keys','env_not_found','Ryljw','setupHeader','length','authEnv','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','environments','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','\x20\x20https://docs.ranger.net/main/concepts/profiles','Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000','fetch\x20failed','YAZOo','rbjYD','1573143qIkxBo','--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','includes','saveToCloud','setupHeaders','EZePF','origin','action','force','What\x20would\x20you\x20like\x20to\x20do?','join','http://localhost:3000'];_0x1a7b=function(){return _0x4413df;};return _0x1a7b();}import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING='This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization';function warnCloudProfileSharedInOrg(){const _0x299297=_0x2836;if(!process[_0x299297(0x1c5)][_0x299297(0x20f)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x529afd){const _0x12a9a1=_0x2836,_0x5585ef={'tQwDO':function(_0xd0565c,_0x41a45d){return _0xd0565c<_0x41a45d;},'TrHlR':function(_0x441b57,_0xcfbb12){return _0x441b57===_0xcfbb12;},'KWEAc':_0x12a9a1(0x218),'qgxmu':_0x12a9a1(0x1e6)};try{const _0xe5a2c8=new AbortController(),_0x59bfa5=setTimeout(()=>_0xe5a2c8['abort'](),0x1388),_0x5592bc={'method':_0x12a9a1(0x1fc),'signal':_0xe5a2c8['signal'],'redirect':'manual'};/^https:\/\/localhost(:\d+)?/i['test'](_0x529afd)&&(process['env']['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x3b918a=await fetch(_0x529afd,_0x5592bc);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x59bfa5);if(_0x5585ef['tQwDO'](_0x3b918a[_0x12a9a1(0x1bc)],0x190))return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x3b918a[_0x12a9a1(0x1bc)]};}catch(_0x198b15){delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x4e8a04=_0x198b15,_0xabd8b4=_0x4e8a04['message']||String(_0x198b15),_0x1d0e36=_0xabd8b4['includes']('Invalid\x20URL')||_0x5585ef[_0x12a9a1(0x1f8)](_0x4e8a04[_0x12a9a1(0x1fd)],_0x5585ef[_0x12a9a1(0x1cd)])||_0xabd8b4[_0x12a9a1(0x1eb)](_0x5585ef['qgxmu']);return{'ok':![],'error':_0xabd8b4,'isProtocolError':_0x1d0e36};}}async function sweepOrphanLocalProfile(_0x17939c,_0x1c4f04,_0x34d8ae){const _0x13bad1=_0x2836,_0x288f01={'AYehI':function(_0xf57b5a,_0x53f042){return _0xf57b5a(_0x53f042);},'boTnm':function(_0x985d73,_0x3c4d8a,_0x1ed60f){return _0x985d73(_0x3c4d8a,_0x1ed60f);}},_0x9fcfd0=join(_0x1c4f04,'local'),_0x311a1d=join(_0x9fcfd0,_0x17939c);existsSync(_0x311a1d)&&(_0x34d8ae&&await isPathGitTracked(_0x311a1d)?console['log']('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x311a1d+_0x13bad1(0x21d)):(await rm(_0x311a1d,{'recursive':!![],'force':!![]}),console[_0x13bad1(0x1f9)](_0x13bad1(0x1e3)+_0x311a1d)));if(existsSync(_0x9fcfd0)){let _0x7eea84=[];try{_0x7eea84=await _0x288f01['AYehI'](readdir,_0x9fcfd0);}catch{return;}const _0xe059c0='.tmp-'+_0x17939c+'-';for(const _0x454ad9 of _0x7eea84){if(!_0x454ad9[_0x13bad1(0x21b)](_0xe059c0))continue;const _0x82f2e0=join(_0x9fcfd0,_0x454ad9);await _0x288f01[_0x13bad1(0x1b2)](rm,_0x82f2e0,{'recursive':!![],'force':!![]}),console['log'](_0x13bad1(0x1e3)+_0x82f2e0);}}}async function sweepOrphansBestEffort(_0x45bf32){const _0x36ee55=_0x2836,_0xa8178={'DVtKr':function(_0x3c8c29,_0x4c4a4e,_0x526e86,_0x407195){return _0x3c8c29(_0x4c4a4e,_0x526e86,_0x407195);},'UBRke':function(_0x3fa05f){return _0x3fa05f();},'GlMqZ':function(_0x2f64f0){return _0x2f64f0();},'JFivS':function(_0x3e962d,_0x498bf8,_0x1faaeb,_0x31ced9){return _0x3e962d(_0x498bf8,_0x1faaeb,_0x31ced9);},'kEilj':function(_0x502815,_0x1a0d8a){return _0x502815 instanceof _0x1a0d8a;}};try{await _0xa8178['DVtKr'](sweepOrphanLocalProfile,_0x45bf32,_0xa8178['UBRke'](getRangerHomeDir),![]);const _0x25c294=_0xa8178['GlMqZ'](getRangerDir);_0x25c294!==getRangerHomeDir()&&await _0xa8178[_0x36ee55(0x224)](sweepOrphanLocalProfile,_0x45bf32,_0x25c294,!![]);}catch(_0x36d6ef){console[_0x36ee55(0x1f9)](_0x36ee55(0x230)+(_0xa8178[_0x36ee55(0x1c6)](_0x36d6ef,Error)?_0x36d6ef[_0x36ee55(0x1b0)]:String(_0x36d6ef))+').');}}async function markActive(_0xf73eed){const _0x37c922=_0x2836;try{await writeActiveProfileName(_0xf73eed),console[_0x37c922(0x1f9)](_0x37c922(0x1d5)+_0xf73eed);}catch{console['log']('Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.');}}async function tryAutoRouteCloudProfile(_0xd3209e,_0x55afb4,_0x317fba,_0x5365c3,_0x405dd7){const _0x153200=_0x2836,_0x29344f={'bxrFR':function(_0x12b55c,_0x3f9679){return _0x12b55c instanceof _0x3f9679;},'gDhkw':function(_0x425aad,_0x1ec39c){return _0x425aad===_0x1ec39c;},'nUOqi':_0x153200(0x215),'PSRIU':_0x153200(0x1b6),'DZarU':function(_0x30f99,_0x508235){return _0x30f99+_0x508235;},'YAZOo':_0x153200(0x204),'ZmMvG':_0x153200(0x1da),'ixoPh':_0x153200(0x1d4),'egKqa':'confirm','pwfCf':_0x153200(0x227),'RtslG':function(_0x4825fc,_0x2d232c,_0x2efe85,_0x5daf0e){return _0x4825fc(_0x2d232c,_0x2efe85,_0x5daf0e);},'owyDT':_0x153200(0x200)};let _0x20ce71;try{_0x20ce71=await fetchAuthConfig();}catch(_0x58a94c){return _0x405dd7?.[_0x153200(0x206)](_0x153200(0x215),{'reason':_0x153200(0x1b6),'profileName':_0xd3209e}),console['error']('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x29344f['bxrFR'](_0x58a94c,Error)?_0x58a94c['message']:String(_0x58a94c))),![];}if((!_0x20ce71||!_0x20ce71['environments']||_0x29344f[_0x153200(0x1ce)](Object['keys'](_0x20ce71[_0x153200(0x1e1)])[_0x153200(0x1dd)],0x0))&&!_0x317fba[_0x153200(0x1de)]){if(_0x5365c3)return await captureEnvLessProfile(_0xd3209e,_0x55afb4,_0x317fba,_0x405dd7);return _0x405dd7?.['trackPhaseEnd'](_0x29344f['nUOqi'],{'reason':_0x29344f['PSRIU'],'profileName':_0xd3209e}),console['error'](_0x29344f[_0x153200(0x1ca)](_0x29344f['DZarU'](_0x29344f[_0x153200(0x1ca)](_0x29344f[_0x153200(0x1ca)]('\x0a\x20\x20Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team\x20yet\x20—\x20that\x27s\x20the\x20path\x20that\x20lets\x20Ranger\x20log\x20into\x20your\x20app\x20for\x20you\x20in\x20CI\x20/\x20background\x20agents.\x0a','\x0a')+'\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a'+(_0x153200(0x216)+_0xd3209e+_0x153200(0x222)+_0x55afb4+_0x153200(0x1b7)),'\x0a'),_0x29344f[_0x153200(0x1e7)]),_0x153200(0x210))),![];}let _0x5d79a4;if(_0x317fba[_0x153200(0x1de)]){if(!_0x20ce71?.['environments']?.[_0x317fba['authEnv']]){const _0x59d5ef=Object['keys'](_0x20ce71?.[_0x153200(0x1e1)]??{});return _0x405dd7?.[_0x153200(0x206)](_0x29344f['nUOqi'],{'reason':_0x29344f[_0x153200(0x220)],'profileName':_0xd3209e}),console[_0x153200(0x209)](_0x153200(0x226)+_0x317fba[_0x153200(0x1de)]+'\x22\x20not\x20found.'+(_0x59d5ef['length']?_0x153200(0x234)+_0x59d5ef[_0x153200(0x1f3)](',\x20')+'.':_0x153200(0x1ae))),![];}_0x5d79a4=_0x317fba['authEnv'];}else _0x5d79a4=matchAuthEnvironment(_0x55afb4,_0x20ce71);if(!_0x5d79a4)return _0x405dd7?.['trackPhaseEnd'](_0x29344f['nUOqi'],{'reason':_0x29344f[_0x153200(0x22b)],'profileName':_0xd3209e}),console['error'](_0x153200(0x1e2)+_0x55afb4+_0x153200(0x1b3)+Object[_0x153200(0x1d9)](_0x20ce71?.[_0x153200(0x1e1)]??{})['join'](',\x20')+'.'),![];const _0x286eba=_0x20ce71?.[_0x153200(0x1e1)]?.[_0x5d79a4],_0x1d56ca=_0x286eba?.['domains']??[];if(_0x5365c3&&!_0x317fba[_0x153200(0x22f)]){const {saveToCloud:_0x42de8b}=await _0x2b71a3[_0x153200(0x205)]([{'type':_0x29344f[_0x153200(0x1b5)],'name':_0x153200(0x1ec),'message':_0x153200(0x20e)+_0x5d79a4+_0x153200(0x1ac)+_0x55afb4+'\x0a\x20\x20(domains:\x20'+_0x1d56ca['join'](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0xd3209e+_0x153200(0x239),'default':!![]}]);if(!_0x42de8b)return _0x405dd7?.['trackPhaseEnd'](_0x153200(0x215),{'reason':'user_declined','profileName':_0xd3209e}),console['error'](_0x29344f[_0x153200(0x21e)]),![];}const _0x30cea3=_0x1d56ca[_0x153200(0x20d)](_0x1ded45=>{const _0x586f32=_0x153200;try{return new URL(_0x1ded45)[_0x586f32(0x1ef)]===new URL(_0x55afb4)['origin'];}catch{return![];}}),_0x491d50={};!_0x30cea3&&(_0x491d50[_0x153200(0x238)]=_0x55afb4);try{await _0x29344f['RtslG'](createCloudProfile,_0xd3209e,_0x5d79a4,{'settings':_0x491d50}),warnCloudProfileSharedInOrg();}catch(_0x31ec3e){if(_0x31ec3e instanceof ApiError&&_0x31ec3e[_0x153200(0x1bc)]===0x199){console[_0x153200(0x209)](_0x29344f['DZarU']('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0xd3209e+_0x153200(0x20b),_0x153200(0x1af)+_0xd3209e));throw _0x31ec3e;}throw _0x31ec3e;}return console[_0x153200(0x1f9)](_0x29344f[_0x153200(0x1ca)]('✓\x20Profile\x20\x27'+_0xd3209e+_0x153200(0x1ba),_0x153200(0x237)+_0xd3209e)),await sweepOrphansBestEffort(_0xd3209e),_0x405dd7?.['trackPhaseEnd'](_0x29344f['owyDT'],{'envKey':_0x5d79a4,'profileName':_0xd3209e}),!![];}async function createUnconfiguredCloudProfile(_0x368974,_0xb6a6c1){const _0x18b54a=_0x2836,_0x46f4c7={'qmNxE':function(_0x2480d5,_0x136566){return _0x2480d5 instanceof _0x136566;},'HYwCU':function(_0x25058e,_0x92fd3e){return _0x25058e===_0x92fd3e;},'rbjYD':function(_0x286ce5,_0x2d5112){return _0x286ce5+_0x2d5112;}};try{await createCloudProfile(_0x368974,undefined,{'settings':_0xb6a6c1}),warnCloudProfileSharedInOrg();}catch(_0x978fa){_0x46f4c7['qmNxE'](_0x978fa,ApiError)&&_0x46f4c7['HYwCU'](_0x978fa[_0x18b54a(0x1bc)],0x199)&&console['error'](_0x46f4c7[_0x18b54a(0x1e8)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x368974+_0x18b54a(0x20b),_0x18b54a(0x1af)+_0x368974));throw _0x978fa;}}async function captureEnvLessProfile(_0x270470,_0x40f13a,_0x51ce11,_0x103469){const _0x209869=_0x2836,_0x5b44cd={'KyBhX':'confirm','mGoou':'capture','XRmUP':'user_declined','XSNhz':function(_0x885a17,_0x207f68){return _0x885a17+_0x207f68;},'VUcXA':function(_0x5e8f9a,_0x58544b){return _0x5e8f9a>_0x58544b;},'DlRZh':function(_0x28c002,_0x47342a,_0x4ae56f){return _0x28c002(_0x47342a,_0x4ae56f);},'iUSJQ':function(_0x58c237,_0x179595){return _0x58c237>_0x179595;},'YIxyV':function(_0x454241,_0x2b3360){return _0x454241(_0x2b3360);}};if(!_0x51ce11[_0x209869(0x22f)]){const {capture:_0x101764}=await _0x2b71a3['prompt']([{'type':_0x5b44cd['KyBhX'],'name':_0x5b44cd['mGoou'],'message':'Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','default':!![]}]);if(!_0x101764)return _0x103469?.[_0x209869(0x206)](_0x209869(0x215),{'reason':_0x5b44cd[_0x209869(0x232)],'profileName':_0x270470}),console[_0x209869(0x209)](_0x5b44cd[_0x209869(0x236)](_0x209869(0x1cf),_0x209869(0x22e))),![];}const _0xd19664={};if(_0x51ce11['setupHeader'])for(const _0x8a2089 of _0x51ce11['setupHeader']){const _0x298e3c=_0x8a2089[_0x209869(0x1b9)](':');if(_0x298e3c===-0x1)continue;_0xd19664[_0x8a2089['slice'](0x0,_0x298e3c)['trim']()]=_0x8a2089['slice'](_0x298e3c+0x1)[_0x209869(0x1bf)]();}const _0x491abf={'baseUrl':_0x40f13a};_0x5b44cd['VUcXA'](Object[_0x209869(0x1d9)](_0xd19664)[_0x209869(0x1dd)],0x0)&&(_0x491abf[_0x209869(0x1ed)]=_0xd19664);let _0x20d192;try{_0x20d192=await createCloudProfile(_0x270470,undefined,{'settings':_0x491abf}),warnCloudProfileSharedInOrg();}catch(_0x10a886){_0x10a886 instanceof ApiError&&_0x10a886[_0x209869(0x1bc)]===0x199&&console['error'](_0x5b44cd[_0x209869(0x236)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x270470+_0x209869(0x20b),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x270470));throw _0x10a886;}return await _0x5b44cd[_0x209869(0x1fa)](manualBrowserLogin,_0x20d192,{'key':'','domains':[_0x40f13a],'setupHeaders':_0x5b44cd['iUSJQ'](Object[_0x209869(0x1d9)](_0xd19664)['length'],0x0)?_0xd19664:undefined}),console['log'](_0x209869(0x207)+_0x270470+_0x209869(0x213)+(_0x209869(0x237)+_0x270470)),await _0x5b44cd[_0x209869(0x211)](sweepOrphansBestEffort,_0x270470),_0x103469?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':null,'profileName':_0x270470}),!![];}export async function addEnv(_0x3783a6,_0x556e73={},_0x3c7251){const _0x4b8bf5=_0x2836,_0x24b971={'lajQo':function(_0xe26bbb,_0x4326b3){return _0xe26bbb+_0x4326b3;},'EZePF':function(_0x469158,_0x452501){return _0x469158+_0x452501;},'KgcgA':function(_0x3c59c1,_0x204c52){return _0x3c59c1+_0x204c52;},'RAnEi':_0x4b8bf5(0x1c9),'cyhvG':_0x4b8bf5(0x1e4),'TzoMP':function(_0x575170,_0x165614){return _0x575170===_0x165614;},'TEAMD':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','beREe':_0x4b8bf5(0x1ea),'MsFIY':function(_0x348b61){return _0x348b61();},'VJYlH':_0x4b8bf5(0x1e5),'Ryljw':function(_0xebb997,_0x294895,_0x307a17,_0x26a95b,_0x32dbe3){return _0xebb997(_0x294895,_0x307a17,_0x26a95b,_0x32dbe3);},'yfpLs':_0x4b8bf5(0x21a),'AFaIS':_0x4b8bf5(0x1ad),'SSGEk':function(_0x29c1e8,_0x56697c){return _0x29c1e8 instanceof _0x56697c;},'QTdrF':function(_0x191f7f,_0xaea797){return _0x191f7f(_0xaea797);},'KXpYW':function(_0x210667,_0x33a49d){return _0x210667>_0x33a49d;},'yTxyZ':function(_0x4d8d55,_0x5c39d5,_0x20292a){return _0x4d8d55(_0x5c39d5,_0x20292a);},'DeVfr':function(_0x3e308f,_0x4965d2){return _0x3e308f+_0x4965d2;},'BKmsG':_0x4b8bf5(0x1c4),'ppwMI':_0x4b8bf5(0x1c8),'mRnvQ':_0x4b8bf5(0x201),'xqbUp':_0x4b8bf5(0x214),'khMGp':_0x4b8bf5(0x1f6),'ryQBB':_0x4b8bf5(0x1f2),'hUeCB':_0x4b8bf5(0x1d7),'zTsai':'continue','xDRBN':'use_suggestion','IpngU':function(_0x5a0f40,_0x32b606,_0x2df96b,_0x53abbf,_0x567e5b,_0x5965f8){return _0x5a0f40(_0x32b606,_0x2df96b,_0x53abbf,_0x567e5b,_0x5965f8);},'ERkpX':function(_0x41910d,_0x151860){return _0x41910d(_0x151860);}};_0x556e73['ci']&&(console['error'](_0x24b971[_0x4b8bf5(0x20c)](_0x24b971[_0x4b8bf5(0x20c)](_0x24b971[_0x4b8bf5(0x1ee)](_0x24b971['KgcgA'](_0x24b971[_0x4b8bf5(0x1ee)]('The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a'+'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','\x0a'),'To\x20set\x20up\x20a\x20profile,\x20run:\x0a'),_0x24b971[_0x4b8bf5(0x22d)]),'\x0a')+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a',_0x24b971['cyhvG'])),process[_0x4b8bf5(0x229)](0x1));const _0x1d908b={};if(_0x556e73[_0x4b8bf5(0x1dc)])for(const _0x223f83 of _0x556e73['setupHeader']){const _0x4d5d89=_0x223f83['indexOf'](':');if(_0x4d5d89===-0x1)throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x223f83+_0x4b8bf5(0x1d3));const _0x51b33a=_0x223f83['slice'](0x0,_0x4d5d89)['trim'](),_0x1ba71b=_0x223f83['slice'](_0x4d5d89+0x1)[_0x4b8bf5(0x1bf)]();_0x1d908b[_0x51b33a]=_0x1ba71b;}if(_0x556e73[_0x4b8bf5(0x21a)]!==undefined&&_0x24b971[_0x4b8bf5(0x228)](_0x556e73[_0x4b8bf5(0x21a)][_0x4b8bf5(0x1bf)](),''))throw new Error('--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222');if(_0x556e73['cdpEndpoint']&&_0x556e73['url'])throw new Error(_0x24b971['TEAMD']);if(_0x556e73[_0x4b8bf5(0x1de)]&&_0x556e73['skipAuth'])throw new Error(_0x24b971[_0x4b8bf5(0x1bd)]);if(_0x556e73['authEnv']&&_0x556e73[_0x4b8bf5(0x21a)])throw new Error(_0x4b8bf5(0x1d8));const _0x46347d=Boolean(_0x556e73[_0x4b8bf5(0x21a)]),_0x307f93=_0x24b971['MsFIY'](isInteractive);if(!_0x307f93&&!_0x556e73[_0x4b8bf5(0x217)]&&!_0x46347d&&!_0x556e73[_0x4b8bf5(0x1b8)])throw new Error(_0x24b971[_0x4b8bf5(0x22c)]);if(_0x46347d){const _0x1a6bfa=_0x556e73[_0x4b8bf5(0x21a)];console[_0x4b8bf5(0x1f9)](_0x4b8bf5(0x1df)),console['log']('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x1a6bfa);const _0x3cda6e={'cdpEndpoint':_0x1a6bfa,'isElectron':!![]};Object[_0x4b8bf5(0x1d9)](_0x1d908b)['length']>0x0&&(_0x3cda6e[_0x4b8bf5(0x1ed)]=_0x1d908b);await createUnconfiguredCloudProfile(_0x3783a6,_0x3cda6e);try{_0x24b971[_0x4b8bf5(0x1db)](setProfileOverride,process['cwd'](),_0x3783a6,_0x24b971['yfpLs'],_0x1a6bfa),setProfileOverride(process[_0x4b8bf5(0x1d1)](),_0x3783a6,_0x24b971[_0x4b8bf5(0x1f5)],!![]);}catch(_0x422ecc){console[_0x4b8bf5(0x209)](_0x4b8bf5(0x1c7)+(_0x24b971[_0x4b8bf5(0x219)](_0x422ecc,Error)?_0x422ecc[_0x4b8bf5(0x1b0)]:String(_0x422ecc)));}console['log'](_0x4b8bf5(0x1cc)+_0x3783a6+'\x27\x20created\x20(CDP).'),await sweepOrphansBestEffort(_0x3783a6),await _0x24b971['QTdrF'](markActive,_0x3783a6);return;}if(_0x556e73['skipAuth']){const _0x490f01={};_0x556e73[_0x4b8bf5(0x217)]&&(_0x490f01['baseUrl']=_0x556e73[_0x4b8bf5(0x217)]);_0x24b971['KXpYW'](Object[_0x4b8bf5(0x1d9)](_0x1d908b)['length'],0x0)&&(_0x490f01['setupHeaders']=_0x1d908b);await _0x24b971[_0x4b8bf5(0x1fb)](createUnconfiguredCloudProfile,_0x3783a6,_0x490f01),console[_0x4b8bf5(0x1f9)](_0x24b971[_0x4b8bf5(0x202)](_0x4b8bf5(0x20a)+_0x3783a6+_0x4b8bf5(0x1b4),_0x4b8bf5(0x233)+_0x3783a6+'`\x20again\x20without\x20--skip-auth.')),await sweepOrphansBestEffort(_0x3783a6),await _0x24b971['QTdrF'](markActive,_0x3783a6);return;}if(_0x556e73['url']){const _0x841424=_0x556e73[_0x4b8bf5(0x217)],_0x3caff3=await _0x24b971['QTdrF'](checkUrlReachability,_0x841424);if(!_0x3caff3['ok']&&!_0x556e73[_0x4b8bf5(0x1f1)])throw new Error('Could\x20not\x20reach\x20'+_0x841424+':\x20'+_0x3caff3['error']+_0x4b8bf5(0x1d2));!_0x3caff3['ok']&&_0x556e73[_0x4b8bf5(0x1f1)]&&console[_0x4b8bf5(0x1f9)]('⚠\x20Could\x20not\x20reach\x20'+_0x841424+':\x20'+_0x3caff3[_0x4b8bf5(0x209)]+'\x20(continuing\x20with\x20--force)');}else{console['log'](_0x24b971[_0x4b8bf5(0x1c0)]),console[_0x4b8bf5(0x1f9)](_0x24b971['ppwMI']),console['log'](_0x4b8bf5(0x1e0));let _0xe55f16='',_0x5fd7a7=![];while(!![]){const _0x164608=await _0x2b71a3[_0x4b8bf5(0x205)]([{'type':_0x24b971['mRnvQ'],'name':'baseUrl','message':_0x5fd7a7?_0x24b971[_0x4b8bf5(0x1ff)]:_0x4b8bf5(0x1d0),'default':_0xe55f16||_0x4b8bf5(0x1f4)}]);_0xe55f16=_0x164608[_0x4b8bf5(0x238)];const _0x2e85c7=await checkUrlReachability(_0xe55f16);if(_0x2e85c7['ok'])break;const _0x1c3162=/^[a-zA-Z][\w+.-]*:\/\//[_0x4b8bf5(0x221)](_0xe55f16),_0x261ff9=_0x2e85c7[_0x4b8bf5(0x1cb)]&&!_0x1c3162,_0x567573=_0x261ff9?_0x4b8bf5(0x21c)+_0xe55f16:null;_0x5fd7a7=!![],console[_0x4b8bf5(0x1f9)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0xe55f16+':\x20'+_0x2e85c7[_0x4b8bf5(0x209)]);_0x567573&&console['log'](_0x4b8bf5(0x203)+_0x567573+'?');const {action:_0x589e10}=await _0x2b71a3['prompt']([{'type':_0x24b971[_0x4b8bf5(0x225)],'name':_0x4b8bf5(0x1f0),'message':_0x24b971['ryQBB'],'choices':[..._0x567573?[{'name':_0x4b8bf5(0x231)+_0x567573,'value':'use_suggestion'}]:[],{'name':'Enter\x20a\x20different\x20URL','value':_0x4b8bf5(0x1f7)},{'name':_0x24b971[_0x4b8bf5(0x1be)],'value':_0x24b971[_0x4b8bf5(0x1c2)]}]}]);if(_0x589e10===_0x24b971[_0x4b8bf5(0x1c1)]&&_0x567573){_0xe55f16=_0x567573;const _0x476e7b=await _0x24b971[_0x4b8bf5(0x223)](checkUrlReachability,_0xe55f16);if(_0x476e7b['ok'])break;console['log']('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0xe55f16+':\x20'+_0x476e7b[_0x4b8bf5(0x209)]);}else{if(_0x24b971['TzoMP'](_0x589e10,_0x24b971['zTsai']))break;}}_0x556e73={..._0x556e73,'url':_0xe55f16};}let _0x1bb654=![];try{_0x1bb654=await _0x24b971['IpngU'](tryAutoRouteCloudProfile,_0x3783a6,_0x556e73[_0x4b8bf5(0x217)],_0x556e73,_0x307f93,_0x3c7251);}catch(_0x5b7569){console['error']('\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22'+_0x3783a6+_0x4b8bf5(0x1b1)+(_0x5b7569 instanceof Error?_0x5b7569['message']:String(_0x5b7569))),process['exit'](0x1);}!_0x1bb654&&process[_0x4b8bf5(0x229)](0x1),await _0x24b971[_0x4b8bf5(0x208)](markActive,_0x3783a6);}
|
|
1
|
+
const _0x10726e=_0x3597;(function(_0x59cef9,_0x4c9eb0){const _0x243082=_0x3597,_0xa4ae33=_0x59cef9();while(!![]){try{const _0x210a09=-parseInt(_0x243082(0x1ed))/0x1+-parseInt(_0x243082(0x200))/0x2+-parseInt(_0x243082(0x218))/0x3+parseInt(_0x243082(0x260))/0x4*(parseInt(_0x243082(0x240))/0x5)+-parseInt(_0x243082(0x215))/0x6+parseInt(_0x243082(0x25b))/0x7*(parseInt(_0x243082(0x224))/0x8)+parseInt(_0x243082(0x211))/0x9;if(_0x210a09===_0x4c9eb0)break;else _0xa4ae33['push'](_0xa4ae33['shift']());}catch(_0x2b9363){_0xa4ae33['push'](_0xa4ae33['shift']());}}}(_0xed8e,0xa38d5));function _0x3597(_0x4a775d,_0x42e816){_0x4a775d=_0x4a775d-0x1eb;const _0xed8edb=_0xed8e();let _0x3597e3=_0xed8edb[_0x4a775d];return _0x3597e3;}import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x43de1a from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';function _0xed8e(){const _0x575a21=['keys','bFkAL','40dZrapK','kbcJZ','error','xlaOZ','profile.add.autoRouteSkipped','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','trackPhaseEnd','domains','yes','EsaVO','\x20(continuing\x20with\x20--force)','signal','The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','ycuAD','`\x20again\x20without\x20--skip-auth.','abort','list','UqLUC','wHmwa','indexOf','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','cdpEndpoint','continue','MFABv','Continue\x20anyway','capture','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','3647BEiayh','\x27\x20created.\x0a','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','Use\x20','cwd','400828SmylgL','ROxTf','LtMYN','meogq','--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','HbhiQ','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','gcTxM','Cqfpt','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','isElectron','whrmO','298613iXYqOG','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','SwhmW','slice','ghGTa','authEnv','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','XKjyM','message','skipAuth','\x20--skip-auth\x0a','CpcXR','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','environments','\x22:\x20','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','VOVHx','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','setupHeader','1262432upGoiU','use_suggestion','profile.add.autoRouted','DYgsh','\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20','\x27\x20matching\x20','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','IaUxG','setupHeaders','RYjxb','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','wqqQf','test','no_auth_config','\x20Configured\x20envs:\x20','retry','confirm','8124912anZxSV','status','iSyou','✓\x20Cloud\x20profile\x20\x27','1767282hMvbfz','local','This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization','1479510TTcSdK','aByWs','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','ODptS','wZiBF','saveToCloud','url','\x0a\x20\x20(domains:\x20','Invalid\x20--setup-header\x20format:\x20\x22','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','TypeError','10488vLeyiH','PYbZJ','aWBYb','user_declined','✓\x20Profile\x20\x27','kIbUp','prompt','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','isTTY','\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0a\x20\x20A\x20profile\x20named\x20\x22','iMEmC','Smsma','oiQzu','length','join','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','baseUrl','XCTDD','exit','slqmG','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20','log','zWsTN','--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.'];_0xed8e=function(){return _0x575a21;};return _0xed8e();}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=_0x10726e(0x217);function warnCloudProfileSharedInOrg(){const _0x4e37d6=_0x10726e;if(!process['stdout'][_0x4e37d6(0x22c)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x53a50a){const _0x28ca24=_0x10726e,_0x51849e={'MFABv':'manual','aWBYb':'Invalid\x20URL','meogq':_0x28ca24(0x223),'bFkAL':'fetch\x20failed'};try{const _0x1c532f=new AbortController(),_0x4150d4=setTimeout(()=>_0x1c532f[_0x28ca24(0x24f)](),0x1388),_0x4b7688={'method':'HEAD','signal':_0x1c532f[_0x28ca24(0x24b)],'redirect':_0x51849e[_0x28ca24(0x257)]};/^https:\/\/localhost(:\d+)?/i[_0x28ca24(0x20c)](_0x53a50a)&&(process['env']['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x3b304c=await fetch(_0x53a50a,_0x4b7688);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x4150d4);if(_0x3b304c[_0x28ca24(0x212)]<0x190)return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x3b304c['status']};}catch(_0x6cd92e){delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x3a6b2e=_0x6cd92e,_0x2337c6=_0x3a6b2e['message']||String(_0x6cd92e),_0x23f618=_0x2337c6['includes'](_0x51849e[_0x28ca24(0x226)])||_0x3a6b2e['name']===_0x51849e[_0x28ca24(0x263)]||_0x2337c6['includes'](_0x51849e[_0x28ca24(0x23f)]);return{'ok':![],'error':_0x2337c6,'isProtocolError':_0x23f618};}}async function sweepOrphanLocalProfile(_0x36eaca,_0x15ec26,_0x480299){const _0x10cfee=_0x10726e,_0x4fb9f6={'EjLLj':function(_0x4697ba,_0x5be319,_0x4b62af){return _0x4697ba(_0x5be319,_0x4b62af);},'VOVHx':function(_0xea0591,_0x27ce2d){return _0xea0591(_0x27ce2d);},'tgFym':function(_0x1cec9a,_0x4f72b7,_0x203bd5){return _0x1cec9a(_0x4f72b7,_0x203bd5);}},_0x312213=join(_0x15ec26,_0x10cfee(0x216)),_0xd21478=_0x4fb9f6['EjLLj'](join,_0x312213,_0x36eaca);existsSync(_0xd21478)&&(_0x480299&&await _0x4fb9f6[_0x10cfee(0x1fd)](isPathGitTracked,_0xd21478)?console['log']('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0xd21478+'\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'):(await rm(_0xd21478,{'recursive':!![],'force':!![]}),console[_0x10cfee(0x23b)]('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0xd21478)));if(_0x4fb9f6['VOVHx'](existsSync,_0x312213)){let _0x2a228a=[];try{_0x2a228a=await _0x4fb9f6['VOVHx'](readdir,_0x312213);}catch{return;}const _0x1898b7='.tmp-'+_0x36eaca+'-';for(const _0xbfa3f of _0x2a228a){if(!_0xbfa3f['startsWith'](_0x1898b7))continue;const _0x3770d4=join(_0x312213,_0xbfa3f);await _0x4fb9f6['tgFym'](rm,_0x3770d4,{'recursive':!![],'force':!![]}),console[_0x10cfee(0x23b)]('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x3770d4);}}}async function sweepOrphansBestEffort(_0x142004){const _0xdbb6b2=_0x10726e,_0x557fe9={'PvCng':function(_0x355908,_0x125324,_0x37c6f5,_0xea35c0){return _0x355908(_0x125324,_0x37c6f5,_0xea35c0);},'SrRlO':function(_0x398301,_0x3484c4){return _0x398301!==_0x3484c4;},'iSyou':function(_0x248a15,_0x358708,_0x11e333,_0x2a78e3){return _0x248a15(_0x358708,_0x11e333,_0x2a78e3);},'wLveI':function(_0x2029de,_0x5c0c0f){return _0x2029de(_0x5c0c0f);}};try{await _0x557fe9['PvCng'](sweepOrphanLocalProfile,_0x142004,getRangerHomeDir(),![]);const _0x1a30ad=getRangerDir();_0x557fe9['SrRlO'](_0x1a30ad,getRangerHomeDir())&&await _0x557fe9[_0xdbb6b2(0x213)](sweepOrphanLocalProfile,_0x142004,_0x1a30ad,!![]);}catch(_0xed1ca7){console['log'](_0xdbb6b2(0x1ee)+(_0xed1ca7 instanceof Error?_0xed1ca7[_0xdbb6b2(0x1f5)]:_0x557fe9['wLveI'](String,_0xed1ca7))+').');}}async function markActive(_0x2687f8){const _0x326a4e=_0x10726e;try{await writeActiveProfileName(_0x2687f8),console['log']('\x20\x20Set\x20active\x20profile:\x20'+_0x2687f8);}catch{console[_0x326a4e(0x23b)](_0x326a4e(0x1fc));}}async function tryAutoRouteCloudProfile(_0x2ed2f1,_0x2efd78,_0xf65d13,_0x2be735,_0x5cad2b){const _0x23d830=_0x10726e,_0x2054eb={'kbcJZ':function(_0xb591a4,_0x137eb7){return _0xb591a4===_0x137eb7;},'AyLve':function(_0x337f2c){return _0x337f2c();},'fntrg':_0x23d830(0x20d),'aByWs':function(_0x186780,_0x1f75a4){return _0x186780 instanceof _0x1f75a4;},'ckYEq':function(_0x56190f,_0x5d5840){return _0x56190f(_0x5d5840);},'PYbZJ':function(_0x11e7de,_0x3676ff){return _0x11e7de===_0x3676ff;},'DYgsh':function(_0x352429,_0x200079){return _0x352429+_0x200079;},'Cqfpt':function(_0x5509f1,_0x274eda){return _0x5509f1+_0x274eda;},'HbhiQ':'\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','CpcXR':_0x23d830(0x244),'AcZHi':'env_not_found','nEBhk':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','AtJKK':function(_0x293a32,_0x5b85dd,_0x332e59){return _0x293a32(_0x5b85dd,_0x332e59);},'ywKXn':'no_match','rFteN':_0x23d830(0x266),'LvHtD':function(_0x350ae6,_0x31366c,_0x2e2352,_0x5d4193){return _0x350ae6(_0x31366c,_0x2e2352,_0x5d4193);},'YLoAe':function(_0x50bb65){return _0x50bb65();},'IaUxG':function(_0xa6bf1d,_0x3ff186){return _0xa6bf1d(_0x3ff186);}};let _0x91a5ab;try{_0x91a5ab=await _0x2054eb['AyLve'](fetchAuthConfig);}catch(_0x5eb0e7){return _0x5cad2b?.['trackPhaseEnd'](_0x23d830(0x244),{'reason':_0x2054eb['fntrg'],'profileName':_0x2ed2f1}),console['error'](_0x23d830(0x204)+(_0x2054eb[_0x23d830(0x219)](_0x5eb0e7,Error)?_0x5eb0e7[_0x23d830(0x1f5)]:_0x2054eb['ckYEq'](String,_0x5eb0e7))),![];}if((!_0x91a5ab||!_0x91a5ab[_0x23d830(0x1fa)]||_0x2054eb[_0x23d830(0x225)](Object[_0x23d830(0x23e)](_0x91a5ab['environments'])[_0x23d830(0x232)],0x0))&&!_0xf65d13[_0x23d830(0x1f2)]){if(_0x2be735)return await captureEnvLessProfile(_0x2ed2f1,_0x2efd78,_0xf65d13,_0x5cad2b);return _0x5cad2b?.[_0x23d830(0x246)](_0x23d830(0x244),{'reason':'no_auth_config','profileName':_0x2ed2f1}),console[_0x23d830(0x242)](_0x2054eb[_0x23d830(0x203)](_0x2054eb['Cqfpt'](_0x2054eb[_0x23d830(0x265)]+'\x0a'+_0x23d830(0x1f3)+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x2ed2f1+'\x20--url\x20'+_0x2efd78+_0x23d830(0x1f7))+'\x0a',_0x23d830(0x25d)),_0x23d830(0x21a))),![];}let _0x4d8d96;if(_0xf65d13[_0x23d830(0x1f2)]){if(!_0x91a5ab?.['environments']?.[_0xf65d13['authEnv']]){const _0x5ed1bd=Object[_0x23d830(0x23e)](_0x91a5ab?.['environments']??{});return _0x5cad2b?.[_0x23d830(0x246)](_0x2054eb[_0x23d830(0x1f8)],{'reason':_0x2054eb['AcZHi'],'profileName':_0x2ed2f1}),console['error'](_0x2054eb[_0x23d830(0x268)]('\x0a\x20\x20Auth\x20environment\x20\x22'+_0xf65d13['authEnv']+'\x22\x20not\x20found.',_0x5ed1bd['length']?_0x23d830(0x20e)+_0x5ed1bd[_0x23d830(0x233)](',\x20')+'.':_0x2054eb['nEBhk'])),![];}_0x4d8d96=_0xf65d13['authEnv'];}else _0x4d8d96=_0x2054eb['AtJKK'](matchAuthEnvironment,_0x2efd78,_0x91a5ab);if(!_0x4d8d96)return _0x5cad2b?.[_0x23d830(0x246)](_0x2054eb[_0x23d830(0x1f8)],{'reason':_0x2054eb['ywKXn'],'profileName':_0x2ed2f1}),console[_0x23d830(0x242)](_0x23d830(0x269)+_0x2efd78+_0x23d830(0x235)+Object[_0x23d830(0x23e)](_0x91a5ab?.[_0x23d830(0x1fa)]??{})[_0x23d830(0x233)](',\x20')+'.'),![];const _0x2bf63e=_0x91a5ab?.[_0x23d830(0x1fa)]?.[_0x4d8d96],_0x394f2c=_0x2bf63e?.[_0x23d830(0x247)]??[];if(_0x2be735&&!_0xf65d13['yes']){const {saveToCloud:_0x5f2ce5}=await _0x43de1a[_0x23d830(0x22a)]([{'type':'confirm','name':_0x23d830(0x21e),'message':'Found\x20auth\x20environment\x20\x27'+_0x4d8d96+_0x23d830(0x205)+_0x2efd78+_0x23d830(0x220)+_0x394f2c[_0x23d830(0x233)](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x2ed2f1+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x5f2ce5)return _0x5cad2b?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x23d830(0x227),'profileName':_0x2ed2f1}),console['error'](_0x2054eb['rFteN']),![];}const _0x5090c6=_0x394f2c['some'](_0x1c9071=>{const _0x12c9ab=_0x23d830;try{return _0x2054eb[_0x12c9ab(0x241)](new URL(_0x1c9071)['origin'],new URL(_0x2efd78)['origin']);}catch{return![];}}),_0x3ceaa7={};!_0x5090c6&&(_0x3ceaa7[_0x23d830(0x236)]=_0x2efd78);try{await _0x2054eb['LvHtD'](createCloudProfile,_0x2ed2f1,_0x4d8d96,{'settings':_0x3ceaa7}),_0x2054eb['YLoAe'](warnCloudProfileSharedInOrg);}catch(_0x59b683){if(_0x59b683 instanceof ApiError&&_0x2054eb[_0x23d830(0x225)](_0x59b683[_0x23d830(0x212)],0x199)){console['error']('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x2ed2f1+_0x23d830(0x21b)+(_0x23d830(0x222)+_0x2ed2f1));throw _0x59b683;}throw _0x59b683;}return console[_0x23d830(0x23b)]('✓\x20Profile\x20\x27'+_0x2ed2f1+_0x23d830(0x25c)+(_0x23d830(0x1f9)+_0x2ed2f1)),await _0x2054eb[_0x23d830(0x207)](sweepOrphansBestEffort,_0x2ed2f1),_0x5cad2b?.[_0x23d830(0x246)](_0x23d830(0x202),{'envKey':_0x4d8d96,'profileName':_0x2ed2f1}),!![];}async function createUnconfiguredCloudProfile(_0x54b8b1,_0xba9fb7){const _0x34f79a=_0x10726e,_0x5a9912={'PSGAK':function(_0x4cb352,_0x446820,_0x4033cd,_0x895408){return _0x4cb352(_0x446820,_0x4033cd,_0x895408);},'XCTDD':function(_0x546bd2,_0x507e42){return _0x546bd2===_0x507e42;},'yfQLc':function(_0x5a6bcd,_0x564cb5){return _0x5a6bcd+_0x564cb5;}};try{await _0x5a9912['PSGAK'](createCloudProfile,_0x54b8b1,undefined,{'settings':_0xba9fb7}),warnCloudProfileSharedInOrg();}catch(_0x9c53fe){_0x9c53fe instanceof ApiError&&_0x5a9912[_0x34f79a(0x237)](_0x9c53fe[_0x34f79a(0x212)],0x199)&&console[_0x34f79a(0x242)](_0x5a9912['yfQLc'](_0x34f79a(0x22e)+_0x54b8b1+_0x34f79a(0x21b),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x54b8b1));throw _0x9c53fe;}}async function captureEnvLessProfile(_0x2a3d29,_0x15dfe9,_0x265f84,_0x45a583){const _0x3e7baa=_0x10726e,_0x3ee1f1={'yIoQZ':_0x3e7baa(0x210),'JRpUD':_0x3e7baa(0x22b),'SxBnQ':function(_0x3e73ea,_0x3b457c){return _0x3e73ea+_0x3b457c;},'oiQzu':function(_0x1522ea,_0x54aafc){return _0x1522ea===_0x54aafc;},'jubgb':function(_0x4f5e1b,_0x36a581){return _0x4f5e1b+_0x36a581;},'zWsTN':function(_0x49756d,_0x530059,_0x31f17b,_0xe1b863){return _0x49756d(_0x530059,_0x31f17b,_0xe1b863);},'whrmO':function(_0x3427e2,_0x5703e9){return _0x3427e2(_0x5703e9);},'SLlgt':_0x3e7baa(0x202)};if(!_0x265f84[_0x3e7baa(0x248)]){const {capture:_0x48d27d}=await _0x43de1a['prompt']([{'type':_0x3ee1f1['yIoQZ'],'name':_0x3e7baa(0x259),'message':_0x3ee1f1['JRpUD'],'default':!![]}]);if(!_0x48d27d)return _0x45a583?.[_0x3e7baa(0x246)]('profile.add.autoRouteSkipped',{'reason':_0x3e7baa(0x227),'profileName':_0x2a3d29}),console[_0x3e7baa(0x242)](_0x3ee1f1['SxBnQ'](_0x3e7baa(0x25a),'\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.')),![];}const _0x30fa96={};if(_0x265f84['setupHeader'])for(const _0x1b2387 of _0x265f84[_0x3e7baa(0x1ff)]){const _0x35a228=_0x1b2387[_0x3e7baa(0x253)](':');if(_0x3ee1f1[_0x3e7baa(0x231)](_0x35a228,-0x1))continue;_0x30fa96[_0x1b2387[_0x3e7baa(0x1f0)](0x0,_0x35a228)['trim']()]=_0x1b2387['slice'](_0x3ee1f1['jubgb'](_0x35a228,0x1))['trim']();}const _0x11655a={'baseUrl':_0x15dfe9};Object[_0x3e7baa(0x23e)](_0x30fa96)[_0x3e7baa(0x232)]>0x0&&(_0x11655a[_0x3e7baa(0x208)]=_0x30fa96);let _0x125c57;try{_0x125c57=await _0x3ee1f1[_0x3e7baa(0x23c)](createCloudProfile,_0x2a3d29,undefined,{'settings':_0x11655a}),warnCloudProfileSharedInOrg();}catch(_0xf01472){_0xf01472 instanceof ApiError&&_0xf01472['status']===0x199&&console['error'](_0x3ee1f1['SxBnQ'](_0x3e7baa(0x22e)+_0x2a3d29+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x2a3d29));throw _0xf01472;}return await manualBrowserLogin(_0x125c57,{'key':'','domains':[_0x15dfe9],'setupHeaders':Object[_0x3e7baa(0x23e)](_0x30fa96)[_0x3e7baa(0x232)]>0x0?_0x30fa96:undefined}),console[_0x3e7baa(0x23b)]('\x0a✓\x20Profile\x20\x27'+_0x2a3d29+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a'+('\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x2a3d29)),await _0x3ee1f1[_0x3e7baa(0x1ec)](sweepOrphansBestEffort,_0x2a3d29),_0x45a583?.['trackPhaseEnd'](_0x3ee1f1['SLlgt'],{'envKey':null,'profileName':_0x2a3d29}),!![];}export async function addEnv(_0x4ffc8e,_0x55d126={},_0x19a010){const _0x2d5a6e=_0x10726e,_0x1fbf62={'ycuAD':function(_0x56cf8c,_0x5cfa24){return _0x56cf8c+_0x5cfa24;},'ERBcL':function(_0x1dc3fe,_0x1892bf){return _0x1dc3fe+_0x1892bf;},'ODptS':function(_0x423d13,_0x465a36){return _0x423d13+_0x465a36;},'jwAaU':_0x2d5a6e(0x24c),'iMEmC':'To\x20set\x20up\x20a\x20profile,\x20run:\x0a','ascmK':_0x2d5a6e(0x254),'SwhmW':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','HhiXI':function(_0x4490d0,_0xc91e77){return _0x4490d0===_0xc91e77;},'XKjyM':function(_0x489155,_0x2fb3b2){return _0x489155!==_0x2fb3b2;},'EOgbW':function(_0x362532,_0x178e74){return _0x362532===_0x178e74;},'fTfhJ':_0x2d5a6e(0x26a),'wHmwa':_0x2d5a6e(0x264),'wqqQf':'--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','jRGBd':function(_0xff9fa8,_0x5234fa){return _0xff9fa8(_0x5234fa);},'TMQKK':'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','gcTxM':function(_0x475430,_0x240117){return _0x475430>_0x240117;},'UqLUC':function(_0x4fcc1d,_0x52092f,_0x35b81f,_0x1fb73e,_0x500d0c){return _0x4fcc1d(_0x52092f,_0x35b81f,_0x1fb73e,_0x500d0c);},'Smsma':function(_0x447ef4,_0x5a902c){return _0x447ef4(_0x5a902c);},'fKOda':function(_0x12d547,_0xdab85a,_0x3d16d5){return _0x12d547(_0xdab85a,_0x3d16d5);},'ROxTf':function(_0x368f80,_0xef5c69){return _0x368f80+_0xef5c69;},'wZiBF':function(_0x4d329c,_0x319533){return _0x4d329c(_0x319533);},'BVcUq':function(_0x46746f,_0x3c1b42){return _0x46746f(_0x3c1b42);},'ghGTa':function(_0x5dab19,_0x5674a7){return _0x5dab19(_0x5674a7);},'dYlwx':'\x0a🌐\x20Profile\x20Setup\x0a','kxILB':_0x2d5a6e(0x245),'xlaOZ':'input','RYjxb':'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','EsaVO':'http://localhost:3000','LtMYN':'action','SPqEq':'What\x20would\x20you\x20like\x20to\x20do?','kIbUp':function(_0x583db3,_0x58ea12){return _0x583db3===_0x58ea12;},'slqmG':_0x2d5a6e(0x201),'RSxxv':function(_0x4050e1,_0x52816){return _0x4050e1 instanceof _0x52816;}};_0x55d126['ci']&&(console[_0x2d5a6e(0x242)](_0x1fbf62['ycuAD'](_0x1fbf62[_0x2d5a6e(0x24d)](_0x1fbf62['ERBcL'](_0x1fbf62[_0x2d5a6e(0x21c)](_0x1fbf62['jwAaU']+'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a'+'\x0a',_0x1fbf62[_0x2d5a6e(0x22f)]),_0x1fbf62['ascmK']),'\x0a')+_0x1fbf62[_0x2d5a6e(0x1ef)],_0x2d5a6e(0x22d))),process[_0x2d5a6e(0x238)](0x1));const _0x324a92={};if(_0x55d126[_0x2d5a6e(0x1ff)])for(const _0x5bedae of _0x55d126['setupHeader']){const _0x1ef652=_0x5bedae['indexOf'](':');if(_0x1fbf62['HhiXI'](_0x1ef652,-0x1))throw new Error(_0x2d5a6e(0x221)+_0x5bedae+'\x22.\x20Expected\x20\x22Name:\x20Value\x22.');const _0x66fba1=_0x5bedae[_0x2d5a6e(0x1f0)](0x0,_0x1ef652)['trim'](),_0x5bc553=_0x5bedae[_0x2d5a6e(0x1f0)](_0x1fbf62['ODptS'](_0x1ef652,0x1))['trim']();_0x324a92[_0x66fba1]=_0x5bc553;}if(_0x1fbf62[_0x2d5a6e(0x1f4)](_0x55d126['cdpEndpoint'],undefined)&&_0x1fbf62['EOgbW'](_0x55d126[_0x2d5a6e(0x255)]['trim'](),''))throw new Error(_0x1fbf62['fTfhJ']);if(_0x55d126[_0x2d5a6e(0x255)]&&_0x55d126['url'])throw new Error(_0x2d5a6e(0x23d));if(_0x55d126[_0x2d5a6e(0x1f2)]&&_0x55d126[_0x2d5a6e(0x1f6)])throw new Error(_0x1fbf62[_0x2d5a6e(0x252)]);if(_0x55d126['authEnv']&&_0x55d126['cdpEndpoint'])throw new Error(_0x1fbf62[_0x2d5a6e(0x20b)]);const _0x462612=_0x1fbf62['jRGBd'](Boolean,_0x55d126['cdpEndpoint']),_0x5b1df1=isInteractive();if(!_0x5b1df1&&!_0x55d126[_0x2d5a6e(0x21f)]&&!_0x462612&&!_0x55d126['skipAuth'])throw new Error(_0x1fbf62['TMQKK']);if(_0x462612){const _0x51b7b1=_0x55d126[_0x2d5a6e(0x255)];console[_0x2d5a6e(0x23b)]('\x0a🔌\x20CDP\x20Profile\x20Setup\x0a'),console[_0x2d5a6e(0x23b)]('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x51b7b1);const _0x5cf9f2={'cdpEndpoint':_0x51b7b1,'isElectron':!![]};_0x1fbf62[_0x2d5a6e(0x267)](Object[_0x2d5a6e(0x23e)](_0x324a92)[_0x2d5a6e(0x232)],0x0)&&(_0x5cf9f2['setupHeaders']=_0x324a92);await createUnconfiguredCloudProfile(_0x4ffc8e,_0x5cf9f2);try{setProfileOverride(process[_0x2d5a6e(0x25f)](),_0x4ffc8e,_0x2d5a6e(0x255),_0x51b7b1),_0x1fbf62[_0x2d5a6e(0x251)](setProfileOverride,process[_0x2d5a6e(0x25f)](),_0x4ffc8e,_0x2d5a6e(0x1eb),!![]);}catch(_0x13e995){console['error']('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x13e995 instanceof Error?_0x13e995['message']:_0x1fbf62[_0x2d5a6e(0x230)](String,_0x13e995)));}console['log'](_0x2d5a6e(0x214)+_0x4ffc8e+'\x27\x20created\x20(CDP).'),await sweepOrphansBestEffort(_0x4ffc8e),await markActive(_0x4ffc8e);return;}if(_0x55d126[_0x2d5a6e(0x1f6)]){const _0x26c7ad={};_0x55d126['url']&&(_0x26c7ad['baseUrl']=_0x55d126['url']);Object['keys'](_0x324a92)[_0x2d5a6e(0x232)]>0x0&&(_0x26c7ad['setupHeaders']=_0x324a92);await _0x1fbf62['fKOda'](createUnconfiguredCloudProfile,_0x4ffc8e,_0x26c7ad),console[_0x2d5a6e(0x23b)](_0x1fbf62[_0x2d5a6e(0x261)](_0x2d5a6e(0x228)+_0x4ffc8e+'\x27\x20created\x20(no\x20session).\x0a',_0x2d5a6e(0x23a)+_0x4ffc8e+_0x2d5a6e(0x24e))),await _0x1fbf62[_0x2d5a6e(0x21d)](sweepOrphansBestEffort,_0x4ffc8e),await _0x1fbf62['BVcUq'](markActive,_0x4ffc8e);return;}if(_0x55d126['url']){const _0x4e489b=_0x55d126['url'],_0x14914f=await _0x1fbf62['ghGTa'](checkUrlReachability,_0x4e489b);if(!_0x14914f['ok']&&!_0x55d126['force'])throw new Error('Could\x20not\x20reach\x20'+_0x4e489b+':\x20'+_0x14914f[_0x2d5a6e(0x242)]+_0x2d5a6e(0x20a));!_0x14914f['ok']&&_0x55d126['force']&&console['log']('⚠\x20Could\x20not\x20reach\x20'+_0x4e489b+':\x20'+_0x14914f[_0x2d5a6e(0x242)]+_0x2d5a6e(0x24a));}else{console['log'](_0x1fbf62['dYlwx']),console[_0x2d5a6e(0x23b)](_0x1fbf62['kxILB']),console[_0x2d5a6e(0x23b)](_0x2d5a6e(0x234));let _0x28bdd1='',_0x2139a8=![];while(!![]){const _0x12696e=await _0x43de1a[_0x2d5a6e(0x22a)]([{'type':_0x1fbf62[_0x2d5a6e(0x243)],'name':'baseUrl','message':_0x2139a8?_0x1fbf62[_0x2d5a6e(0x209)]:'What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','default':_0x28bdd1||_0x1fbf62[_0x2d5a6e(0x249)]}]);_0x28bdd1=_0x12696e['baseUrl'];const _0x5cdaf5=await checkUrlReachability(_0x28bdd1);if(_0x5cdaf5['ok'])break;const _0x4bbd9b=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x28bdd1),_0x5408ee=_0x5cdaf5['isProtocolError']&&!_0x4bbd9b,_0x799b71=_0x5408ee?'http://'+_0x28bdd1:null;_0x2139a8=!![],console[_0x2d5a6e(0x23b)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x28bdd1+':\x20'+_0x5cdaf5['error']);_0x799b71&&console[_0x2d5a6e(0x23b)]('\x20\x20Did\x20you\x20mean\x20'+_0x799b71+'?');const {action:_0x34bf0b}=await _0x43de1a['prompt']([{'type':_0x2d5a6e(0x250),'name':_0x1fbf62[_0x2d5a6e(0x262)],'message':_0x1fbf62['SPqEq'],'choices':[..._0x799b71?[{'name':_0x2d5a6e(0x25e)+_0x799b71,'value':'use_suggestion'}]:[],{'name':'Enter\x20a\x20different\x20URL','value':_0x2d5a6e(0x20f)},{'name':_0x2d5a6e(0x258),'value':_0x2d5a6e(0x256)}]}]);if(_0x1fbf62[_0x2d5a6e(0x229)](_0x34bf0b,_0x1fbf62[_0x2d5a6e(0x239)])&&_0x799b71){_0x28bdd1=_0x799b71;const _0x3bbfc5=await _0x1fbf62[_0x2d5a6e(0x230)](checkUrlReachability,_0x28bdd1);if(_0x3bbfc5['ok'])break;console[_0x2d5a6e(0x23b)](_0x2d5a6e(0x1fe)+_0x28bdd1+':\x20'+_0x3bbfc5['error']);}else{if(_0x34bf0b==='continue')break;}}_0x55d126={..._0x55d126,'url':_0x28bdd1};}let _0x53c3f0=![];try{_0x53c3f0=await tryAutoRouteCloudProfile(_0x4ffc8e,_0x55d126['url'],_0x55d126,_0x5b1df1,_0x19a010);}catch(_0x140ec9){console[_0x2d5a6e(0x242)](_0x2d5a6e(0x206)+_0x4ffc8e+_0x2d5a6e(0x1fb)+(_0x1fbf62['RSxxv'](_0x140ec9,Error)?_0x140ec9[_0x2d5a6e(0x1f5)]:String(_0x140ec9))),process['exit'](0x1);}!_0x53c3f0&&process[_0x2d5a6e(0x238)](0x1),await _0x1fbf62[_0x2d5a6e(0x1f1)](markActive,_0x4ffc8e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5506e6,_0x1876a8){var _0x486745=_0x2f00,_0x5acca1=_0x5506e6();while(!![]){try{var _0x35a491=parseInt(_0x486745(0x1d7))/0x1*(parseInt(_0x486745(0x1d8))/0x2)+parseInt(_0x486745(0x1d2))/0x3+parseInt(_0x486745(0x1d6))/0x4+parseInt(_0x486745(0x1d9))/0x5+parseInt(_0x486745(0x1d0))/0x6+-parseInt(_0x486745(0x1d3))/0x7*(-parseInt(_0x486745(0x1cc))/0x8)+-parseInt(_0x486745(0x1d4))/0x9;if(_0x35a491===_0x1876a8)break;else _0x5acca1['push'](_0x5acca1['shift']());}catch(_0x5d29cc){_0x5acca1['push'](_0x5acca1['shift']());}}}(_0x53aa,0x9e83d));function _0x2f00(_0x331840,_0x538a92){_0x331840=_0x331840-0x1cc;var _0x53aa90=_0x53aa();var _0x2f00aa=_0x53aa90[_0x331840];return _0x2f00aa;}export async function authEncrypt(_0x4e470f){var _0x23e86b=_0x2f00,_0x3f124d={'CXSgC':function(_0x48d3c3,_0x186840){return _0x48d3c3+_0x186840;},'uKWsq':function(_0x27550f,_0x12ca1f){return _0x27550f+_0x12ca1f;},'OeTKl':_0x23e86b(0x1ce),'MFIyp':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'};console[_0x23e86b(0x1cd)](_0x3f124d['CXSgC'](_0x3f124d['CXSgC'](_0x3f124d[_0x23e86b(0x1d1)](_0x3f124d[_0x23e86b(0x1cf)],'session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a')+'\x0a',_0x3f124d['MFIyp'])+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a'+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles')),process[_0x23e86b(0x1d5)](0x1);}function _0x53aa(){var _0x18e4de=['200PRZswR','error','ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','OeTKl','3010098YVSSys','uKWsq','543414SeTOYC','33579ogGqpU','25996302vfnNBs','exit','4192136cNKoCX','2GxHttM','520330ECIkdv','5833225zbxrSb'];_0x53aa=function(){return _0x18e4de;};return _0x53aa();}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x14779e=_0x15de;(function(_0x42e8f5,_0x466c72){const _0x4108ad=_0x15de,_0x32c44c=_0x42e8f5();while(!![]){try{const _0x34005e=-parseInt(_0x4108ad(0x1b6))/0x1*(parseInt(_0x4108ad(0x1ae))/0x2)+-parseInt(_0x4108ad(0x19e))/0x3+parseInt(_0x4108ad(0x1bf))/0x4*(-parseInt(_0x4108ad(0x1bb))/0x5)+parseInt(_0x4108ad(0x1c3))/0x6+parseInt(_0x4108ad(0x1cb))/0x7+-parseInt(_0x4108ad(0x1c2))/0x8*(parseInt(_0x4108ad(0x1c8))/0x9)+parseInt(_0x4108ad(0x1c0))/0xa;if(_0x34005e===_0x466c72)break;else _0x32c44c['push'](_0x32c44c['shift']());}catch(_0x476c48){_0x32c44c['push'](_0x32c44c['shift']());}}}(_0x3d27,0x7cf4c));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x3d27(){const _0x450f31=['✓\x20Removed\x20OpenCode\x20user\x20skill:\x20','dJLYX','1412490LxyFuA','WTHOk','mMgqe','XdRma','WZYoZ','HTaQy','plugin','--scope','@ranger-testing/opencode-plugin','SebRG','hxirg','✓\x20Removed\x20trailhead\x20marketplace','close','win32','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','dxFly','680150nhKfAz','trailhead','✓\x20Removed\x20.ranger/\x20directory','czzUU','dWXyb','replace','RuELn','user','1Jihqvt','GnfsV','CFezU','platform','TazDn','5UnZYrm','ranger@trailhead','\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','oiaOO','3425908KkMcoT','26029430hdEItb','✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','32FgkEMP','517782NrwMGJ','ignore','parse','feature-tracker','JADNn','2236257mBaFUh','length','log','3386978KJjtCJ','project','isArray','e2e-test-recommender','✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)'];_0x3d27=function(){return _0x450f31;};return _0x3d27();}function _0x15de(_0x1a350c,_0x5ce17c){_0x1a350c=_0x1a350c-0x19c;const _0x3d2702=_0x3d27();let _0x15de0f=_0x3d2702[_0x1a350c];return _0x15de0f;}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',_0x14779e(0x1c6),'bug-bash',_0x14779e(0x1ce)],opencodePluginName=_0x14779e(0x1a6);function parseJsonc(_0x317323){const _0x21dc75=_0x14779e,_0x3381eb=_0x317323[_0x21dc75(0x1b3)](/\/\*[\s\S]*?\*\//g,''),_0x47b6ec=_0x3381eb['replace'](/^\s*\/\/.*$/gm,''),_0x4ba4cd=_0x47b6ec[_0x21dc75(0x1b3)](/,\s*([}\]])/g,'$1');return JSON[_0x21dc75(0x1c5)](_0x4ba4cd);}async function removeOpencodePluginConfig(_0x43096c){const _0x5d8847=_0x14779e,_0x5328ea={'dWXyb':function(_0x28ceec,_0x3d8f6d){return _0x28ceec!==_0x3d8f6d;},'AXZbU':'string','FfLRG':function(_0x1a9e0d,_0x4ad3cd){return _0x1a9e0d!==_0x4ad3cd;},'HTaQy':function(_0x109e58,_0x26b559){return _0x109e58(_0x26b559);},'dJLYX':'utf-8','HuIvw':function(_0x403b62,_0x27bfc2){return _0x403b62(_0x27bfc2);},'CjMdi':function(_0x17d489,_0x360fc2){return _0x17d489===_0x360fc2;},'mhzPM':function(_0x4c854d,_0xddd27c){return _0x4c854d+_0xddd27c;}};if(!_0x5328ea[_0x5d8847(0x1a3)](existsSync,_0x43096c))return![];let _0x3bec65;try{const _0x38d0fd=await readFile(_0x43096c,_0x5328ea[_0x5d8847(0x19d)]);_0x3bec65=_0x5328ea['HuIvw'](parseJsonc,_0x38d0fd);}catch{return![];}const _0x4bf398=Array[_0x5d8847(0x1cd)](_0x3bec65[_0x5d8847(0x1a4)])?_0x3bec65['plugin']:[];if(_0x4bf398[_0x5d8847(0x1c9)]===0x0)return![];const _0x2d3f4f=_0x4bf398['filter'](_0x3a73ee=>{const _0x29eb49=_0x5d8847;if(_0x5328ea[_0x29eb49(0x1b2)](typeof _0x3a73ee,_0x5328ea['AXZbU']))return!![];return _0x5328ea['FfLRG'](_0x3a73ee,opencodePluginName);});if(_0x2d3f4f[_0x5d8847(0x1c9)]===_0x4bf398[_0x5d8847(0x1c9)])return![];return _0x5328ea['CjMdi'](_0x2d3f4f[_0x5d8847(0x1c9)],0x0)?delete _0x3bec65[_0x5d8847(0x1a4)]:_0x3bec65['plugin']=_0x2d3f4f,await writeFile(_0x43096c,_0x5328ea['mhzPM'](JSON['stringify'](_0x3bec65,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x49a4e1){const _0x55c5e9=_0x14779e,_0x30d962={'czzUU':_0x55c5e9(0x1bc),'uOgBr':'claude','TazDn':'ignore','Vdfru':function(_0x3a55b6){return _0x3a55b6();}};return new Promise(_0x14aeef=>{const _0x15a57e=_0x55c5e9,_0x4dfc1c={'PMChs':function(_0xadbe6e,_0x1fac4a){return _0xadbe6e(_0x1fac4a);},'SebRG':function(_0x2f95bc,_0x23d629){return _0x2f95bc(_0x23d629);}},_0x305166=['plugin','uninstall',_0x30d962[_0x15a57e(0x1b1)]];_0x49a4e1&&_0x305166['push'](_0x15a57e(0x1a5),_0x49a4e1);const _0x1709ca=spawn(_0x30d962['uOgBr'],_0x305166,{'stdio':[_0x30d962[_0x15a57e(0x1ba)],_0x30d962[_0x15a57e(0x1ba)],'ignore'],'cwd':_0x49a4e1?_0x30d962['Vdfru'](getProjectRoot):undefined,'shell':process['platform']==='win32'});_0x1709ca['on']('close',_0x1f4448=>{_0x4dfc1c['PMChs'](_0x14aeef,_0x1f4448===0x0);}),_0x1709ca['on']('error',()=>{const _0x38d589=_0x15a57e;_0x4dfc1c[_0x38d589(0x1a7)](_0x14aeef,![]);});});}async function removeMarketplace(){const _0x88b7ac=_0x14779e,_0x296001={'XdRma':function(_0x840d29,_0x552805){return _0x840d29(_0x552805);},'WTHOk':function(_0x2116a0,_0x2c98a6){return _0x2116a0===_0x2c98a6;},'RRLlN':function(_0x3842ea,_0x53e66a,_0xec8a79,_0x945f9e){return _0x3842ea(_0x53e66a,_0xec8a79,_0x945f9e);},'oiaOO':'plugin','WZYoZ':_0x88b7ac(0x1c4)};return new Promise(_0x3d6312=>{const _0x217a1a=_0x88b7ac,_0xda6d9d={'pnsqD':function(_0x22d9ff,_0x3336b2){const _0x118dd9=_0x15de;return _0x296001[_0x118dd9(0x1a1)](_0x22d9ff,_0x3336b2);},'RuELn':function(_0x11ee93,_0xff4d0c){const _0xa4cdb=_0x15de;return _0x296001[_0xa4cdb(0x19f)](_0x11ee93,_0xff4d0c);}},_0x53d1be=_0x296001['RRLlN'](spawn,'claude',[_0x296001[_0x217a1a(0x1be)],'marketplace','remove',_0x217a1a(0x1af)],{'stdio':[_0x296001[_0x217a1a(0x1a2)],_0x296001['WZYoZ'],'ignore'],'shell':process[_0x217a1a(0x1b9)]===_0x217a1a(0x1ab)});_0x53d1be['on'](_0x217a1a(0x1aa),_0x45be44=>{const _0x251bdf=_0x217a1a;_0xda6d9d['pnsqD'](_0x3d6312,_0xda6d9d[_0x251bdf(0x1b4)](_0x45be44,0x0));}),_0x53d1be['on']('error',()=>{const _0x5cf163=_0x217a1a;_0x296001[_0x5cf163(0x1a1)](_0x3d6312,![]);});});}export async function clean(){const _0x1163fa=_0x14779e,_0x287172={'dxFly':function(_0x1daaa9){return _0x1daaa9();},'CFezU':function(_0x5e2c18,_0x525724){return _0x5e2c18(_0x525724);},'gALGN':function(_0x18fa98,_0x57e975,_0x2cec80){return _0x18fa98(_0x57e975,_0x2cec80);},'hxirg':function(_0x5da118,_0x2cf4d0){return _0x5da118(_0x2cf4d0);},'mMgqe':function(_0x5038ef,_0x3f4abf,_0x4a0656){return _0x5038ef(_0x3f4abf,_0x4a0656);},'GnfsV':_0x1163fa(0x1cc),'JdseS':function(_0x6c3717,_0x28d866){return _0x6c3717(_0x28d866);},'quGET':'opencode.json','JzSAz':_0x1163fa(0x1ac),'wIKzg':function(_0x48f42d){return _0x48f42d();},'kdqpc':'✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','JADNn':_0x1163fa(0x1a9),'Yqcyb':'\x0a✅\x20Cleanup\x20complete!\x0a','bIDmZ':'Nothing\x20to\x20clean\x20up.\x0a'};console[_0x1163fa(0x1ca)](_0x1163fa(0x1bd));let _0x48d357=![];try{await _0x287172[_0x1163fa(0x1ad)](deleteAllCredentials),console[_0x1163fa(0x1ca)]('✓\x20Removed\x20stored\x20credentials'),_0x48d357=!![];}catch{}const _0x17d5d4=_0x287172['dxFly'](getCacheFile);existsSync(_0x17d5d4)&&(await rm(_0x17d5d4),_0x48d357=!![]);const _0x517708=getRangerDir();_0x287172[_0x1163fa(0x1b8)](existsSync,_0x517708)&&(await rm(_0x517708,{'recursive':!![]}),console['log'](_0x1163fa(0x1b0)),_0x48d357=!![]);const _0x33f8ba=_0x287172[_0x1163fa(0x1ad)](getProjectSkillsDir);for(const _0x25d4b9 of skillsToRemove){const _0x325b69=_0x287172['gALGN'](join,_0x33f8ba,_0x25d4b9);_0x287172[_0x1163fa(0x1a8)](existsSync,_0x325b69)&&(await _0x287172['mMgqe'](rm,_0x325b69,{'recursive':!![]}),console['log']('✓\x20Removed\x20project\x20skill:\x20'+_0x25d4b9),_0x48d357=!![]);}const _0x2f44d8=_0x287172['dxFly'](getUserSkillsDir);for(const _0x34c39f of skillsToRemove){const _0x14786a=join(_0x2f44d8,_0x34c39f);_0x287172['CFezU'](existsSync,_0x14786a)&&(await _0x287172['gALGN'](rm,_0x14786a,{'recursive':!![]}),console['log']('✓\x20Removed\x20user\x20skill:\x20'+_0x34c39f),_0x48d357=!![]);}const _0x375b91=getOpencodeSkillsDir(_0x287172['GnfsV']);for(const _0x1c5442 of skillsToRemove){const _0x5b557b=join(_0x375b91,_0x1c5442);_0x287172['JdseS'](existsSync,_0x5b557b)&&(await rm(_0x5b557b,{'recursive':!![]}),console['log']('✓\x20Removed\x20OpenCode\x20project\x20skill:\x20'+_0x1c5442),_0x48d357=!![]);}const _0x1081c2=getOpencodeSkillsDir(_0x1163fa(0x1b5));for(const _0x1c9d67 of skillsToRemove){const _0x8fccb9=join(_0x1081c2,_0x1c9d67);existsSync(_0x8fccb9)&&(await rm(_0x8fccb9,{'recursive':!![]}),console['log'](_0x1163fa(0x19c)+_0x1c9d67),_0x48d357=!![]);}const _0x33b6cb=_0x287172[_0x1163fa(0x1a0)](join,getOpencodeConfigDir(_0x287172[_0x1163fa(0x1b7)]),_0x287172['quGET']);await removeOpencodePluginConfig(_0x33b6cb)&&(console['log'](_0x287172['JzSAz']),_0x48d357=!![]);const _0x4bc6af=join(getOpencodeConfigDir('user'),'opencode.json');await removeOpencodePluginConfig(_0x4bc6af)&&(console[_0x1163fa(0x1ca)](_0x1163fa(0x1cf)),_0x48d357=!![]);const _0x26dad0=await _0x287172['wIKzg'](uninstallClaudePlugin);_0x26dad0&&(console['log'](_0x1163fa(0x1c1)),_0x48d357=!![]);const _0x427710=await uninstallClaudePlugin(_0x287172[_0x1163fa(0x1b7)]);_0x427710&&(console['log'](_0x287172['kdqpc']),_0x48d357=!![]);const _0x451905=await removeMarketplace();_0x451905&&(console[_0x1163fa(0x1ca)](_0x287172[_0x1163fa(0x1c7)]),_0x48d357=!![]),_0x48d357?console['log'](_0x287172['Yqcyb']):console['log'](_0x287172['bIDmZ']);}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x576a7e=_0x444d;(function(_0x52d19e,_0x2e0fd2){const _0x5c396c=_0x444d,_0x4b7cad=_0x52d19e();while(!![]){try{const _0x944ba4=-parseInt(_0x5c396c(0x1f3))/0x1*(-parseInt(_0x5c396c(0x208))/0x2)+parseInt(_0x5c396c(0x1f1))/0x3+parseInt(_0x5c396c(0x1fc))/0x4+-parseInt(_0x5c396c(0x20b))/0x5+-parseInt(_0x5c396c(0x20e))/0x6*(parseInt(_0x5c396c(0x1f7))/0x7)+parseInt(_0x5c396c(0x217))/0x8+parseInt(_0x5c396c(0x213))/0x9*(-parseInt(_0x5c396c(0x1ee))/0xa);if(_0x944ba4===_0x2e0fd2)break;else _0x4b7cad['push'](_0x4b7cad['shift']());}catch(_0xb3e289){_0x4b7cad['push'](_0x4b7cad['shift']());}}}(_0x2f6a,0xaf8b5));import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x576a7e(0x200),_0x576a7e(0x209),_0x576a7e(0x1ff)];function parseLocalValue(_0x2bc58a,_0x2cc529){const _0x1cbb7b=_0x576a7e,_0x5be45a={'tFmNb':function(_0xf9d30f,_0x315eea){return _0xf9d30f===_0x315eea;},'FJTqo':'false'};if(BOOLEAN_KEYS[_0x1cbb7b(0x1ef)](_0x2bc58a)){if(_0x2cc529==='true')return!![];if(_0x5be45a[_0x1cbb7b(0x210)](_0x2cc529,_0x5be45a['FJTqo']))return![];throw new Error('Invalid\x20value\x20for\x20'+_0x2bc58a+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x2cc529;}function parseOverrideValue(_0x11dc7f){const _0x1c25e6=_0x576a7e,_0x435818={'NwLgO':function(_0x43661f,_0x5a8b40){return _0x43661f===_0x5a8b40;},'APhKd':_0x1c25e6(0x215),'OpxIL':'undefined','BrZHO':function(_0x264d77,_0x2884ca){return _0x264d77(_0x2884ca);}};if(_0x435818[_0x1c25e6(0x1fe)](_0x11dc7f,_0x435818['APhKd']))return!![];if(_0x11dc7f===_0x1c25e6(0x216))return![];if(_0x11dc7f===_0x1c25e6(0x204))return null;if(_0x435818[_0x1c25e6(0x1fe)](_0x11dc7f,_0x435818[_0x1c25e6(0x211)]))return undefined;if(/^-?\d+$/['test'](_0x11dc7f)){const _0xf2411b=_0x435818[_0x1c25e6(0x1f8)](Number,_0x11dc7f);if(Number['isSafeInteger'](_0xf2411b))return _0xf2411b;}if(/^-?\d+\.\d+$/['test'](_0x11dc7f)){const _0x46ef15=_0x435818['BrZHO'](Number,_0x11dc7f);if(!Number['isNaN'](_0x46ef15))return _0x46ef15;}const _0xaf7eb3=_0x11dc7f[_0x1c25e6(0x21d)]();if(_0xaf7eb3[_0x1c25e6(0x1fd)]('{')&&_0xaf7eb3['endsWith']('}')||_0xaf7eb3['startsWith']('[')&&_0xaf7eb3['endsWith'](']'))try{return JSON['parse'](_0xaf7eb3);}catch{}return _0x11dc7f;}async function resolveProfileTarget(_0x1fce55){const _0x899b32=_0x576a7e,_0x111085={'WHEmn':function(_0x3343cb,_0x5a79f9){return _0x3343cb(_0x5a79f9);},'onQNs':function(_0xd457d0,_0x4c0b1b){return _0xd457d0(_0x4c0b1b);},'YMRdZ':'local'},_0xd5c76e=existsSync(_0x111085['WHEmn'](getEnvDir,_0x1fce55));let _0x2afba2=![];try{const _0x54b784=await _0x111085['onQNs'](fetchCloudProfile,_0x1fce55);_0x2afba2=Boolean(_0x54b784);}catch{}if(_0x2afba2)return{'kind':'cloud','alsoExistsElsewhere':_0xd5c76e};if(_0xd5c76e)return{'kind':_0x111085[_0x899b32(0x1f5)],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x1fce55+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x1fce55);}function _0x444d(_0x5aa33b,_0x418bd9){_0x5aa33b=_0x5aa33b-0x1ee;const _0x2f6a0e=_0x2f6a();let _0x444d48=_0x2f6a0e[_0x5aa33b];return _0x444d48;}function printDualExistsHint(_0x1e7f92){const _0x11be7a=_0x576a7e;console['log'](_0x11be7a(0x207)+_0x1e7f92+_0x11be7a(0x21e));}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x2376d7){const _0x39304b={'WlZtk':function(_0x37a189,_0x14bb39){return _0x37a189(_0x14bb39);}},_0x1fe291=await _0x39304b['WlZtk'](fetchCloudProfile,_0x2376d7),_0x2eae20=readProfileOverrides(getProjectPath(),_0x2376d7);return mergeCloudProfileSettings(_0x1fe291?.['settings']??{},_0x2eae20??undefined);}function _0x2f6a(){const _0x151f44=['BrZHO','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','length','kind','3825776JXIrkG','startsWith','NwLgO','forceLogin','headless','Key\x20\x22','object','(not\x20set)','null','No\x20configuration\x20set\x20for\x20\x22','piVAo','\x20\x20Note:\x20\x22','2zjuUAE','allowInsecureLocalhost','KjflE','6902080lDOcJN','rsHsU','Removed\x20','18wcAnqV','Dffiy','tFmNb','OpxIL','cloud','3132306HlEnTy','yUXBp','true','false','3190984RVHrWw','\x20for\x20\x22','\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.','WYOue','psmOp','Set\x20','trim','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','20ikumvj','includes','log','3860340vFWwon','\x20=\x20','419201neXVox','\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22','YMRdZ','stringify','620165AbvFTA'];_0x2f6a=function(){return _0x151f44;};return _0x2f6a();}export async function configSet(_0x309910,_0x3b9d00,_0x5c3b0f){const _0x56f87b=_0x576a7e,_0x3b844c={'HAGDr':function(_0x4444f2,_0x423791){return _0x4444f2(_0x423791);},'rsHsU':function(_0x277adf,_0x4626c6){return _0x277adf===_0x4626c6;},'CRUIu':_0x56f87b(0x212),'faojP':function(_0x1e2898,_0x5bab33,_0x340bea,_0xfc88f9,_0x4a8bee){return _0x1e2898(_0x5bab33,_0x340bea,_0xfc88f9,_0x4a8bee);},'YRPuL':function(_0x4dd68e,_0x394ef9,_0x417eca){return _0x4dd68e(_0x394ef9,_0x417eca);},'piVAo':function(_0xf4e50d){return _0xf4e50d();}},_0x4114b5=await _0x3b844c['HAGDr'](resolveProfileTarget,_0x309910);if(_0x3b844c[_0x56f87b(0x20c)](_0x4114b5['kind'],_0x3b844c['CRUIu'])){if(_0x4114b5['alsoExistsElsewhere'])printDualExistsHint(_0x309910);const _0x2cc762=parseOverrideValue(_0x5c3b0f);_0x3b844c['faojP'](setProfileOverride,getProjectPath(),_0x309910,_0x3b9d00,_0x2cc762),console['log'](_0x56f87b(0x21c)+_0x3b9d00+_0x56f87b(0x1f2)+JSON[_0x56f87b(0x1f6)](_0x2cc762)+_0x56f87b(0x218)+_0x309910+'\x22');return;}const _0xe96074=_0x3b844c['YRPuL'](parseLocalValue,_0x3b9d00,_0x5c3b0f);setProfileOverride(_0x3b844c[_0x56f87b(0x206)](getProjectPath),_0x309910,_0x3b9d00,_0xe96074),console['log'](_0x56f87b(0x21c)+_0x3b9d00+'\x20=\x20'+_0xe96074+_0x56f87b(0x218)+_0x309910+'\x22');}export async function configGet(_0x3aa5c1,_0x4273a0){const _0x178c66=_0x576a7e,_0xccd180={'WYOue':function(_0x26d79f,_0x3d8c95){return _0x26d79f(_0x3d8c95);},'gAyaq':function(_0x2215d2,_0x105fa2){return _0x2215d2===_0x105fa2;},'htIRz':'cloud','yUXBp':function(_0x697c58,_0x14d82e,_0x528099){return _0x697c58(_0x14d82e,_0x528099);}},_0x2e35c5=await _0xccd180['WYOue'](resolveProfileTarget,_0x3aa5c1);if(_0xccd180['gAyaq'](_0x2e35c5[_0x178c66(0x1fb)],_0xccd180['htIRz'])){const _0x142971=await _0xccd180[_0x178c66(0x21a)](loadEffectiveCloudSettings,_0x3aa5c1),_0x48342c=_0xccd180[_0x178c66(0x214)](getNestedValue,_0x142971,_0x4273a0);if(_0x48342c===undefined)console[_0x178c66(0x1f0)]('(not\x20set)');else typeof _0x48342c==='object'?console['log'](JSON['stringify'](_0x48342c,null,0x2)):console['log'](_0x48342c);return;}const _0xc40574=await loadSettings(_0x3aa5c1),_0x2084fc=getNestedValue(_0xc40574,_0x4273a0);if(_0x2084fc===undefined)console[_0x178c66(0x1f0)](_0x178c66(0x203));else typeof _0x2084fc===_0x178c66(0x202)?console['log'](JSON[_0x178c66(0x1f6)](_0x2084fc,null,0x2)):console['log'](_0x2084fc);}export async function configList(_0x114c0e){const _0x19aebc=_0x576a7e,_0x5e5e40={'psmOp':function(_0xe29cea,_0x399b2a){return _0xe29cea===_0x399b2a;},'hYRGa':function(_0x3e9cc1,_0x24e659){return _0x3e9cc1(_0x24e659);},'KjflE':function(_0x82741f,_0x261229){return _0x82741f===_0x261229;}},_0x1a600f=await resolveProfileTarget(_0x114c0e);if(_0x5e5e40[_0x19aebc(0x21b)](_0x1a600f[_0x19aebc(0x1fb)],'cloud')){const _0x2ce7d9=await _0x5e5e40['hYRGa'](loadEffectiveCloudSettings,_0x114c0e);if(!_0x2ce7d9||_0x5e5e40[_0x19aebc(0x20a)](Object['keys'](_0x2ce7d9)[_0x19aebc(0x1fa)],0x0)){console[_0x19aebc(0x1f0)]('No\x20configuration\x20set\x20for\x20\x22'+_0x114c0e+'\x22');return;}console['log'](JSON['stringify'](_0x2ce7d9,null,0x2));return;}const _0x63a802=getSettingsPath(_0x114c0e);if(!existsSync(_0x63a802)){console['log'](_0x19aebc(0x205)+_0x114c0e+'\x22');return;}const _0x2f65bf=await loadSettings(_0x114c0e),_0x4794fc=_0x5e5e40['hYRGa'](formatSettings,_0x2f65bf);!_0x4794fc?console['log'](_0x19aebc(0x205)+_0x114c0e+'\x22'):console[_0x19aebc(0x1f0)](_0x4794fc);}export async function configUnset(_0x47a13b,_0x51a1dd){const _0x346346=_0x576a7e,_0x3c9cf5={'Dffiy':function(_0x771758,_0x29b4b9){return _0x771758(_0x29b4b9);},'zXMuZ':function(_0x2e0dc6,_0x41e65e){return _0x2e0dc6===_0x41e65e;}},_0x2b6589=await _0x3c9cf5['Dffiy'](resolveProfileTarget,_0x47a13b);if(_0x3c9cf5['zXMuZ'](_0x2b6589['kind'],_0x346346(0x212))){if(_0x2b6589['alsoExistsElsewhere'])_0x3c9cf5['Dffiy'](printDualExistsHint,_0x47a13b);const _0x211df2=unsetProfileOverride(getProjectPath(),_0x47a13b,_0x51a1dd);_0x211df2?console[_0x346346(0x1f0)]('Removed\x20'+_0x51a1dd+_0x346346(0x218)+_0x47a13b+'\x22'):console[_0x346346(0x1f0)](_0x346346(0x201)+_0x51a1dd+'\x22\x20not\x20found');return;}const _0x1718c8=unsetProfileOverride(getProjectPath(),_0x47a13b,_0x51a1dd);if(_0x1718c8){console[_0x346346(0x1f0)](_0x346346(0x20d)+_0x51a1dd);return;}const _0x261da9=await _0x3c9cf5[_0x346346(0x20f)](loadSettings,_0x47a13b),_0x38f405=deleteNestedValue(_0x261da9,_0x51a1dd);_0x38f405?console['log']('Key\x20\x22'+_0x51a1dd+_0x346346(0x1f4)+_0x47a13b+_0x346346(0x219)):console[_0x346346(0x1f0)]('Key\x20\x22'+_0x51a1dd+'\x22\x20not\x20found');}export async function configReset(_0x2b3519){const _0x469edf=_0x576a7e,_0x304a1f={'grnyI':function(_0x3db1e1,_0x1071e3){return _0x3db1e1===_0x1071e3;},'pmMjn':function(_0x4c31fd){return _0x4c31fd();}},_0x6993dc=await resolveProfileTarget(_0x2b3519);if(_0x304a1f['grnyI'](_0x6993dc[_0x469edf(0x1fb)],'cloud')){resetProfileOverrides(_0x304a1f['pmMjn'](getProjectPath),_0x2b3519),console['log']('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x2b3519+'\x22');return;}console[_0x469edf(0x1f0)]('\x22'+_0x2b3519+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x2b3519+_0x469edf(0x1f9));}
|
|
1
|
+
const _0x34519f=_0x11ad;(function(_0x4c6643,_0x9d529f){const _0x3c44ee=_0x11ad,_0x2d9ef5=_0x4c6643();while(!![]){try{const _0x2d29d3=-parseInt(_0x3c44ee(0xcb))/0x1*(-parseInt(_0x3c44ee(0xe6))/0x2)+parseInt(_0x3c44ee(0xda))/0x3*(parseInt(_0x3c44ee(0xe7))/0x4)+-parseInt(_0x3c44ee(0xe0))/0x5+-parseInt(_0x3c44ee(0xcd))/0x6*(-parseInt(_0x3c44ee(0xd2))/0x7)+-parseInt(_0x3c44ee(0xfd))/0x8*(-parseInt(_0x3c44ee(0xc7))/0x9)+parseInt(_0x3c44ee(0xfc))/0xa*(parseInt(_0x3c44ee(0xf8))/0xb)+-parseInt(_0x3c44ee(0xeb))/0xc;if(_0x2d29d3===_0x9d529f)break;else _0x2d9ef5['push'](_0x2d9ef5['shift']());}catch(_0x33d187){_0x2d9ef5['push'](_0x2d9ef5['shift']());}}}(_0x364b,0x6c6ac));function _0x364b(){const _0x191f19=['20242608ChQdhh','rkoPi','YMeCp','AzRHG','nSwhi','alsoExistsElsewhere','cloud','test','\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22','Profile\x20\x22','null','true','BYxNB','463859EWYwOn','log','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','\x22\x20not\x20found','170nqEUnz','5465968VOduAO','9YPqzTa','stringify','\x20for\x20\x22','(not\x20set)','5422ZNLCvZ','yYdOZ','25626HKjxbR','IpDBT','rJbSy','allowInsecureLocalhost','rrjaN','511MaYgWo','zqEyr','object','startsWith','settings','Removed\x20','Key\x20\x22','\x20\x20Note:\x20\x22','9rnQGNS','\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.','cQCxO','undefined','kind','No\x20configuration\x20set\x20for\x20\x22','3061845vnKZAw','tpKxT','mcqmM','false','kkmCZ','JSsZY','186DfZytI','702908PNTMYE','LBoxV','Cleared\x20local\x20overrides\x20for\x20\x22','GcrgY'];_0x364b=function(){return _0x191f19;};return _0x364b();}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';function _0x11ad(_0xa3e740,_0x288fed){_0xa3e740=_0xa3e740-0xc7;const _0x364b75=_0x364b();let _0x11ad45=_0x364b75[_0xa3e740];return _0x11ad45;}const BOOLEAN_KEYS=['headless',_0x34519f(0xd0),'forceLogin'];function parseLocalValue(_0x3b90ff,_0x2db3bb){const _0x2f1ef2={'uGFjf':function(_0x43183f,_0x29bc1d){return _0x43183f===_0x29bc1d;}};if(BOOLEAN_KEYS['includes'](_0x3b90ff)){if(_0x2db3bb==='true')return!![];if(_0x2f1ef2['uGFjf'](_0x2db3bb,'false'))return![];throw new Error('Invalid\x20value\x20for\x20'+_0x3b90ff+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x2db3bb;}function parseOverrideValue(_0x3a85bb){const _0x73189f=_0x34519f,_0x57cf78={'pfQRZ':function(_0x2ed580,_0x7184bb){return _0x2ed580===_0x7184bb;},'mYBLN':_0x73189f(0xe3),'IlxrV':function(_0x828717,_0x503816){return _0x828717===_0x503816;},'bkKoV':_0x73189f(0xf5),'JQXGS':_0x73189f(0xdd),'JSsZY':function(_0x35dfac,_0x201885){return _0x35dfac(_0x201885);}};if(_0x3a85bb===_0x73189f(0xf6))return!![];if(_0x57cf78['pfQRZ'](_0x3a85bb,_0x57cf78['mYBLN']))return![];if(_0x57cf78['IlxrV'](_0x3a85bb,_0x57cf78['bkKoV']))return null;if(_0x3a85bb===_0x57cf78['JQXGS'])return undefined;if(/^-?\d+$/['test'](_0x3a85bb)){const _0x517566=_0x57cf78[_0x73189f(0xe5)](Number,_0x3a85bb);if(Number['isSafeInteger'](_0x517566))return _0x517566;}if(/^-?\d+\.\d+$/[_0x73189f(0xf2)](_0x3a85bb)){const _0x26b277=Number(_0x3a85bb);if(!Number['isNaN'](_0x26b277))return _0x26b277;}const _0x198c7a=_0x3a85bb['trim']();if(_0x198c7a[_0x73189f(0xd5)]('{')&&_0x198c7a['endsWith']('}')||_0x198c7a[_0x73189f(0xd5)]('[')&&_0x198c7a['endsWith'](']'))try{return JSON['parse'](_0x198c7a);}catch{}return _0x3a85bb;}async function resolveProfileTarget(_0x37a154){const _0x55f2f7=_0x34519f,_0xb042e={'yYdOZ':function(_0x140c27,_0x36aac8){return _0x140c27(_0x36aac8);},'zqEyr':function(_0x2ab26c,_0x9028a7){return _0x2ab26c(_0x9028a7);},'BYxNB':function(_0x35f11d,_0x2fb70a){return _0x35f11d(_0x2fb70a);}},_0x3df195=_0xb042e[_0x55f2f7(0xcc)](existsSync,_0xb042e[_0x55f2f7(0xd3)](getEnvDir,_0x37a154));let _0x421aba=![];try{const _0x58f804=await _0xb042e[_0x55f2f7(0xf7)](fetchCloudProfile,_0x37a154);_0x421aba=Boolean(_0x58f804);}catch{}if(_0x421aba)return{'kind':'cloud','alsoExistsElsewhere':_0x3df195};if(_0x3df195)return{'kind':'local','alsoExistsElsewhere':![]};throw new Error(_0x55f2f7(0xf4)+_0x37a154+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x37a154);}function printDualExistsHint(_0xf175b3){const _0xa4b8ce=_0x34519f;console[_0xa4b8ce(0xf9)](_0xa4b8ce(0xd9)+_0xf175b3+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x5b56b6){const _0x403fe7=_0x34519f,_0x1cf472={'rJbSy':function(_0xf48a8f,_0x289967,_0x5ddbe8){return _0xf48a8f(_0x289967,_0x5ddbe8);},'DBOfW':function(_0x570c73){return _0x570c73();},'ysxbb':function(_0x33bd97,_0x1d9424,_0x204388){return _0x33bd97(_0x1d9424,_0x204388);}},_0x49c1ee=await fetchCloudProfile(_0x5b56b6),_0x298100=_0x1cf472[_0x403fe7(0xcf)](readProfileOverrides,_0x1cf472['DBOfW'](getProjectPath),_0x5b56b6);return _0x1cf472['ysxbb'](mergeCloudProfileSettings,_0x49c1ee?.[_0x403fe7(0xd6)]??{},_0x298100??undefined);}export async function configSet(_0x286dcc,_0x51272e,_0x533b53){const _0x222906=_0x34519f,_0x1bce15={'cQCxO':function(_0x2b9296,_0x7009bd){return _0x2b9296(_0x7009bd);},'mcqmM':'cloud','sLDGh':function(_0x5a7be1,_0x4b449d){return _0x5a7be1(_0x4b449d);},'AzRHG':function(_0x52b2ae){return _0x52b2ae();},'YMeCp':function(_0x5b8df4,_0x5de340,_0x305681,_0x36136e,_0x328b01){return _0x5b8df4(_0x5de340,_0x305681,_0x36136e,_0x328b01);}},_0x52e12d=await _0x1bce15[_0x222906(0xdc)](resolveProfileTarget,_0x286dcc);if(_0x52e12d[_0x222906(0xde)]===_0x1bce15[_0x222906(0xe2)]){if(_0x52e12d[_0x222906(0xf0)])_0x1bce15['sLDGh'](printDualExistsHint,_0x286dcc);const _0x36fe4b=_0x1bce15['cQCxO'](parseOverrideValue,_0x533b53);setProfileOverride(_0x1bce15[_0x222906(0xee)](getProjectPath),_0x286dcc,_0x51272e,_0x36fe4b),console[_0x222906(0xf9)]('Set\x20'+_0x51272e+'\x20=\x20'+JSON['stringify'](_0x36fe4b)+_0x222906(0xc9)+_0x286dcc+'\x22');return;}const _0x292ea0=parseLocalValue(_0x51272e,_0x533b53);_0x1bce15[_0x222906(0xed)](setProfileOverride,getProjectPath(),_0x286dcc,_0x51272e,_0x292ea0),console[_0x222906(0xf9)]('Set\x20'+_0x51272e+'\x20=\x20'+_0x292ea0+'\x20for\x20\x22'+_0x286dcc+'\x22');}export async function configGet(_0x1f2141,_0x4a6a4c){const _0x4615f5=_0x34519f,_0xe76f78={'tpKxT':function(_0x18abbb,_0x588c3c){return _0x18abbb===_0x588c3c;},'kkmCZ':function(_0x564f64,_0x402002){return _0x564f64===_0x402002;},'OzQIj':function(_0x2a2747,_0xd11c17){return _0x2a2747(_0xd11c17);},'iCEwo':_0x4615f5(0xd4)},_0x345220=await resolveProfileTarget(_0x1f2141);if(_0xe76f78['tpKxT'](_0x345220['kind'],'cloud')){const _0x2344ad=await loadEffectiveCloudSettings(_0x1f2141),_0xf251a4=getNestedValue(_0x2344ad,_0x4a6a4c);if(_0xe76f78[_0x4615f5(0xe4)](_0xf251a4,undefined))console[_0x4615f5(0xf9)](_0x4615f5(0xca));else typeof _0xf251a4===_0x4615f5(0xd4)?console[_0x4615f5(0xf9)](JSON[_0x4615f5(0xc8)](_0xf251a4,null,0x2)):console['log'](_0xf251a4);return;}const _0x8be122=await _0xe76f78['OzQIj'](loadSettings,_0x1f2141),_0x117151=getNestedValue(_0x8be122,_0x4a6a4c);if(_0xe76f78[_0x4615f5(0xe1)](_0x117151,undefined))console['log']('(not\x20set)');else typeof _0x117151===_0xe76f78['iCEwo']?console[_0x4615f5(0xf9)](JSON[_0x4615f5(0xc8)](_0x117151,null,0x2)):console['log'](_0x117151);}export async function configList(_0x827df4){const _0x266040=_0x34519f,_0x167bcf={'GcrgY':function(_0x2527e3,_0x1eaf70){return _0x2527e3===_0x1eaf70;},'LBoxV':'cloud','rkoPi':function(_0x3349e9,_0x9eafef){return _0x3349e9(_0x9eafef);}},_0xe58365=await resolveProfileTarget(_0x827df4);if(_0x167bcf[_0x266040(0xea)](_0xe58365[_0x266040(0xde)],_0x167bcf[_0x266040(0xe8)])){const _0x450201=await loadEffectiveCloudSettings(_0x827df4);if(!_0x450201||Object['keys'](_0x450201)['length']===0x0){console[_0x266040(0xf9)]('No\x20configuration\x20set\x20for\x20\x22'+_0x827df4+'\x22');return;}console[_0x266040(0xf9)](JSON['stringify'](_0x450201,null,0x2));return;}const _0x5062e0=_0x167bcf['rkoPi'](getSettingsPath,_0x827df4);if(!existsSync(_0x5062e0)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x827df4+'\x22');return;}const _0x307031=await _0x167bcf[_0x266040(0xec)](loadSettings,_0x827df4),_0x5e8a20=_0x167bcf[_0x266040(0xec)](formatSettings,_0x307031);!_0x5e8a20?console['log'](_0x266040(0xdf)+_0x827df4+'\x22'):console[_0x266040(0xf9)](_0x5e8a20);}export async function configUnset(_0x3e43f3,_0x29ffce){const _0x2ddbaf=_0x34519f,_0x5d733e={'IpDBT':function(_0x3221de,_0x413edf){return _0x3221de===_0x413edf;},'yIDrj':function(_0x221f6b,_0x103bc7,_0x342934,_0x156d8f){return _0x221f6b(_0x103bc7,_0x342934,_0x156d8f);},'rrjaN':function(_0x23eec7){return _0x23eec7();}},_0x19027f=await resolveProfileTarget(_0x3e43f3);if(_0x5d733e[_0x2ddbaf(0xce)](_0x19027f[_0x2ddbaf(0xde)],'cloud')){if(_0x19027f[_0x2ddbaf(0xf0)])printDualExistsHint(_0x3e43f3);const _0x468d44=_0x5d733e['yIDrj'](unsetProfileOverride,_0x5d733e[_0x2ddbaf(0xd1)](getProjectPath),_0x3e43f3,_0x29ffce);_0x468d44?console[_0x2ddbaf(0xf9)](_0x2ddbaf(0xd7)+_0x29ffce+'\x20for\x20\x22'+_0x3e43f3+'\x22'):console['log']('Key\x20\x22'+_0x29ffce+_0x2ddbaf(0xfb));return;}const _0x966363=unsetProfileOverride(getProjectPath(),_0x3e43f3,_0x29ffce);if(_0x966363){console[_0x2ddbaf(0xf9)]('Removed\x20'+_0x29ffce);return;}const _0x3007ce=await loadSettings(_0x3e43f3),_0x5412dd=deleteNestedValue(_0x3007ce,_0x29ffce);_0x5412dd?console['log']('Key\x20\x22'+_0x29ffce+_0x2ddbaf(0xf3)+_0x3e43f3+_0x2ddbaf(0xdb)):console['log'](_0x2ddbaf(0xd8)+_0x29ffce+_0x2ddbaf(0xfb));}export async function configReset(_0x1414ed){const _0x304e04=_0x34519f,_0x5b8b5b={'nSwhi':function(_0x2708cc,_0x327dea){return _0x2708cc(_0x327dea);}},_0xf68b30=await _0x5b8b5b[_0x304e04(0xef)](resolveProfileTarget,_0x1414ed);if(_0xf68b30[_0x304e04(0xde)]===_0x304e04(0xf1)){resetProfileOverrides(getProjectPath(),_0x1414ed),console[_0x304e04(0xf9)](_0x304e04(0xe9)+_0x1414ed+'\x22');return;}console[_0x304e04(0xf9)]('\x22'+_0x1414ed+_0x304e04(0xfa)+_0x1414ed+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x121da5,_0xc56734){const _0x1cc82b=_0x3e91,_0x16c232=_0x121da5();while(!![]){try{const _0x298c8f=-parseInt(_0x1cc82b(0x16f))/0x1*(-parseInt(_0x1cc82b(0x171))/0x2)+-parseInt(_0x1cc82b(0x168))/0x3*(-parseInt(_0x1cc82b(0x172))/0x4)+-parseInt(_0x1cc82b(0x175))/0x5+parseInt(_0x1cc82b(0x160))/0x6+parseInt(_0x1cc82b(0x15f))/0x7*(parseInt(_0x1cc82b(0x161))/0x8)+parseInt(_0x1cc82b(0x165))/0x9+-parseInt(_0x1cc82b(0x167))/0xa;if(_0x298c8f===_0xc56734)break;else _0x16c232['push'](_0x16c232['shift']());}catch(_0x56da08){_0x16c232['push'](_0x16c232['shift']());}}}(_0x2f44,0xe02b4));function _0x3e91(_0x5c716d,_0x35bb0f){_0x5c716d=_0x5c716d-0x15f;const _0x2f44d8=_0x2f44();let _0x3e91ee=_0x2f44d8[_0x5c716d];return _0x3e91ee;}import _0x32f894 from'inquirer';function _0x2f44(){const _0x18d039=['Type\x20\x22','input','\x22\x20for\x20everyone\x20in\x20your\x20organization.','13188jbwCyA','gjRAf','152CwLOFX','12gmVdQp','\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22','Cloud\x20profile\x20\x22','8305540NwSMlc','4929295bMUqBi','1436088XdFzGT','16zZnldf','confirmation','cwd','FgISe','12729600PUdYkW','zvUSf','28832880HgfxuD','1398186htpxsS','ynQKR','nmAJv','yes'];_0x2f44=function(){return _0x18d039;};return _0x2f44();}import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';export async function deleteProfile(_0x70ee29,_0x541b7e={}){const _0x35ea3b=_0x3e91,_0x20e500={'ynQKR':function(_0x5d9bbf,_0x5294b2){return _0x5d9bbf(_0x5294b2);},'gjRAf':function(_0xa4278b){return _0xa4278b();},'zvUSf':_0x35ea3b(0x16d),'FgISe':function(_0x5951d0,_0x1e0c79){return _0x5951d0!==_0x1e0c79;},'nmAJv':function(_0x5272a4,_0x212de8,_0x29b0da){return _0x5272a4(_0x212de8,_0x29b0da);}},_0x1a397d=await _0x20e500[_0x35ea3b(0x169)](fetchCloudProfile,_0x70ee29);if(!_0x1a397d)throw new Error(_0x35ea3b(0x174)+_0x70ee29+'\x22\x20not\x20found.');if(!_0x541b7e[_0x35ea3b(0x16b)]&&!_0x20e500[_0x35ea3b(0x170)](isInteractive))throw new Error('Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.');console['log'](_0x35ea3b(0x173)+_0x70ee29+_0x35ea3b(0x16e));if(!_0x541b7e[_0x35ea3b(0x16b)]){const {confirmation:_0x20f470}=await _0x32f894['prompt']([{'type':_0x20e500[_0x35ea3b(0x166)],'name':_0x35ea3b(0x162),'message':_0x35ea3b(0x16c)+_0x70ee29+'\x22\x20to\x20confirm\x20deletion:'}]);if(_0x20e500[_0x35ea3b(0x164)](_0x20f470,_0x70ee29))throw new Error('Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.');}await deleteCloudProfile(_0x70ee29),_0x20e500[_0x35ea3b(0x16a)](resetProfileOverrides,process[_0x35ea3b(0x163)](),_0x70ee29),clearLastProfile(process['cwd'](),_0x70ee29),console['log']('✓\x20Deleted\x20cloud\x20profile\x20\x22'+_0x70ee29+'\x22.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x400d(){const _0x5273f9=['902721oVUlfx','fAgQB','xqBJi','ADuUl','get','baseUrl','reports','365Ayjmsw','\x20\x20\x20\x20\x20\x20Details:\x20','4298648GaqNDc','4HohtrL','Rizot','CgVHf','YOqys','(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)','cached\x20(updated\x20','9336wDHaog','\x20\x20\x20\x20','has','mWVji','10fqzrJc','length','legacy','ikpbR','1027940ncMfBU','9063923JfZVFg','SWwRL','\x0a\x20\x20','\x0aNo\x20profiles\x20found.','sort','\x0aLocal\x20Profiles\x20(legacy):','QIzkx','message','28232VmDEYe','keys','push','environmentKey','name','localeCompare','1043tbEcDd','isDirectory','4439385zPnNyh','log','environmentDetails','YxaMR','CVEhn','Cinxa','local','includes'];_0x400d=function(){return _0x5273f9;};return _0x400d();}const _0x5b69da=_0x2d84;(function(_0x40e4a1,_0x1c34da){const _0x3cf9b8=_0x2d84,_0xd7182a=_0x40e4a1();while(!![]){try{const _0x2e6693=parseInt(_0x3cf9b8(0x11a))/0x1+parseInt(_0x3cf9b8(0x10c))/0x2*(parseInt(_0x3cf9b8(0x102))/0x3)+-parseInt(_0x3cf9b8(0x10b))/0x4+-parseInt(_0x3cf9b8(0x109))/0x5*(parseInt(_0x3cf9b8(0x112))/0x6)+-parseInt(_0x3cf9b8(0x129))/0x7*(-parseInt(_0x3cf9b8(0x123))/0x8)+parseInt(_0x3cf9b8(0x12b))/0x9+parseInt(_0x3cf9b8(0x116))/0xa*(-parseInt(_0x3cf9b8(0x11b))/0xb);if(_0x2e6693===_0x1c34da)break;else _0xd7182a['push'](_0xd7182a['shift']());}catch(_0x6009ca){_0xd7182a['push'](_0xd7182a['shift']());}}}(_0x400d,0x9b6b5));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{getRangerDir}from'./utils/rangerRoot.js';import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';import{getToken}from'./utils/keychain.js';import{listCloudProfiles}from'./utils/cloudProfile.js';const NON_ENV_DIRS=['sessions','bug-bashes',_0x5b69da(0x108),'local','ci'];export function shouldGroupByEnvironment(_0x32316b){return _0x32316b['some'](_0x45f255=>_0x45f255['environmentKey']);}function _0x2d84(_0x2fa852,_0x10f16c){_0x2fa852=_0x2fa852-0xfd;const _0x400dac=_0x400d();let _0x2d8447=_0x400dac[_0x2fa852];return _0x2d8447;}export function groupCloudProfilesByEnvironment(_0x35b141){const _0x53b5ac=_0x5b69da,_0x5db4d9={'dFhZd':function(_0x161e37,_0x123569){return _0x161e37===_0x123569;}},_0x51bc06=new Map();for(const _0x34a1e4 of _0x35b141){const _0x31304c=_0x34a1e4['environmentKey']??null,_0x1c2863=_0x51bc06['get'](_0x31304c);if(_0x1c2863)_0x1c2863['push'](_0x34a1e4);else _0x51bc06['set'](_0x31304c,[_0x34a1e4]);}const _0x1f7514=[..._0x51bc06[_0x53b5ac(0x124)]()]['sort']((_0x56b5f8,_0x5645c5)=>{const _0x470c36=_0x53b5ac;if(_0x5db4d9['dFhZd'](_0x56b5f8,null))return 0x1;if(_0x5db4d9['dFhZd'](_0x5645c5,null))return-0x1;return _0x56b5f8[_0x470c36(0x128)](_0x5645c5);});return _0x1f7514['map'](_0x18d7ae=>({'environmentKey':_0x18d7ae,'profiles':_0x51bc06[_0x53b5ac(0x106)](_0x18d7ae)[_0x53b5ac(0x11f)]((_0x34bfee,_0xa2649d)=>_0x34bfee['name'][_0x53b5ac(0x128)](_0xa2649d['name']))}));}export async function getEnvNames(){const _0x234fc0=_0x5b69da,_0x412405={'XUdvW':_0x234fc0(0x100),'CgVHf':function(_0x6e9a0d,_0x34f4b8){return _0x6e9a0d(_0x34f4b8);},'ikpbR':function(_0x4ad1f4,_0x1df529){return _0x4ad1f4(_0x1df529);},'xqBJi':function(_0x50c26b,_0x3d042c,_0x20a825){return _0x50c26b(_0x3d042c,_0x20a825);},'ADuUl':function(_0x1c94bc,_0x1fb86b){return _0x1c94bc(_0x1fb86b);},'SVvnd':function(_0x185039,_0x1b8bd6){return _0x185039(_0x1b8bd6);},'YOqys':'.txt','MJJnk':function(_0x5d6b17,_0x1abd9a){return _0x5d6b17(_0x1abd9a);},'gscla':'settings.json','Cinxa':_0x234fc0(0x118)},_0x1d9e1a=getRangerDir();if(!existsSync(_0x1d9e1a))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x4e3dc3=await readActiveProfileName(),_0x2462c6=[],_0x3aac7e={},_0x40e968=join(_0x1d9e1a,_0x412405['XUdvW']);if(_0x412405[_0x234fc0(0x10e)](existsSync,_0x40e968)){const _0x3e8e48=await _0x412405[_0x234fc0(0x119)](readdir,_0x40e968);for(const _0x6916d8 of _0x3e8e48){const _0x56f32c=_0x412405['xqBJi'](join,_0x40e968,_0x6916d8),_0x563855=await _0x412405[_0x234fc0(0x105)](stat,_0x56f32c);_0x563855[_0x234fc0(0x12a)]()&&(_0x2462c6[_0x234fc0(0x125)](_0x6916d8),_0x3aac7e[_0x6916d8]='local');}}const _0x522dec=join(_0x1d9e1a,'ci');if(_0x412405['ADuUl'](existsSync,_0x522dec)){const _0x4ba81f=await _0x412405['SVvnd'](readdir,_0x522dec);for(const _0x32d4ee of _0x4ba81f){const _0x14f2df=_0x412405[_0x234fc0(0x104)](join,_0x522dec,_0x32d4ee),_0x11ab39=await stat(_0x14f2df);_0x11ab39[_0x234fc0(0x12a)]()&&(_0x2462c6['push'](_0x32d4ee),_0x3aac7e[_0x32d4ee]='ci');}}const _0x3c5efa=await readdir(_0x1d9e1a);for(const _0x14cca9 of _0x3c5efa){if(NON_ENV_DIRS['includes'](_0x14cca9))continue;if(_0x14cca9['startsWith']('.'))continue;if(_0x14cca9['endsWith'](_0x412405[_0x234fc0(0x10f)]))continue;const _0x531052=join(_0x1d9e1a,_0x14cca9),_0x266c27=await _0x412405['MJJnk'](stat,_0x531052);_0x266c27[_0x234fc0(0x12a)]()&&existsSync(join(_0x531052,_0x412405['gscla']))&&(!_0x2462c6[_0x234fc0(0x101)](_0x14cca9)&&(_0x2462c6['push'](_0x14cca9),_0x3aac7e[_0x14cca9]=_0x412405[_0x234fc0(0xff)]));}return{'envNames':_0x2462c6,'activeEnv':_0x4e3dc3,'envTypes':_0x3aac7e};}export async function envList(){const _0x4dc7af=_0x5b69da,_0x5920d4={'QIzkx':function(_0x42eddd,_0x39d56e){return _0x42eddd===_0x39d56e;},'Rizot':'no\x20session','fAgQB':function(_0xcd709e){return _0xcd709e();},'CVEhn':function(_0x55d54a){return _0x55d54a();},'mWVji':function(_0x5bd0a8,_0x3aeefc){return _0x5bd0a8(_0x3aeefc);},'duuMA':_0x4dc7af(0x11e),'elwMw':function(_0x931381,_0xa95b9){return _0x931381>_0xa95b9;},'CXEER':_0x4dc7af(0x120),'SWwRL':'local','jaNlj':_0x4dc7af(0x110),'YxaMR':function(_0x40443b,_0x54e1b0,_0x1eb031){return _0x40443b(_0x54e1b0,_0x1eb031);}},{envNames:_0x25c98a,activeEnv:_0x347981,envTypes:_0x501aa5}=await getEnvNames();let _0x4e030f=[];const _0x3a88dc=await _0x5920d4[_0x4dc7af(0x103)](getToken);if(_0x3a88dc)try{_0x4e030f=await _0x5920d4[_0x4dc7af(0xfe)](listCloudProfiles);}catch(_0x404442){console['error']('\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20'+(_0x404442 instanceof Error?_0x404442[_0x4dc7af(0x122)]:_0x5920d4['mWVji'](String,_0x404442)));}if(_0x5920d4[_0x4dc7af(0x121)](_0x25c98a[_0x4dc7af(0x117)],0x0)&&_0x5920d4['QIzkx'](_0x4e030f[_0x4dc7af(0x117)],0x0)){console['log'](_0x5920d4['duuMA']),console['log']('Run:\x20ranger\x20profile\x20add\x20<profile-name>');return;}const _0x1c3037=new Set(_0x4e030f['map'](_0x17a5c3=>_0x17a5c3['name']));if(_0x5920d4['elwMw'](_0x25c98a['length'],0x0)){console['log'](_0x5920d4['CXEER']);for(const _0x2ba777 of _0x25c98a['sort']()){const _0x3b1d18=_0x5920d4['QIzkx'](_0x2ba777,_0x347981)&&!_0x1c3037[_0x4dc7af(0x114)](_0x2ba777),_0x59cdf9=_0x501aa5[_0x2ba777]||_0x5920d4[_0x4dc7af(0x11c)],_0x19fe23=await _0x5920d4[_0x4dc7af(0x115)](loadSettings,_0x2ba777),_0x22a6dc=_0x59cdf9===_0x4dc7af(0x118)?'':'\x20['+_0x59cdf9+']';console['log']('\x20\x20'+(_0x3b1d18?'*\x20':'\x20\x20')+_0x2ba777+_0x22a6dc),_0x19fe23[_0x4dc7af(0x107)]&&console['log']('\x20\x20\x20\x20\x20\x20URL:\x20'+_0x19fe23[_0x4dc7af(0x107)]),_0x19fe23[_0x4dc7af(0x12d)]&&console[_0x4dc7af(0x12c)](_0x4dc7af(0x10a)+_0x19fe23[_0x4dc7af(0x12d)]);}}const _0x3fe39e=(_0xecdddf,_0x423c8c)=>{const _0xb57e9a=_0x4dc7af,_0x8ea27a=_0x5920d4[_0xb57e9a(0x121)](_0xecdddf[_0xb57e9a(0x127)],_0x347981),_0x1d564e=_0xecdddf['sessionUpdatedAt']?_0xb57e9a(0x111)+_0xecdddf['sessionUpdatedAt']+')':_0x5920d4[_0xb57e9a(0x10d)];console['log'](''+_0x423c8c+(_0x8ea27a?'*\x20':'\x20\x20')+_0xecdddf[_0xb57e9a(0x127)]),console[_0xb57e9a(0x12c)](_0x423c8c+'\x20\x20\x20\x20Session:\x20'+_0x1d564e);};if(_0x5920d4['elwMw'](_0x4e030f[_0x4dc7af(0x117)],0x0)){if(_0x5920d4['mWVji'](shouldGroupByEnvironment,_0x4e030f)){console['log']('\x0aCloud\x20Profiles\x20(by\x20environment):');for(const _0x186925 of groupCloudProfilesByEnvironment(_0x4e030f)){const _0x191853=_0x186925[_0x4dc7af(0x126)]??_0x5920d4['jaNlj'];console[_0x4dc7af(0x12c)](_0x4dc7af(0x11d)+_0x191853);for(const _0x32181e of _0x186925['profiles']){_0x5920d4['YxaMR'](_0x3fe39e,_0x32181e,_0x4dc7af(0x113));}}}else{console[_0x4dc7af(0x12c)]('\x0aCloud\x20Profiles:');for(const _0x533736 of[..._0x4e030f]['sort']((_0x352c07,_0x2b581e)=>_0x352c07['name'][_0x4dc7af(0x128)](_0x2b581e['name']))){_0x5920d4[_0x4dc7af(0xfd)](_0x3fe39e,_0x533736,'\x20\x20');}}}_0x347981&&console[_0x4dc7af(0x12c)]('\x0a*\x20=\x20active\x20profile');}
|