@ranger-testing/ranger-cli 3.1.7-alpha.387730d-58 → 3.1.7-alpha.9dea9f8-61
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 +1 -1
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x14643b,_0x228c7a){const _0x5ef594=_0x1369,_0x29a00f=_0x14643b();while(!![]){try{const _0x412489=parseInt(_0x5ef594(0x1ac))/0x1*(parseInt(_0x5ef594(0x1af))/0x2)+parseInt(_0x5ef594(0x1c5))/0x3*(-parseInt(_0x5ef594(0x18d))/0x4)+-parseInt(_0x5ef594(0x143))/0x5*(parseInt(_0x5ef594(0x157))/0x6)+parseInt(_0x5ef594(0x14b))/0x7*(-parseInt(_0x5ef594(0x152))/0x8)+-parseInt(_0x5ef594(0x178))/0x9+-parseInt(_0x5ef594(0x1aa))/0xa+-parseInt(_0x5ef594(0x15d))/0xb*(-parseInt(_0x5ef594(0x184))/0xc);if(_0x412489===_0x228c7a)break;else _0x29a00f['push'](_0x29a00f['shift']());}catch(_0x3caf5b){_0x29a00f['push'](_0x29a00f['shift']());}}}(_0xc63d,0xc81ab));import{readdir,rm}from'fs/promises';import{join}from'path';function _0x1369(_0x413ec0,_0x29a2f2){_0x413ec0=_0x413ec0-0x13e;const _0xc63d2c=_0xc63d();let _0x1369d1=_0xc63d2c[_0x413ec0];return _0x1369d1;}import{existsSync}from'fs';import _0x22def1 from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING='This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization';function warnCloudProfileSharedInOrg(){const _0x2d6cab=_0x1369;if(!process['stdout'][_0x2d6cab(0x18f)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x553f8f){const _0x3a37e7=_0x1369,_0x50c724={'cmIBp':function(_0x21dc9f,_0x312d89,_0x2ea1b4){return _0x21dc9f(_0x312d89,_0x2ea1b4);},'jORaR':'HEAD','nKife':'manual','orlIj':function(_0x381772,_0x56d73b){return _0x381772(_0x56d73b);},'vTJwe':'Invalid\x20URL','iCJLd':'fetch\x20failed'};try{const _0x5245a5=new AbortController(),_0x15acea=_0x50c724[_0x3a37e7(0x191)](setTimeout,()=>_0x5245a5['abort'](),0x1388),_0x1b1bb1={'method':_0x50c724[_0x3a37e7(0x156)],'signal':_0x5245a5[_0x3a37e7(0x188)],'redirect':_0x50c724['nKife']};/^https:\/\/localhost(:\d+)?/i[_0x3a37e7(0x1c1)](_0x553f8f)&&(process[_0x3a37e7(0x16b)][_0x3a37e7(0x189)]='0');const _0x74013d=await _0x50c724[_0x3a37e7(0x191)](fetch,_0x553f8f,_0x1b1bb1);delete process[_0x3a37e7(0x16b)][_0x3a37e7(0x189)],_0x50c724['orlIj'](clearTimeout,_0x15acea);if(_0x74013d['status']<0x190)return{'ok':!![]};return{'ok':![],'error':_0x3a37e7(0x1c0)+_0x74013d['status']};}catch(_0x13c565){delete process[_0x3a37e7(0x16b)]['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x41c336=_0x13c565,_0x5c3b70=_0x41c336['message']||String(_0x13c565),_0x58bba0=_0x5c3b70[_0x3a37e7(0x172)](_0x50c724[_0x3a37e7(0x19e)])||_0x41c336['name']==='TypeError'||_0x5c3b70[_0x3a37e7(0x172)](_0x50c724['iCJLd']);return{'ok':![],'error':_0x5c3b70,'isProtocolError':_0x58bba0};}}async function sweepOrphanLocalProfile(_0x1804fa,_0x1c5b6e,_0x3b150b){const _0x28dc03=_0x1369,_0x26411c={'PKMVf':'local','GjmHX':function(_0x261bb0,_0x2ab406){return _0x261bb0(_0x2ab406);},'JmRXZ':function(_0x4c9fee,_0xa54324){return _0x4c9fee(_0xa54324);},'Fzzlh':function(_0x4aaf2d,_0x277b3f,_0x2d4e18){return _0x4aaf2d(_0x277b3f,_0x2d4e18);}},_0x234cbd=join(_0x1c5b6e,_0x26411c[_0x28dc03(0x150)]),_0x3277a9=join(_0x234cbd,_0x1804fa);_0x26411c['GjmHX'](existsSync,_0x3277a9)&&(_0x3b150b&&await _0x26411c['GjmHX'](isPathGitTracked,_0x3277a9)?console['log']('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x3277a9+_0x28dc03(0x1c2)):(await rm(_0x3277a9,{'recursive':!![],'force':!![]}),console['log']('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x3277a9)));if(_0x26411c['JmRXZ'](existsSync,_0x234cbd)){let _0x5c708d=[];try{_0x5c708d=await _0x26411c[_0x28dc03(0x170)](readdir,_0x234cbd);}catch{return;}const _0x3d89c5=_0x28dc03(0x17c)+_0x1804fa+'-';for(const _0x59561b of _0x5c708d){if(!_0x59561b[_0x28dc03(0x168)](_0x3d89c5))continue;const _0x2ec99c=_0x26411c['Fzzlh'](join,_0x234cbd,_0x59561b);await _0x26411c['Fzzlh'](rm,_0x2ec99c,{'recursive':!![],'force':!![]}),console['log'](_0x28dc03(0x1b7)+_0x2ec99c);}}}async function sweepOrphansBestEffort(_0x368f11){const _0x1575e3=_0x1369,_0x2fea7c={'UQyuR':function(_0x1dee2a,_0xd1aaaa,_0x44c8c1,_0x27c783){return _0x1dee2a(_0xd1aaaa,_0x44c8c1,_0x27c783);},'ycKcD':function(_0x2b8b87){return _0x2b8b87();},'FLiqu':function(_0x44d29b,_0x2629b5){return _0x44d29b!==_0x2629b5;},'EAtks':function(_0x302b67){return _0x302b67();},'inrMJ':function(_0x54808a,_0x3bd444,_0x541079,_0x3ac57c){return _0x54808a(_0x3bd444,_0x541079,_0x3ac57c);}};try{await _0x2fea7c[_0x1575e3(0x197)](sweepOrphanLocalProfile,_0x368f11,_0x2fea7c['ycKcD'](getRangerHomeDir),![]);const _0x21fdc7=_0x2fea7c[_0x1575e3(0x161)](getRangerDir);_0x2fea7c['FLiqu'](_0x21fdc7,_0x2fea7c[_0x1575e3(0x1b8)](getRangerHomeDir))&&await _0x2fea7c[_0x1575e3(0x1a5)](sweepOrphanLocalProfile,_0x368f11,_0x21fdc7,!![]);}catch(_0xc5bb0e){console[_0x1575e3(0x141)](_0x1575e3(0x190)+(_0xc5bb0e instanceof Error?_0xc5bb0e[_0x1575e3(0x14d)]:String(_0xc5bb0e))+').');}}async function markActive(_0x4a3e5c){const _0x28023a=_0x1369,_0xdbc597={'LHDzI':_0x28023a(0x185)};try{await writeActiveProfileName(_0x4a3e5c),console['log'](_0x28023a(0x163)+_0x4a3e5c);}catch{console[_0x28023a(0x141)](_0xdbc597[_0x28023a(0x162)]);}}async function tryAutoRouteCloudProfile(_0x21b518,_0x1fad8e,_0x113c04,_0x2f2058,_0x2b5643){const _0x4616ea=_0x1369,_0x5978c5={'OAZbv':_0x4616ea(0x196),'zugCZ':function(_0x1b6893,_0x268928){return _0x1b6893===_0x268928;},'iROaz':function(_0x4b797f,_0x2ab331,_0x3b74d3,_0x4318e8,_0x40693d){return _0x4b797f(_0x2ab331,_0x3b74d3,_0x4318e8,_0x40693d);},'KAJxU':function(_0x5d87e4,_0x3f1f56){return _0x5d87e4+_0x3f1f56;},'PbbJI':function(_0x26c7a9,_0x273d02){return _0x26c7a9+_0x273d02;},'mKjgh':'\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','uvQFJ':'profile.add.autoRouteSkipped','gwBym':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','bFePv':function(_0x16b533,_0x135cfa,_0x3cfcb8){return _0x16b533(_0x135cfa,_0x3cfcb8);},'mstri':_0x4616ea(0x19b),'dICQA':_0x4616ea(0x154),'nAZhc':'user_declined','krHaL':function(_0x1124f3,_0x5aef38,_0xf06306,_0x32510e){return _0x1124f3(_0x5aef38,_0xf06306,_0x32510e);},'svAjk':function(_0x2df9da){return _0x2df9da();},'dJSxB':function(_0x5dc321,_0x40a44f){return _0x5dc321 instanceof _0x40a44f;},'dzwii':function(_0x4cd3fb,_0xc99edc){return _0x4cd3fb===_0xc99edc;},'wywxv':_0x4616ea(0x1a9)};let _0x38f8d8;try{_0x38f8d8=await fetchAuthConfig();}catch(_0x4c6553){return _0x2b5643?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x5978c5[_0x4616ea(0x179)],'profileName':_0x21b518}),console[_0x4616ea(0x1c7)]('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x4c6553 instanceof Error?_0x4c6553[_0x4616ea(0x14d)]:String(_0x4c6553))),![];}if((!_0x38f8d8||!_0x38f8d8['environments']||_0x5978c5[_0x4616ea(0x140)](Object[_0x4616ea(0x1b6)](_0x38f8d8['environments'])[_0x4616ea(0x175)],0x0))&&!_0x113c04['authEnv']){if(_0x2f2058)return await _0x5978c5['iROaz'](captureEnvLessProfile,_0x21b518,_0x1fad8e,_0x113c04,_0x2b5643);return _0x2b5643?.[_0x4616ea(0x176)]('profile.add.autoRouteSkipped',{'reason':_0x5978c5['OAZbv'],'profileName':_0x21b518}),console['error'](_0x5978c5[_0x4616ea(0x167)](_0x5978c5[_0x4616ea(0x164)]('\x0a\x20\x20Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team\x20yet\x20—\x20that\x27s\x20the\x20path\x20that\x20lets\x20Ranger\x20log\x20into\x20your\x20app\x20for\x20you\x20in\x20CI\x20/\x20background\x20agents.\x0a'+'\x0a'+'\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a'+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x21b518+'\x20--url\x20'+_0x1fad8e+'\x20--skip-auth\x0a')+'\x0a','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a'),_0x5978c5['mKjgh'])),![];}let _0x219c32;if(_0x113c04[_0x4616ea(0x1bf)]){if(!_0x38f8d8?.[_0x4616ea(0x1ca)]?.[_0x113c04[_0x4616ea(0x1bf)]]){const _0x48792b=Object['keys'](_0x38f8d8?.['environments']??{});return _0x2b5643?.['trackPhaseEnd'](_0x5978c5[_0x4616ea(0x1ae)],{'reason':_0x4616ea(0x15a),'profileName':_0x21b518}),console[_0x4616ea(0x1c7)](_0x4616ea(0x182)+_0x113c04['authEnv']+'\x22\x20not\x20found.'+(_0x48792b[_0x4616ea(0x175)]?_0x4616ea(0x1a1)+_0x48792b[_0x4616ea(0x18c)](',\x20')+'.':_0x5978c5['gwBym'])),![];}_0x219c32=_0x113c04['authEnv'];}else _0x219c32=_0x5978c5[_0x4616ea(0x160)](matchAuthEnvironment,_0x1fad8e,_0x38f8d8);if(!_0x219c32)return _0x2b5643?.['trackPhaseEnd'](_0x5978c5[_0x4616ea(0x1ae)],{'reason':_0x5978c5[_0x4616ea(0x1a3)],'profileName':_0x21b518}),console[_0x4616ea(0x1c7)](_0x4616ea(0x148)+_0x1fad8e+'.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20'+Object[_0x4616ea(0x1b6)](_0x38f8d8?.[_0x4616ea(0x1ca)]??{})['join'](',\x20')+'.'),![];const _0x5cb05f=_0x38f8d8?.['environments']?.[_0x219c32],_0x49e2a3=_0x5cb05f?.['domains']??[];if(_0x2f2058&&!_0x113c04['yes']){const {saveToCloud:_0x1e9771}=await _0x22def1['prompt']([{'type':_0x5978c5[_0x4616ea(0x18b)],'name':'saveToCloud','message':_0x4616ea(0x15c)+_0x219c32+'\x27\x20matching\x20'+_0x1fad8e+_0x4616ea(0x18e)+_0x49e2a3[_0x4616ea(0x18c)](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x21b518+_0x4616ea(0x171),'default':!![]}]);if(!_0x1e9771)return _0x2b5643?.[_0x4616ea(0x176)]('profile.add.autoRouteSkipped',{'reason':_0x5978c5[_0x4616ea(0x180)],'profileName':_0x21b518}),console['error'](_0x4616ea(0x14a)),![];}const _0x59d713=_0x49e2a3['some'](_0x25417c=>{const _0x5d49a9=_0x4616ea;try{return new URL(_0x25417c)[_0x5d49a9(0x195)]===new URL(_0x1fad8e)[_0x5d49a9(0x195)];}catch{return![];}}),_0x523986={};!_0x59d713&&(_0x523986[_0x4616ea(0x13e)]=_0x1fad8e);try{await _0x5978c5[_0x4616ea(0x16d)](createCloudProfile,_0x21b518,_0x219c32,{'settings':_0x523986}),_0x5978c5[_0x4616ea(0x1a2)](warnCloudProfileSharedInOrg);}catch(_0x5c0655){if(_0x5978c5['dJSxB'](_0x5c0655,ApiError)&&_0x5978c5[_0x4616ea(0x14f)](_0x5c0655['status'],0x199)){console[_0x4616ea(0x1c7)](_0x4616ea(0x173)+_0x21b518+_0x4616ea(0x1b2)+(_0x4616ea(0x1c3)+_0x21b518));throw _0x5c0655;}throw _0x5c0655;}return console['log'](_0x5978c5['KAJxU'](_0x4616ea(0x183)+_0x21b518+_0x4616ea(0x165),_0x4616ea(0x17d)+_0x21b518)),await sweepOrphansBestEffort(_0x21b518),_0x2b5643?.[_0x4616ea(0x176)](_0x5978c5[_0x4616ea(0x16e)],{'envKey':_0x219c32,'profileName':_0x21b518}),!![];}function _0xc63d(){const _0x1f25f3=['82HzmOSI','Use\x20','\x0a✓\x20Profile\x20\x27','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','bsEhE','force','url','keys','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','EAtks','To\x20set\x20up\x20a\x20profile,\x20run:\x0a','\x20\x20Did\x20you\x20mean\x20','Invalid\x20--setup-header\x20format:\x20\x22','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','DiZEJ','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','authEnv','HTTP\x20','test','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','cwd','952116FBLcXq','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','error','zaxTP','skipAuth','environments','baseUrl','XkdMM','zugCZ','log','\x0a🌐\x20Profile\x20Setup\x0a','1311005NMEsxX','Could\x20not\x20reach\x20','OIpMB','fMgzq','status','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','KsYVy','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','21qcKVfN','qmmeS','message','prompt','dzwii','PKMVf','HJOVj','3261592GMxohK','indexOf','confirm','\x27\x20created\x20(CDP).','jORaR','6DQVkft','input','pVGys','env_not_found','setupHeaders','Found\x20auth\x20environment\x20\x27','39444955oXwHyU','Continue\x20anyway','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20','bFePv','ycKcD','LHDzI','\x20\x20Set\x20active\x20profile:\x20','PbbJI','\x27\x20created.\x0a','slice','KAJxU','startsWith','HYwOy','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.','env','`\x20again\x20without\x20--skip-auth.','krHaL','wywxv','ojrGW','JmRXZ','\x27\x20to\x20the\x20cloud?','includes','\x0a\x20\x20A\x20profile\x20named\x20\x22','isElectron','length','trackPhaseEnd','cdpEndpoint','9117648CFWXEm','OAZbv','fFCPD','VRSkb','.tmp-','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','yes','http://localhost:3000','nAZhc','kSfxq','\x0a\x20\x20Auth\x20environment\x20\x22','✓\x20Profile\x20\x27','12vNhMIx','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','retry','vmOLL','signal','NODE_TLS_REJECT_UNAUTHORIZED','\x0a\x20\x20Could\x20not\x20reach\x20','dICQA','join','8rwpZnZ','\x0a\x20\x20(domains:\x20','isTTY','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','cmIBp','use_suggestion','continue','mPiCA','origin','no_auth_config','UQyuR','vZEpV','Cfdya','profile.add.autoRouteSkipped','no_match','trim','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','vTJwe','\x27\x20created\x20(no\x20session).\x0a','FFZeC','\x20Configured\x20envs:\x20','svAjk','mstri','rAzfS','inrMJ','Enter\x20a\x20different\x20URL','exit','Uzlmd','profile.add.autoRouted','4701380VJlUsj','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','20414ZrOjdw','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','uvQFJ'];_0xc63d=function(){return _0x1f25f3;};return _0xc63d();}async function createUnconfiguredCloudProfile(_0x4114b2,_0x453bea){const _0x4c79ec=_0x1369,_0x2c6aa0={'zaxTP':function(_0x2674a1){return _0x2674a1();},'MnINL':function(_0x1b967d,_0x3f26cb){return _0x1b967d===_0x3f26cb;}};try{await createCloudProfile(_0x4114b2,undefined,{'settings':_0x453bea}),_0x2c6aa0[_0x4c79ec(0x1c8)](warnCloudProfileSharedInOrg);}catch(_0x20dec6){_0x20dec6 instanceof ApiError&&_0x2c6aa0['MnINL'](_0x20dec6[_0x4c79ec(0x147)],0x199)&&console['error'](_0x4c79ec(0x173)+_0x4114b2+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+(_0x4c79ec(0x1c3)+_0x4114b2));throw _0x20dec6;}}async function captureEnvLessProfile(_0x12cd77,_0x14e4f5,_0x3fc6ac,_0xcdf1c9){const _0x4a2597=_0x1369,_0x493c4b={'YDmnn':'Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','WRdYG':_0x4a2597(0x19a),'OlRVv':'user_declined','vTOst':function(_0x55d039,_0x21652b){return _0x55d039===_0x21652b;},'bsEhE':function(_0x33a11c,_0x5efca9){return _0x33a11c>_0x5efca9;},'sMoGn':function(_0x23c7ff){return _0x23c7ff();},'FFZeC':function(_0x133ca2,_0x507979){return _0x133ca2+_0x507979;},'XkdMM':function(_0x498bf8,_0x4fce0f,_0x30ea82){return _0x498bf8(_0x4fce0f,_0x30ea82);},'pVGys':function(_0x1c4e6a,_0x1b6170){return _0x1c4e6a>_0x1b6170;},'gOirK':function(_0x3de6ef,_0x39bad6){return _0x3de6ef(_0x39bad6);}};if(!_0x3fc6ac[_0x4a2597(0x17e)]){const {capture:_0x1b1a02}=await _0x22def1[_0x4a2597(0x14e)]([{'type':'confirm','name':'capture','message':_0x493c4b['YDmnn'],'default':!![]}]);if(!_0x1b1a02)return _0xcdf1c9?.['trackPhaseEnd'](_0x493c4b['WRdYG'],{'reason':_0x493c4b['OlRVv'],'profileName':_0x12cd77}),console['error']('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a'+_0x4a2597(0x16a)),![];}const _0x406831={};if(_0x3fc6ac['setupHeader'])for(const _0x4ebefe of _0x3fc6ac['setupHeader']){const _0x456998=_0x4ebefe[_0x4a2597(0x153)](':');if(_0x493c4b['vTOst'](_0x456998,-0x1))continue;_0x406831[_0x4ebefe['slice'](0x0,_0x456998)['trim']()]=_0x4ebefe[_0x4a2597(0x166)](_0x456998+0x1)[_0x4a2597(0x19c)]();}const _0x221f99={'baseUrl':_0x14e4f5};_0x493c4b[_0x4a2597(0x1b3)](Object['keys'](_0x406831)['length'],0x0)&&(_0x221f99[_0x4a2597(0x15b)]=_0x406831);let _0x22e5d9;try{_0x22e5d9=await createCloudProfile(_0x12cd77,undefined,{'settings':_0x221f99}),_0x493c4b['sMoGn'](warnCloudProfileSharedInOrg);}catch(_0xbb1498){_0xbb1498 instanceof ApiError&&_0xbb1498[_0x4a2597(0x147)]===0x199&&console['error'](_0x493c4b[_0x4a2597(0x1a0)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x12cd77+_0x4a2597(0x1b2),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x12cd77));throw _0xbb1498;}return await _0x493c4b[_0x4a2597(0x13f)](manualBrowserLogin,_0x22e5d9,{'key':'','domains':[_0x14e4f5],'setupHeaders':_0x493c4b[_0x4a2597(0x159)](Object[_0x4a2597(0x1b6)](_0x406831)[_0x4a2597(0x175)],0x0)?_0x406831:undefined}),console['log'](_0x493c4b['FFZeC'](_0x4a2597(0x1b1)+_0x12cd77+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a',_0x4a2597(0x17d)+_0x12cd77)),await _0x493c4b['gOirK'](sweepOrphansBestEffort,_0x12cd77),_0xcdf1c9?.[_0x4a2597(0x176)](_0x4a2597(0x1a9),{'envKey':null,'profileName':_0x12cd77}),!![];}export async function addEnv(_0x2cdbff,_0x699d06={},_0x40d5b8){const _0x3d237b=_0x1369,_0x882d66={'PNAaQ':function(_0x484e2e,_0x5534d9){return _0x484e2e+_0x5534d9;},'GYvZH':function(_0x2eedc9,_0x69be94){return _0x2eedc9+_0x69be94;},'Cfdya':function(_0x57f50a,_0x4ba546){return _0x57f50a+_0x4ba546;},'mPiCA':'The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','ojrGW':_0x3d237b(0x1b9),'rIWeC':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','Uzlmd':_0x3d237b(0x1bc),'qnCWq':function(_0x8e46f0,_0x56f89c){return _0x8e46f0!==_0x56f89c;},'JsGmy':function(_0x1955f5,_0x298a78){return _0x1955f5===_0x298a78;},'QEeTr':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','HYwOy':'--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','DDeiD':_0x3d237b(0x1ab),'KsYVy':function(_0x351874,_0x51057f){return _0x351874>_0x51057f;},'OIpMB':function(_0x3ff901,_0x2392e0,_0x47e725,_0x39efd7,_0x15ef76){return _0x3ff901(_0x2392e0,_0x47e725,_0x39efd7,_0x15ef76);},'HJOVj':function(_0x1b8d81,_0x2d7fec){return _0x1b8d81 instanceof _0x2d7fec;},'vmOLL':function(_0xa0f4d5,_0x2b882b){return _0xa0f4d5(_0x2b882b);},'mZwEQ':function(_0x4af5eb,_0x3872dd){return _0x4af5eb(_0x3872dd);},'DiZEJ':function(_0x370a38,_0x3a89a5){return _0x370a38(_0x3a89a5);},'nTXTf':function(_0x69ff5,_0x4a9827){return _0x69ff5+_0x4a9827;},'kSfxq':'\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','KfEqC':'baseUrl','qmmeS':_0x3d237b(0x1be),'eGMnt':_0x3d237b(0x17f),'VRSkb':'list','fMgzq':'action','eqTYW':_0x3d237b(0x1a6),'vZEpV':_0x3d237b(0x15e),'PqoMd':'continue','fFCPD':function(_0x5f1309,_0x1939c0,_0x2f56d7,_0x11ddc1,_0x14a614,_0x24213f){return _0x5f1309(_0x1939c0,_0x2f56d7,_0x11ddc1,_0x14a614,_0x24213f);},'rAzfS':function(_0x211a30,_0x25e9b8){return _0x211a30(_0x25e9b8);}};_0x699d06['ci']&&(console[_0x3d237b(0x1c7)](_0x882d66['PNAaQ'](_0x882d66['GYvZH'](_0x882d66[_0x3d237b(0x199)](_0x882d66[_0x3d237b(0x194)],'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a'),'\x0a')+_0x882d66[_0x3d237b(0x16f)]+_0x882d66['rIWeC'],'\x0a')+_0x882d66[_0x3d237b(0x1a8)]+'\x20\x20https://docs.ranger.net/main/concepts/profiles'),process['exit'](0x1));const _0x576118={};if(_0x699d06['setupHeader'])for(const _0x42ee89 of _0x699d06['setupHeader']){const _0x5d3dca=_0x42ee89[_0x3d237b(0x153)](':');if(_0x5d3dca===-0x1)throw new Error(_0x3d237b(0x1bb)+_0x42ee89+'\x22.\x20Expected\x20\x22Name:\x20Value\x22.');const _0x164069=_0x42ee89['slice'](0x0,_0x5d3dca)[_0x3d237b(0x19c)](),_0x7dcf48=_0x42ee89['slice'](_0x882d66[_0x3d237b(0x199)](_0x5d3dca,0x1))['trim']();_0x576118[_0x164069]=_0x7dcf48;}if(_0x882d66['qnCWq'](_0x699d06['cdpEndpoint'],undefined)&&_0x882d66['JsGmy'](_0x699d06[_0x3d237b(0x177)]['trim'](),''))throw new Error('--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222');if(_0x699d06['cdpEndpoint']&&_0x699d06[_0x3d237b(0x1b5)])throw new Error(_0x882d66['QEeTr']);if(_0x699d06['authEnv']&&_0x699d06['skipAuth'])throw new Error(_0x882d66[_0x3d237b(0x169)]);if(_0x699d06['authEnv']&&_0x699d06[_0x3d237b(0x177)])throw new Error('--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.');const _0x202d58=Boolean(_0x699d06[_0x3d237b(0x177)]),_0x239503=isInteractive();if(!_0x239503&&!_0x699d06['url']&&!_0x202d58&&!_0x699d06[_0x3d237b(0x1c9)])throw new Error(_0x3d237b(0x19d));if(_0x202d58){const _0x1908e7=_0x699d06['cdpEndpoint'];console['log'](_0x882d66['DDeiD']),console['log']('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x1908e7);const _0x14234d={'cdpEndpoint':_0x1908e7,'isElectron':!![]};_0x882d66[_0x3d237b(0x149)](Object['keys'](_0x576118)[_0x3d237b(0x175)],0x0)&&(_0x14234d['setupHeaders']=_0x576118);await createUnconfiguredCloudProfile(_0x2cdbff,_0x14234d);try{setProfileOverride(process['cwd'](),_0x2cdbff,_0x3d237b(0x177),_0x1908e7),_0x882d66[_0x3d237b(0x145)](setProfileOverride,process[_0x3d237b(0x1c4)](),_0x2cdbff,_0x3d237b(0x174),!![]);}catch(_0xb2b7d8){console['error']('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x882d66['HJOVj'](_0xb2b7d8,Error)?_0xb2b7d8[_0x3d237b(0x14d)]:_0x882d66[_0x3d237b(0x187)](String,_0xb2b7d8)));}console[_0x3d237b(0x141)]('✓\x20Cloud\x20profile\x20\x27'+_0x2cdbff+_0x3d237b(0x155)),await _0x882d66['mZwEQ'](sweepOrphansBestEffort,_0x2cdbff),await _0x882d66['DiZEJ'](markActive,_0x2cdbff);return;}if(_0x699d06['skipAuth']){const _0x41e37e={};_0x699d06['url']&&(_0x41e37e[_0x3d237b(0x13e)]=_0x699d06[_0x3d237b(0x1b5)]);Object[_0x3d237b(0x1b6)](_0x576118)[_0x3d237b(0x175)]>0x0&&(_0x41e37e[_0x3d237b(0x15b)]=_0x576118);await createUnconfiguredCloudProfile(_0x2cdbff,_0x41e37e),console[_0x3d237b(0x141)](_0x882d66['nTXTf'](_0x3d237b(0x183)+_0x2cdbff+_0x3d237b(0x19f),_0x3d237b(0x15f)+_0x2cdbff+_0x3d237b(0x16c))),await _0x882d66['DiZEJ'](sweepOrphansBestEffort,_0x2cdbff),await markActive(_0x2cdbff);return;}if(_0x699d06['url']){const _0x4828d3=_0x699d06['url'],_0x1d5516=await checkUrlReachability(_0x4828d3);if(!_0x1d5516['ok']&&!_0x699d06[_0x3d237b(0x1b4)])throw new Error(_0x3d237b(0x144)+_0x4828d3+':\x20'+_0x1d5516[_0x3d237b(0x1c7)]+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x1d5516['ok']&&_0x699d06[_0x3d237b(0x1b4)]&&console['log']('⚠\x20Could\x20not\x20reach\x20'+_0x4828d3+':\x20'+_0x1d5516[_0x3d237b(0x1c7)]+'\x20(continuing\x20with\x20--force)');}else{console[_0x3d237b(0x141)](_0x3d237b(0x142)),console[_0x3d237b(0x141)](_0x3d237b(0x1c6)),console[_0x3d237b(0x141)](_0x882d66[_0x3d237b(0x181)]);let _0x5e4db7='',_0x1d5ad2=![];while(!![]){const _0x4d301b=await _0x22def1['prompt']([{'type':_0x3d237b(0x158),'name':_0x882d66['KfEqC'],'message':_0x1d5ad2?_0x882d66[_0x3d237b(0x14c)]:'What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','default':_0x5e4db7||_0x882d66['eGMnt']}]);_0x5e4db7=_0x4d301b['baseUrl'];const _0x450afd=await checkUrlReachability(_0x5e4db7);if(_0x450afd['ok'])break;const _0x7c143e=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x5e4db7),_0x24b84a=_0x450afd['isProtocolError']&&!_0x7c143e,_0x2eec93=_0x24b84a?'http://'+_0x5e4db7:null;_0x1d5ad2=!![],console[_0x3d237b(0x141)](_0x3d237b(0x18a)+_0x5e4db7+':\x20'+_0x450afd['error']);_0x2eec93&&console[_0x3d237b(0x141)](_0x3d237b(0x1ba)+_0x2eec93+'?');const {action:_0x5cd492}=await _0x22def1['prompt']([{'type':_0x882d66[_0x3d237b(0x17b)],'name':_0x882d66[_0x3d237b(0x146)],'message':'What\x20would\x20you\x20like\x20to\x20do?','choices':[..._0x2eec93?[{'name':_0x3d237b(0x1b0)+_0x2eec93,'value':'use_suggestion'}]:[],{'name':_0x882d66['eqTYW'],'value':_0x3d237b(0x186)},{'name':_0x882d66[_0x3d237b(0x198)],'value':_0x882d66['PqoMd']}]}]);if(_0x5cd492===_0x3d237b(0x192)&&_0x2eec93){_0x5e4db7=_0x2eec93;const _0x3bd979=await checkUrlReachability(_0x5e4db7);if(_0x3bd979['ok'])break;console[_0x3d237b(0x141)]('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x5e4db7+':\x20'+_0x3bd979[_0x3d237b(0x1c7)]);}else{if(_0x5cd492===_0x3d237b(0x193))break;}}_0x699d06={..._0x699d06,'url':_0x5e4db7};}let _0x395c3b=![];try{_0x395c3b=await _0x882d66[_0x3d237b(0x17a)](tryAutoRouteCloudProfile,_0x2cdbff,_0x699d06[_0x3d237b(0x1b5)],_0x699d06,_0x239503,_0x40d5b8);}catch(_0x2d723f){console[_0x3d237b(0x1c7)](_0x3d237b(0x1ad)+_0x2cdbff+'\x22:\x20'+(_0x882d66[_0x3d237b(0x151)](_0x2d723f,Error)?_0x2d723f['message']:_0x882d66[_0x3d237b(0x1bd)](String,_0x2d723f))),process['exit'](0x1);}!_0x395c3b&&process[_0x3d237b(0x1a7)](0x1),await _0x882d66[_0x3d237b(0x1a4)](markActive,_0x2cdbff);}
|
|
1
|
+
const _0x3e0415=_0x7663;(function(_0x24169d,_0x115e63){const _0x5f1346=_0x7663,_0x191d9d=_0x24169d();while(!![]){try{const _0x234e38=-parseInt(_0x5f1346(0x12e))/0x1*(parseInt(_0x5f1346(0x15b))/0x2)+parseInt(_0x5f1346(0x116))/0x3+parseInt(_0x5f1346(0x172))/0x4+-parseInt(_0x5f1346(0x11e))/0x5+-parseInt(_0x5f1346(0x11c))/0x6+parseInt(_0x5f1346(0xf9))/0x7*(parseInt(_0x5f1346(0x136))/0x8)+-parseInt(_0x5f1346(0x16f))/0x9*(-parseInt(_0x5f1346(0x148))/0xa);if(_0x234e38===_0x115e63)break;else _0x191d9d['push'](_0x191d9d['shift']());}catch(_0x193147){_0x191d9d['push'](_0x191d9d['shift']());}}}(_0x9ac9,0xce98c));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x5db0d0 from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING=_0x3e0415(0x107);function warnCloudProfileSharedInOrg(){const _0x4db9ab=_0x3e0415;if(!process[_0x4db9ab(0x16d)][_0x4db9ab(0x118)])return;console[_0x4db9ab(0x11a)](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x4c15be){const _0x78ec40=_0x3e0415,_0x444b6b={'EfJvZ':function(_0x4738ed,_0x330338,_0x1f441f){return _0x4738ed(_0x330338,_0x1f441f);},'gruwK':function(_0x5c8d57,_0x58361c){return _0x5c8d57(_0x58361c);},'yGoGh':_0x78ec40(0x114),'dcxzd':function(_0x1e212e,_0x319ff0){return _0x1e212e===_0x319ff0;},'vIWEj':_0x78ec40(0x131)};try{const _0x2ec9fd=new AbortController(),_0x3b82d2=setTimeout(()=>_0x2ec9fd['abort'](),0x1388),_0x14ba70={'method':'HEAD','signal':_0x2ec9fd['signal'],'redirect':_0x78ec40(0xef)};/^https:\/\/localhost(:\d+)?/i[_0x78ec40(0x127)](_0x4c15be)&&(process[_0x78ec40(0x104)]['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x194d86=await _0x444b6b[_0x78ec40(0xf2)](fetch,_0x4c15be,_0x14ba70);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x3b82d2);if(_0x194d86[_0x78ec40(0x120)]<0x190)return{'ok':!![]};return{'ok':![],'error':_0x78ec40(0x16e)+_0x194d86[_0x78ec40(0x120)]};}catch(_0x494112){delete process[_0x78ec40(0x104)][_0x78ec40(0x168)];const _0x5d55a6=_0x494112,_0x2c3530=_0x5d55a6['message']||_0x444b6b[_0x78ec40(0x128)](String,_0x494112),_0x3ef5dc=_0x2c3530[_0x78ec40(0xfa)](_0x444b6b[_0x78ec40(0x174)])||_0x444b6b['dcxzd'](_0x5d55a6['name'],_0x444b6b[_0x78ec40(0xfc)])||_0x2c3530[_0x78ec40(0xfa)](_0x78ec40(0x119));return{'ok':![],'error':_0x2c3530,'isProtocolError':_0x3ef5dc};}}async function sweepOrphanLocalProfile(_0x2b7a5e,_0x8fe636,_0x2ec7eb){const _0x208379=_0x3e0415,_0x1e4580={'yQVAC':function(_0x4f04ed,_0x247873){return _0x4f04ed(_0x247873);},'VOyHM':function(_0x5702c0,_0x1fc024,_0x1a5d53){return _0x5702c0(_0x1fc024,_0x1a5d53);}},_0x1168d7=join(_0x8fe636,'local'),_0x4c8f08=join(_0x1168d7,_0x2b7a5e);_0x1e4580['yQVAC'](existsSync,_0x4c8f08)&&(_0x2ec7eb&&await isPathGitTracked(_0x4c8f08)?console[_0x208379(0xf3)](_0x208379(0x151)+_0x4c8f08+_0x208379(0x164)):(await _0x1e4580[_0x208379(0x13c)](rm,_0x4c8f08,{'recursive':!![],'force':!![]}),console['log']('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x4c8f08)));if(existsSync(_0x1168d7)){let _0x1c4c4e=[];try{_0x1c4c4e=await _0x1e4580['yQVAC'](readdir,_0x1168d7);}catch{return;}const _0x9cf2a=_0x208379(0x10f)+_0x2b7a5e+'-';for(const _0x3fc5a3 of _0x1c4c4e){if(!_0x3fc5a3['startsWith'](_0x9cf2a))continue;const _0x2cee10=_0x1e4580['VOyHM'](join,_0x1168d7,_0x3fc5a3);await rm(_0x2cee10,{'recursive':!![],'force':!![]}),console['log']('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x2cee10);}}}async function sweepOrphansBestEffort(_0x5f0302){const _0x512a37=_0x3e0415,_0x26f14b={'jyxQV':function(_0x5ab3c4){return _0x5ab3c4();},'EBjdJ':function(_0x22a00d){return _0x22a00d();},'NLhTS':function(_0x1979f3,_0x36090a){return _0x1979f3!==_0x36090a;},'QhkbN':function(_0x1b4272,_0x1a9924){return _0x1b4272 instanceof _0x1a9924;},'CSAnX':function(_0x6a8747,_0x595d2a){return _0x6a8747(_0x595d2a);}};try{await sweepOrphanLocalProfile(_0x5f0302,_0x26f14b['jyxQV'](getRangerHomeDir),![]);const _0x2f4f6b=_0x26f14b[_0x512a37(0x101)](getRangerDir);_0x26f14b['NLhTS'](_0x2f4f6b,getRangerHomeDir())&&await sweepOrphanLocalProfile(_0x5f0302,_0x2f4f6b,!![]);}catch(_0x141d44){console['log'](_0x512a37(0x123)+(_0x26f14b['QhkbN'](_0x141d44,Error)?_0x141d44['message']:_0x26f14b[_0x512a37(0x122)](String,_0x141d44))+').');}}function _0x7663(_0x462783,_0x4ee5d6){_0x462783=_0x462783-0xec;const _0x9ac93f=_0x9ac9();let _0x7663c5=_0x9ac93f[_0x462783];return _0x7663c5;}function _0x9ac9(){const _0x731011=['\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','\x0a\x20\x20Could\x20not\x20reach\x20','confirm','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','test','gruwK',')\x0a\x20\x20Save\x20\x27','trim','rayQM','\x20\x20Set\x20active\x20profile:\x20','isElectron','801796uDircV','LOXfH','trackPhaseEnd','TypeError','EfPCj','authEnv','cDAxF','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','424JHCqXx','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.','\x20(continuing\x20with\x20--force)','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','Gvtjt','url','VOyHM','opmoV','profile.add.autoRouteSkipped','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','yBwGP','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','\x27\x20created\x20(no\x20session).\x0a','--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','TdySr','HWojZ','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','\x27\x20to\x20the\x20cloud?','170270Uiiowx','user_declined','✓\x20Profile\x20\x27','fjwjA','\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','ZBPXB','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','domains','retry','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','setupHeaders','jStpT','\x27\x20created\x20(CDP).','cwd','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','vpRCr','join','environments','eqIHZ','4wQoRtf','list','use_suggestion','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','\x0a\x20\x20(domains:\x20','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','message','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','PxRta','\x0a\x20\x20A\x20profile\x20named\x20\x22','skipAuth','NODE_TLS_REJECT_UNAUTHORIZED','input','\x20--skip-auth\x0a','yes','\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20','stdout','HTTP\x20','1260fmttlR','error','Continue\x20anyway','5092924gOmpYy','vixSN','yGoGh','cdpEndpoint','slice','XuHmx','no_match','manual','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','profile.add.autoRouted','EfJvZ','log','CEyUq','zDkxw','no_auth_config','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','To\x20set\x20up\x20a\x20profile,\x20run:\x0a','79219JfgxAw','includes','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','vIWEj','xMECC','DHGYG','for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','fORrt','EBjdJ','Use\x20','Found\x20auth\x20environment\x20\x27','env','prompt','\x20Configured\x20envs:\x20','This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization','exit','origin','\x0a\x20\x20Auth\x20environment\x20\x22','keys','FfZLY','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','rcDiZ','.tmp-','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','force','RMrEl','setupHeader','Invalid\x20URL','What\x20would\x20you\x20like\x20to\x20do?','1095903vtbyVd','The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','isTTY','fetch\x20failed','warn','IUmpd','8112618gVRUSm','indexOf','4100990dMuNyg','length','status','saveToCloud','CSAnX'];_0x9ac9=function(){return _0x731011;};return _0x9ac9();}async function markActive(_0x26ea80){const _0x5b0752=_0x3e0415,_0x449d0b={'LOXfH':function(_0x36a8b5,_0x3262d2){return _0x36a8b5(_0x3262d2);},'IUmpd':_0x5b0752(0x126)};try{await _0x449d0b[_0x5b0752(0x12f)](writeActiveProfileName,_0x26ea80),console['log'](_0x5b0752(0x12c)+_0x26ea80);}catch{console['log'](_0x449d0b[_0x5b0752(0x11b)]);}}async function tryAutoRouteCloudProfile(_0x290e60,_0x33ae39,_0x3e3f86,_0x22d055,_0x2b1609){const _0x14dde2=_0x3e0415,_0x466e79={'zDkxw':'profile.add.autoRouteSkipped','AIOFo':function(_0x5add89,_0x17c731){return _0x5add89 instanceof _0x17c731;},'GQeEd':function(_0x10cc85,_0x56a7b6){return _0x10cc85(_0x56a7b6);},'cDAxF':function(_0x236ff7,_0x4228b4){return _0x236ff7===_0x4228b4;},'oTaZi':'no_auth_config','vixSN':function(_0x1beea4,_0x5b3ab9){return _0x1beea4+_0x5b3ab9;},'PxRta':_0x14dde2(0x163),'rayQM':'\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','fORrt':'env_not_found','EfPCj':function(_0x57c234,_0x13e85a){return _0x57c234+_0x13e85a;},'aOkvK':_0x14dde2(0x121),'DHGYG':'\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','Eestm':function(_0xadf284,_0x47c160,_0x33d68d,_0xaf81b5){return _0xadf284(_0x47c160,_0x33d68d,_0xaf81b5);},'SKwUr':function(_0x2b0cbb){return _0x2b0cbb();},'PZtBt':function(_0x57ab7e,_0x4f3a93){return _0x57ab7e===_0x4f3a93;}};let _0x5ab913;try{_0x5ab913=await fetchAuthConfig();}catch(_0x16e507){return _0x2b1609?.['trackPhaseEnd'](_0x466e79['zDkxw'],{'reason':_0x14dde2(0xf6),'profileName':_0x290e60}),console[_0x14dde2(0x170)](_0x14dde2(0x16c)+(_0x466e79['AIOFo'](_0x16e507,Error)?_0x16e507[_0x14dde2(0x161)]:_0x466e79['GQeEd'](String,_0x16e507))),![];}if((!_0x5ab913||!_0x5ab913[_0x14dde2(0x159)]||_0x466e79[_0x14dde2(0x134)](Object['keys'](_0x5ab913[_0x14dde2(0x159)])[_0x14dde2(0x11f)],0x0))&&!_0x3e3f86[_0x14dde2(0x133)]){if(_0x22d055)return await captureEnvLessProfile(_0x290e60,_0x33ae39,_0x3e3f86,_0x2b1609);return _0x2b1609?.[_0x14dde2(0x130)](_0x466e79[_0x14dde2(0xf5)],{'reason':_0x466e79['oTaZi'],'profileName':_0x290e60}),console[_0x14dde2(0x170)](_0x466e79['vixSN'](_0x466e79['vixSN'](_0x466e79['vixSN'](_0x14dde2(0x14c),'\x0a')+'\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a'+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x290e60+'\x20--url\x20'+_0x33ae39+_0x14dde2(0x16a))+'\x0a',_0x466e79[_0x14dde2(0x165)]),_0x466e79[_0x14dde2(0x12b)])),![];}let _0x29cb32;if(_0x3e3f86['authEnv']){if(!_0x5ab913?.['environments']?.[_0x3e3f86['authEnv']]){const _0xf5d3bd=Object[_0x14dde2(0x10b)](_0x5ab913?.['environments']??{});return _0x2b1609?.['trackPhaseEnd'](_0x14dde2(0x13e),{'reason':_0x466e79[_0x14dde2(0x100)],'profileName':_0x290e60}),console['error'](_0x466e79[_0x14dde2(0x132)](_0x14dde2(0x10a)+_0x3e3f86['authEnv']+'\x22\x20not\x20found.',_0xf5d3bd[_0x14dde2(0x11f)]?_0x14dde2(0x106)+_0xf5d3bd['join'](',\x20')+'.':_0x14dde2(0x135))),![];}_0x29cb32=_0x3e3f86['authEnv'];}else _0x29cb32=matchAuthEnvironment(_0x33ae39,_0x5ab913);if(!_0x29cb32)return _0x2b1609?.['trackPhaseEnd'](_0x14dde2(0x13e),{'reason':_0x14dde2(0xee),'profileName':_0x290e60}),console[_0x14dde2(0x170)]('\x0a\x20\x20No\x20auth\x20env\x20matches\x20'+_0x33ae39+'.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20'+Object[_0x14dde2(0x10b)](_0x5ab913?.[_0x14dde2(0x159)]??{})[_0x14dde2(0x158)](',\x20')+'.'),![];const _0x17eac0=_0x5ab913?.[_0x14dde2(0x159)]?.[_0x29cb32],_0x272af4=_0x17eac0?.[_0x14dde2(0x14f)]??[];if(_0x22d055&&!_0x3e3f86[_0x14dde2(0x16b)]){const {saveToCloud:_0x57621d}=await _0x5db0d0['prompt']([{'type':_0x14dde2(0x125),'name':_0x466e79['aOkvK'],'message':_0x14dde2(0x103)+_0x29cb32+'\x27\x20matching\x20'+_0x33ae39+_0x14dde2(0x15f)+_0x272af4['join'](',\x20')+_0x14dde2(0x129)+_0x290e60+_0x14dde2(0x147),'default':!![]}]);if(!_0x57621d)return _0x2b1609?.[_0x14dde2(0x130)]('profile.add.autoRouteSkipped',{'reason':'user_declined','profileName':_0x290e60}),console[_0x14dde2(0x170)](_0x466e79[_0x14dde2(0xfe)]),![];}const _0x57730d=_0x272af4['some'](_0x2982f7=>{const _0x6b9fb9=_0x14dde2;try{return new URL(_0x2982f7)[_0x6b9fb9(0x109)]===new URL(_0x33ae39)['origin'];}catch{return![];}}),_0xcdc149={};!_0x57730d&&(_0xcdc149['baseUrl']=_0x33ae39);try{await _0x466e79['Eestm'](createCloudProfile,_0x290e60,_0x29cb32,{'settings':_0xcdc149}),_0x466e79['SKwUr'](warnCloudProfileSharedInOrg);}catch(_0x54bbd1){if(_0x54bbd1 instanceof ApiError&&_0x466e79['PZtBt'](_0x54bbd1[_0x14dde2(0x120)],0x199)){console[_0x14dde2(0x170)](_0x14dde2(0x166)+_0x290e60+_0x14dde2(0x160)+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x290e60));throw _0x54bbd1;}throw _0x54bbd1;}return console[_0x14dde2(0xf3)](_0x466e79[_0x14dde2(0x173)](_0x14dde2(0x14a)+_0x290e60+'\x27\x20created.\x0a',_0x14dde2(0xf7)+_0x290e60)),await _0x466e79['GQeEd'](sweepOrphansBestEffort,_0x290e60),_0x2b1609?.[_0x14dde2(0x130)]('profile.add.autoRouted',{'envKey':_0x29cb32,'profileName':_0x290e60}),!![];}async function createUnconfiguredCloudProfile(_0x16bc6b,_0x48306f){const _0x758c76=_0x3e0415,_0x23259f={'HHbOg':function(_0x3ea8b2,_0x48a4f0,_0x1d12c6,_0x497dec){return _0x3ea8b2(_0x48a4f0,_0x1d12c6,_0x497dec);},'vpRCr':function(_0x208fb8){return _0x208fb8();},'Lbajy':function(_0xf4f2ab,_0x3a4e0c){return _0xf4f2ab===_0x3a4e0c;}};try{await _0x23259f['HHbOg'](createCloudProfile,_0x16bc6b,undefined,{'settings':_0x48306f}),_0x23259f[_0x758c76(0x157)](warnCloudProfileSharedInOrg);}catch(_0x5db41b){_0x5db41b instanceof ApiError&&_0x23259f['Lbajy'](_0x5db41b[_0x758c76(0x120)],0x199)&&console[_0x758c76(0x170)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x16bc6b+_0x758c76(0x160)+(_0x758c76(0x139)+_0x16bc6b));throw _0x5db41b;}}async function captureEnvLessProfile(_0x3e1eaa,_0x471643,_0x4f5dcc,_0x21dbf4){const _0x572d93=_0x3e0415,_0x427e61={'Hmjue':_0x572d93(0x141),'ZBPXB':function(_0x3f8c9b,_0x45d5df){return _0x3f8c9b+_0x45d5df;},'fjwjA':function(_0xe6a3fb,_0x140f17){return _0xe6a3fb===_0x140f17;},'yBwGP':function(_0x40c6b7){return _0x40c6b7();},'HEscM':function(_0x4b660b,_0x1f37ea){return _0x4b660b+_0x1f37ea;},'XuHmx':function(_0x12b6dc,_0x9b3a7f){return _0x12b6dc>_0x9b3a7f;},'ZvpCw':function(_0x390c2d,_0x33821e){return _0x390c2d(_0x33821e);},'LqRis':_0x572d93(0xf1)};if(!_0x4f5dcc['yes']){const {capture:_0x2a442f}=await _0x5db0d0['prompt']([{'type':_0x572d93(0x125),'name':'capture','message':_0x427e61['Hmjue'],'default':!![]}]);if(!_0x2a442f)return _0x21dbf4?.[_0x572d93(0x130)](_0x572d93(0x13e),{'reason':_0x572d93(0x149),'profileName':_0x3e1eaa}),console['error'](_0x427e61['ZBPXB'](_0x572d93(0xf0),_0x572d93(0x137))),![];}const _0x461d99={};if(_0x4f5dcc['setupHeader'])for(const _0x5810c4 of _0x4f5dcc[_0x572d93(0x113)]){const _0x188b2b=_0x5810c4['indexOf'](':');if(_0x427e61[_0x572d93(0x14b)](_0x188b2b,-0x1))continue;_0x461d99[_0x5810c4[_0x572d93(0xec)](0x0,_0x188b2b)[_0x572d93(0x12a)]()]=_0x5810c4['slice'](_0x427e61[_0x572d93(0x14d)](_0x188b2b,0x1))[_0x572d93(0x12a)]();}const _0xe05587={'baseUrl':_0x471643};Object['keys'](_0x461d99)[_0x572d93(0x11f)]>0x0&&(_0xe05587[_0x572d93(0x152)]=_0x461d99);let _0x4e3942;try{_0x4e3942=await createCloudProfile(_0x3e1eaa,undefined,{'settings':_0xe05587}),_0x427e61[_0x572d93(0x140)](warnCloudProfileSharedInOrg);}catch(_0x150dde){_0x150dde instanceof ApiError&&_0x427e61['fjwjA'](_0x150dde[_0x572d93(0x120)],0x199)&&console['error'](_0x427e61['HEscM']('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x3e1eaa+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x3e1eaa));throw _0x150dde;}return await manualBrowserLogin(_0x4e3942,{'key':'','domains':[_0x471643],'setupHeaders':_0x427e61[_0x572d93(0xed)](Object[_0x572d93(0x10b)](_0x461d99)[_0x572d93(0x11f)],0x0)?_0x461d99:undefined}),console[_0x572d93(0xf3)](_0x427e61[_0x572d93(0x14d)]('\x0a✓\x20Profile\x20\x27'+_0x3e1eaa+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a',_0x572d93(0xf7)+_0x3e1eaa)),await _0x427e61['ZvpCw'](sweepOrphansBestEffort,_0x3e1eaa),_0x21dbf4?.['trackPhaseEnd'](_0x427e61['LqRis'],{'envKey':null,'profileName':_0x3e1eaa}),!![];}export async function addEnv(_0x13cfbf,_0x1995f4={},_0x73a70a){const _0x235c26=_0x3e0415,_0x264c26={'SRJEj':function(_0x649eb,_0x3b413f){return _0x649eb+_0x3b413f;},'RMrEl':_0x235c26(0x162),'WrUaA':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','qSATj':_0x235c26(0x110),'eqIHZ':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','zgNhQ':_0x235c26(0x143),'pSkoK':'--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','JJPiU':function(_0x7bdea3,_0x52e367){return _0x7bdea3(_0x52e367);},'Gvtjt':'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','HWojZ':_0x235c26(0x146),'PRBvL':function(_0x518a9f,_0x1b353d){return _0x518a9f>_0x1b353d;},'YNYFk':function(_0x39a074,_0xe8f7a9,_0xf30088){return _0x39a074(_0xe8f7a9,_0xf30088);},'yHzwg':function(_0xcd0c84,_0x6adbd,_0x2b9b5a,_0x39ea1f,_0x30d056){return _0xcd0c84(_0x6adbd,_0x2b9b5a,_0x39ea1f,_0x30d056);},'TdySr':function(_0x3dc26b,_0x63e945){return _0x3dc26b instanceof _0x63e945;},'rcDiZ':function(_0x5456b6,_0x4f3b14){return _0x5456b6(_0x4f3b14);},'opmoV':function(_0x418ccb,_0x482625){return _0x418ccb(_0x482625);},'OahHb':'\x0a🌐\x20Profile\x20Setup\x0a','cVKAN':_0x235c26(0x15e),'YXEXz':'baseUrl','cpymm':_0x235c26(0x10d),'jStpT':'action','xMECC':_0x235c26(0x15d),'CEyUq':'Enter\x20a\x20different\x20URL','gPWKc':_0x235c26(0x150),'FfZLY':_0x235c26(0x171),'OnkAd':'continue','mcJyM':function(_0x377d90,_0x49393c,_0x577eba,_0x48a76f,_0x43c3c3,_0x334e3c){return _0x377d90(_0x49393c,_0x577eba,_0x48a76f,_0x43c3c3,_0x334e3c);}};_0x1995f4['ci']&&(console['error'](_0x264c26['SRJEj'](_0x264c26['SRJEj'](_0x235c26(0x117)+_0x235c26(0xff)+'\x0a'+_0x235c26(0xf8),_0x264c26[_0x235c26(0x112)])+'\x0a',_0x264c26['WrUaA'])+'\x20\x20https://docs.ranger.net/main/concepts/profiles'),process[_0x235c26(0x108)](0x1));const _0x56aa2a={};if(_0x1995f4['setupHeader'])for(const _0x103976 of _0x1995f4['setupHeader']){const _0x1fe8aa=_0x103976[_0x235c26(0x11d)](':');if(_0x1fe8aa===-0x1)throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x103976+_0x235c26(0x156));const _0x4d478f=_0x103976[_0x235c26(0xec)](0x0,_0x1fe8aa)['trim'](),_0x328380=_0x103976['slice'](_0x1fe8aa+0x1)['trim']();_0x56aa2a[_0x4d478f]=_0x328380;}if(_0x1995f4[_0x235c26(0x175)]!==undefined&&_0x1995f4[_0x235c26(0x175)][_0x235c26(0x12a)]()==='')throw new Error(_0x264c26['qSATj']);if(_0x1995f4[_0x235c26(0x175)]&&_0x1995f4[_0x235c26(0x13b)])throw new Error(_0x264c26[_0x235c26(0x15a)]);if(_0x1995f4[_0x235c26(0x133)]&&_0x1995f4[_0x235c26(0x167)])throw new Error(_0x264c26['zgNhQ']);if(_0x1995f4['authEnv']&&_0x1995f4[_0x235c26(0x175)])throw new Error(_0x264c26['pSkoK']);const _0x28e73a=_0x264c26['JJPiU'](Boolean,_0x1995f4[_0x235c26(0x175)]),_0x44f524=isInteractive();if(!_0x44f524&&!_0x1995f4[_0x235c26(0x13b)]&&!_0x28e73a&&!_0x1995f4['skipAuth'])throw new Error(_0x264c26[_0x235c26(0x13a)]);if(_0x28e73a){const _0x54926e=_0x1995f4['cdpEndpoint'];console['log'](_0x264c26[_0x235c26(0x145)]),console[_0x235c26(0xf3)]('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x54926e);const _0x59faa3={'cdpEndpoint':_0x54926e,'isElectron':!![]};_0x264c26['PRBvL'](Object['keys'](_0x56aa2a)[_0x235c26(0x11f)],0x0)&&(_0x59faa3['setupHeaders']=_0x56aa2a);await _0x264c26['YNYFk'](createUnconfiguredCloudProfile,_0x13cfbf,_0x59faa3);try{_0x264c26['yHzwg'](setProfileOverride,process['cwd'](),_0x13cfbf,'cdpEndpoint',_0x54926e),setProfileOverride(process[_0x235c26(0x155)](),_0x13cfbf,_0x235c26(0x12d),!![]);}catch(_0x3023ba){console['error']('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x264c26[_0x235c26(0x144)](_0x3023ba,Error)?_0x3023ba['message']:String(_0x3023ba)));}console[_0x235c26(0xf3)]('✓\x20Cloud\x20profile\x20\x27'+_0x13cfbf+_0x235c26(0x154)),await sweepOrphansBestEffort(_0x13cfbf),await markActive(_0x13cfbf);return;}if(_0x1995f4[_0x235c26(0x167)]){const _0x87e752={};_0x1995f4[_0x235c26(0x13b)]&&(_0x87e752['baseUrl']=_0x1995f4[_0x235c26(0x13b)]);Object['keys'](_0x56aa2a)[_0x235c26(0x11f)]>0x0&&(_0x87e752[_0x235c26(0x152)]=_0x56aa2a);await _0x264c26['YNYFk'](createUnconfiguredCloudProfile,_0x13cfbf,_0x87e752),console['log']('✓\x20Profile\x20\x27'+_0x13cfbf+_0x235c26(0x142)+('\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x13cfbf+'`\x20again\x20without\x20--skip-auth.')),await _0x264c26[_0x235c26(0x10e)](sweepOrphansBestEffort,_0x13cfbf),await _0x264c26[_0x235c26(0x13d)](markActive,_0x13cfbf);return;}if(_0x1995f4[_0x235c26(0x13b)]){const _0x567afe=_0x1995f4['url'],_0x379cbb=await _0x264c26[_0x235c26(0x13d)](checkUrlReachability,_0x567afe);if(!_0x379cbb['ok']&&!_0x1995f4[_0x235c26(0x111)])throw new Error('Could\x20not\x20reach\x20'+_0x567afe+':\x20'+_0x379cbb['error']+_0x235c26(0x13f));!_0x379cbb['ok']&&_0x1995f4['force']&&console['log']('⚠\x20Could\x20not\x20reach\x20'+_0x567afe+':\x20'+_0x379cbb['error']+_0x235c26(0x138));}else{console['log'](_0x264c26['OahHb']),console[_0x235c26(0xf3)](_0x264c26['cVKAN']),console[_0x235c26(0xf3)]('\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a');let _0x38eaee='',_0x29a9ab=![];while(!![]){const _0x16d563=await _0x5db0d0[_0x235c26(0x105)]([{'type':_0x235c26(0x169),'name':_0x264c26['YXEXz'],'message':_0x29a9ab?'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):':_0x264c26['cpymm'],'default':_0x38eaee||'http://localhost:3000'}]);_0x38eaee=_0x16d563['baseUrl'];const _0x2ee82b=await _0x264c26[_0x235c26(0x10e)](checkUrlReachability,_0x38eaee);if(_0x2ee82b['ok'])break;const _0x30d15b=/^[a-zA-Z][\w+.-]*:\/\//[_0x235c26(0x127)](_0x38eaee),_0xe8b03e=_0x2ee82b['isProtocolError']&&!_0x30d15b,_0x1c7e86=_0xe8b03e?'http://'+_0x38eaee:null;_0x29a9ab=!![],console['log'](_0x235c26(0x124)+_0x38eaee+':\x20'+_0x2ee82b[_0x235c26(0x170)]);_0x1c7e86&&console['log']('\x20\x20Did\x20you\x20mean\x20'+_0x1c7e86+'?');const {action:_0x1ac2f1}=await _0x5db0d0[_0x235c26(0x105)]([{'type':_0x235c26(0x15c),'name':_0x264c26[_0x235c26(0x153)],'message':_0x235c26(0x115),'choices':[..._0x1c7e86?[{'name':_0x235c26(0x102)+_0x1c7e86,'value':_0x264c26['xMECC']}]:[],{'name':_0x264c26[_0x235c26(0xf4)],'value':_0x264c26['gPWKc']},{'name':_0x264c26[_0x235c26(0x10c)],'value':_0x264c26['OnkAd']}]}]);if(_0x1ac2f1===_0x264c26[_0x235c26(0xfd)]&&_0x1c7e86){_0x38eaee=_0x1c7e86;const _0x4a7615=await checkUrlReachability(_0x38eaee);if(_0x4a7615['ok'])break;console['log'](_0x235c26(0xfb)+_0x38eaee+':\x20'+_0x4a7615[_0x235c26(0x170)]);}else{if(_0x1ac2f1===_0x264c26['OnkAd'])break;}}_0x1995f4={..._0x1995f4,'url':_0x38eaee};}let _0x427cf7=![];try{_0x427cf7=await _0x264c26['mcJyM'](tryAutoRouteCloudProfile,_0x13cfbf,_0x1995f4['url'],_0x1995f4,_0x44f524,_0x73a70a);}catch(_0x4dae94){console['error'](_0x235c26(0x14e)+_0x13cfbf+'\x22:\x20'+(_0x264c26[_0x235c26(0x144)](_0x4dae94,Error)?_0x4dae94[_0x235c26(0x161)]:_0x264c26['JJPiU'](String,_0x4dae94))),process[_0x235c26(0x108)](0x1);}!_0x427cf7&&process[_0x235c26(0x108)](0x1),await _0x264c26[_0x235c26(0x13d)](markActive,_0x13cfbf);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x459f(){var _0x3a1bd8=['30tmBNOI','riZHN','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','58956sskElX','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','145146nDEUlC','1311540BoFpPe','18yqsJqB','617842uQKbSZ','30414sLviEb','ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','4687697oTLouD','BTENC','4217936uVnWze'];_0x459f=function(){return _0x3a1bd8;};return _0x459f();}function _0x3304(_0xf1470b,_0x206c90){_0xf1470b=_0xf1470b-0xa3;var _0x459fae=_0x459f();var _0x330450=_0x459fae[_0xf1470b];return _0x330450;}(function(_0x351899,_0x449a6b){var _0x50d7eb=_0x3304,_0xe5bf2=_0x351899();while(!![]){try{var _0x2a61e6=parseInt(_0x50d7eb(0xac))/0x1+-parseInt(_0x50d7eb(0xad))/0x2+parseInt(_0x50d7eb(0xaa))/0x3+-parseInt(_0x50d7eb(0xa7))/0x4+-parseInt(_0x50d7eb(0xa4))/0x5*(parseInt(_0x50d7eb(0xa9))/0x6)+parseInt(_0x50d7eb(0xaf))/0x7+parseInt(_0x50d7eb(0xa3))/0x8*(-parseInt(_0x50d7eb(0xab))/0x9);if(_0x2a61e6===_0x449a6b)break;else _0xe5bf2['push'](_0xe5bf2['shift']());}catch(_0x279f0a){_0xe5bf2['push'](_0xe5bf2['shift']());}}}(_0x459f,0x78e0d));export async function authEncrypt(_0x184f09){var _0x3f151c=_0x3304,_0x2ce17e={'BTENC':function(_0xedb513,_0x1e5c27){return _0xedb513+_0x1e5c27;},'riZHN':_0x3f151c(0xa8),'JnSBo':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0x2ce17e['BTENC'](_0x2ce17e['BTENC'](_0x2ce17e['BTENC'](_0x2ce17e[_0x3f151c(0xb0)](_0x3f151c(0xae),'session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a'),'\x0a'),'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'),_0x3f151c(0xa6))+'\x0a'+_0x2ce17e[_0x3f151c(0xa5)]+_0x2ce17e['JnSBo']),process['exit'](0x1);}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x4c5acc=_0x39a8;function _0x39a8(_0x17a583,_0x396972){_0x17a583=_0x17a583-0x1a6;const _0x2b1e33=_0x2b1e();let _0x39a853=_0x2b1e33[_0x17a583];return _0x39a853;}(function(_0x37aee6,_0xb8b4b6){const _0x4dd6ec=_0x39a8,_0x1c516d=_0x37aee6();while(!![]){try{const _0x2d602a=parseInt(_0x4dd6ec(0x1a8))/0x1+-parseInt(_0x4dd6ec(0x1b4))/0x2*(-parseInt(_0x4dd6ec(0x1bd))/0x3)+parseInt(_0x4dd6ec(0x1ba))/0x4+parseInt(_0x4dd6ec(0x1af))/0x5*(parseInt(_0x4dd6ec(0x1b3))/0x6)+-parseInt(_0x4dd6ec(0x1b5))/0x7+parseInt(_0x4dd6ec(0x1b8))/0x8+-parseInt(_0x4dd6ec(0x1b2))/0x9*(parseInt(_0x4dd6ec(0x1cc))/0xa);if(_0x2d602a===_0xb8b4b6)break;else _0x1c516d['push'](_0x1c516d['shift']());}catch(_0x3f218a){_0x1c516d['push'](_0x1c516d['shift']());}}}(_0x2b1e,0x450bb));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=['ranger','feature-tracker',_0x4c5acc(0x1d0),_0x4c5acc(0x1d3)],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x478917){const _0xa2bc27=_0x4c5acc,_0x5d2c6c=_0x478917['replace'](/\/\*[\s\S]*?\*\//g,''),_0x429b56=_0x5d2c6c[_0xa2bc27(0x1b9)](/^\s*\/\/.*$/gm,''),_0x2e9726=_0x429b56[_0xa2bc27(0x1b9)](/,\s*([}\]])/g,'$1');return JSON[_0xa2bc27(0x1d1)](_0x2e9726);}async function removeOpencodePluginConfig(_0x39e8ed){const _0x53029f=_0x4c5acc,_0x2e531d={'Pqsok':function(_0x3ea771,_0x1257cf){return _0x3ea771!==_0x1257cf;},'bszUr':function(_0x2d445d,_0xa6db0a){return _0x2d445d(_0xa6db0a);},'kmIgi':function(_0x290108,_0x6daa4d,_0x29d799){return _0x290108(_0x6daa4d,_0x29d799);},'nocvj':'utf-8'};if(!_0x2e531d['bszUr'](existsSync,_0x39e8ed))return![];let _0x55ace7;try{const _0x5506f4=await _0x2e531d[_0x53029f(0x1c1)](readFile,_0x39e8ed,_0x2e531d[_0x53029f(0x1da)]);_0x55ace7=parseJsonc(_0x5506f4);}catch{return![];}const _0x35b15b=Array['isArray'](_0x55ace7['plugin'])?_0x55ace7[_0x53029f(0x1b1)]:[];if(_0x35b15b[_0x53029f(0x1aa)]===0x0)return![];const _0x304fbc=_0x35b15b[_0x53029f(0x1bb)](_0x404cb7=>{const _0x37c197=_0x53029f;if(typeof _0x404cb7!=='string')return!![];return _0x2e531d[_0x37c197(0x1c2)](_0x404cb7,opencodePluginName);});if(_0x304fbc['length']===_0x35b15b[_0x53029f(0x1aa)])return![];return _0x304fbc['length']===0x0?delete _0x55ace7[_0x53029f(0x1b1)]:_0x55ace7['plugin']=_0x304fbc,await _0x2e531d[_0x53029f(0x1c1)](writeFile,_0x39e8ed,JSON['stringify'](_0x55ace7,null,0x2)+'\x0a'),!![];}function _0x2b1e(){const _0xac16d9=['\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','claude','close','✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','1045370eVAZPk','ACzrt','MMwpK','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','bug-bash','parse','XuHWz','e2e-test-recommender','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','✓\x20Removed\x20trailhead\x20marketplace','emXIC','pOUxY','win32','OuZPe','nocvj','khpAp','log','platform','RJOof','339325gHARzj','\x0a✅\x20Cleanup\x20complete!\x0a','length','xPGkG','YkHBs','tDyhN','ZBwcF','2088745PNdmkI','ignore','plugin','81QoOGWx','6JpQfjK','2FpNjmX','2002756OweZdj','✓\x20Removed\x20project\x20skill:\x20','jyWaI','922648KRydLH','replace','741056VZuJIU','filter','AISBl','1356249VWevUE','uPQzg','trailhead','project','kmIgi','Pqsok','user','jvREo','HxKRA','✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','error'];_0x2b1e=function(){return _0xac16d9;};return _0x2b1e();}async function uninstallClaudePlugin(_0xab70f1){const _0x102bc2=_0x4c5acc,_0x3ed570={'ZBwcF':function(_0xe595cf,_0x2c41d6){return _0xe595cf(_0x2c41d6);},'owxbk':function(_0x381423,_0x51824d){return _0x381423(_0x51824d);},'YkHBs':'plugin','HxKRA':'ranger@trailhead','tJVrG':'--scope','UDEnZ':function(_0x54eeb6,_0x721c,_0x5b5240,_0x1239b7){return _0x54eeb6(_0x721c,_0x5b5240,_0x1239b7);},'UMCga':function(_0x477394){return _0x477394();},'RJOof':function(_0x5aa3c6,_0x1e8cc0){return _0x5aa3c6===_0x1e8cc0;},'sreqC':_0x102bc2(0x1ca),'rffLK':_0x102bc2(0x1c7)};return new Promise(_0x542909=>{const _0x1495a8=_0x102bc2,_0x2a0fac=[_0x3ed570[_0x1495a8(0x1ac)],'uninstall',_0x3ed570[_0x1495a8(0x1c5)]];_0xab70f1&&_0x2a0fac['push'](_0x3ed570['tJVrG'],_0xab70f1);const _0x350293=_0x3ed570['UDEnZ'](spawn,_0x1495a8(0x1c9),_0x2a0fac,{'stdio':['ignore',_0x1495a8(0x1b0),_0x1495a8(0x1b0)],'cwd':_0xab70f1?_0x3ed570['UMCga'](getProjectRoot):undefined,'shell':_0x3ed570[_0x1495a8(0x1a7)](process['platform'],'win32')});_0x350293['on'](_0x3ed570['sreqC'],_0x2b0bb5=>{const _0x3ebdeb=_0x1495a8;_0x3ed570[_0x3ebdeb(0x1ae)](_0x542909,_0x2b0bb5===0x0);}),_0x350293['on'](_0x3ed570['rffLK'],()=>{_0x3ed570['owxbk'](_0x542909,![]);});});}async function removeMarketplace(){const _0x2b02f5=_0x4c5acc,_0x4b1132={'xPGkG':function(_0x2930d3,_0x1ea54c,_0xa6440f,_0x415102){return _0x2930d3(_0x1ea54c,_0xa6440f,_0x415102);},'IEbTq':'plugin','jvREo':_0x2b02f5(0x1b0),'pOUxY':function(_0x3c52ca,_0x1ecafb){return _0x3c52ca===_0x1ecafb;},'ACzrt':'error'};return new Promise(_0x49901e=>{const _0x4a4c3a=_0x2b02f5,_0x589cf4=_0x4b1132[_0x4a4c3a(0x1ab)](spawn,'claude',[_0x4b1132['IEbTq'],'marketplace','remove',_0x4a4c3a(0x1bf)],{'stdio':[_0x4b1132['jvREo'],_0x4b1132[_0x4a4c3a(0x1c4)],_0x4a4c3a(0x1b0)],'shell':_0x4b1132[_0x4a4c3a(0x1d7)](process[_0x4a4c3a(0x1a6)],_0x4a4c3a(0x1d8))});_0x589cf4['on']('close',_0x47a21a=>{_0x49901e(_0x47a21a===0x0);}),_0x589cf4['on'](_0x4b1132[_0x4a4c3a(0x1cd)],()=>{_0x49901e(![]);});});}export async function clean(){const _0x576b62=_0x4c5acc,_0x1adc25={'XuHWz':_0x576b62(0x1c8),'emXIC':'✓\x20Removed\x20stored\x20credentials','MMwpK':function(_0x56d918){return _0x56d918();},'AISBl':function(_0x3cdc42,_0x4f1c4b){return _0x3cdc42(_0x4f1c4b);},'uPQzg':function(_0x11f17a,_0x48ec7f,_0x5b6b2a){return _0x11f17a(_0x48ec7f,_0x5b6b2a);},'lPLiI':'✓\x20Removed\x20.ranger/\x20directory','khpAp':function(_0xd2296d,_0x11555f){return _0xd2296d(_0x11555f);},'SEYUr':_0x576b62(0x1c3),'jyWaI':'opencode.json','JsgWd':_0x576b62(0x1d4),'OFbVi':function(_0x7a3edb,_0xe067cf){return _0x7a3edb(_0xe067cf);},'OuZPe':_0x576b62(0x1c6),'tDyhN':function(_0x4af384){return _0x4af384();},'KIvMI':_0x576b62(0x1d5),'DniXo':'Nothing\x20to\x20clean\x20up.\x0a'};console[_0x576b62(0x1dc)](_0x1adc25[_0x576b62(0x1d2)]);let _0x568ff3=![];try{await deleteAllCredentials(),console['log'](_0x1adc25[_0x576b62(0x1d6)]),_0x568ff3=!![];}catch{}const _0x6eeea0=_0x1adc25['MMwpK'](getCacheFile);existsSync(_0x6eeea0)&&(await rm(_0x6eeea0),_0x568ff3=!![]);const _0x6417cc=getRangerDir();_0x1adc25[_0x576b62(0x1bc)](existsSync,_0x6417cc)&&(await _0x1adc25[_0x576b62(0x1be)](rm,_0x6417cc,{'recursive':!![]}),console[_0x576b62(0x1dc)](_0x1adc25['lPLiI']),_0x568ff3=!![]);const _0x1bd7fe=getProjectSkillsDir();for(const _0x4493a0 of skillsToRemove){const _0x4010ce=join(_0x1bd7fe,_0x4493a0);existsSync(_0x4010ce)&&(await _0x1adc25['uPQzg'](rm,_0x4010ce,{'recursive':!![]}),console['log'](_0x576b62(0x1b6)+_0x4493a0),_0x568ff3=!![]);}const _0x4213d3=getUserSkillsDir();for(const _0x33dce7 of skillsToRemove){const _0x1f5495=join(_0x4213d3,_0x33dce7);_0x1adc25[_0x576b62(0x1bc)](existsSync,_0x1f5495)&&(await _0x1adc25[_0x576b62(0x1be)](rm,_0x1f5495,{'recursive':!![]}),console['log']('✓\x20Removed\x20user\x20skill:\x20'+_0x33dce7),_0x568ff3=!![]);}const _0x255d21=getOpencodeSkillsDir('project');for(const _0x433a23 of skillsToRemove){const _0x105d0b=join(_0x255d21,_0x433a23);_0x1adc25[_0x576b62(0x1db)](existsSync,_0x105d0b)&&(await rm(_0x105d0b,{'recursive':!![]}),console[_0x576b62(0x1dc)](_0x576b62(0x1cf)+_0x433a23),_0x568ff3=!![]);}const _0x156e59=getOpencodeSkillsDir(_0x1adc25['SEYUr']);for(const _0x412e0d of skillsToRemove){const _0xd041e0=_0x1adc25[_0x576b62(0x1be)](join,_0x156e59,_0x412e0d);_0x1adc25[_0x576b62(0x1db)](existsSync,_0xd041e0)&&(await _0x1adc25['uPQzg'](rm,_0xd041e0,{'recursive':!![]}),console[_0x576b62(0x1dc)]('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x412e0d),_0x568ff3=!![]);}const _0x2ba996=join(getOpencodeConfigDir('project'),_0x1adc25[_0x576b62(0x1b7)]);await removeOpencodePluginConfig(_0x2ba996)&&(console[_0x576b62(0x1dc)](_0x1adc25['JsgWd']),_0x568ff3=!![]);const _0x26c791=join(_0x1adc25['OFbVi'](getOpencodeConfigDir,'user'),_0x1adc25[_0x576b62(0x1b7)]);await _0x1adc25['OFbVi'](removeOpencodePluginConfig,_0x26c791)&&(console[_0x576b62(0x1dc)]('✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)'),_0x568ff3=!![]);const _0x2f72b2=await _0x1adc25[_0x576b62(0x1ce)](uninstallClaudePlugin);_0x2f72b2&&(console['log'](_0x576b62(0x1cb)),_0x568ff3=!![]);const _0x46fe12=await uninstallClaudePlugin(_0x576b62(0x1c0));_0x46fe12&&(console[_0x576b62(0x1dc)](_0x1adc25[_0x576b62(0x1d9)]),_0x568ff3=!![]);const _0x441aab=await _0x1adc25[_0x576b62(0x1ad)](removeMarketplace);_0x441aab&&(console['log'](_0x1adc25['KIvMI']),_0x568ff3=!![]),_0x568ff3?console['log'](_0x576b62(0x1a9)):console['log'](_0x1adc25['DniXo']);}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5fcee1=_0xca7e;(function(_0x3055d8,_0x381c1c){const _0x39cf41=_0xca7e,_0x442a7c=_0x3055d8();while(!![]){try{const _0x1dcd73=parseInt(_0x39cf41(0x142))/0x1+-parseInt(_0x39cf41(0x14c))/0x2+parseInt(_0x39cf41(0x12b))/0x3+parseInt(_0x39cf41(0x131))/0x4*(-parseInt(_0x39cf41(0x147))/0x5)+parseInt(_0x39cf41(0x13d))/0x6*(-parseInt(_0x39cf41(0x141))/0x7)+parseInt(_0x39cf41(0x148))/0x8+parseInt(_0x39cf41(0x134))/0x9*(parseInt(_0x39cf41(0x124))/0xa);if(_0x1dcd73===_0x381c1c)break;else _0x442a7c['push'](_0x442a7c['shift']());}catch(_0x4ef7ec){_0x442a7c['push'](_0x442a7c['shift']());}}}(_0x2dc3,0x8d217));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=[_0x5fcee1(0x143),_0x5fcee1(0x132),_0x5fcee1(0x139)];function parseLocalValue(_0x22cba1,_0x1584df){const _0x55852e=_0x5fcee1,_0x216300={'tEKOA':function(_0x41f070,_0x1eaaf6){return _0x41f070===_0x1eaaf6;},'bhjMe':function(_0x11f957,_0x15d5d6){return _0x11f957===_0x15d5d6;}};if(BOOLEAN_KEYS[_0x55852e(0x12e)](_0x22cba1)){if(_0x216300['tEKOA'](_0x1584df,'true'))return!![];if(_0x216300['bhjMe'](_0x1584df,'false'))return![];throw new Error('Invalid\x20value\x20for\x20'+_0x22cba1+_0x55852e(0x144));}return _0x1584df;}function parseOverrideValue(_0x93b37d){const _0xf15f6a=_0x5fcee1,_0xbd06f4={'aCjtz':function(_0x4fc3b8,_0x20974a){return _0x4fc3b8===_0x20974a;},'KvFuf':'false','WIQJd':function(_0x3fe19b,_0x406d98){return _0x3fe19b===_0x406d98;},'WEOZC':'null','SoFoT':_0xf15f6a(0x11d)};if(_0xbd06f4[_0xf15f6a(0x130)](_0x93b37d,_0xf15f6a(0x11e)))return!![];if(_0x93b37d===_0xbd06f4[_0xf15f6a(0x12f)])return![];if(_0xbd06f4[_0xf15f6a(0x152)](_0x93b37d,_0xbd06f4['WEOZC']))return null;if(_0x93b37d===_0xbd06f4['SoFoT'])return undefined;if(/^-?\d+$/['test'](_0x93b37d)){const _0x1bae3b=Number(_0x93b37d);if(Number[_0xf15f6a(0x12a)](_0x1bae3b))return _0x1bae3b;}if(/^-?\d+\.\d+$/[_0xf15f6a(0x140)](_0x93b37d)){const _0x49e6d3=Number(_0x93b37d);if(!Number[_0xf15f6a(0x11b)](_0x49e6d3))return _0x49e6d3;}const _0x2f46a7=_0x93b37d['trim']();if(_0x2f46a7['startsWith']('{')&&_0x2f46a7[_0xf15f6a(0x13f)]('}')||_0x2f46a7[_0xf15f6a(0x13c)]('[')&&_0x2f46a7['endsWith'](']'))try{return JSON[_0xf15f6a(0x150)](_0x2f46a7);}catch{}return _0x93b37d;}function _0xca7e(_0x2a148b,_0xbc564e){_0x2a148b=_0x2a148b-0x11a;const _0x2dc37d=_0x2dc3();let _0xca7ef2=_0x2dc37d[_0x2a148b];return _0xca7ef2;}async function resolveProfileTarget(_0x45de5e){const _0xff697a=_0x5fcee1,_0xf1728a={'tIPnQ':function(_0xa1c96c,_0xc98273){return _0xa1c96c(_0xc98273);},'PdebS':_0xff697a(0x121)},_0x3b5e9f=existsSync(getEnvDir(_0x45de5e));let _0x47c3ab=![];try{const _0x537bed=await fetchCloudProfile(_0x45de5e);_0x47c3ab=_0xf1728a[_0xff697a(0x126)](Boolean,_0x537bed);}catch{}if(_0x47c3ab)return{'kind':_0xff697a(0x138),'alsoExistsElsewhere':_0x3b5e9f};if(_0x3b5e9f)return{'kind':_0xf1728a['PdebS'],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x45de5e+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x45de5e);}function printDualExistsHint(_0x56b8ad){const _0x1862b9=_0x5fcee1;console['log'](_0x1862b9(0x145)+_0x56b8ad+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x4defd8){const _0x244d17=_0x5fcee1,_0x5cc003={'XGnJs':function(_0x11b005,_0x25b760,_0x1548d7){return _0x11b005(_0x25b760,_0x1548d7);},'VMxnM':function(_0x3eb3b8){return _0x3eb3b8();}},_0x24879a=await fetchCloudProfile(_0x4defd8),_0x2a979a=_0x5cc003[_0x244d17(0x12d)](readProfileOverrides,_0x5cc003[_0x244d17(0x153)](getProjectPath),_0x4defd8);return mergeCloudProfileSettings(_0x24879a?.['settings']??{},_0x2a979a??undefined);}export async function configSet(_0x7f8149,_0x581153,_0x3a16f2){const _0x520342=_0x5fcee1,_0x4f095c={'dxebs':function(_0xb0ef48,_0x83512){return _0xb0ef48===_0x83512;},'GypmG':_0x520342(0x138),'GsfuA':function(_0x4b19ca,_0xfdc5db){return _0x4b19ca(_0xfdc5db);},'yNHKu':function(_0x298092,_0x266ccd,_0x3226c1){return _0x298092(_0x266ccd,_0x3226c1);},'ZQteE':function(_0x15e494){return _0x15e494();}},_0x203f8e=await resolveProfileTarget(_0x7f8149);if(_0x4f095c[_0x520342(0x14f)](_0x203f8e[_0x520342(0x137)],_0x4f095c[_0x520342(0x128)])){if(_0x203f8e[_0x520342(0x13e)])_0x4f095c[_0x520342(0x125)](printDualExistsHint,_0x7f8149);const _0x3968a0=parseOverrideValue(_0x3a16f2);setProfileOverride(getProjectPath(),_0x7f8149,_0x581153,_0x3968a0),console['log']('Set\x20'+_0x581153+_0x520342(0x13b)+JSON['stringify'](_0x3968a0)+'\x20for\x20\x22'+_0x7f8149+'\x22');return;}const _0x20e5b7=_0x4f095c['yNHKu'](parseLocalValue,_0x581153,_0x3a16f2);setProfileOverride(_0x4f095c['ZQteE'](getProjectPath),_0x7f8149,_0x581153,_0x20e5b7),console[_0x520342(0x120)](_0x520342(0x151)+_0x581153+_0x520342(0x13b)+_0x20e5b7+_0x520342(0x127)+_0x7f8149+'\x22');}export async function configGet(_0x5f268a,_0x1af1b3){const _0x1bf25c=_0x5fcee1,_0x6e3e={'ndXir':function(_0x50c356,_0xbc8a16){return _0x50c356===_0xbc8a16;},'rwWcR':'cloud','zNmaO':function(_0x11b6ce,_0x5e1dc7){return _0x11b6ce===_0x5e1dc7;},'PxFDK':_0x1bf25c(0x149),'KwYoz':function(_0x1abf7c,_0x4174db){return _0x1abf7c===_0x4174db;}},_0x2ec4c9=await resolveProfileTarget(_0x5f268a);if(_0x6e3e['ndXir'](_0x2ec4c9[_0x1bf25c(0x137)],_0x6e3e[_0x1bf25c(0x135)])){const _0x316218=await loadEffectiveCloudSettings(_0x5f268a),_0x1504ed=getNestedValue(_0x316218,_0x1af1b3);if(_0x1504ed===undefined)console[_0x1bf25c(0x120)]('(not\x20set)');else _0x6e3e[_0x1bf25c(0x154)](typeof _0x1504ed,_0x6e3e[_0x1bf25c(0x146)])?console[_0x1bf25c(0x120)](JSON[_0x1bf25c(0x129)](_0x1504ed,null,0x2)):console['log'](_0x1504ed);return;}const _0x442118=await loadSettings(_0x5f268a),_0x2ed332=getNestedValue(_0x442118,_0x1af1b3);if(_0x2ed332===undefined)console['log']('(not\x20set)');else _0x6e3e['KwYoz'](typeof _0x2ed332,_0x1bf25c(0x149))?console[_0x1bf25c(0x120)](JSON[_0x1bf25c(0x129)](_0x2ed332,null,0x2)):console['log'](_0x2ed332);}export async function configList(_0x40d435){const _0x40c4ce=_0x5fcee1,_0x2d6607={'niAUn':function(_0x4c0577,_0x380966){return _0x4c0577(_0x380966);},'HHMTi':function(_0x57d5a3,_0x433850){return _0x57d5a3(_0x433850);},'ySCnA':function(_0x7e89b9,_0x1bd65d){return _0x7e89b9===_0x1bd65d;},'SurGK':function(_0x432f4f,_0x4f8f25){return _0x432f4f(_0x4f8f25);}},_0x340b4e=await _0x2d6607[_0x40c4ce(0x123)](resolveProfileTarget,_0x40d435);if(_0x340b4e[_0x40c4ce(0x137)]===_0x40c4ce(0x138)){const _0x3b2f5a=await _0x2d6607[_0x40c4ce(0x13a)](loadEffectiveCloudSettings,_0x40d435);if(!_0x3b2f5a||_0x2d6607['ySCnA'](Object['keys'](_0x3b2f5a)[_0x40c4ce(0x11c)],0x0)){console[_0x40c4ce(0x120)](_0x40c4ce(0x14d)+_0x40d435+'\x22');return;}console[_0x40c4ce(0x120)](JSON['stringify'](_0x3b2f5a,null,0x2));return;}const _0xd33134=_0x2d6607['SurGK'](getSettingsPath,_0x40d435);if(!existsSync(_0xd33134)){console[_0x40c4ce(0x120)](_0x40c4ce(0x14d)+_0x40d435+'\x22');return;}const _0x1ad88d=await loadSettings(_0x40d435),_0x88934c=formatSettings(_0x1ad88d);!_0x88934c?console['log'](_0x40c4ce(0x14d)+_0x40d435+'\x22'):console[_0x40c4ce(0x120)](_0x88934c);}export async function configUnset(_0x19cb05,_0x4a330e){const _0x5b87e1=_0x5fcee1,_0x21eb61={'ggEEg':function(_0x1067f7,_0xb6da65){return _0x1067f7(_0xb6da65);},'xFpwd':function(_0x198701){return _0x198701();},'rwYZI':function(_0x3181af){return _0x3181af();},'OcdYF':function(_0x526d6f,_0x3a55e5){return _0x526d6f(_0x3a55e5);},'VIYiw':function(_0x173a23,_0x1a0d4e,_0x30d28){return _0x173a23(_0x1a0d4e,_0x30d28);}},_0x22284c=await _0x21eb61[_0x5b87e1(0x122)](resolveProfileTarget,_0x19cb05);if(_0x22284c['kind']===_0x5b87e1(0x138)){if(_0x22284c['alsoExistsElsewhere'])printDualExistsHint(_0x19cb05);const _0x3241f8=unsetProfileOverride(_0x21eb61['xFpwd'](getProjectPath),_0x19cb05,_0x4a330e);_0x3241f8?console[_0x5b87e1(0x120)](_0x5b87e1(0x14e)+_0x4a330e+'\x20for\x20\x22'+_0x19cb05+'\x22'):console['log'](_0x5b87e1(0x136)+_0x4a330e+_0x5b87e1(0x11f));return;}const _0x442825=unsetProfileOverride(_0x21eb61[_0x5b87e1(0x14b)](getProjectPath),_0x19cb05,_0x4a330e);if(_0x442825){console['log'](_0x5b87e1(0x14e)+_0x4a330e);return;}const _0x1740d7=await _0x21eb61[_0x5b87e1(0x11a)](loadSettings,_0x19cb05),_0x224388=_0x21eb61['VIYiw'](deleteNestedValue,_0x1740d7,_0x4a330e);_0x224388?console[_0x5b87e1(0x120)]('Key\x20\x22'+_0x4a330e+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0x19cb05+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console[_0x5b87e1(0x120)]('Key\x20\x22'+_0x4a330e+_0x5b87e1(0x11f));}export async function configReset(_0x1d7c2c){const _0x2bf5be=_0x5fcee1,_0x320a1b=await resolveProfileTarget(_0x1d7c2c);if(_0x320a1b['kind']===_0x2bf5be(0x138)){resetProfileOverrides(getProjectPath(),_0x1d7c2c),console[_0x2bf5be(0x120)](_0x2bf5be(0x14a)+_0x1d7c2c+'\x22');return;}console[_0x2bf5be(0x120)]('\x22'+_0x1d7c2c+_0x2bf5be(0x133)+_0x1d7c2c+_0x2bf5be(0x12c));}function _0x2dc3(){const _0x40c6b8=['undefined','true','\x22\x20not\x20found','log','local','ggEEg','niAUn','565660EbwXaY','GsfuA','tIPnQ','\x20for\x20\x22','GypmG','stringify','isSafeInteger','685767yMlfpE','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','XGnJs','includes','KvFuf','aCjtz','4NYpWRu','allowInsecureLocalhost','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','234IwoUCA','rwWcR','Key\x20\x22','kind','cloud','forceLogin','HHMTi','\x20=\x20','startsWith','407598XlnpWQ','alsoExistsElsewhere','endsWith','test','119jTbulX','757145wlDLrD','headless',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','\x20\x20Note:\x20\x22','PxFDK','3375510lSNNWE','2884608UeeNvo','object','Cleared\x20local\x20overrides\x20for\x20\x22','rwYZI','817984HZBDkj','No\x20configuration\x20set\x20for\x20\x22','Removed\x20','dxebs','parse','Set\x20','WIQJd','VMxnM','zNmaO','OcdYF','isNaN','length'];_0x2dc3=function(){return _0x40c6b8;};return _0x2dc3();}
|
|
1
|
+
const _0x538cff=_0x2699;(function(_0x41fe8b,_0x2d4f85){const _0x3e5b0b=_0x2699,_0x4e300d=_0x41fe8b();while(!![]){try{const _0x49288c=-parseInt(_0x3e5b0b(0x21f))/0x1*(parseInt(_0x3e5b0b(0x215))/0x2)+parseInt(_0x3e5b0b(0x21e))/0x3+-parseInt(_0x3e5b0b(0x206))/0x4+parseInt(_0x3e5b0b(0x1f3))/0x5+parseInt(_0x3e5b0b(0x1f5))/0x6*(parseInt(_0x3e5b0b(0x226))/0x7)+parseInt(_0x3e5b0b(0x202))/0x8+-parseInt(_0x3e5b0b(0x228))/0x9*(parseInt(_0x3e5b0b(0x1fb))/0xa);if(_0x49288c===_0x2d4f85)break;else _0x4e300d['push'](_0x4e300d['shift']());}catch(_0x1b32ab){_0x4e300d['push'](_0x4e300d['shift']());}}}(_0x2a21,0x48fd3));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=[_0x538cff(0x1f8),'allowInsecureLocalhost',_0x538cff(0x208)];function parseLocalValue(_0x2ded15,_0x394791){const _0x14215f=_0x538cff,_0x4da701={'Xdczr':function(_0x49f0bf,_0x2e2df0){return _0x49f0bf===_0x2e2df0;},'CsFUk':_0x14215f(0x1f9),'qFcGB':'false'};if(BOOLEAN_KEYS['includes'](_0x2ded15)){if(_0x4da701['Xdczr'](_0x394791,_0x4da701[_0x14215f(0x209)]))return!![];if(_0x394791===_0x4da701[_0x14215f(0x1fa)])return![];throw new Error('Invalid\x20value\x20for\x20'+_0x2ded15+_0x14215f(0x227));}return _0x394791;}function parseOverrideValue(_0xf4f32){const _0x4a5fbc=_0x538cff,_0x5157bf={'ZqYno':_0x4a5fbc(0x1f9),'kYBua':function(_0x504963,_0x2cc233){return _0x504963===_0x2cc233;},'tIHrG':_0x4a5fbc(0x207),'DcuSB':'undefined'};if(_0xf4f32===_0x5157bf['ZqYno'])return!![];if(_0xf4f32==='false')return![];if(_0x5157bf['kYBua'](_0xf4f32,_0x5157bf[_0x4a5fbc(0x221)]))return null;if(_0xf4f32===_0x5157bf[_0x4a5fbc(0x21d)])return undefined;if(/^-?\d+$/['test'](_0xf4f32)){const _0x15a23c=Number(_0xf4f32);if(Number['isSafeInteger'](_0x15a23c))return _0x15a23c;}if(/^-?\d+\.\d+$/[_0x4a5fbc(0x20f)](_0xf4f32)){const _0x3f9634=Number(_0xf4f32);if(!Number['isNaN'](_0x3f9634))return _0x3f9634;}const _0x19a39f=_0xf4f32['trim']();if(_0x19a39f['startsWith']('{')&&_0x19a39f['endsWith']('}')||_0x19a39f[_0x4a5fbc(0x20b)]('[')&&_0x19a39f[_0x4a5fbc(0x224)](']'))try{return JSON['parse'](_0x19a39f);}catch{}return _0xf4f32;}function _0x2699(_0x371c23,_0x49fba8){_0x371c23=_0x371c23-0x1f3;const _0x2a21ef=_0x2a21();let _0x269981=_0x2a21ef[_0x371c23];return _0x269981;}function _0x2a21(){const _0x1b80c1=['startsWith','jPdNH','rTugV','kind','test','JeoxK','KzrCP','\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.','tMTFs','\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20','2230yKWWoP','Removed\x20','KjKJH','vGCtO','object','lTtmQ','cluis','log','DcuSB','9930fmsIwU','86VlsgRQ','\x20for\x20\x22','tIHrG','\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22','DkJJD','endsWith','\x20\x20Note:\x20\x22','7HBUXRO',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','24174FiEtxh','1038135gGFykq','Set\x20','2335266FmldMg','Cleared\x20local\x20overrides\x20for\x20\x22','Profile\x20\x22','headless','true','qFcGB','170JDwdMq','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','length','(not\x20set)','stringify','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','cloud','264856sMTYyp','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','\x22\x20not\x20found','RKYvv','770960IlejDx','null','forceLogin','CsFUk','gAaAv'];_0x2a21=function(){return _0x1b80c1;};return _0x2a21();}async function resolveProfileTarget(_0x331592){const _0xdc992f=_0x538cff,_0x11e7d2={'JeoxK':function(_0x23061a,_0x2974de){return _0x23061a(_0x2974de);},'fWLKj':function(_0x55a6da,_0x3272fa){return _0x55a6da(_0x3272fa);},'FEZtz':'cloud','lTtmQ':'local'},_0x582038=_0x11e7d2[_0xdc992f(0x210)](existsSync,_0x11e7d2['fWLKj'](getEnvDir,_0x331592));let _0x1cbd03=![];try{const _0x5fbd95=await fetchCloudProfile(_0x331592);_0x1cbd03=_0x11e7d2['JeoxK'](Boolean,_0x5fbd95);}catch{}if(_0x1cbd03)return{'kind':_0x11e7d2['FEZtz'],'alsoExistsElsewhere':_0x582038};if(_0x582038)return{'kind':_0x11e7d2[_0xdc992f(0x21a)],'alsoExistsElsewhere':![]};throw new Error(_0xdc992f(0x1f7)+_0x331592+_0xdc992f(0x214)+_0x331592);}function printDualExistsHint(_0x3ed841){const _0x4c7624=_0x538cff;console[_0x4c7624(0x21c)](_0x4c7624(0x225)+_0x3ed841+_0x4c7624(0x203));}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x2f656a){const _0x551d16=_0x538cff,_0x20acf4={'RKYvv':function(_0x4228b0,_0x3215b2,_0x4ad6e3){return _0x4228b0(_0x3215b2,_0x4ad6e3);}},_0x7a7562=await fetchCloudProfile(_0x2f656a),_0xe41364=_0x20acf4[_0x551d16(0x205)](readProfileOverrides,getProjectPath(),_0x2f656a);return mergeCloudProfileSettings(_0x7a7562?.['settings']??{},_0xe41364??undefined);}export async function configSet(_0x3ba74e,_0x56abbd,_0x1465d8){const _0x392dd2=_0x538cff,_0x409969={'gAaAv':function(_0x4b06d6,_0x28a030){return _0x4b06d6(_0x28a030);},'vGCtO':function(_0x3891df,_0x3cbe95){return _0x3891df===_0x3cbe95;},'kleiH':function(_0x2257f8,_0x1eeeb2){return _0x2257f8(_0x1eeeb2);},'DkJJD':function(_0x28cbad,_0x4a3410,_0x3d5723){return _0x28cbad(_0x4a3410,_0x3d5723);}},_0x507bf0=await _0x409969[_0x392dd2(0x20a)](resolveProfileTarget,_0x3ba74e);if(_0x409969[_0x392dd2(0x218)](_0x507bf0[_0x392dd2(0x20e)],'cloud')){if(_0x507bf0['alsoExistsElsewhere'])_0x409969['kleiH'](printDualExistsHint,_0x3ba74e);const _0x4e2c87=parseOverrideValue(_0x1465d8);setProfileOverride(getProjectPath(),_0x3ba74e,_0x56abbd,_0x4e2c87),console['log'](_0x392dd2(0x1f4)+_0x56abbd+'\x20=\x20'+JSON['stringify'](_0x4e2c87)+_0x392dd2(0x220)+_0x3ba74e+'\x22');return;}const _0xb540ff=_0x409969[_0x392dd2(0x223)](parseLocalValue,_0x56abbd,_0x1465d8);setProfileOverride(getProjectPath(),_0x3ba74e,_0x56abbd,_0xb540ff),console[_0x392dd2(0x21c)]('Set\x20'+_0x56abbd+'\x20=\x20'+_0xb540ff+'\x20for\x20\x22'+_0x3ba74e+'\x22');}export async function configGet(_0x597af8,_0x8e268){const _0x12af60=_0x538cff,_0x2484a6={'KjKJH':function(_0x318b60,_0x42ac8b){return _0x318b60(_0x42ac8b);},'yXNfE':_0x12af60(0x201),'DyaKR':function(_0x5ebc3b,_0x29c2b4){return _0x5ebc3b(_0x29c2b4);},'EjGjp':_0x12af60(0x219),'viSnZ':function(_0x1a60d1,_0x3bc3d0){return _0x1a60d1===_0x3bc3d0;},'JtApb':function(_0x17bb53,_0x4d5a93){return _0x17bb53===_0x4d5a93;}},_0x538d36=await _0x2484a6[_0x12af60(0x217)](resolveProfileTarget,_0x597af8);if(_0x538d36['kind']===_0x2484a6['yXNfE']){const _0x456591=await _0x2484a6['DyaKR'](loadEffectiveCloudSettings,_0x597af8),_0x114d76=getNestedValue(_0x456591,_0x8e268);if(_0x114d76===undefined)console['log']('(not\x20set)');else typeof _0x114d76===_0x2484a6['EjGjp']?console['log'](JSON['stringify'](_0x114d76,null,0x2)):console[_0x12af60(0x21c)](_0x114d76);return;}const _0x509988=await loadSettings(_0x597af8),_0x5f1415=getNestedValue(_0x509988,_0x8e268);if(_0x2484a6['viSnZ'](_0x5f1415,undefined))console[_0x12af60(0x21c)](_0x12af60(0x1fe));else _0x2484a6['JtApb'](typeof _0x5f1415,'object')?console[_0x12af60(0x21c)](JSON['stringify'](_0x5f1415,null,0x2)):console['log'](_0x5f1415);}export async function configList(_0x100fa1){const _0x554de3=_0x538cff,_0x20c4b4={'teUul':function(_0x1b3e3a,_0x22dbdb){return _0x1b3e3a(_0x22dbdb);},'tMTFs':function(_0x1c3c1d,_0x46c897){return _0x1c3c1d===_0x46c897;},'TRpAV':function(_0x2ea446,_0x28c321){return _0x2ea446(_0x28c321);}},_0x4db8c1=await _0x20c4b4['teUul'](resolveProfileTarget,_0x100fa1);if(_0x20c4b4[_0x554de3(0x213)](_0x4db8c1['kind'],_0x554de3(0x201))){const _0x2f7137=await _0x20c4b4['TRpAV'](loadEffectiveCloudSettings,_0x100fa1);if(!_0x2f7137||Object['keys'](_0x2f7137)[_0x554de3(0x1fd)]===0x0){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x100fa1+'\x22');return;}console[_0x554de3(0x21c)](JSON[_0x554de3(0x1ff)](_0x2f7137,null,0x2));return;}const _0x399848=getSettingsPath(_0x100fa1);if(!existsSync(_0x399848)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x100fa1+'\x22');return;}const _0x254bd0=await loadSettings(_0x100fa1),_0x352b35=formatSettings(_0x254bd0);!_0x352b35?console[_0x554de3(0x21c)]('No\x20configuration\x20set\x20for\x20\x22'+_0x100fa1+'\x22'):console[_0x554de3(0x21c)](_0x352b35);}export async function configUnset(_0x150d7d,_0x49062f){const _0x146f4b=_0x538cff,_0x4d3fc9={'KzrCP':function(_0x125c59,_0x575b86){return _0x125c59(_0x575b86);},'cluis':_0x146f4b(0x201),'rTugV':function(_0x4ef54d){return _0x4ef54d();},'kYuZx':function(_0x31ee5c,_0x5c15aa){return _0x31ee5c(_0x5c15aa);}},_0x935cf6=await _0x4d3fc9[_0x146f4b(0x211)](resolveProfileTarget,_0x150d7d);if(_0x935cf6['kind']===_0x4d3fc9[_0x146f4b(0x21b)]){if(_0x935cf6['alsoExistsElsewhere'])_0x4d3fc9['KzrCP'](printDualExistsHint,_0x150d7d);const _0x4f4cac=unsetProfileOverride(getProjectPath(),_0x150d7d,_0x49062f);_0x4f4cac?console[_0x146f4b(0x21c)](_0x146f4b(0x216)+_0x49062f+'\x20for\x20\x22'+_0x150d7d+'\x22'):console[_0x146f4b(0x21c)]('Key\x20\x22'+_0x49062f+_0x146f4b(0x204));return;}const _0x12b330=unsetProfileOverride(_0x4d3fc9[_0x146f4b(0x20d)](getProjectPath),_0x150d7d,_0x49062f);if(_0x12b330){console['log'](_0x146f4b(0x216)+_0x49062f);return;}const _0x31dbd8=await _0x4d3fc9['kYuZx'](loadSettings,_0x150d7d),_0x8c2128=deleteNestedValue(_0x31dbd8,_0x49062f);_0x8c2128?console['log']('Key\x20\x22'+_0x49062f+_0x146f4b(0x222)+_0x150d7d+_0x146f4b(0x212)):console['log']('Key\x20\x22'+_0x49062f+_0x146f4b(0x204));}export async function configReset(_0x472153){const _0xa757be=_0x538cff,_0x138135={'jPdNH':function(_0x456355,_0x122ef0,_0x146eb7){return _0x456355(_0x122ef0,_0x146eb7);}},_0x351d57=await resolveProfileTarget(_0x472153);if(_0x351d57['kind']===_0xa757be(0x201)){_0x138135[_0xa757be(0x20c)](resetProfileOverrides,getProjectPath(),_0x472153),console[_0xa757be(0x21c)](_0xa757be(0x1f6)+_0x472153+'\x22');return;}console[_0xa757be(0x21c)]('\x22'+_0x472153+_0xa757be(0x200)+_0x472153+_0xa757be(0x1fc));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x203d4f,_0xb9b0f9){const _0x1ab393=_0x39a9,_0x52f87d=_0x203d4f();while(!![]){try{const _0x23a641=-parseInt(_0x1ab393(0x170))/0x1+parseInt(_0x1ab393(0x15f))/0x2*(parseInt(_0x1ab393(0x165))/0x3)+-parseInt(_0x1ab393(0x15e))/0x4*(parseInt(_0x1ab393(0x16e))/0x5)+parseInt(_0x1ab393(0x160))/0x6*(parseInt(_0x1ab393(0x161))/0x7)+-parseInt(_0x1ab393(0x171))/0x8*(parseInt(_0x1ab393(0x172))/0x9)+-parseInt(_0x1ab393(0x15c))/0xa*(parseInt(_0x1ab393(0x164))/0xb)+parseInt(_0x1ab393(0x15b))/0xc;if(_0x23a641===_0xb9b0f9)break;else _0x52f87d['push'](_0x52f87d['shift']());}catch(_0x17158c){_0x52f87d['push'](_0x52f87d['shift']());}}}(_0x57f7,0x924be));function _0x57f7(){const _0x55d4c4=['539572LuyfLY','17868yitgIJ','✓\x20Deleted\x20cloud\x20profile\x20\x22','Type\x20\x22','Cloud\x20profile\x20\x22','log','input','cwd','XOImR','\x22\x20not\x20found.','25YmVkTz','Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.','736542empsiW','5724632qklUXi','9epsdNO','dcbde','Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.','23962668kWIpsl','140pTojeB','BaUmr','535452WkRYsg','360tDqiPm','81222DWGJkD','175jTCGIH','\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22','confirmation'];_0x57f7=function(){return _0x55d4c4;};return _0x57f7();}import _0x462b85 from'inquirer';import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';function _0x39a9(_0x225ff5,_0x529f62){_0x225ff5=_0x225ff5-0x159;const _0x57f73c=_0x57f7();let _0x39a9a0=_0x57f73c[_0x225ff5];return _0x39a9a0;}import{isInteractive}from'./utils/cloudProfileSession.js';import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';export async function deleteProfile(_0x21d844,_0xff6274={}){const _0x20e173=_0x39a9,_0x56e061={'kVfeI':function(_0xcb55e5,_0x53a1f9){return _0xcb55e5(_0x53a1f9);},'XOImR':_0x20e173(0x15a),'dcbde':_0x20e173(0x16a),'BaUmr':function(_0x48f7e4,_0x2b4a29,_0x33fee7){return _0x48f7e4(_0x2b4a29,_0x33fee7);}},_0x2c5e0b=await _0x56e061['kVfeI'](fetchCloudProfile,_0x21d844);if(!_0x2c5e0b)throw new Error(_0x20e173(0x168)+_0x21d844+_0x20e173(0x16d));if(!_0xff6274['yes']&&!isInteractive())throw new Error(_0x56e061[_0x20e173(0x16c)]);console['log'](_0x20e173(0x162)+_0x21d844+'\x22\x20for\x20everyone\x20in\x20your\x20organization.');if(!_0xff6274['yes']){const {confirmation:_0x45d1df}=await _0x462b85['prompt']([{'type':_0x56e061[_0x20e173(0x159)],'name':_0x20e173(0x163),'message':_0x20e173(0x167)+_0x21d844+'\x22\x20to\x20confirm\x20deletion:'}]);if(_0x45d1df!==_0x21d844)throw new Error(_0x20e173(0x16f));}await _0x56e061['kVfeI'](deleteCloudProfile,_0x21d844),_0x56e061[_0x20e173(0x15d)](resetProfileOverrides,process[_0x20e173(0x16b)](),_0x21d844),clearLastProfile(process['cwd'](),_0x21d844),console[_0x20e173(0x169)](_0x20e173(0x166)+_0x21d844+'\x22.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x572e6a=_0x1d01;(function(_0x176097,_0x862f2a){const _0x4f43c7=_0x1d01,_0x5e2e30=_0x176097();while(!![]){try{const _0x6f530e=-parseInt(_0x4f43c7(0x20e))/0x1+parseInt(_0x4f43c7(0x1fb))/0x2*(-parseInt(_0x4f43c7(0x1f6))/0x3)+-parseInt(_0x4f43c7(0x205))/0x4*(parseInt(_0x4f43c7(0x21f))/0x5)+-parseInt(_0x4f43c7(0x211))/0x6+-parseInt(_0x4f43c7(0x1f7))/0x7*(parseInt(_0x4f43c7(0x1f1))/0x8)+parseInt(_0x4f43c7(0x21e))/0x9+parseInt(_0x4f43c7(0x220))/0xa;if(_0x6f530e===_0x862f2a)break;else _0x5e2e30['push'](_0x5e2e30['shift']());}catch(_0x2131b5){_0x5e2e30['push'](_0x5e2e30['shift']());}}}(_0xc0ab,0x68089));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0xc0ab(){const _0x48211d=['244806uEmvCj','70343zbDDEu','includes','legacy','(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)','14tjtFgD','jCUDV','message','wLyUP','sessionUpdatedAt','local','.txt','isDirectory','endsWith','okszY','4gQeMhh','\x0aCloud\x20Profiles\x20(by\x20environment):','AgrFF','reports','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20','\x20\x20\x20\x20\x20\x20Details:\x20','ydTJO','push','\x20\x20\x20\x20\x20\x20URL:\x20','707466IIgsbx','SXVdl','BOfWA','1945404yKKhIR','posmk','log','localeCompare','name','VmDuR','\x0a\x20\x20','jkGIV','\x0aCloud\x20Profiles:','\x0a*\x20=\x20active\x20profile','yukeH','\x0aLocal\x20Profiles\x20(legacy):','dvlmv','5384403BqerwK','2674255PUExbF','23173340klXDsT','get','cached\x20(updated\x20','some','Maduo','environmentKey','length','bnLgC','\x20\x20\x20\x20','280gmHxEA','ecHzK','sort','WGOKa','baseUrl'];_0xc0ab=function(){return _0x48211d;};return _0xc0ab();}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',_0x572e6a(0x208),'local','ci'];function _0x1d01(_0x1ea063,_0x47b499){_0x1ea063=_0x1ea063-0x1f1;const _0xc0ab4c=_0xc0ab();let _0x1d011a=_0xc0ab4c[_0x1ea063];return _0x1d011a;}export function shouldGroupByEnvironment(_0x1424f4){const _0x1f6362=_0x572e6a;return _0x1424f4[_0x1f6362(0x223)](_0xd111cc=>_0xd111cc[_0x1f6362(0x225)]);}export function groupCloudProfilesByEnvironment(_0x3ff274){const _0x1f84eb=_0x572e6a,_0x3b473b={'yukeH':function(_0x5068ac,_0x151d7f){return _0x5068ac===_0x151d7f;}},_0x2e7772=new Map();for(const _0x2b52ac of _0x3ff274){const _0x3789dc=_0x2b52ac[_0x1f84eb(0x225)]??null,_0x5ae02d=_0x2e7772[_0x1f84eb(0x221)](_0x3789dc);if(_0x5ae02d)_0x5ae02d[_0x1f84eb(0x20c)](_0x2b52ac);else _0x2e7772['set'](_0x3789dc,[_0x2b52ac]);}const _0x324e1a=[..._0x2e7772['keys']()]['sort']((_0x24cb11,_0x50924a)=>{const _0x2f4218=_0x1f84eb;if(_0x3b473b['yukeH'](_0x24cb11,null))return 0x1;if(_0x3b473b[_0x2f4218(0x21b)](_0x50924a,null))return-0x1;return _0x24cb11[_0x2f4218(0x214)](_0x50924a);});return _0x324e1a['map'](_0x53b2d9=>({'environmentKey':_0x53b2d9,'profiles':_0x2e7772['get'](_0x53b2d9)['sort']((_0x241724,_0x10d303)=>_0x241724[_0x1f84eb(0x215)][_0x1f84eb(0x214)](_0x10d303['name']))}));}export async function getEnvNames(){const _0x599bca=_0x572e6a,_0x403529={'okszY':function(_0x23ae06){return _0x23ae06();},'jCUDV':function(_0x5291fd,_0x2872c0){return _0x5291fd(_0x2872c0);},'wLyUP':function(_0x21aa2c){return _0x21aa2c();},'dvlmv':function(_0x528205,_0x2eb545,_0x38a6f3){return _0x528205(_0x2eb545,_0x38a6f3);},'AgrFF':_0x599bca(0x200),'ecHzK':function(_0x4a0dbb,_0x2dcde9,_0x592a13){return _0x4a0dbb(_0x2dcde9,_0x592a13);},'hCoEv':_0x599bca(0x201),'ydTJO':function(_0x1c219f,_0x439d4e){return _0x1c219f(_0x439d4e);},'BOfWA':function(_0x3b9241,_0x11ffa3){return _0x3b9241(_0x11ffa3);},'VvsYB':'legacy'},_0x383d9d=_0x403529[_0x599bca(0x204)](getRangerDir);if(!_0x403529[_0x599bca(0x1fc)](existsSync,_0x383d9d))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x592021=await _0x403529[_0x599bca(0x1fe)](readActiveProfileName),_0x5646f5=[],_0x2fff86={},_0x4d8f1f=_0x403529[_0x599bca(0x21d)](join,_0x383d9d,_0x403529[_0x599bca(0x207)]);if(_0x403529['jCUDV'](existsSync,_0x4d8f1f)){const _0x2458da=await readdir(_0x4d8f1f);for(const _0x4ca5c3 of _0x2458da){const _0x420082=_0x403529[_0x599bca(0x1f2)](join,_0x4d8f1f,_0x4ca5c3),_0x501184=await _0x403529['jCUDV'](stat,_0x420082);_0x501184[_0x599bca(0x202)]()&&(_0x5646f5[_0x599bca(0x20c)](_0x4ca5c3),_0x2fff86[_0x4ca5c3]=_0x403529['AgrFF']);}}const _0x4c6686=_0x403529['dvlmv'](join,_0x383d9d,'ci');if(_0x403529[_0x599bca(0x1fc)](existsSync,_0x4c6686)){const _0x23dd8e=await readdir(_0x4c6686);for(const _0x38f111 of _0x23dd8e){const _0xfe8de2=join(_0x4c6686,_0x38f111),_0xcaaea7=await stat(_0xfe8de2);_0xcaaea7[_0x599bca(0x202)]()&&(_0x5646f5[_0x599bca(0x20c)](_0x38f111),_0x2fff86[_0x38f111]='ci');}}const _0x4ebb3f=await readdir(_0x383d9d);for(const _0x4936bc of _0x4ebb3f){if(NON_ENV_DIRS['includes'](_0x4936bc))continue;if(_0x4936bc['startsWith']('.'))continue;if(_0x4936bc[_0x599bca(0x203)](_0x403529['hCoEv']))continue;const _0x46410b=join(_0x383d9d,_0x4936bc),_0x3d65cb=await _0x403529[_0x599bca(0x20b)](stat,_0x46410b);_0x3d65cb[_0x599bca(0x202)]()&&_0x403529[_0x599bca(0x210)](existsSync,join(_0x46410b,'settings.json'))&&(!_0x5646f5[_0x599bca(0x1f8)](_0x4936bc)&&(_0x5646f5[_0x599bca(0x20c)](_0x4936bc),_0x2fff86[_0x4936bc]=_0x403529['VvsYB']));}return{'envNames':_0x5646f5,'activeEnv':_0x592021,'envTypes':_0x2fff86};}export async function envList(){const _0x2ce25d=_0x572e6a,_0x390c29={'SXVdl':function(_0x3902fc,_0x4851cf){return _0x3902fc===_0x4851cf;},'VclcH':'no\x20session','auzUz':function(_0x3b2179){return _0x3b2179();},'DxMJz':function(_0x2f75e2,_0x2db2ae){return _0x2f75e2 instanceof _0x2db2ae;},'VmDuR':function(_0x9f639,_0x49a972){return _0x9f639===_0x49a972;},'YbVpf':'\x0aNo\x20profiles\x20found.','TxbPx':'Run:\x20ranger\x20profile\x20add\x20<profile-name>','WGOKa':_0x2ce25d(0x21c),'jKmhT':function(_0x81abf3,_0x170e20){return _0x81abf3(_0x170e20);},'jkGIV':_0x2ce25d(0x1f9),'Maduo':_0x2ce25d(0x206),'bnLgC':_0x2ce25d(0x1fa),'NYomo':function(_0xf903e9,_0x577706,_0x4fff5b){return _0xf903e9(_0x577706,_0x4fff5b);},'posmk':_0x2ce25d(0x228)},{envNames:_0x3e593c,activeEnv:_0x12e882,envTypes:_0x194ee0}=await getEnvNames();let _0x60c531=[];const _0x3fbaef=await getToken();if(_0x3fbaef)try{_0x60c531=await _0x390c29['auzUz'](listCloudProfiles);}catch(_0x302f76){console['error'](_0x2ce25d(0x209)+(_0x390c29['DxMJz'](_0x302f76,Error)?_0x302f76[_0x2ce25d(0x1fd)]:String(_0x302f76)));}if(_0x390c29[_0x2ce25d(0x20f)](_0x3e593c['length'],0x0)&&_0x390c29[_0x2ce25d(0x216)](_0x60c531[_0x2ce25d(0x226)],0x0)){console['log'](_0x390c29['YbVpf']),console['log'](_0x390c29['TxbPx']);return;}const _0xeef063=new Set(_0x60c531['map'](_0x88e2d2=>_0x88e2d2[_0x2ce25d(0x215)]));if(_0x3e593c[_0x2ce25d(0x226)]>0x0){console['log'](_0x390c29[_0x2ce25d(0x1f4)]);for(const _0x1a0ee4 of _0x3e593c[_0x2ce25d(0x1f3)]()){const _0xece607=_0x390c29['SXVdl'](_0x1a0ee4,_0x12e882)&&!_0xeef063['has'](_0x1a0ee4),_0x5db79d=_0x194ee0[_0x1a0ee4]||'local',_0x4fa939=await _0x390c29['jKmhT'](loadSettings,_0x1a0ee4),_0x305543=_0x5db79d===_0x390c29[_0x2ce25d(0x218)]?'':'\x20['+_0x5db79d+']';console[_0x2ce25d(0x213)]('\x20\x20'+(_0xece607?'*\x20':'\x20\x20')+_0x1a0ee4+_0x305543),_0x4fa939['baseUrl']&&console['log'](_0x2ce25d(0x20d)+_0x4fa939[_0x2ce25d(0x1f5)]),_0x4fa939['environmentDetails']&&console[_0x2ce25d(0x213)](_0x2ce25d(0x20a)+_0x4fa939['environmentDetails']);}}const _0x51a362=(_0x1b8b72,_0x4dad70)=>{const _0x463c6c=_0x2ce25d,_0x4f11e6=_0x390c29[_0x463c6c(0x20f)](_0x1b8b72['name'],_0x12e882),_0x376f0b=_0x1b8b72[_0x463c6c(0x1ff)]?_0x463c6c(0x222)+_0x1b8b72[_0x463c6c(0x1ff)]+')':_0x390c29['VclcH'];console[_0x463c6c(0x213)](''+_0x4dad70+(_0x4f11e6?'*\x20':'\x20\x20')+_0x1b8b72[_0x463c6c(0x215)]),console[_0x463c6c(0x213)](_0x4dad70+'\x20\x20\x20\x20Session:\x20'+_0x376f0b);};if(_0x60c531[_0x2ce25d(0x226)]>0x0){if(shouldGroupByEnvironment(_0x60c531)){console['log'](_0x390c29[_0x2ce25d(0x224)]);for(const _0x16d5fa of groupCloudProfilesByEnvironment(_0x60c531)){const _0x11e417=_0x16d5fa[_0x2ce25d(0x225)]??_0x390c29[_0x2ce25d(0x227)];console[_0x2ce25d(0x213)](_0x2ce25d(0x217)+_0x11e417);for(const _0x59b32d of _0x16d5fa['profiles']){_0x390c29['NYomo'](_0x51a362,_0x59b32d,_0x390c29[_0x2ce25d(0x212)]);}}}else{console['log'](_0x2ce25d(0x219));for(const _0x3fc78d of[..._0x60c531][_0x2ce25d(0x1f3)]((_0x13f56c,_0x568813)=>_0x13f56c[_0x2ce25d(0x215)][_0x2ce25d(0x214)](_0x568813['name']))){_0x51a362(_0x3fc78d,'\x20\x20');}}}_0x12e882&&console[_0x2ce25d(0x213)](_0x2ce25d(0x21a));}
|
|
1
|
+
function _0x39cc(_0x162618,_0x15225a){_0x162618=_0x162618-0x10f;const _0x2295aa=_0x2295();let _0x39ccf6=_0x2295aa[_0x162618];return _0x39ccf6;}const _0x3b176e=_0x39cc;(function(_0x57ee4c,_0x474bab){const _0x13c5eb=_0x39cc,_0x21c2ec=_0x57ee4c();while(!![]){try{const _0x5576a7=parseInt(_0x13c5eb(0x147))/0x1*(-parseInt(_0x13c5eb(0x12f))/0x2)+parseInt(_0x13c5eb(0x13a))/0x3+-parseInt(_0x13c5eb(0x11e))/0x4*(parseInt(_0x13c5eb(0x135))/0x5)+parseInt(_0x13c5eb(0x13c))/0x6+parseInt(_0x13c5eb(0x116))/0x7+parseInt(_0x13c5eb(0x13b))/0x8*(parseInt(_0x13c5eb(0x126))/0x9)+-parseInt(_0x13c5eb(0x146))/0xa;if(_0x5576a7===_0x474bab)break;else _0x21c2ec['push'](_0x21c2ec['shift']());}catch(_0x2e419d){_0x21c2ec['push'](_0x21c2ec['shift']());}}}(_0x2295,0xcd3b7));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{getRangerDir}from'./utils/rangerRoot.js';import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';import{getToken}from'./utils/keychain.js';import{fetchAuthConfig,fetchCloudProfile,listCloudProfiles}from'./utils/cloudProfile.js';import{resolveAuthEnvironmentLocally}from'./utils/cloudProfileSession.js';import{readProfileOverrides}from'./utils/projectsConfig.js';import{resolveProfileUrl}from'./utils/resolveProfileUrl.js';function _0x2295(){const _0x24726a=['profiles','OlDLn','8726fnglbd','\x0a\x20\x20','GDfOc','keys','cached\x20(updated\x20','environmentKey','2629135SHJXYx','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profile\x20\x22','CBMyO','endsWith','sort','3652260NPMBxY','251192YXhKrP','5125512udMSYC','Run:\x20ranger\x20profile\x20add\x20<profile-name>','get','length','environmentDetails','includes','localeCompare','QudvO','\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20','\x20\x20\x20\x20\x20\x20URL:\x20','14699040qIUGSy','29zUQvpj','hSBnI','ZqOhW','map','qQqeL','has','(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)','DbtgT','baseUrlSource','all','name','gyyWM','GJyJw','isDirectory','\x0aCloud\x20Profiles:','WVBVN','HJMpy','legacy','4040589gDnUhp','log','.txt','set','authConfig','sessionUpdatedAt','\x22:\x20','message','4vebVQr','some','\x20\x20\x20\x20\x20\x20Details:\x20','cwd','ZhZmf','qVyso','baseUrl','local','90pxTcYR','PhzWi','jqTxW','bTsvl','push','lqezj','startsWith'];_0x2295=function(){return _0x24726a;};return _0x2295();}import{resolveEnvVars}from'./utils/settings.js';const NON_ENV_DIRS=['sessions','bug-bashes','reports',_0x3b176e(0x125),'ci'];export function shouldGroupByEnvironment(_0xd3a36f){const _0x10f939=_0x3b176e;return _0xd3a36f[_0x10f939(0x11f)](_0x1ce768=>_0x1ce768['environmentKey']);}export function groupCloudProfilesByEnvironment(_0xa9050c){const _0x1581ce=_0x3b176e,_0x385e80={'aUGyH':function(_0x123d6b,_0x1b6065){return _0x123d6b===_0x1b6065;}},_0x1f75f4=new Map();for(const _0xe5aee8 of _0xa9050c){const _0x363fa7=_0xe5aee8[_0x1581ce(0x134)]??null,_0x438287=_0x1f75f4[_0x1581ce(0x13e)](_0x363fa7);if(_0x438287)_0x438287[_0x1581ce(0x12a)](_0xe5aee8);else _0x1f75f4['set'](_0x363fa7,[_0xe5aee8]);}const _0x434a6f=[..._0x1f75f4[_0x1581ce(0x132)]()][_0x1581ce(0x139)]((_0x5e124a,_0x4f99d3)=>{const _0x504034=_0x1581ce;if(_0x385e80['aUGyH'](_0x5e124a,null))return 0x1;if(_0x4f99d3===null)return-0x1;return _0x5e124a[_0x504034(0x142)](_0x4f99d3);});return _0x434a6f[_0x1581ce(0x14a)](_0x11dfa=>({'environmentKey':_0x11dfa,'profiles':_0x1f75f4[_0x1581ce(0x13e)](_0x11dfa)['sort']((_0x251e32,_0x307316)=>_0x251e32['name'][_0x1581ce(0x142)](_0x307316['name']))}));}function expandString(_0x45cb8d){const _0x26215f=_0x3b176e,_0x124bbd={'GDfOc':function(_0x36b79b,_0x11455d){return _0x36b79b(_0x11455d);}};if(!_0x45cb8d)return undefined;return _0x124bbd[_0x26215f(0x131)](resolveEnvVars,_0x45cb8d);}function expandProfileOverrides(_0x111bf3){const _0x1fc80e=_0x3b176e,_0x200c27={'QudvO':function(_0x22b3be,_0x1cb648){return _0x22b3be(_0x1cb648);}};if(!_0x111bf3)return null;return{..._0x111bf3,'baseUrl':expandString(_0x111bf3[_0x1fc80e(0x124)]),'startPath':_0x200c27[_0x1fc80e(0x143)](expandString,_0x111bf3['startPath'])};}export function resolveCloudProfileListUrl(_0x2dbe43,_0x1c6516={}){const _0x58e25b=_0x3b176e,_0x4ee4f9={'bTyFu':function(_0x3233a1,_0xa2b63e){return _0x3233a1(_0xa2b63e);},'ttpwo':function(_0x1b520d,_0x291d57){return _0x1b520d(_0x291d57);},'ujZEK':function(_0xd77fd8,_0x519077){return _0xd77fd8(_0x519077);}},_0x418fd5=_0x2dbe43['settings']??{},_0x105c44=_0x1c6516[_0x58e25b(0x11a)]?resolveAuthEnvironmentLocally(_0x1c6516['authConfig'],_0x2dbe43['environmentKey']):null,_0x500fd0=_0x4ee4f9['bTyFu'](resolveProfileUrl,{'projectOverrides':_0x4ee4f9['ttpwo'](expandProfileOverrides,_0x1c6516['projectOverrides']??null),'cloudSettings':{'baseUrl':_0x4ee4f9['ujZEK'](expandString,_0x418fd5[_0x58e25b(0x124)]),'startPath':expandString(_0x418fd5['startPath'])},'authEnvironmentDomain':_0x105c44?.['domains']?.[0x0]});return{'baseUrl':_0x500fd0[_0x58e25b(0x124)],'source':_0x500fd0[_0x58e25b(0x14f)]};}async function loadCloudProfileListUrls(_0x1ffaa6){const _0x418dca=_0x3b176e,_0x3fd970={'OlDLn':function(_0x44a323,_0x4a9bc4){return _0x44a323(_0x4a9bc4);},'lqezj':function(_0x3f5492,_0x259721,_0xc5f5e4){return _0x3f5492(_0x259721,_0xc5f5e4);},'LbDok':function(_0x2f0be5,_0xdf6b76,_0x498250){return _0x2f0be5(_0xdf6b76,_0x498250);},'PhzWi':function(_0x298e55,_0x33aa8b){return _0x298e55===_0x33aa8b;}},_0x2285cc=new Map();if(_0x3fd970[_0x418dca(0x127)](_0x1ffaa6['length'],0x0))return _0x2285cc;const _0x45a400=await fetchAuthConfig();return await Promise[_0x418dca(0x150)](_0x1ffaa6['map'](async _0x1479d0=>{const _0x405951=_0x418dca;try{const _0x528349=await _0x3fd970[_0x405951(0x12e)](fetchCloudProfile,_0x1479d0['name']);if(!_0x528349)return;_0x2285cc[_0x405951(0x119)](_0x1479d0[_0x405951(0x151)],_0x3fd970[_0x405951(0x12b)](resolveCloudProfileListUrl,_0x528349,{'authConfig':_0x45a400,'projectOverrides':_0x3fd970['LbDok'](readProfileOverrides,process['cwd'](),_0x1479d0['name'])}));}catch(_0x4d84ad){console['error'](_0x405951(0x136)+_0x1479d0['name']+_0x405951(0x11c)+(_0x4d84ad instanceof Error?_0x4d84ad[_0x405951(0x11d)]:String(_0x4d84ad)));}})),_0x2285cc;}export async function getEnvNames(){const _0x34ff0b=_0x3b176e,_0xedc8d9={'UpLqZ':_0x34ff0b(0x125),'HJMpy':function(_0x3a991b,_0x1b3ede){return _0x3a991b(_0x1b3ede);},'fogoM':function(_0x1ad873,_0x3010fb){return _0x1ad873(_0x3010fb);},'ZJSxa':function(_0x1dff7c,_0x2599d9,_0x23152c){return _0x1dff7c(_0x2599d9,_0x23152c);},'tDrYH':function(_0x26d1df,_0x34bf5c){return _0x26d1df(_0x34bf5c);},'bEMWp':function(_0x4568b8,_0x5ec8f0){return _0x4568b8(_0x5ec8f0);},'GJyJw':_0x34ff0b(0x118),'ZqOhW':function(_0x595973,_0x54095f,_0xba7de9){return _0x595973(_0x54095f,_0xba7de9);}},_0x3cba29=getRangerDir();if(!existsSync(_0x3cba29))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x15a12f=await readActiveProfileName(),_0x1ec509=[],_0x3f55d3={},_0x57f5c3=join(_0x3cba29,_0xedc8d9['UpLqZ']);if(existsSync(_0x57f5c3)){const _0x308b6b=await _0xedc8d9[_0x34ff0b(0x114)](readdir,_0x57f5c3);for(const _0x31cc50 of _0x308b6b){const _0x59a3ac=join(_0x57f5c3,_0x31cc50),_0x463d0b=await _0xedc8d9['fogoM'](stat,_0x59a3ac);_0x463d0b[_0x34ff0b(0x111)]()&&(_0x1ec509[_0x34ff0b(0x12a)](_0x31cc50),_0x3f55d3[_0x31cc50]=_0x34ff0b(0x125));}}const _0x4f3e03=_0xedc8d9['ZJSxa'](join,_0x3cba29,'ci');if(_0xedc8d9['tDrYH'](existsSync,_0x4f3e03)){const _0x1c53da=await _0xedc8d9['bEMWp'](readdir,_0x4f3e03);for(const _0x581aae of _0x1c53da){const _0x565794=join(_0x4f3e03,_0x581aae),_0x1f81e8=await _0xedc8d9['tDrYH'](stat,_0x565794);_0x1f81e8[_0x34ff0b(0x111)]()&&(_0x1ec509[_0x34ff0b(0x12a)](_0x581aae),_0x3f55d3[_0x581aae]='ci');}}const _0x5bcefc=await readdir(_0x3cba29);for(const _0x4b021b of _0x5bcefc){if(NON_ENV_DIRS['includes'](_0x4b021b))continue;if(_0x4b021b[_0x34ff0b(0x12c)]('.'))continue;if(_0x4b021b[_0x34ff0b(0x138)](_0xedc8d9[_0x34ff0b(0x110)]))continue;const _0x164d32=join(_0x3cba29,_0x4b021b),_0xd4cbf3=await stat(_0x164d32);_0xd4cbf3['isDirectory']()&&existsSync(_0xedc8d9[_0x34ff0b(0x149)](join,_0x164d32,'settings.json'))&&(!_0x1ec509[_0x34ff0b(0x141)](_0x4b021b)&&(_0x1ec509[_0x34ff0b(0x12a)](_0x4b021b),_0x3f55d3[_0x4b021b]='legacy'));}return{'envNames':_0x1ec509,'activeEnv':_0x15a12f,'envTypes':_0x3f55d3};}export async function envList(){const _0x4ca39f=_0x3b176e,_0xe7b2f9={'qQqeL':'no\x20session','bzcOI':function(_0x136551){return _0x136551();},'qVyso':function(_0x5a9cfa){return _0x5a9cfa();},'CBMyO':function(_0x4d3c78,_0x18d6db){return _0x4d3c78 instanceof _0x18d6db;},'ZhZmf':function(_0x843be7,_0x3c754c){return _0x843be7===_0x3c754c;},'fStkr':'\x0aNo\x20profiles\x20found.','OLEdz':_0x4ca39f(0x13d),'jqTxW':function(_0x49ee8f,_0x2fd329){return _0x49ee8f(_0x2fd329);},'VpfQw':function(_0x57bcce,_0x9be456){return _0x57bcce(_0x9be456);},'gyyWM':function(_0x5a5898,_0x4092aa,_0x27da01){return _0x5a5898(_0x4092aa,_0x27da01);},'fofnI':function(_0x439955,_0x42c05d){return _0x439955===_0x42c05d;},'FanZh':function(_0x4d64ed,_0x3327a5){return _0x4d64ed>_0x3327a5;},'vDElX':function(_0xd36163,_0x393d53){return _0xd36163(_0x393d53);},'hSBnI':function(_0x3d37e3,_0xa9cc87){return _0x3d37e3(_0xa9cc87);},'bTsvl':_0x4ca39f(0x14d),'DbtgT':function(_0x1dc20b,_0x2b6528,_0x54c683){return _0x1dc20b(_0x2b6528,_0x54c683);},'qyPCK':'\x20\x20\x20\x20','WVBVN':_0x4ca39f(0x112)},{envNames:_0x32415a,activeEnv:_0x27e231,envTypes:_0x1cd532}=await getEnvNames();let _0x4541a2=[],_0x1ddd4e=new Map();const _0x210d1f=await _0xe7b2f9['bzcOI'](getToken);if(_0x210d1f)try{_0x4541a2=await _0xe7b2f9[_0x4ca39f(0x123)](listCloudProfiles),_0x1ddd4e=await loadCloudProfileListUrls(_0x4541a2);}catch(_0x40b464){console['error'](_0x4ca39f(0x144)+(_0xe7b2f9[_0x4ca39f(0x137)](_0x40b464,Error)?_0x40b464['message']:String(_0x40b464)));}if(_0x32415a[_0x4ca39f(0x13f)]===0x0&&_0xe7b2f9['ZhZmf'](_0x4541a2['length'],0x0)){console['log'](_0xe7b2f9['fStkr']),console[_0x4ca39f(0x117)](_0xe7b2f9['OLEdz']);return;}const _0x2aed63=new Set(_0x4541a2['map'](_0x331169=>_0x331169[_0x4ca39f(0x151)]));if(_0x32415a[_0x4ca39f(0x13f)]>0x0){console[_0x4ca39f(0x117)]('\x0aLocal\x20Profiles\x20(legacy):');for(const _0x55e9af of _0x32415a[_0x4ca39f(0x139)]()){const _0x1ae10e=_0xe7b2f9[_0x4ca39f(0x122)](_0x55e9af,_0x27e231)&&!_0x2aed63[_0x4ca39f(0x14c)](_0x55e9af),_0x8d85f4=_0x1cd532[_0x55e9af]||_0x4ca39f(0x125),_0x1df4fa=await _0xe7b2f9[_0x4ca39f(0x128)](loadSettings,_0x55e9af),_0x2a8757=_0xe7b2f9['VpfQw'](resolveProfileUrl,{'localSettingsBaseUrl':expandString(_0x1df4fa['baseUrl']),'projectOverrides':expandProfileOverrides(_0xe7b2f9[_0x4ca39f(0x10f)](readProfileOverrides,process[_0x4ca39f(0x121)](),_0x55e9af))}),_0x2e1a63=_0xe7b2f9['fofnI'](_0x8d85f4,_0x4ca39f(0x115))?'':'\x20['+_0x8d85f4+']';console[_0x4ca39f(0x117)]('\x20\x20'+(_0x1ae10e?'*\x20':'\x20\x20')+_0x55e9af+_0x2e1a63),_0x2a8757['baseUrl']&&console['log'](_0x4ca39f(0x145)+_0x2a8757[_0x4ca39f(0x124)]),_0x1df4fa[_0x4ca39f(0x140)]&&console['log'](_0x4ca39f(0x120)+_0x1df4fa['environmentDetails']);}}const _0x143e45=(_0x4e8b7d,_0x2e1baa)=>{const _0x41c128=_0x4ca39f,_0x3f2150=_0x4e8b7d['name']===_0x27e231,_0xdb6a61=_0x4e8b7d[_0x41c128(0x11b)]?_0x41c128(0x133)+_0x4e8b7d[_0x41c128(0x11b)]+')':_0xe7b2f9[_0x41c128(0x14b)],_0x42f6f0=_0x1ddd4e[_0x41c128(0x13e)](_0x4e8b7d['name']);console[_0x41c128(0x117)](''+_0x2e1baa+(_0x3f2150?'*\x20':'\x20\x20')+_0x4e8b7d[_0x41c128(0x151)]),_0x42f6f0?.[_0x41c128(0x124)]&&console['log'](_0x2e1baa+'\x20\x20\x20\x20URL:\x20'+_0x42f6f0[_0x41c128(0x124)]),console[_0x41c128(0x117)](_0x2e1baa+'\x20\x20\x20\x20Session:\x20'+_0xdb6a61);};if(_0xe7b2f9['FanZh'](_0x4541a2['length'],0x0)){if(_0xe7b2f9['vDElX'](shouldGroupByEnvironment,_0x4541a2)){console['log']('\x0aCloud\x20Profiles\x20(by\x20environment):');for(const _0x3e04af of _0xe7b2f9[_0x4ca39f(0x148)](groupCloudProfilesByEnvironment,_0x4541a2)){const _0x30f3cc=_0x3e04af['environmentKey']??_0xe7b2f9[_0x4ca39f(0x129)];console['log'](_0x4ca39f(0x130)+_0x30f3cc);for(const _0x139029 of _0x3e04af[_0x4ca39f(0x12d)]){_0xe7b2f9[_0x4ca39f(0x14e)](_0x143e45,_0x139029,_0xe7b2f9['qyPCK']);}}}else{console['log'](_0xe7b2f9[_0x4ca39f(0x113)]);for(const _0x58569d of[..._0x4541a2]['sort']((_0x4125d0,_0x3c9198)=>_0x4125d0['name'][_0x4ca39f(0x142)](_0x3c9198[_0x4ca39f(0x151)]))){_0x143e45(_0x58569d,'\x20\x20');}}}_0x27e231&&console['log']('\x0a*\x20=\x20active\x20profile');}
|