@ranger-testing/ranger-cli 3.0.1-alpha.f6aba6c-32 → 3.1.0
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/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 -0
- 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 +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x315adf=_0x1074;function _0x1074(_0x54eb06,_0x2ffd39){_0x54eb06=_0x54eb06-0x137;const _0xb6feff=_0xb6fe();let _0x10747d=_0xb6feff[_0x54eb06];return _0x10747d;}(function(_0x3e9fa3,_0x3efa08){const _0x2a3816=_0x1074,_0x4c4d9c=_0x3e9fa3();while(!![]){try{const _0x2b44b5=parseInt(_0x2a3816(0x183))/0x1*(-parseInt(_0x2a3816(0x1ad))/0x2)+parseInt(_0x2a3816(0x1a5))/0x3*(parseInt(_0x2a3816(0x196))/0x4)+-parseInt(_0x2a3816(0x15e))/0x5*(parseInt(_0x2a3816(0x1ae))/0x6)+parseInt(_0x2a3816(0x190))/0x7*(-parseInt(_0x2a3816(0x180))/0x8)+-parseInt(_0x2a3816(0x157))/0x9+parseInt(_0x2a3816(0x177))/0xa+parseInt(_0x2a3816(0x161))/0xb;if(_0x2b44b5===_0x3efa08)break;else _0x4c4d9c['push'](_0x4c4d9c['shift']());}catch(_0x4a3192){_0x4c4d9c['push'](_0x4c4d9c['shift']());}}}(_0xb6fe,0x1f814));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x4beffa from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x3749a2={'DVAxv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x10028c=await getToken();if(!_0x10028c)throw new Error(_0x3749a2['DVAxv']);return _0x10028c;}async function apiRequest(_0x37d2dc,_0x42d2a3={}){const _0x47155e=_0x1074,_0x539087={'mdkSK':function(_0x48c8a3){return _0x48c8a3();}},_0x3eb5d0=await _0x539087[_0x47155e(0x148)](requireToken),_0x28bed3=getApiBaseUrl(),_0x2d61ac=await fetch(''+_0x28bed3+_0x37d2dc,{..._0x42d2a3,'headers':{'Authorization':'Bearer\x20'+_0x3eb5d0,'Content-Type':_0x47155e(0x169),..._0x42d2a3['headers']??{}}});if(!_0x2d61ac['ok']){let _0x23ab55='',_0x4eaea2;try{const _0x5885f9=await _0x2d61ac['json']();_0x23ab55=(typeof _0x5885f9[_0x47155e(0x17a)]==='string'?_0x5885f9[_0x47155e(0x17a)]:undefined)??JSON['stringify'](_0x5885f9);if(typeof _0x5885f9[_0x47155e(0x141)]===_0x47155e(0x19f))_0x4eaea2=_0x5885f9['code'];}catch{_0x23ab55=_0x2d61ac[_0x47155e(0x1af)];}throw new ApiError(_0x47155e(0x16b)+_0x37d2dc+_0x47155e(0x138)+_0x2d61ac[_0x47155e(0x16d)]+_0x47155e(0x145)+_0x23ab55,_0x2d61ac[_0x47155e(0x16d)],_0x23ab55,_0x4eaea2);}if(_0x2d61ac[_0x47155e(0x16d)]===0xcc)return undefined;return _0x2d61ac['json']();}export class ApiError extends Error{[_0x315adf(0x16d)];[_0x315adf(0x1a1)];['code'];constructor(_0x357505,_0x346e8c,_0x44efd6,_0x68dfb5){const _0x2a6ab0=_0x315adf,_0x44c0b6={'JOdYS':_0x2a6ab0(0x172)};super(_0x357505),this[_0x2a6ab0(0x16d)]=_0x346e8c,this[_0x2a6ab0(0x1a1)]=_0x44efd6,this['code']=_0x68dfb5,this[_0x2a6ab0(0x19e)]=_0x44c0b6[_0x2a6ab0(0x174)];}}export async function fetchCloudProfile(_0x5dc9dd){const _0x57340f=_0x315adf,_0x3ad3fe={'Yfctp':function(_0x3a6d35,_0x183815){return _0x3a6d35(_0x183815);},'eNgOX':function(_0x5c31a2,_0x274a89){return _0x5c31a2 instanceof _0x274a89;}};try{return await _0x3ad3fe['Yfctp'](apiRequest,_0x57340f(0x176)+encodeURIComponent(_0x5dc9dd));}catch(_0x493d7b){if(_0x3ad3fe[_0x57340f(0x184)](_0x493d7b,ApiError)&&_0x493d7b['status']===0x194)return null;throw _0x493d7b;}}export async function listCloudProfiles(){const _0x12f273=_0x315adf,_0x8ea989=await apiRequest(_0x12f273(0x19d));return _0x8ea989[_0x12f273(0x186)];}export async function deleteCloudProfile(_0x5e89fd){const _0x4d21b0=_0x315adf,_0x2464eb={'jfNeL':function(_0x4d024b,_0x5e0a49,_0x514bce){return _0x4d024b(_0x5e0a49,_0x514bce);},'UPRWr':function(_0x1e0af0,_0x52b4d1){return _0x1e0af0(_0x52b4d1);},'YqrEl':_0x4d21b0(0x18e),'bmwSK':function(_0x321d76,_0x4b10b9){return _0x321d76===_0x4b10b9;}};try{await _0x2464eb['jfNeL'](apiRequest,_0x4d21b0(0x176)+_0x2464eb['UPRWr'](encodeURIComponent,_0x5e89fd),{'method':_0x2464eb['YqrEl']});}catch(_0x5b2b4e){if(_0x5b2b4e instanceof ApiError&&_0x2464eb[_0x4d21b0(0x165)](_0x5b2b4e['status'],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0x5e89fd+'\x22\x20not\x20found.');throw _0x5b2b4e;}}export async function createCloudProfile(_0x5121ed,_0x46b863,_0x3d1b79={}){const _0xb96092=_0x315adf,_0x2d7db1={'name':_0x5121ed};if(_0x46b863)_0x2d7db1[_0xb96092(0x1a7)]=_0x46b863;_0x3d1b79[_0xb96092(0x14c)]&&Object[_0xb96092(0x13f)](_0x3d1b79[_0xb96092(0x14c)])['length']>0x0&&(_0x2d7db1[_0xb96092(0x14c)]=_0x3d1b79[_0xb96092(0x14c)]);if(_0x3d1b79[_0xb96092(0x167)])_0x2d7db1['username']=_0x3d1b79[_0xb96092(0x167)];if(_0x3d1b79[_0xb96092(0x13a)])_0x2d7db1[_0xb96092(0x13a)]=_0x3d1b79['password'];return await apiRequest(_0xb96092(0x19d),{'method':'POST','body':JSON['stringify'](_0x2d7db1)});}export async function uploadCloudProfileSession(_0x817fd9,_0x301a70){const _0xc88e99=_0x315adf,_0x4eee0b={'NsvtT':function(_0x4d6ce2,_0x29c650,_0x57d805){return _0x4d6ce2(_0x29c650,_0x57d805);},'vKebu':_0xc88e99(0x1b0)};return await _0x4eee0b['NsvtT'](apiRequest,_0xc88e99(0x176)+encodeURIComponent(_0x817fd9)+'/session',{'method':_0x4eee0b[_0xc88e99(0x151)],'body':JSON['stringify']({'session_state':_0x301a70})});}export async function saveCloudProfileCredentials(_0x1d8372,_0x48bad8,_0x3c0ff9){const _0x15f387=_0x315adf,_0x1a5710={'lLfnv':function(_0x29cdc5,_0x2f90c2,_0x41e1){return _0x29cdc5(_0x2f90c2,_0x41e1);},'xhguM':function(_0x45cea5,_0xb37103){return _0x45cea5(_0xb37103);}};await _0x1a5710[_0x15f387(0x168)](apiRequest,_0x15f387(0x176)+_0x1a5710[_0x15f387(0x15a)](encodeURIComponent,_0x1d8372),{'method':_0x15f387(0x162),'body':JSON['stringify']({'username':_0x48bad8,'password':_0x3c0ff9})});}export async function fetchAuthConfig(){const _0x40d91a=_0x315adf,_0x3f405c={'pbFQo':function(_0x29870f,_0x40d8f8){return _0x29870f instanceof _0x40d8f8;},'YuRhE':function(_0xaefc6f,_0x5c8d4b){return _0xaefc6f!==_0x5c8d4b;}};try{const _0x51a802=await apiRequest('/api/v1/profiles/auth-config');return _0x51a802[_0x40d91a(0x147)];}catch(_0x331c54){return _0x3f405c['pbFQo'](_0x331c54,ApiError)&&_0x3f405c[_0x40d91a(0x158)](_0x331c54['status'],0x194)&&console['error']('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x331c54['message']),null;}}export function pickAdHocEnvKey(_0x8dfbcd){const _0x28121e=_0x315adf,_0x2ae096={'mFIeL':function(_0x2beea7,_0x4c1822){return _0x2beea7===_0x4c1822;},'DuLlm':function(_0x57ba33,_0x4d8cc1){return _0x57ba33+_0x4d8cc1;}};if(!_0x8dfbcd)return null;if(_0x8dfbcd[_0x28121e(0x164)])return _0x8dfbcd['defaultEnvironmentKey'];const _0x54aae4=Object['keys'](_0x8dfbcd[_0x28121e(0x149)]??{});if(_0x54aae4[_0x28121e(0x17c)]===0x1)return _0x54aae4[0x0];if(_0x2ae096[_0x28121e(0x18a)](_0x54aae4[_0x28121e(0x17c)],0x0))return null;throw new Error(_0x2ae096['DuLlm'](_0x28121e(0x194)+_0x54aae4[_0x28121e(0x19a)](',\x20')+_0x28121e(0x199),'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.'));}export async function resolveAdHocProfile(_0x1a5eb8=process['env']){const _0x1bb4cd=_0x315adf,_0x26d562={'WFhyK':function(_0xe7ab5e,_0x31ddf7){return _0xe7ab5e(_0x31ddf7);},'HQOdC':function(_0x30da12){return _0x30da12();},'ZvSlq':function(_0xba023d,_0x4900b1,_0x17a001,_0x81f225){return _0xba023d(_0x4900b1,_0x17a001,_0x81f225);},'fydDC':function(_0x54edc9,_0x2547d8){return _0x54edc9??_0x2547d8;}},_0xb052ac=_0x1a5eb8['RANGER_TEST_USERNAME'];if(!_0xb052ac)return null;const _0x3f5561=await _0x26d562[_0x1bb4cd(0x18d)](fetchCloudProfile,_0xb052ac);if(_0x3f5561)return{'name':_0x3f5561[_0x1bb4cd(0x19e)],'profile':_0x3f5561};const _0x33390a=await _0x26d562['HQOdC'](fetchAuthConfig),_0x18693b=pickAdHocEnvKey(_0x33390a),_0x4660dc=_0x1a5eb8[_0x1bb4cd(0x163)],_0x2a8bc5=await _0x26d562[_0x1bb4cd(0x159)](createCloudProfile,_0xb052ac,_0x26d562[_0x1bb4cd(0x171)](_0x18693b,undefined),{'username':_0xb052ac,'password':_0x4660dc});return console[_0x1bb4cd(0x192)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x2a8bc5['name']+'\x22\x20for\x20'+_0xb052ac),{'name':_0x2a8bc5['name'],'profile':_0x2a8bc5};}export async function writeSessionToLocalCache(_0xce10f4,_0x538edf,_0x1acda2,_0x37dbd9,_0x5f29f0,_0xc52809,_0x410c74){const _0x2f2e63=_0x315adf,_0x1002ba={'jHVOw':function(_0x41b6e2){return _0x41b6e2();},'xHItb':'auth','lGZEb':function(_0x590f8d,_0x3e0f1b){return _0x590f8d(_0x3e0f1b);},'qnrmV':function(_0xc91544,_0x5e8f4a,_0x1bc7d3){return _0xc91544(_0x5e8f4a,_0x1bc7d3);},'Tpyqa':function(_0x552bbe,_0x48227e,_0x423780){return _0x552bbe(_0x48227e,_0x423780);}},_0x13b932=sessionCacheHash({'orgId':_0x538edf,'profileName':_0xce10f4,'effectiveBaseUrl':_0x1acda2,'setupHeaders':_0x37dbd9,'invalidateOn':_0x410c74?.['invalidateOn'],'userAgent':_0x410c74?.[_0x2f2e63(0x14f)],'clientIp':_0x410c74?.['clientIp']}),_0x2685ec=getSessionCachePath(_0x13b932,_0xce10f4),_0x234bb5=join(_0x1002ba['jHVOw'](getRangerHomeDir),_0x1002ba[_0x2f2e63(0x1a0)]);!_0x1002ba['lGZEb'](existsSync,_0x234bb5)&&await mkdir(_0x234bb5,{'recursive':!![]});const _0x4c65b2={..._0x5f29f0};_0xc52809&&_0xc52809[_0x2f2e63(0x17c)]>0x0&&Array['isArray'](_0x4c65b2[_0x2f2e63(0x155)])&&(_0x4c65b2['cookies']=_0x1002ba[_0x2f2e63(0x1ac)](duplicateCookiesForDomains,_0x4c65b2[_0x2f2e63(0x155)],_0xc52809));const _0x341c71={'cached_at':new Date()[_0x2f2e63(0x14d)](),'session_state':_0x4c65b2};await _0x1002ba[_0x2f2e63(0x144)](writeFile,_0x2685ec,JSON['stringify'](_0x341c71,null,0x2));const _0x32a4f9=getStorageStatePath(_0x2685ec);return await writeFile(_0x32a4f9,JSON['stringify'](_0x4c65b2,null,0x2)),_0x32a4f9;}export async function checkLocalCache(_0x1516ef,_0x21c4c9,_0x3de57b,_0x58e4fb,_0x17e045){const _0x962b63=_0x315adf,_0x53baa7={'hALFK':function(_0x5d017a,_0x22861b){return _0x5d017a(_0x22861b);},'KnLaw':function(_0x4ff9df,_0x4828ce){return _0x4ff9df(_0x4828ce);}},_0x56d52a=_0x53baa7[_0x962b63(0x197)](sessionCacheHash,{'orgId':_0x21c4c9,'profileName':_0x1516ef,'effectiveBaseUrl':_0x3de57b,'setupHeaders':_0x58e4fb,'invalidateOn':_0x17e045?.[_0x962b63(0x140)],'userAgent':_0x17e045?.['userAgent'],'clientIp':_0x17e045?.['clientIp']}),_0x32af86=getSessionCachePath(_0x56d52a,_0x1516ef),_0x42d7bd=_0x53baa7['hALFK'](getStorageStatePath,_0x32af86);if(!existsSync(_0x32af86)||!_0x53baa7['KnLaw'](existsSync,_0x42d7bd))return null;try{const _0x4f4306=await readFile(_0x32af86,_0x962b63(0x1a4));return JSON[_0x962b63(0x1a2)](_0x4f4306),{'storageStatePath':_0x42d7bd};}catch{return null;}}function launchRealBrowser(){const _0x27e6d7=_0x315adf;return chromium[_0x27e6d7(0x153)]({'headless':!![]});}function emitSessionValidationHint(_0x23b656,_0x23160d){const _0x1dac29=_0x315adf,_0x100500={'MBZqj':function(_0x5743fb,_0x2d02f4){return _0x5743fb+_0x2d02f4;}};if(!_0x23160d||!_0x23160d['domains']?.['length'])return;let _0x1295d5;try{_0x1295d5=new URL(_0x23b656);}catch{return;}const _0x4a1333=[];for(const _0x2a6b6f of _0x23160d[_0x1dac29(0x187)]){try{_0x4a1333[_0x1dac29(0x193)]({'raw':_0x2a6b6f,'url':new URL(_0x2a6b6f)});}catch{}}if(_0x4a1333['length']===0x0)return;if(_0x4a1333['some'](_0x539212=>_0x539212[_0x1dac29(0x179)]['origin']===_0x1295d5[_0x1dac29(0x13d)]))return;const _0x3c7933=_0x4a1333[_0x1dac29(0x175)](_0x4f7e3c=>'\x22'+_0x4f7e3c[_0x1dac29(0x170)]+'\x22')[_0x1dac29(0x19a)](',\x20');console[_0x1dac29(0x192)](_0x100500['MBZqj']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x3c7933+';\x20'+(_0x1dac29(0x16e)+_0x23b656+_0x1dac29(0x14a)),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x54d656,_0x16fb22){const _0x35827b=_0x315adf,_0x2a5d53={'kaADs':'POST','VTJQo':function(_0x5d877d,_0x48f5fb){return _0x5d877d instanceof _0x48f5fb;}},_0x462a5d=process[_0x35827b(0x152)][_0x35827b(0x195)],_0x1e7f58=process['env']['RANGER_TEST_PASSWORD'],_0x30403b={};if(_0x462a5d)_0x30403b[_0x35827b(0x167)]=_0x462a5d;if(_0x1e7f58)_0x30403b['password']=_0x1e7f58;if(_0x16fb22?.[_0x35827b(0x15b)])_0x30403b[_0x35827b(0x15b)]=!![];try{return await apiRequest(_0x35827b(0x176)+encodeURIComponent(_0x54d656)+_0x35827b(0x160),{'method':_0x2a5d53['kaADs'],'body':JSON['stringify'](_0x30403b)});}catch(_0xfe4db4){if(_0x2a5d53[_0x35827b(0x146)](_0xfe4db4,ApiError)&&_0xfe4db4[_0x35827b(0x16d)]===0x190&&_0xfe4db4[_0x35827b(0x141)]===_0x35827b(0x14b))return{'status':_0x35827b(0x14b),'error':_0xfe4db4[_0x35827b(0x1a1)]};throw _0xfe4db4;}}function _0xb6fe(){const _0x2c623b=['password','save','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','origin','FMmOy','keys','invalidateOn','code','DvsgN','\x22,\x20cached\x20locally','Tpyqa','):\x20','VTJQo','auth_config','mdkSK','environments','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','not_configured','settings','toISOString','organizationId','userAgent','stringify','vKebu','env','launch','environmentKey','cookies','extraHTTPHeaders','1888776uZhXFS','YuRhE','ZvSlq','xhguM','force','storageState','close','20kDCsCU','loginInstructions','/login','6740019SKVGAJ','PUT','RANGER_TEST_PASSWORD','defaultEnvironmentKey','bmwSK','QIfwk','username','lLfnv','application/json','about:blank','API\x20request\x20','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','status','you\x27re\x20now\x20at\x20\x22','confirm','raw','fydDC','ApiError','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','JOdYS','map','/api/v1/profiles/','844000ttJJel','baseUrl','url','error','storageStatePath','length','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','newPage','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','16SLksnr','sessionState','success','18427scXfmw','eNgOX','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','profiles','domains','setupHeaders','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','mFIeL','test_output','wkrjJ','WFhyK','DELETE','catch','848596iSHFjS','Browser\x20login\x20timed\x20out\x20after\x20','log','push','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','RANGER_TEST_USERNAME','62596AcHQuI','hALFK','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20',').\x20','join','tZivD','FXFSW','/api/v1/profiles','name','string','xHItb','detail','parse','trim','utf-8','39EKmUkK','VqROV','environment_key','MEYeU','\x22,\x20attempting\x20login...','bUPpf','/session','qnrmV','20bxKMRg','202398cbTWAP','statusText','POST','umCFc','RqOmM','\x20failed\x20(','DBRNZ'];_0xb6fe=function(){return _0x2c623b;};return _0xb6fe();}export async function manualBrowserLogin(_0x16feee,_0x446f53){const _0x1b686e=_0x315adf,_0x30d91a={'sXCli':function(_0x55a40f){return _0x55a40f();},'TKxfr':function(_0x4328d9,_0x2ee085){return _0x4328d9+_0x2ee085;},'VqROV':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','YjgWY':'\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','FMmOy':function(_0x1cd8d6,_0x462ae3){return _0x1cd8d6(_0x462ae3);},'OWWjd':function(_0x103a81,_0x519ecd){return _0x103a81&&_0x519ecd;},'TjRZZ':_0x1b686e(0x13c),'xYRtB':'cli:manual-login'};if(!isInteractive())throw new Error(_0x30d91a['TKxfr']('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x16feee[_0x1b686e(0x19e)]+'\x22.\x0a'+_0x1b686e(0x198),_0x30d91a[_0x1b686e(0x1a6)]));const _0x57061e=_0x446f53&&_0x446f53[_0x1b686e(0x187)][_0x1b686e(0x17c)]>0x0?_0x446f53[_0x1b686e(0x187)][0x0]:_0x1b686e(0x16a);console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log'](_0x30d91a['YjgWY']),await new Promise(_0x42a822=>setTimeout(_0x42a822,0x7d0));const _0x3a631a=await chromium[_0x1b686e(0x153)]({'headless':![]});let _0x47f29d=null;try{const _0x45927f={'ignoreHTTPSErrors':!![]};_0x446f53?.['setupHeaders']&&(_0x45927f[_0x1b686e(0x156)]=_0x446f53[_0x1b686e(0x188)]);const _0x52f37e=await _0x3a631a['newContext'](_0x45927f);await _0x30d91a[_0x1b686e(0x13e)](addProfileSetupBanner,_0x52f37e);const _0x1b85e1=await _0x52f37e[_0x1b686e(0x17e)]();await _0x1b85e1['goto'](_0x57061e);let _0x4ddbec=![];await new Promise(_0x54b9b9=>{const _0x14f9c5={'RqOmM':function(_0x56e425,_0x151f79){return _0x56e425/_0x151f79;},'gRrhh':function(_0x3a73fa){return _0x30d91a['sXCli'](_0x3a73fa);}},_0x23b33f=setTimeout(()=>{const _0x4b779e=_0x1074;_0x4ddbec=!![],console['error'](_0x4b779e(0x191)+_0x14f9c5[_0x4b779e(0x137)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x4b779e(0x16c)),_0x14f9c5['gRrhh'](_0x54b9b9);},MANUAL_LOGIN_TIMEOUT_MS);_0x1b85e1['on']('close',async()=>{const _0x1b3de3=_0x1074;clearTimeout(_0x23b33f);try{const _0x3172a3=await _0x52f37e[_0x1b3de3(0x15c)]();_0x47f29d=_0x3172a3;}catch{}_0x14f9c5['gRrhh'](_0x54b9b9);});});if(_0x30d91a['OWWjd'](_0x4ddbec,!_0x47f29d))throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0x3a631a[_0x1b686e(0x15d)]()[_0x1b686e(0x18f)](()=>{});}if(!_0x47f29d)throw new Error(_0x30d91a['TjRZZ']);return await apiRequest('/api/v1/profiles/'+_0x30d91a['FMmOy'](encodeURIComponent,_0x16feee[_0x1b686e(0x19e)])+_0x1b686e(0x1ab),{'method':'POST','body':JSON[_0x1b686e(0x150)]({'session_state':_0x47f29d,'updated_by':_0x30d91a['xYRtB']})}),{'sessionState':_0x47f29d};}export async function promptSaveCredentials(_0x49c491){const _0x220c8b=_0x315adf,_0x7831a={'FXFSW':_0x220c8b(0x16f),'ouQfL':_0x220c8b(0x13b),'wkrjJ':'PUT','uBiJa':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0x391d25=process[_0x220c8b(0x152)]['RANGER_TEST_USERNAME'],_0x345aec=process['env'][_0x220c8b(0x163)];if(!_0x391d25||!_0x345aec)return;if(!isInteractive())return;const {save:_0x4c3e4b}=await _0x4beffa['prompt']([{'type':_0x7831a[_0x220c8b(0x19c)],'name':_0x7831a['ouQfL'],'message':_0x220c8b(0x189),'default':![]}]);if(!_0x4c3e4b)return;await apiRequest(_0x220c8b(0x176)+encodeURIComponent(_0x49c491),{'method':_0x7831a[_0x220c8b(0x18c)],'body':JSON[_0x220c8b(0x150)]({'username':_0x391d25,'password':_0x345aec})}),console[_0x220c8b(0x192)](_0x7831a['uBiJa']);}export async function resolveCloudProfileSession(_0x54894e,_0xf4bcd2={}){const _0x44a981=_0x315adf,_0x3a41cf={'dpyDC':function(_0x3902d0){return _0x3902d0();},'bUPpf':function(_0x32fbbf,_0x31235a){return _0x32fbbf===_0x31235a;},'DBRNZ':function(_0x7a6d22,_0x5791ed){return _0x7a6d22===_0x5791ed;},'umCFc':function(_0x3886cb,_0x29b4e5,_0x308615){return _0x3886cb(_0x29b4e5,_0x308615);},'FJShN':function(_0x3a85a4,_0x253697,_0x2af7be,_0x3b9adb,_0x2196d1,_0x259705,_0x30a880,_0x481ce2){return _0x3a85a4(_0x253697,_0x2af7be,_0x3b9adb,_0x2196d1,_0x259705,_0x30a880,_0x481ce2);},'eABYG':function(_0x1cca53,_0x49cf7b){return _0x1cca53(_0x49cf7b);},'MEYeU':function(_0x14574e,_0x393f84){return _0x14574e(_0x393f84);},'FLekg':_0x44a981(0x14b),'CXVZP':function(_0x3fb5c9,_0x263a5a){return _0x3fb5c9===_0x263a5a;},'tZivD':_0x44a981(0x182),'DvsgN':function(_0xc73303,_0x317488){return _0xc73303&&_0x317488;},'TlUKV':_0x44a981(0x17f),'QIfwk':_0x44a981(0x173)},_0x4e0b74=_0x54894e['settings']??{},_0x459deb=await _0x3a41cf['dpyDC'](fetchAuthConfig),_0x28af67=_0x459deb?resolveAuthEnvironmentLocally(_0x459deb,_0x54894e[_0x44a981(0x154)]):null,_0x3e21cd=_0x3a41cf[_0x44a981(0x1aa)](typeof _0x28af67?.[_0x44a981(0x15f)],_0x44a981(0x19f))&&_0x28af67[_0x44a981(0x15f)]['trim']()?_0x28af67[_0x44a981(0x15f)]:undefined,_0xc68751=_0x3a41cf[_0x44a981(0x139)](typeof _0x4e0b74['loginInstructions'],'string')&&_0x4e0b74[_0x44a981(0x15f)][_0x44a981(0x1a3)]()?_0x4e0b74['loginInstructions']:undefined,_0x388901=_0xc68751||!_0x3e21cd?_0x4e0b74:{..._0x4e0b74,'loginInstructions':_0x3e21cd},_0x5466fb=Boolean(_0x388901['loginInstructions']?.[_0x44a981(0x1a3)]()),_0xa598c7=_0x28af67?.['domains'],_0xb64c8f=_0x4e0b74[_0x44a981(0x188)],_0x135178=_0xb64c8f??_0x28af67?.['setupHeaders'],_0x5046dc=_0xf4bcd2['effectiveBaseUrl']??_0x4e0b74[_0x44a981(0x178)]??(_0xa598c7&&_0xa598c7['length']>0x0?_0xa598c7[0x0]:''),_0x3fecbc={'invalidateOn':_0x28af67?.[_0x44a981(0x140)],'userAgent':_0x28af67?.['browserOptions']?.[_0x44a981(0x14f)]??_0x4e0b74['userAgent']},_0x10859d=await checkLocalCache(_0x54894e[_0x44a981(0x19e)],_0x54894e[_0x44a981(0x14e)],_0x5046dc,_0x135178,_0x3fecbc);if(_0x10859d){if(_0x5046dc){const _0x37300e=await isCachedSessionLive(_0x10859d[_0x44a981(0x17b)],_0x5046dc,{'sessionCheckPath':_0x28af67?.['sessionCheckPath'],'setupHeaders':_0x135178},{'launchBrowser':launchRealBrowser});if(_0x37300e)return console[_0x44a981(0x192)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x54894e['name']+'\x22'),{'authPath':_0x10859d['storageStatePath'],'settings':_0x388901,'resolvedEnv':_0x28af67};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x54894e['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x3a41cf[_0x44a981(0x1b1)](emitSessionValidationHint,_0x5046dc,_0x28af67);}else return{'authPath':_0x10859d['storageStatePath'],'settings':_0x388901,'resolvedEnv':_0x28af67};}if(_0x54894e[_0x44a981(0x181)]){const _0x531992=await _0x3a41cf['FJShN'](writeSessionToLocalCache,_0x54894e[_0x44a981(0x19e)],_0x54894e[_0x44a981(0x14e)],_0x5046dc,_0x135178,_0x54894e['sessionState'],_0xa598c7,_0x3fecbc);if(_0x5046dc){const _0x1cde14=await isCachedSessionLive(_0x531992,_0x5046dc,{'sessionCheckPath':_0x28af67?.['sessionCheckPath'],'setupHeaders':_0x135178},{'launchBrowser':launchRealBrowser});if(_0x1cde14)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x54894e['name']+_0x44a981(0x143)),{'authPath':_0x531992,'settings':_0x388901,'resolvedEnv':_0x28af67};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x54894e['name']+_0x44a981(0x185)),emitSessionValidationHint(_0x5046dc,_0x28af67);}else return{'authPath':_0x531992,'settings':_0x388901,'resolvedEnv':_0x28af67};}if(_0x5466fb)return console[_0x44a981(0x192)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x54894e['name']+'\x22;\x20proceeding\x20with\x20loginInstructions.'),{'authPath':undefined,'settings':_0x388901,'resolvedEnv':_0x28af67};console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x54894e[_0x44a981(0x19e)]+_0x44a981(0x1a9));const _0x413fef=_0x3a41cf['eABYG'](Boolean,process[_0x44a981(0x152)][_0x44a981(0x195)])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x135b20=_0x3a41cf['MEYeU'](Boolean,_0x54894e[_0x44a981(0x167)]);if(_0x413fef||_0x135b20)try{const _0x8bc632=await serverSideLogin(_0x54894e['name']);if(_0x8bc632['status']===_0x3a41cf['FLekg'])console[_0x44a981(0x192)](_0x44a981(0x17d));else{if(_0x3a41cf['CXVZP'](_0x8bc632[_0x44a981(0x16d)],_0x3a41cf[_0x44a981(0x19b)])&&_0x8bc632['session_state']){console[_0x44a981(0x192)]('\x20\x20Login\x20successful.\x20Session\x20cached.');const _0x2168ca=await writeSessionToLocalCache(_0x54894e[_0x44a981(0x19e)],_0x54894e[_0x44a981(0x14e)],_0x5046dc,_0x135178,_0x8bc632['session_state'],_0xa598c7,_0x3fecbc);return _0x3a41cf[_0x44a981(0x142)](_0x413fef,!_0x135b20)&&await _0x3a41cf[_0x44a981(0x1a8)](promptSaveCredentials,_0x54894e[_0x44a981(0x19e)]),{'authPath':_0x2168ca,'settings':_0x388901,'resolvedEnv':_0x28af67};}else _0x8bc632[_0x44a981(0x18b)]&&(console['log'](_0x3a41cf['TlUKV']),console[_0x44a981(0x192)](_0x8bc632[_0x44a981(0x18b)])),console[_0x44a981(0x192)](_0x3a41cf[_0x44a981(0x166)]);}}catch(_0x58654c){console[_0x44a981(0x192)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x58654c instanceof Error?_0x58654c['message']:String(_0x58654c))),console['log'](_0x3a41cf['QIfwk']);}const {sessionState:_0x146ec4}=await manualBrowserLogin(_0x54894e,_0x28af67),_0x150767=await writeSessionToLocalCache(_0x54894e[_0x44a981(0x19e)],_0x54894e[_0x44a981(0x14e)],_0x5046dc,_0x135178,_0x146ec4,_0xa598c7,_0x3fecbc);return{'authPath':_0x150767,'settings':_0x388901,'resolvedEnv':_0x28af67};}
|
|
1
|
+
const _0x3a83a9=_0x20a5;(function(_0x53a4ba,_0x4ad983){const _0x1afb52=_0x20a5,_0x3e25b1=_0x53a4ba();while(!![]){try{const _0x42757c=-parseInt(_0x1afb52(0x16e))/0x1+-parseInt(_0x1afb52(0x112))/0x2+parseInt(_0x1afb52(0x164))/0x3*(parseInt(_0x1afb52(0x10e))/0x4)+-parseInt(_0x1afb52(0x157))/0x5+-parseInt(_0x1afb52(0x136))/0x6*(parseInt(_0x1afb52(0xf4))/0x7)+parseInt(_0x1afb52(0x145))/0x8*(parseInt(_0x1afb52(0x12b))/0x9)+parseInt(_0x1afb52(0xf3))/0xa;if(_0x42757c===_0x4ad983)break;else _0x3e25b1['push'](_0x3e25b1['shift']());}catch(_0x4d86f2){_0x3e25b1['push'](_0x3e25b1['shift']());}}}(_0x9e98,0x4305e));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x1ab9dd from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';function _0x9e98(){const _0x434d70=['\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','iyCjJ','/api/v1/profiles/','qZUoV','RANGER_TEST_USERNAME','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','username','DELETE','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','220370xUGxCY','toISOString','organizationId','xoZfk','string','uAyJu','effectiveBaseUrl','detail','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','iOBZO','kVVik','\x20\x20Created\x20cloud\x20profile\x20\x22',').\x20','103227RMYJRZ','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','error','\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22','defaultEnvironmentKey','\x22;\x20proceeding\x20with\x20loginInstructions.','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','Bearer\x20','KXJfh','settings','136520NZBqCq','/api/v1/tunnel/sessions/','Cloud\x20profile\x20\x22','aoDIq','name','\x20failed\x20(','cBbvp','trim','IoBPJ','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','code','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','parse','HxARj','rfgOd','persistSessionState','save','8154900OtZflg','124432ZsyxKs','sessionCheckPath','auth','zISbG','\x22.\x0a','wxSPv','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','\x20\x20Server-side\x20login\x20error:\x20','tunnelUrl','json','RhYgW','\x22\x20not\x20found.','CfJFt','newContext','test_output','Jcadb','LNhxZ','FlZnk','Browser\x20login\x20timed\x20out\x20before\x20completion.','statusText','length','/api/v1/profiles','environments','close','log','agent','4bMhKyX','ZeKtM','/session','extraHTTPHeaders','800946jZQJXm','targetUrl','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','target_url','NYrmW','force','\x22\x20for\x20','origin','\x22,\x20refreshing\x20session...','not_configured','KBxUH','sessionId','\x20\x20No\x20live\x20session\x20for\x20\x22','DERsY','auWQO','browserOptions','\x22\x20on\x20profile\x20\x22','Hqnfe','status','setupHeaders','about:blank','KAsxg','session_state','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','userAgent','1625463VNnuRc','zQCOC','map','HkcwG','env','newPage','stringify','jcfKD','keys','pwEndpoint','RANGER_TEST_PASSWORD','120HxMqtO','POST','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ogarm','environmentKey','YyIvs','catch','loginInstructions','qvBpp','gXdDU','mLIGb','cookies','domains','KdPia','storageStatePath','16wWAZYV','YevbW','message','YccEc','tunnel','KcWgb','ztifs','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','baseUrl'];_0x9e98=function(){return _0x434d70;};return _0x9e98();}import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,needsTunnel,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x36f48c=_0x20a5,_0xe66665={'FlZnk':function(_0xe44b11){return _0xe44b11();},'CfJFt':_0x36f48c(0x138)},_0x5bec78=await _0xe66665[_0x36f48c(0x105)](getToken);if(!_0x5bec78)throw new Error(_0xe66665[_0x36f48c(0x100)]);return _0x5bec78;}async function apiRequest(_0x4f49ac,_0x43dd61={}){const _0x4b2347=_0x20a5,_0x3c2942={'KcWgb':function(_0x52c490){return _0x52c490();},'qZUoV':function(_0x318cf9){return _0x318cf9();},'jcfKD':'application/json','HxARj':function(_0x1a9063,_0x254f86){return _0x1a9063===_0x254f86;},'mLIGb':function(_0x2d591b,_0x3e03ae){return _0x2d591b===_0x3e03ae;}},_0x3e7ae9=await _0x3c2942[_0x4b2347(0x14a)](requireToken),_0x4910ff=_0x3c2942[_0x4b2347(0x151)](getApiBaseUrl),_0x3849da=await fetch(''+_0x4910ff+_0x4f49ac,{..._0x43dd61,'headers':{'Authorization':_0x4b2347(0x16b)+_0x3e7ae9,'Content-Type':_0x3c2942[_0x4b2347(0x132)],..._0x43dd61['headers']??{}}});if(!_0x3849da['ok']){let _0x3fe5ba='',_0x4366f4;try{const _0x29a282=await _0x3849da['json']();_0x3fe5ba=(_0x3c2942[_0x4b2347(0xef)](typeof _0x29a282[_0x4b2347(0x166)],'string')?_0x29a282['error']:undefined)??JSON['stringify'](_0x29a282);if(_0x3c2942[_0x4b2347(0x140)](typeof _0x29a282[_0x4b2347(0xec)],'string'))_0x4366f4=_0x29a282['code'];}catch{_0x3fe5ba=_0x3849da[_0x4b2347(0x107)];}throw new ApiError('API\x20request\x20'+_0x4f49ac+_0x4b2347(0x173)+_0x3849da[_0x4b2347(0x124)]+'):\x20'+_0x3fe5ba,_0x3849da['status'],_0x3fe5ba,_0x4366f4);}if(_0x3c2942['HxARj'](_0x3849da[_0x4b2347(0x124)],0xcc))return undefined;return _0x3849da[_0x4b2347(0xfd)]();}export class ApiError extends Error{['status'];[_0x3a83a9(0x15e)];[_0x3a83a9(0xec)];constructor(_0x22bcf7,_0x4f985f,_0x3bb6b1,_0x104038){const _0x3cc73a=_0x3a83a9;super(_0x22bcf7),this['status']=_0x4f985f,this['detail']=_0x3bb6b1,this['code']=_0x104038,this[_0x3cc73a(0x172)]='ApiError';}}export async function fetchCloudProfile(_0x54c843){const _0x5658ab=_0x3a83a9,_0x46b7c1={'yEyyg':function(_0xc57ff7,_0x111e5e){return _0xc57ff7(_0x111e5e);},'auWQO':function(_0x22c783,_0x34575a){return _0x22c783===_0x34575a;}};try{return await apiRequest('/api/v1/profiles/'+_0x46b7c1['yEyyg'](encodeURIComponent,_0x54c843));}catch(_0x3b3f53){if(_0x3b3f53 instanceof ApiError&&_0x46b7c1[_0x5658ab(0x120)](_0x3b3f53['status'],0x194))return null;throw _0x3b3f53;}}export async function listCloudProfiles(){const _0x164e6a=_0x3a83a9,_0x3e41f4=await apiRequest(_0x164e6a(0x109));return _0x3e41f4['profiles'];}export async function deleteCloudProfile(_0x560818){const _0x32590e=_0x3a83a9,_0x2b3b0d={'zmsez':function(_0x43b4e7,_0x55149f,_0x366303){return _0x43b4e7(_0x55149f,_0x366303);},'gaaGL':function(_0x2219fa,_0x238aef){return _0x2219fa===_0x238aef;}};try{await _0x2b3b0d['zmsez'](apiRequest,_0x32590e(0x150)+encodeURIComponent(_0x560818),{'method':_0x32590e(0x155)});}catch(_0x5351b4){if(_0x5351b4 instanceof ApiError&&_0x2b3b0d['gaaGL'](_0x5351b4['status'],0x194))throw new Error(_0x32590e(0x170)+_0x560818+_0x32590e(0xff));throw _0x5351b4;}}export async function createCloudProfile(_0x302484,_0x151dde,_0x5ae8bf={}){const _0x402c73=_0x3a83a9,_0x1f8430={'KorFY':function(_0x3a9400,_0x2cb1c4,_0x276a36){return _0x3a9400(_0x2cb1c4,_0x276a36);},'DpJDq':'/api/v1/profiles'},_0x4b6b72={'name':_0x302484};if(_0x151dde)_0x4b6b72['environment_key']=_0x151dde;_0x5ae8bf[_0x402c73(0x16d)]&&Object['keys'](_0x5ae8bf[_0x402c73(0x16d)])['length']>0x0&&(_0x4b6b72[_0x402c73(0x16d)]=_0x5ae8bf['settings']);if(_0x5ae8bf[_0x402c73(0x154)])_0x4b6b72['username']=_0x5ae8bf[_0x402c73(0x154)];if(_0x5ae8bf['password'])_0x4b6b72['password']=_0x5ae8bf['password'];return await _0x1f8430['KorFY'](apiRequest,_0x1f8430['DpJDq'],{'method':'POST','body':JSON['stringify'](_0x4b6b72)});}export async function uploadCloudProfileSession(_0x3d852f,_0x247e28){const _0x1b1e71=_0x3a83a9,_0x59799b={'zQCOC':function(_0x3fbd13,_0x5d1f2a,_0x492eed){return _0x3fbd13(_0x5d1f2a,_0x492eed);},'lxmrA':'POST'};return await _0x59799b[_0x1b1e71(0x12c)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x3d852f)+_0x1b1e71(0x110),{'method':_0x59799b['lxmrA'],'body':JSON['stringify']({'session_state':_0x247e28})});}export async function saveCloudProfileCredentials(_0x3dbce8,_0x4fbc64,_0x1fc80c){const _0x1593b8={'eRiKo':function(_0x3acfaa,_0x2ca21d){return _0x3acfaa(_0x2ca21d);}};await apiRequest('/api/v1/profiles/'+_0x1593b8['eRiKo'](encodeURIComponent,_0x3dbce8),{'method':'PUT','body':JSON['stringify']({'username':_0x4fbc64,'password':_0x1fc80c})});}function _0x20a5(_0x32c190,_0x27ee43){_0x32c190=_0x32c190-0xec;const _0x9e982=_0x9e98();let _0x20a54a=_0x9e982[_0x32c190];return _0x20a54a;}export async function fetchAuthConfig(){const _0x4ef02e=_0x3a83a9,_0x2953ec={'ztifs':'/api/v1/profiles/auth-config'};try{const _0x20e8a6=await apiRequest(_0x2953ec[_0x4ef02e(0x14b)]);return _0x20e8a6['auth_config'];}catch(_0x175fb3){return _0x175fb3 instanceof ApiError&&_0x175fb3[_0x4ef02e(0x124)]!==0x194&&console[_0x4ef02e(0x166)](_0x4ef02e(0x14c)+_0x175fb3[_0x4ef02e(0x147)]),null;}}async function createTunnelSession(_0x59df70){const _0x5e0072=_0x3a83a9,_0x54afa1={'dpVjA':'/api/v1/tunnel/sessions','dkfoR':'POST'};return await apiRequest(_0x54afa1['dpVjA'],{'method':_0x54afa1['dkfoR'],'body':JSON[_0x5e0072(0x131)]({'targetUrl':_0x59df70,'mode':_0x5e0072(0x10d)})});}async function deleteTunnelSession(_0x2a4ff2){const _0x325d21=_0x3a83a9,_0x1e6101={'rzjSz':function(_0x55865a,_0x43127e,_0xcb536){return _0x55865a(_0x43127e,_0xcb536);}};await _0x1e6101['rzjSz'](apiRequest,_0x325d21(0x16f)+_0x2a4ff2,{'method':'DELETE'});}export function pickAdHocEnvKey(_0x1293f1){const _0xc5aab0=_0x3a83a9,_0x1482b1={'iyCjJ':function(_0xa060d4,_0x5c4ab4){return _0xa060d4===_0x5c4ab4;}};if(!_0x1293f1)return null;if(_0x1293f1[_0xc5aab0(0x168)])return _0x1293f1[_0xc5aab0(0x168)];const _0x5e2047=Object[_0xc5aab0(0x133)](_0x1293f1[_0xc5aab0(0x10a)]??{});if(_0x1482b1[_0xc5aab0(0x14f)](_0x5e2047['length'],0x1))return _0x5e2047[0x0];if(_0x1482b1[_0xc5aab0(0x14f)](_0x5e2047[_0xc5aab0(0x108)],0x0))return null;throw new Error('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x5e2047['join'](',\x20')+_0xc5aab0(0x163)+'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.');}export async function resolveAdHocProfile(_0x86772b=process[_0x3a83a9(0x12f)]){const _0x327eb0=_0x3a83a9,_0x282cd8={'YccEc':function(_0x4a2a57,_0xfdb744){return _0x4a2a57(_0xfdb744);},'IoBPJ':function(_0x1986cd,_0x9a2a1,_0x586430,_0x55a88c){return _0x1986cd(_0x9a2a1,_0x586430,_0x55a88c);}},_0x2bf704=_0x86772b['RANGER_TEST_USERNAME'];if(!_0x2bf704)return null;const _0x5c7ec0=await fetchCloudProfile(_0x2bf704);if(_0x5c7ec0)return{'name':_0x5c7ec0['name'],'profile':_0x5c7ec0};const _0x305c4c=await fetchAuthConfig(),_0x2cddfe=_0x282cd8[_0x327eb0(0x148)](pickAdHocEnvKey,_0x305c4c),_0x3aec18=_0x86772b[_0x327eb0(0x135)],_0x1faedc=await _0x282cd8[_0x327eb0(0x176)](createCloudProfile,_0x2bf704,_0x2cddfe??undefined,{'username':_0x2bf704,'password':_0x3aec18});return console[_0x327eb0(0x10c)](_0x327eb0(0x162)+_0x1faedc[_0x327eb0(0x172)]+_0x327eb0(0x118)+_0x2bf704),{'name':_0x1faedc[_0x327eb0(0x172)],'profile':_0x1faedc};}export async function writeSessionToLocalCache(_0x1536f6,_0x136ef8,_0x4d4d5b,_0x4f1a30,_0x56c02d,_0x481874,_0x57e82d){const _0x132082=_0x3a83a9,_0x15ff07={'LNhxZ':function(_0x11f36a,_0x2d61e2,_0x45aa7f){return _0x11f36a(_0x2d61e2,_0x45aa7f);},'BHTRQ':function(_0x4f82d8){return _0x4f82d8();},'JeyZE':function(_0x400d51,_0x3c9fa6){return _0x400d51(_0x3c9fa6);},'ZeKtM':function(_0x496f01,_0x4e9860,_0x2d6315){return _0x496f01(_0x4e9860,_0x2d6315);}},_0x417fc5=sessionCacheHash({'orgId':_0x136ef8,'profileName':_0x1536f6,'effectiveBaseUrl':_0x4d4d5b,'setupHeaders':_0x4f1a30,'invalidateOn':_0x57e82d?.['invalidateOn'],'userAgent':_0x57e82d?.[_0x132082(0x12a)],'clientIp':_0x57e82d?.['clientIp']}),_0x85bf5=getSessionCachePath(_0x417fc5,_0x1536f6),_0x4f7047=_0x15ff07['LNhxZ'](join,_0x15ff07['BHTRQ'](getRangerHomeDir),_0x132082(0xf6));!_0x15ff07['JeyZE'](existsSync,_0x4f7047)&&await _0x15ff07[_0x132082(0x10f)](mkdir,_0x4f7047,{'recursive':!![]});const _0xfc6e3d={..._0x56c02d};_0x481874&&_0x481874[_0x132082(0x108)]>0x0&&Array['isArray'](_0xfc6e3d[_0x132082(0x141)])&&(_0xfc6e3d[_0x132082(0x141)]=_0x15ff07[_0x132082(0x104)](duplicateCookiesForDomains,_0xfc6e3d[_0x132082(0x141)],_0x481874));const _0x104b0d={'cached_at':new Date()[_0x132082(0x158)](),'session_state':_0xfc6e3d};await _0x15ff07[_0x132082(0x104)](writeFile,_0x85bf5,JSON[_0x132082(0x131)](_0x104b0d,null,0x2));const _0x18d9ab=getStorageStatePath(_0x85bf5);return await _0x15ff07[_0x132082(0x10f)](writeFile,_0x18d9ab,JSON['stringify'](_0xfc6e3d,null,0x2)),_0x18d9ab;}export async function checkLocalCache(_0x54efcf,_0x59b59b,_0x302ef4,_0x50be82,_0x1083a2){const _0x11189f=_0x3a83a9,_0x2ff981={'zobMI':function(_0x4910e0,_0x33cf25){return _0x4910e0(_0x33cf25);},'uAyJu':function(_0x1fee21,_0x5198bc,_0x3e26fc){return _0x1fee21(_0x5198bc,_0x3e26fc);},'DERsY':function(_0x41b32e,_0x27b110){return _0x41b32e(_0x27b110);},'NYrmW':function(_0x6caad1,_0x8bfc5b,_0x19dae8){return _0x6caad1(_0x8bfc5b,_0x19dae8);},'oqfUd':'utf-8'},_0x5eb281=_0x2ff981['zobMI'](sessionCacheHash,{'orgId':_0x59b59b,'profileName':_0x54efcf,'effectiveBaseUrl':_0x302ef4,'setupHeaders':_0x50be82,'invalidateOn':_0x1083a2?.['invalidateOn'],'userAgent':_0x1083a2?.['userAgent'],'clientIp':_0x1083a2?.['clientIp']}),_0x50c83d=_0x2ff981[_0x11189f(0x15c)](getSessionCachePath,_0x5eb281,_0x54efcf),_0x47b90e=_0x2ff981[_0x11189f(0x11f)](getStorageStatePath,_0x50c83d);if(!existsSync(_0x50c83d)||!existsSync(_0x47b90e))return null;try{const _0x231e00=await _0x2ff981[_0x11189f(0x116)](readFile,_0x50c83d,_0x2ff981['oqfUd']);return JSON[_0x11189f(0xee)](_0x231e00),{'storageStatePath':_0x47b90e};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0xd9a7f3,_0x287431){const _0x7051f2=_0x3a83a9,_0x3dbee0={'yfbAK':function(_0x20fca0,_0x2f6a08){return _0x20fca0+_0x2f6a08;}};if(!_0x287431||!_0x287431[_0x7051f2(0x142)]?.[_0x7051f2(0x108)])return;let _0x3ec4bf;try{_0x3ec4bf=new URL(_0xd9a7f3);}catch{return;}const _0x3ee4b2=[];for(const _0x1bf349 of _0x287431[_0x7051f2(0x142)]){try{_0x3ee4b2['push']({'raw':_0x1bf349,'url':new URL(_0x1bf349)});}catch{}}if(_0x3ee4b2['length']===0x0)return;if(_0x3ee4b2['some'](_0x407cbd=>_0x407cbd['url'][_0x7051f2(0x119)]===_0x3ec4bf['origin']))return;const _0x4c5a7e=_0x3ee4b2[_0x7051f2(0x12d)](_0x4d20c1=>'\x22'+_0x4d20c1['raw']+'\x22')['join'](',\x20');console[_0x7051f2(0x10c)](_0x3dbee0['yfbAK'](_0x7051f2(0x16a)+_0x4c5a7e+';\x20','you\x27re\x20now\x20at\x20\x22'+_0xd9a7f3+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20')+_0x7051f2(0xed));}export async function serverSideLogin(_0x5618c4,_0x59b3c1){const _0x58ef2e=_0x3a83a9,_0x120cdc={'BDojl':function(_0x4671d1,_0x3f15ba,_0x5ecda6){return _0x4671d1(_0x3f15ba,_0x5ecda6);},'ogarm':_0x58ef2e(0x137)},_0x2f3843=process[_0x58ef2e(0x12f)][_0x58ef2e(0x152)],_0x213fc9=process[_0x58ef2e(0x12f)]['RANGER_TEST_PASSWORD'],_0x308500={};if(_0x2f3843)_0x308500[_0x58ef2e(0x154)]=_0x2f3843;if(_0x213fc9)_0x308500['password']=_0x213fc9;if(_0x59b3c1?.[_0x58ef2e(0x117)])_0x308500[_0x58ef2e(0x117)]=!![];if(_0x59b3c1?.[_0x58ef2e(0x113)])_0x308500[_0x58ef2e(0x115)]=_0x59b3c1[_0x58ef2e(0x113)];_0x59b3c1?.[_0x58ef2e(0x149)]&&(_0x308500['tunnel_session_id']=_0x59b3c1['tunnel'][_0x58ef2e(0x11d)],_0x308500['pw_endpoint']=_0x59b3c1[_0x58ef2e(0x149)]['pwEndpoint']);try{return await _0x120cdc['BDojl'](apiRequest,_0x58ef2e(0x150)+encodeURIComponent(_0x5618c4)+'/login',{'method':_0x120cdc[_0x58ef2e(0x139)],'body':JSON[_0x58ef2e(0x131)](_0x308500)});}catch(_0x26d4f1){if(_0x26d4f1 instanceof ApiError&&_0x26d4f1['status']===0x190&&_0x26d4f1[_0x58ef2e(0xec)]===_0x58ef2e(0x11b))return{'status':_0x58ef2e(0x11b),'error':_0x26d4f1['detail']};throw _0x26d4f1;}}async function serverSideLoginWithOptionalTunnel(_0x474ec2,_0x58addf,_0x26e980={}){const _0x489965=_0x3a83a9,_0x4b49b9={'cTpaA':function(_0x3a4f04,_0x3b36ab){return _0x3a4f04(_0x3b36ab);},'HkcwG':function(_0xe67c35){return _0xe67c35();}};if(!needsTunnel(_0x58addf))return await serverSideLogin(_0x474ec2,{'force':_0x26e980['force']});let _0x50e510=null,_0x2863a6=null,_0x882db=null;try{_0x50e510=await _0x4b49b9['cTpaA'](launchBrowserServer,{'headless':!![]}),_0x2863a6=await _0x4b49b9['cTpaA'](createTunnelSession,_0x58addf);const _0x2f783a=await _0x4b49b9[_0x489965(0x12e)](requireToken);return _0x882db=await createTunnelBridge({'localWsUrl':_0x50e510['wsEndpoint'],'tunnelServerUrl':_0x2863a6[_0x489965(0xfc)],'sessionId':_0x2863a6[_0x489965(0x11d)],'apiKey':_0x2f783a}),await serverSideLogin(_0x474ec2,{'force':_0x26e980[_0x489965(0x117)],'targetUrl':_0x58addf,'tunnel':{'sessionId':_0x2863a6['sessionId'],'pwEndpoint':_0x2863a6[_0x489965(0x134)]}});}finally{_0x882db?.['close'](),_0x50e510&&await _0x50e510[_0x489965(0x10b)]()[_0x489965(0x13c)](()=>{}),_0x2863a6&&await _0x4b49b9['cTpaA'](deleteTunnelSession,_0x2863a6[_0x489965(0x11d)])['catch'](()=>{});}}export async function manualBrowserLogin(_0x504fa4,_0x16e337,_0xf4119e={}){const _0x343109=_0x3a83a9,_0x24e8ba={'KBxUH':function(_0x5e288a){return _0x5e288a();},'cBbvp':function(_0x5b9ace,_0x1d09aa,_0x53e4d8){return _0x5b9ace(_0x1d09aa,_0x53e4d8);},'AuLcg':_0x343109(0x10b),'kVVik':function(_0x12b96c,_0x1dbde3){return _0x12b96c+_0x1dbde3;},'UPJoZ':_0x343109(0xfa),'YevbW':_0x343109(0x156),'wxSPv':function(_0x1cfd43,_0x21a055){return _0x1cfd43>_0x21a055;},'KXJfh':_0x343109(0x126),'zISbG':function(_0x295ecd,_0x44c219){return _0x295ecd(_0x44c219);},'rfgOd':function(_0x284893,_0x2eb81d){return _0x284893&&_0x2eb81d;},'hWGmg':_0x343109(0x106),'HZLCt':function(_0x44833e,_0x5a9510,_0x287436){return _0x44833e(_0x5a9510,_0x287436);}};if(!isInteractive())throw new Error(_0x24e8ba['kVVik'](_0x24e8ba[_0x343109(0x161)](_0x343109(0x165)+_0x504fa4[_0x343109(0x172)]+_0x343109(0xf8),_0x24e8ba['UPJoZ']),_0x24e8ba[_0x343109(0x146)]));const _0x31c582=_0x16e337&&_0x24e8ba[_0x343109(0xf9)](_0x16e337[_0x343109(0x142)][_0x343109(0x108)],0x0)?_0x16e337['domains'][0x0]:_0x24e8ba[_0x343109(0x16c)];console[_0x343109(0x10c)]('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log'](_0x343109(0x177)),await new Promise(_0x2434ea=>setTimeout(_0x2434ea,0x7d0));const _0x1ae9d2=await chromium['launch']({'headless':![]});let _0x5928b1=null;try{const _0x2611a3={'ignoreHTTPSErrors':!![]};_0x16e337?.[_0x343109(0x125)]&&(_0x2611a3[_0x343109(0x111)]=_0x16e337['setupHeaders']);const _0x216b7d=await _0x1ae9d2[_0x343109(0x101)](_0x2611a3);await _0x24e8ba[_0x343109(0xf7)](addProfileSetupBanner,_0x216b7d);const _0x550c0d=await _0x216b7d[_0x343109(0x130)]();await _0x550c0d['goto'](_0x31c582);let _0x1c7f55=![];await new Promise(_0x6c4e42=>{const _0x2a2539=_0x343109,_0x48f415={'xoZfk':function(_0x26b5f0){const _0x5afefa=_0x20a5;return _0x24e8ba[_0x5afefa(0x11c)](_0x26b5f0);},'aoDIq':function(_0x2498e3){return _0x2498e3();}},_0x2986a1=_0x24e8ba[_0x2a2539(0x174)](setTimeout,()=>{const _0x158e39=_0x2a2539;_0x1c7f55=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x48f415[_0x158e39(0x15a)](_0x6c4e42);},MANUAL_LOGIN_TIMEOUT_MS);_0x550c0d['on'](_0x24e8ba['AuLcg'],async()=>{const _0x310aa9=_0x2a2539;clearTimeout(_0x2986a1);try{const _0x2dcc77=await _0x216b7d['storageState']();_0x5928b1=_0x2dcc77;}catch{}_0x48f415[_0x310aa9(0x171)](_0x6c4e42);});});if(_0x24e8ba[_0x343109(0xf0)](_0x1c7f55,!_0x5928b1))throw new Error(_0x24e8ba['hWGmg']);}finally{await _0x1ae9d2[_0x343109(0x10b)]()[_0x343109(0x13c)](()=>{});}if(!_0x5928b1)throw new Error(_0x343109(0x114));return _0xf4119e[_0x343109(0xf1)]!==![]&&await _0x24e8ba['HZLCt'](apiRequest,_0x343109(0x150)+_0x24e8ba[_0x343109(0xf7)](encodeURIComponent,_0x504fa4['name'])+'/session',{'method':_0x343109(0x137),'body':JSON[_0x343109(0x131)]({'session_state':_0x5928b1,'updated_by':'cli:manual-login'})}),{'sessionState':_0x5928b1};}export async function promptSaveCredentials(_0x378939){const _0x381114=_0x3a83a9,_0xda67d7={'wZGmg':function(_0x169896,_0x487827){return _0x169896||_0x487827;},'XMFDA':function(_0x5e243d,_0x34e92e,_0x42a255){return _0x5e243d(_0x34e92e,_0x42a255);},'RPFrk':function(_0x1a4bb4,_0x2aeaa2){return _0x1a4bb4(_0x2aeaa2);},'gXdDU':'PUT'},_0x1014e7=process[_0x381114(0x12f)]['RANGER_TEST_USERNAME'],_0xa8a385=process[_0x381114(0x12f)][_0x381114(0x135)];if(_0xda67d7['wZGmg'](!_0x1014e7,!_0xa8a385))return;if(!isInteractive())return;const {save:_0xdca2b8}=await _0x1ab9dd['prompt']([{'type':'confirm','name':_0x381114(0xf2),'message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0xdca2b8)return;await _0xda67d7['XMFDA'](apiRequest,'/api/v1/profiles/'+_0xda67d7['RPFrk'](encodeURIComponent,_0x378939),{'method':_0xda67d7[_0x381114(0x13f)],'body':JSON['stringify']({'username':_0x1014e7,'password':_0xa8a385})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x253325,_0x310b04={}){const _0x7422b=_0x3a83a9,_0x5b3818={'oTarT':function(_0x4197cd,_0x51c785,_0x585215){return _0x4197cd(_0x51c785,_0x585215);},'wGLmJ':function(_0x469285,_0xf43982){return _0x469285===_0xf43982;},'YyIvs':function(_0xdc0550,_0x463a7f){return _0xdc0550||_0x463a7f;},'Jcadb':function(_0x1255b5,_0x5ee355){return _0x1255b5(_0x5ee355);},'qvBpp':function(_0x2d7869,_0x327d9a,_0x6f0600,_0x14e96f,_0x4fcb1b){return _0x2d7869(_0x327d9a,_0x6f0600,_0x14e96f,_0x4fcb1b);},'qMgDA':function(_0x5ba10c,_0x4f738c,_0x4d5977,_0x2d5a22,_0x1eba17,_0x515731,_0x465b88,_0x253303){return _0x5ba10c(_0x4f738c,_0x4d5977,_0x2d5a22,_0x1eba17,_0x515731,_0x465b88,_0x253303);},'Hqnfe':function(_0x5e0164,_0x51ff10,_0x345684,_0x2889b9,_0x4db1c0){return _0x5e0164(_0x51ff10,_0x345684,_0x2889b9,_0x4db1c0);},'PgkdG':function(_0xda5a8a,_0x395b38){return _0xda5a8a(_0x395b38);},'YgeEH':function(_0x4d2b69,_0x132dda){return _0x4d2b69(_0x132dda);},'imKPO':function(_0x27ded1,_0x346c78){return _0x27ded1===_0x346c78;},'IMXzH':_0x7422b(0x11b),'RhYgW':'success','iOBZO':'\x20\x20Login\x20successful.\x20Session\x20cached.','KAsxg':function(_0x34cd16,_0x4ccc0f){return _0x34cd16&&_0x4ccc0f;},'dQQmP':function(_0x5888f0,_0x1eb890){return _0x5888f0(_0x1eb890);},'KdPia':function(_0x913d85,_0x3dda7c,_0x3d4ce3,_0x137187){return _0x913d85(_0x3dda7c,_0x3d4ce3,_0x137187);}},_0x29efa4=_0x253325[_0x7422b(0x16d)]??{},_0x3324e4=await fetchAuthConfig(),_0x2e36e1=_0x3324e4?_0x5b3818['oTarT'](resolveAuthEnvironmentLocally,_0x3324e4,_0x253325['environmentKey']):null,_0x18d232=typeof _0x2e36e1?.[_0x7422b(0x13d)]===_0x7422b(0x15b)&&_0x2e36e1['loginInstructions']['trim']()?_0x2e36e1['loginInstructions']:undefined,_0x41af56=_0x5b3818['wGLmJ'](typeof _0x29efa4['loginInstructions'],_0x7422b(0x15b))&&_0x29efa4[_0x7422b(0x13d)]['trim']()?_0x29efa4['loginInstructions']:undefined,_0x4e68b6=_0x5b3818[_0x7422b(0x13b)](_0x41af56,!_0x18d232)?_0x29efa4:{..._0x29efa4,'loginInstructions':_0x18d232},_0x4e0144=Boolean(_0x4e68b6['loginInstructions']?.[_0x7422b(0x175)]()),_0x230c4e=_0x5b3818[_0x7422b(0x103)](Boolean,_0x29efa4['forceLogin']||_0x2e36e1?.['forceLogin']),_0x4f95ec=_0x2e36e1?.['domains'],_0x4d38eb=_0x29efa4[_0x7422b(0x125)],_0x1014fc=_0x4d38eb??_0x2e36e1?.['setupHeaders'],_0x14e9fb=_0x310b04[_0x7422b(0x15d)]??_0x29efa4[_0x7422b(0x14d)]??(_0x4f95ec&&_0x4f95ec['length']>0x0?_0x4f95ec[0x0]:''),_0x286ec2=_0x14e9fb?needsTunnel(_0x14e9fb):![],_0x574d7a={'invalidateOn':_0x2e36e1?.['invalidateOn'],'userAgent':_0x2e36e1?.[_0x7422b(0x121)]?.[_0x7422b(0x12a)]??_0x29efa4[_0x7422b(0x12a)]};_0x230c4e&&console['log']('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x253325[_0x7422b(0x172)]+_0x7422b(0x11a));if(!_0x230c4e){const _0x28334c=await checkLocalCache(_0x253325['name'],_0x253325[_0x7422b(0x159)],_0x14e9fb,_0x1014fc,_0x574d7a);if(_0x28334c){if(_0x14e9fb&&!_0x286ec2){const _0x8ef6ba=await _0x5b3818[_0x7422b(0x13e)](isCachedSessionLive,_0x28334c[_0x7422b(0x144)],_0x14e9fb,{'sessionCheckPath':_0x2e36e1?.[_0x7422b(0xf5)],'setupHeaders':_0x1014fc},{'launchBrowser':launchRealBrowser});if(_0x8ef6ba)return console[_0x7422b(0x10c)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x253325[_0x7422b(0x172)]+'\x22'),{'authPath':_0x28334c[_0x7422b(0x144)],'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};console[_0x7422b(0x10c)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x253325['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x5b3818['oTarT'](emitSessionValidationHint,_0x14e9fb,_0x2e36e1);}else return _0x286ec2&&console[_0x7422b(0x10c)](_0x7422b(0x129)+_0x253325['name']+'\x22'),{'authPath':_0x28334c['storageStatePath'],'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};}}if(!_0x230c4e&&_0x253325['sessionState']){if(_0x286ec2)console['log'](_0x7422b(0x167)+_0x14e9fb+_0x7422b(0x122)+_0x253325[_0x7422b(0x172)]+'\x22');else{const _0x55126b=await _0x5b3818['qMgDA'](writeSessionToLocalCache,_0x253325[_0x7422b(0x172)],_0x253325[_0x7422b(0x159)],_0x14e9fb,_0x1014fc,_0x253325['sessionState'],_0x4f95ec,_0x574d7a);if(_0x14e9fb){const _0xaa4ce2=await _0x5b3818[_0x7422b(0x123)](isCachedSessionLive,_0x55126b,_0x14e9fb,{'sessionCheckPath':_0x2e36e1?.['sessionCheckPath'],'setupHeaders':_0x1014fc},{'launchBrowser':launchRealBrowser});if(_0xaa4ce2)return console['log'](_0x7422b(0x153)+_0x253325[_0x7422b(0x172)]+'\x22,\x20cached\x20locally'),{'authPath':_0x55126b,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x253325['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0x5b3818['oTarT'](emitSessionValidationHint,_0x14e9fb,_0x2e36e1);}else return{'authPath':_0x55126b,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};}}if(_0x4e0144)return console[_0x7422b(0x10c)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x253325['name']+_0x7422b(0x169)),{'authPath':undefined,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};console[_0x7422b(0x10c)](_0x7422b(0x11e)+_0x253325[_0x7422b(0x172)]+'\x22,\x20attempting\x20login...');const _0x2729e8=_0x5b3818['PgkdG'](Boolean,process[_0x7422b(0x12f)]['RANGER_TEST_USERNAME'])&&Boolean(process[_0x7422b(0x12f)][_0x7422b(0x135)]),_0x18f6e3=_0x5b3818['YgeEH'](Boolean,_0x253325['username']);if(_0x2729e8||_0x18f6e3)try{const _0x2483a2=_0x14e9fb?await serverSideLoginWithOptionalTunnel(_0x253325[_0x7422b(0x172)],_0x14e9fb,{'force':_0x230c4e}):await serverSideLogin(_0x253325[_0x7422b(0x172)],{'force':_0x230c4e});if(_0x5b3818['imKPO'](_0x2483a2['status'],_0x5b3818['IMXzH']))console['log'](_0x7422b(0x15f));else{if(_0x2483a2['status']===_0x5b3818[_0x7422b(0xfe)]&&_0x2483a2[_0x7422b(0x128)]){console['log'](_0x5b3818[_0x7422b(0x160)]);const _0x5cca42=await writeSessionToLocalCache(_0x253325['name'],_0x253325[_0x7422b(0x159)],_0x14e9fb,_0x1014fc,_0x2483a2[_0x7422b(0x128)],_0x4f95ec,_0x574d7a);return _0x5b3818[_0x7422b(0x127)](_0x2729e8,!_0x18f6e3)&&await promptSaveCredentials(_0x253325['name']),{'authPath':_0x5cca42,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};}else _0x2483a2[_0x7422b(0x102)]&&(console[_0x7422b(0x10c)]('\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'),console[_0x7422b(0x10c)](_0x2483a2['test_output'])),console['log'](_0x7422b(0x14e));}}catch(_0x16f7a5){console[_0x7422b(0x10c)](_0x7422b(0xfb)+(_0x16f7a5 instanceof Error?_0x16f7a5[_0x7422b(0x147)]:_0x5b3818['dQQmP'](String,_0x16f7a5))),console[_0x7422b(0x10c)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const _0x466500=_0x2e36e1?{..._0x2e36e1,'setupHeaders':_0x1014fc}:_0x14e9fb?{'key':_0x253325[_0x7422b(0x13a)]??'','domains':[_0x14e9fb],'setupHeaders':_0x1014fc}:null,{sessionState:_0x767afd}=await _0x5b3818[_0x7422b(0x143)](manualBrowserLogin,_0x253325,_0x466500,{'persistSessionState':!_0x286ec2}),_0x5b7198=await writeSessionToLocalCache(_0x253325[_0x7422b(0x172)],_0x253325[_0x7422b(0x159)],_0x14e9fb,_0x1014fc,_0x767afd,_0x4f95ec,_0x574d7a);return{'authPath':_0x5b7198,'settings':_0x4e68b6,'resolvedEnv':_0x2e36e1};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x482b7c=_0x2bfe;(function(_0x3d21de,_0x22e1c2){const _0x55cca0=_0x2bfe,_0x5bbd20=_0x3d21de();while(!![]){try{const _0x284d86=-parseInt(_0x55cca0(0x1ee))/0x1*(parseInt(_0x55cca0(0x1ef))/0x2)+-parseInt(_0x55cca0(0x210))/0x3+-parseInt(_0x55cca0(0x21c))/0x4+parseInt(_0x55cca0(0x218))/0x5+-parseInt(_0x55cca0(0x1f7))/0x6+parseInt(_0x55cca0(0x211))/0x7*(parseInt(_0x55cca0(0x201))/0x8)+parseInt(_0x55cca0(0x21b))/0x9;if(_0x284d86===_0x22e1c2)break;else _0x5bbd20['push'](_0x5bbd20['shift']());}catch(_0x24fd3f){_0x5bbd20['push'](_0x5bbd20['shift']());}}}(_0x21b2,0x75f31));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x4292dc=process[_0x482b7c(0x1f4)],_0x360b5={'stdin':process[_0x482b7c(0x209)],'stdout':process[_0x482b7c(0x20b)]}){const _0x2506a5=_0x482b7c,_0x1712cd={'cBSVM':function(_0x21e5e7,_0x4a6506){return _0x21e5e7(_0x4a6506);}};if(_0x4292dc['CI'])return![];return Boolean(_0x360b5['stdin']['isTTY'])&&_0x1712cd[_0x2506a5(0x1f6)](Boolean,_0x360b5[_0x2506a5(0x20b)][_0x2506a5(0x213)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x365cdb){const _0x1e043f=_0x482b7c,_0x24d16b={'sypbt':'baseUrl','UgxAC':function(_0x526fce,_0x5a0f77){return _0x526fce(_0x5a0f77);},'XaCze':_0x1e043f(0x214),'ZpOXD':function(_0x455323,_0x681bc4){return _0x455323!==_0x681bc4;},'WESPQ':'clientIp','Tnbhy':'hex'},_0xcd6b9a=new Set(_0x365cdb['invalidateOn']??DEFAULT_INVALIDATE_ON),_0x48df23={'orgId':_0x365cdb['orgId'],'profileName':_0x365cdb['profileName']};return _0xcd6b9a['has'](_0x24d16b['sypbt'])&&(_0x48df23['effectiveBaseUrl']=_0x365cdb['effectiveBaseUrl']),_0xcd6b9a['has'](_0x1e043f(0x1f5))&&(_0x48df23['setupHeaders']=_0x365cdb[_0x1e043f(0x1f5)]?_0x24d16b[_0x1e043f(0x1f9)](sortObjectKeys,_0x365cdb['setupHeaders']):_0x365cdb[_0x1e043f(0x1f5)]),_0xcd6b9a['has'](_0x24d16b[_0x1e043f(0x219)])&&(_0x48df23[_0x1e043f(0x214)]=extractPort(_0x365cdb[_0x1e043f(0x1fd)])),_0xcd6b9a[_0x1e043f(0x21d)](_0x1e043f(0x215))&&_0x24d16b[_0x1e043f(0x1ec)](_0x365cdb[_0x1e043f(0x215)],undefined)&&(_0x48df23[_0x1e043f(0x215)]=_0x365cdb[_0x1e043f(0x215)]),_0xcd6b9a['has'](_0x24d16b['WESPQ'])&&_0x24d16b[_0x1e043f(0x1ec)](_0x365cdb['clientIp'],undefined)&&(_0x48df23['clientIp']=_0x365cdb[_0x1e043f(0x1fb)]),createHash('sha256')[_0x1e043f(0x204)](JSON[_0x1e043f(0x207)](_0x48df23))[_0x1e043f(0x212)](_0x24d16b['Tnbhy'])['slice'](0x0,0xc);}function extractPort(_0x22e3b9){try{return new URL(_0x22e3b9)['port'];}catch{return'';}}function sortObjectKeys(_0x2c1edc){const _0x4f3eb9={};for(const _0x5a5053 of Object['keys'](_0x2c1edc)['sort']()){_0x4f3eb9[_0x5a5053]=_0x2c1edc[_0x5a5053];}return _0x4f3eb9;}export function getSessionCachePath(_0x49c6b7,_0x544b94){const _0xa4b94e=_0x482b7c,_0x302c3b={'qnvdZ':function(_0x2d7d39,_0x37d8ca,_0x3dc40d,_0x983fff){return _0x2d7d39(_0x37d8ca,_0x3dc40d,_0x983fff);},'CFuZA':function(_0x2dedf4){return _0x2dedf4();},'LBnlG':_0xa4b94e(0x208)};return _0x302c3b[_0xa4b94e(0x1ed)](join,_0x302c3b['CFuZA'](getRangerHomeDir),_0x302c3b[_0xa4b94e(0x203)],_0x49c6b7+'-'+_0x544b94+_0xa4b94e(0x1fc));}export function getStorageStatePath(_0x1be6aa){const _0x1288cf=_0x482b7c,_0x453630={'pTQhQ':'.storageState.json'};return _0x1be6aa[_0x1288cf(0x217)](/\.json$/,_0x453630['pTQhQ']);}export function needsTunnel(_0x5c4b18){const _0x3fe812=_0x482b7c,_0x1aef22={'MGoyh':function(_0x7d84f2,_0x371b9b){return _0x7d84f2===_0x371b9b;},'EIsHT':_0x3fe812(0x206),'KwUst':_0x3fe812(0x1f8),'ADayu':'localhost.'};let _0x701d2f;try{_0x701d2f=new URL(_0x5c4b18)['hostname'];}catch{return![];}if(_0x1aef22['MGoyh'](_0x701d2f,_0x1aef22['EIsHT'])||_0x1aef22[_0x3fe812(0x1fe)](_0x701d2f,_0x3fe812(0x20a)))return!![];if(_0x701d2f['endsWith'](_0x1aef22[_0x3fe812(0x1ff)]))return!![];if(_0x701d2f['includes'](_0x1aef22['ADayu']))return!![];return![];}export function hostnameOf(_0x5a9b63){return new URL(_0x5a9b63)['hostname'];}export function duplicateCookiesForDomains(_0x2fd381,_0x554a5d){const _0x309915=_0x482b7c,_0x15d683=[..._0x2fd381],_0xac20b=new Set(_0x2fd381[_0x309915(0x1f0)](_0xf8267d=>_0xf8267d['domain']));for(const _0x15b602 of _0x554a5d){let _0xfc78d;try{_0xfc78d=hostnameOf(_0x15b602);}catch{continue;}if(!_0xfc78d)continue;const _0xe0aa93=_0xfc78d[_0x309915(0x20e)]('.')?_0xfc78d:'.'+_0xfc78d;if(_0xac20b['has'](_0xfc78d)||_0xac20b['has'](_0xe0aa93))continue;for(const _0x888a30 of _0x2fd381){_0x15d683['push']({..._0x888a30,'domain':_0xe0aa93});}_0xac20b['add'](_0xe0aa93);}return _0x15d683;}export function resolveAuthEnvironmentLocally(_0x5406af,_0x5df35d){const _0x497449=_0x482b7c,_0x16b4f1=_0x5406af['environments'];if(_0x5df35d){const _0x40d6fd=_0x16b4f1[_0x5df35d];if(!_0x40d6fd)return null;return{'key':_0x5df35d,..._0x40d6fd};}if(_0x5406af[_0x497449(0x1f1)]){const _0x384e26=_0x16b4f1[_0x5406af[_0x497449(0x1f1)]];if(!_0x384e26)return null;return{'key':_0x5406af[_0x497449(0x1f1)],..._0x384e26};}const _0x334cfd=Object['keys'](_0x16b4f1);if(_0x334cfd[_0x497449(0x202)]===0x1){const _0xa05f57=_0x334cfd[0x0];return{'key':_0xa05f57,..._0x16b4f1[_0xa05f57]};}return null;}function _0x21b2(){const _0x29fafa=['KwUst','catch','280ZEBklZ','length','LBnlG','update','toString','localhost','stringify','auth','stdin','127.0.0.1','stdout','sessionCheckPath','pathname','startsWith','yhkUo','1678404YaUfFx','134792EaUBQv','digest','isTTY','port','userAgent','url','replace','1752545JuccpN','XaCze','test','14786721MceMiG','1070684QdoCXp','has','ZpOXD','qnvdZ','12422PFsOoM','94KbMLQL','map','defaultEnvironmentKey','domcontentloaded','launchBrowser','env','setupHeaders','cBSVM','4640064sHYyrL','.localhost','UgxAC','newPage','clientIp','.json','effectiveBaseUrl','MGoyh'];_0x21b2=function(){return _0x29fafa;};return _0x21b2();}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x4d1f6f,_0x266ce9){const _0x3adaf8=_0x482b7c;try{if(_0x266ce9)return new URL(_0x266ce9,_0x4d1f6f)[_0x3adaf8(0x205)]();return new URL(_0x4d1f6f)['toString']();}catch{return null;}}function _0x2bfe(_0x23460d,_0x3b80ed){_0x23460d=_0x23460d-0x1ec;const _0x21b24d=_0x21b2();let _0x2bfe9a=_0x21b24d[_0x23460d];return _0x2bfe9a;}export function looksLikeLoginUrl(_0x2acdd0){const _0xa67e12=_0x482b7c;try{const _0x1079c3=new URL(_0x2acdd0);return LOGIN_URL_PATTERN['test'](_0x1079c3[_0xa67e12(0x20d)]);}catch{return LOGIN_URL_PATTERN[_0xa67e12(0x21a)](_0x2acdd0);}}export async function isCachedSessionLive(_0x9ff98a,_0x6cd4b0,_0x1d1835={},_0x24effb={}){const _0x19aca4=_0x482b7c,_0x328a8a={'jmEvD':function(_0x32ae42,_0x563335,_0x2723d2){return _0x32ae42(_0x563335,_0x2723d2);},'yhkUo':function(_0x46d445,_0x3e886e){return _0x46d445(_0x3e886e);}},_0x4a4d14=_0x328a8a['jmEvD'](buildSessionCheckUrl,_0x6cd4b0,_0x1d1835[_0x19aca4(0x20c)]);if(!_0x4a4d14)return!![];if(!_0x24effb['launchBrowser'])return!![];let _0x186d7a=null;try{_0x186d7a=await _0x24effb[_0x19aca4(0x1f3)]();const _0x30d092=await _0x186d7a['newContext']({'storageState':_0x9ff98a,'ignoreHTTPSErrors':!![],..._0x1d1835['setupHeaders']?{'extraHTTPHeaders':_0x1d1835[_0x19aca4(0x1f5)]}:{}}),_0x555715=await _0x30d092[_0x19aca4(0x1fa)](),_0x158dc6=await _0x555715['goto'](_0x4a4d14,{'waitUntil':_0x19aca4(0x1f2),'timeout':0x3a98}),_0x233e7b=_0x158dc6?.['status']();if(_0x233e7b===0x191||_0x233e7b===0x193)return![];const _0x28f362=_0x555715[_0x19aca4(0x216)]();if(_0x328a8a[_0x19aca4(0x20f)](looksLikeLoginUrl,_0x28f362))return![];return!![];}catch{return![];}finally{if(_0x186d7a)await _0x186d7a['close']()[_0x19aca4(0x200)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4cddd7,_0x2e842d){const _0x5ccd4b=_0xdf53,_0x4714eb=_0x4cddd7();while(!![]){try{const _0x10dbce=-parseInt(_0x5ccd4b(0x14c))/0x1*(-parseInt(_0x5ccd4b(0x158))/0x2)+parseInt(_0x5ccd4b(0x15a))/0x3+parseInt(_0x5ccd4b(0x149))/0x4*(-parseInt(_0x5ccd4b(0x147))/0x5)+parseInt(_0x5ccd4b(0x155))/0x6*(-parseInt(_0x5ccd4b(0x14a))/0x7)+-parseInt(_0x5ccd4b(0x154))/0x8+-parseInt(_0x5ccd4b(0x151))/0x9*(parseInt(_0x5ccd4b(0x153))/0xa)+parseInt(_0x5ccd4b(0x156))/0xb*(parseInt(_0x5ccd4b(0x14e))/0xc);if(_0x10dbce===_0x2e842d)break;else _0x4714eb['push'](_0x4714eb['shift']());}catch(_0xa8de94){_0x4714eb['push'](_0x4714eb['shift']());}}}(_0x3c42,0x565c8));function _0x3c42(){const _0x277a3c=['585arYgnq','dQWev','56790YDfEzF','1732608hxzsrm','2766OmVZVb','1263647ALcutY','aVdvq','4098XFCTfu','sha256','1799673SceVLU','HJFSw','GKgWL','582305iUXBsW','subarray','4GfUyIT','9422YCzRAU','oyMpi','189uJeKZt','DxgPK','72zEnzdp','vKOPx','final'];_0x3c42=function(){return _0x277a3c;};return _0x3c42();}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0xdf53(_0x298341,_0x138850){_0x298341=_0x298341-0x147;const _0x3c42d3=_0x3c42();let _0xdf532=_0x3c42d3[_0x298341];return _0xdf532;}export function deriveKey(_0x23b9b0){const _0x159b22=_0xdf53,_0x27d81f={'yOKBm':function(_0x303ffe,_0x13c0c2,_0x368d68,_0x4e4cf8,_0xa46419,_0x3c7e98){return _0x303ffe(_0x13c0c2,_0x368d68,_0x4e4cf8,_0xa46419,_0x3c7e98);}};return _0x27d81f['yOKBm'](pbkdf2Sync,_0x23b9b0,SALT,0x186a0,KEY_LENGTH,_0x159b22(0x159));}export function encrypt(_0x4323b5,_0x50edf4){const _0x9ee2d7=_0xdf53,_0xb071e={'aVdvq':function(_0x2dd94c,_0x1fdad7){return _0x2dd94c(_0x1fdad7);},'DxgPK':function(_0x35e730,_0x469967,_0x3e0c3a,_0x277016){return _0x35e730(_0x469967,_0x3e0c3a,_0x277016);},'dQWev':'utf8'},_0x373c0c=_0xb071e[_0x9ee2d7(0x157)](deriveKey,_0x50edf4),_0x336776=randomBytes(IV_LENGTH),_0x3a49ee=_0xb071e[_0x9ee2d7(0x14d)](createCipheriv,ALGORITHM,_0x373c0c,_0x336776),_0x594f38=Buffer['concat']([_0x3a49ee['update'](_0x4323b5,_0xb071e[_0x9ee2d7(0x152)]),_0x3a49ee[_0x9ee2d7(0x150)]()]),_0x138f45=_0x3a49ee['getAuthTag']();return Buffer['concat']([_0x336776,_0x138f45,_0x594f38]);}export function decrypt(_0x459b90,_0x31c627){const _0x2c4d46=_0xdf53,_0x5394c7={'GKgWL':function(_0x306622,_0x26d9a4){return _0x306622(_0x26d9a4);},'HJFSw':function(_0x54e984,_0x47f43c){return _0x54e984+_0x47f43c;},'vKOPx':function(_0x40f157,_0x5751ab,_0x1a84c1,_0x58cf79){return _0x40f157(_0x5751ab,_0x1a84c1,_0x58cf79);},'oyMpi':function(_0x419e17,_0xef86ab){return _0x419e17+_0xef86ab;},'zdvwI':'utf8'},_0x439043=_0x5394c7[_0x2c4d46(0x15c)](deriveKey,_0x31c627),_0x379bc8=_0x459b90[_0x2c4d46(0x148)](0x0,IV_LENGTH),_0x1d9e93=_0x459b90['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x519924=_0x459b90[_0x2c4d46(0x148)](_0x5394c7[_0x2c4d46(0x15b)](IV_LENGTH,TAG_LENGTH)),_0x958ad8=_0x5394c7[_0x2c4d46(0x14f)](createDecipheriv,ALGORITHM,_0x439043,_0x379bc8);return _0x958ad8['setAuthTag'](_0x1d9e93),_0x5394c7[_0x2c4d46(0x14b)](_0x958ad8['update'](_0x519924),_0x958ad8[_0x2c4d46(0x150)](_0x5394c7['zdvwI']));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x240ec0=_0x5afd;(function(_0x535f9d,_0x4c6fe1){const _0x23c4c2=_0x5afd,_0x4cdbc0=_0x535f9d();while(!![]){try{const _0x477ea7=-parseInt(_0x23c4c2(0x99))/0x1*(-parseInt(_0x23c4c2(0x8a))/0x2)+-parseInt(_0x23c4c2(0x8b))/0x3+-parseInt(_0x23c4c2(0x71))/0x4*(parseInt(_0x23c4c2(0x9b))/0x5)+parseInt(_0x23c4c2(0x70))/0x6+parseInt(_0x23c4c2(0x6d))/0x7+-parseInt(_0x23c4c2(0x9e))/0x8+parseInt(_0x23c4c2(0x8d))/0x9;if(_0x477ea7===_0x4c6fe1)break;else _0x4cdbc0['push'](_0x4cdbc0['shift']());}catch(_0x20a5ed){_0x4cdbc0['push'](_0x4cdbc0['shift']());}}}(_0x22d8,0xef268));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x240ec0(0x75),'-t',_0x240ec0(0x7f),_0x240ec0(0x79),_0x240ec0(0x6f),_0x240ec0(0x81),'--password',_0x240ec0(0x9a),'--auth',_0x240ec0(0x78),_0x240ec0(0x69),'--cookie',_0x240ec0(0x8c)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x225527){const _0x229a24=_0x240ec0;return TOKEN_PATTERNS['some'](_0x26ff4e=>_0x26ff4e[_0x229a24(0x89)](_0x225527));}export function sanitizeArgs(_0x245225){const _0x534edc=_0x240ec0,_0x46e34d={'BkAUu':_0x534edc(0x8e)},_0x22a374=[];let _0x4dd84c=![];for(let _0x28560d=0x0;_0x28560d<_0x245225[_0x534edc(0x68)];_0x28560d++){const _0x5282fc=_0x245225[_0x28560d];if(_0x4dd84c){_0x22a374[_0x534edc(0x87)](_0x46e34d['BkAUu']),_0x4dd84c=![];continue;}if(_0x5282fc['startsWith']('--')||_0x5282fc[_0x534edc(0x73)]('-')){const _0x31888f=_0x5282fc['indexOf']('=');if(_0x31888f!==-0x1){const _0x71cf4b=_0x5282fc['slice'](0x0,_0x31888f)[_0x534edc(0x80)]();if(SENSITIVE_FLAGS['has'](_0x71cf4b)){_0x22a374[_0x534edc(0x87)](_0x5282fc[_0x534edc(0x83)](0x0,_0x31888f)+'=[REDACTED]');continue;}}else{const _0x455152=_0x5282fc[_0x534edc(0x80)]();SENSITIVE_FLAGS['has'](_0x455152)&&(_0x4dd84c=!![]);}_0x22a374['push'](_0x5282fc);}else looksLikeToken(_0x5282fc)?_0x22a374[_0x534edc(0x87)](_0x534edc(0x8e)):_0x22a374['push'](_0x5282fc);}return _0x22a374['join']('\x20');}function _0x5afd(_0x472124,_0x1cc73a){_0x472124=_0x472124-0x67;const _0x22d873=_0x22d8();let _0x5afdb8=_0x22d873[_0x472124];return _0x5afdb8;}function _0x22d8(){const _0x1e0080=['ZuRMz','Missing\x20required\x20argument','Authorization','DEBUG','UlYwP','no_token','[desire-path]\x20Payload:\x20','1GqeFDw','--pass','85bEfhWq','metadata','cXInT','2173232NSccOl','missing_required_argument','length','--header','Unknown\x20argument','env','/api/v1/mcp/desire-path-logs','717983WVAErF','invalid_option_value','--apikey','10005708fvBliW','277820Gnvmnz','XYIqz','startsWith','Invalid\x20values','--token','isTTY','missing_option','--authorization','--api-key','gPFOQ','sessionId','JBvcs','1|3|7|0|5|6|2|4','error','--secret','toLowerCase','--key','unknown','slice','errorMessage','includes','syntax_error','push','stringify','test','2390044SIkwkd','2613069LAeSUB','--credentials','3039867NtHPgi','[REDACTED]','stdout','unknown_command','has_token'];_0x22d8=function(){return _0x1e0080;};return _0x22d8();}export async function logDesirePath(_0x4d9d82){const _0x8fc416=_0x240ec0,_0x165acb={'rhaID':function(_0x532af2){return _0x532af2();},'LoHxb':function(_0x11d1f9){return _0x11d1f9();},'hErxj':_0x8fc416(0x91),'UlYwP':'application/json'};try{const _0x3f8909=await _0x165acb['rhaID'](getToken)['catch'](()=>null),_0x1a6495=getApiBaseUrl(),_0x7b3b81=_0x165acb['LoHxb'](getCurrentVersion),_0x1a341c=_0x3f8909?_0x165acb['hErxj']:_0x8fc416(0x97),_0x34d25e={..._0x4d9d82[_0x8fc416(0x9c)],'authStatus':_0x1a341c,'isTty':process[_0x8fc416(0x8f)][_0x8fc416(0x76)]??![]},_0x404108={'Content-Type':_0x165acb[_0x8fc416(0x96)]};_0x3f8909&&(_0x404108[_0x8fc416(0x94)]='Bearer\x20'+_0x3f8909);const _0x323a40={'rawCommand':_0x4d9d82['rawCommand'],'errorMessage':_0x4d9d82[_0x8fc416(0x84)],'errorType':_0x4d9d82['errorType'],'featureId':_0x4d9d82['featureId'],'sessionId':_0x4d9d82[_0x8fc416(0x7b)],'metadata':_0x34d25e,'cliVersion':_0x7b3b81};process['env'][_0x8fc416(0x95)]&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x1a6495+'/api/v1/mcp/desire-path-logs'),console[_0x8fc416(0x7e)](_0x8fc416(0x98)+JSON[_0x8fc416(0x88)](_0x323a40,null,0x2))),await fetch(_0x1a6495+_0x8fc416(0x6c),{'method':'POST','headers':_0x404108,'body':JSON[_0x8fc416(0x88)](_0x323a40)});}catch(_0x3930ac){process[_0x8fc416(0x6b)][_0x8fc416(0x95)]&&console[_0x8fc416(0x7e)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x3930ac);}}export function getErrorType(_0x3b95a0,_0x7248f2){const _0x4efa7b=_0x240ec0,_0x410c17={'ZuRMz':_0x4efa7b(0x7d),'umZTQ':_0x4efa7b(0x6a),'gPFOQ':'unknown_argument','smEPK':_0x4efa7b(0x93),'XYIqz':_0x4efa7b(0x86),'ryjje':'Not\x20enough\x20non-option\x20arguments','JBvcs':_0x4efa7b(0x67),'cXInT':_0x4efa7b(0x6e)},_0x49b9e9=_0x410c17[_0x4efa7b(0x92)]['split']('|');let _0x2998a1=0x0;while(!![]){switch(_0x49b9e9[_0x2998a1++]){case'0':if(_0x3b95a0[_0x4efa7b(0x85)](_0x410c17['umZTQ']))return _0x410c17[_0x4efa7b(0x7a)];continue;case'1':if(_0x7248f2)return'runtime_error';continue;case'2':if(_0x3b95a0['includes'](_0x410c17['smEPK']))return _0x4efa7b(0x77);continue;case'3':if(!_0x3b95a0)return _0x4efa7b(0x82);continue;case'4':return _0x410c17[_0x4efa7b(0x72)];case'5':if(_0x3b95a0[_0x4efa7b(0x85)](_0x410c17['ryjje']))return _0x410c17[_0x4efa7b(0x7c)];continue;case'6':if(_0x3b95a0[_0x4efa7b(0x85)](_0x4efa7b(0x74)))return _0x410c17[_0x4efa7b(0x9d)];continue;case'7':if(_0x3b95a0['includes']('Unknown\x20command'))return _0x4efa7b(0x90);continue;}break;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3c3172=_0x2d4d;(function(_0x1fe4cd,_0x553429){const _0x196fa3=_0x2d4d,_0x15b5a2=_0x1fe4cd();while(!![]){try{const _0x2cf60c=-parseInt(_0x196fa3(0xb5))/0x1+parseInt(_0x196fa3(0xf1))/0x2+parseInt(_0x196fa3(0xf5))/0x3+parseInt(_0x196fa3(0xfd))/0x4*(-parseInt(_0x196fa3(0xc5))/0x5)+-parseInt(_0x196fa3(0xd6))/0x6+parseInt(_0x196fa3(0xdf))/0x7+parseInt(_0x196fa3(0xd7))/0x8*(parseInt(_0x196fa3(0xb4))/0x9);if(_0x2cf60c===_0x553429)break;else _0x15b5a2['push'](_0x15b5a2['shift']());}catch(_0x4491cc){_0x15b5a2['push'](_0x15b5a2['shift']());}}}(_0x432e,0x99cde));import{spawn}from'child_process';function _0x2d4d(_0x4d1012,_0x1b678c){_0x4d1012=_0x4d1012-0xb2;const _0x432eca=_0x432e();let _0x2d4df3=_0x432eca[_0x4d1012];return _0x2d4df3;}import _0x1f87d5 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x3c3172(0xea);export async function requestDeviceCode(_0x1d11e4){const _0x3cbb49=_0x3c3172,_0x1af667={'TLdKW':'application/x-www-form-urlencoded'},_0x96959c=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x3cbb49(0xb7),'headers':{'Content-Type':_0x1af667[_0x3cbb49(0xfb)]},'body':new URLSearchParams({'client_id':_0x1d11e4})});if(!_0x96959c['ok']){const _0x22d740=await _0x96959c['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x96959c['status']+'\x20'+_0x22d740);}return _0x96959c[_0x3cbb49(0xe1)]();}export async function pollForTokens(_0x374213,_0x33a927,_0x55ba29,_0x3683f5){const _0x6ce067=_0x3c3172,_0x561ac2={'maEcc':function(_0x2ddeef,_0x593b99){return _0x2ddeef*_0x593b99;},'SbMdR':function(_0x2a3e66,_0x25bc0a){return _0x2a3e66<_0x25bc0a;},'iirOT':function(_0x13e771,_0x7cf31a){return _0x13e771(_0x7cf31a);},'qlpty':function(_0x47b4f8,_0x3e4ac1,_0x236cbf){return _0x47b4f8(_0x3e4ac1,_0x236cbf);},'jSHgs':'application/x-www-form-urlencoded','KeMEb':function(_0x126445,_0x56bb72){return _0x126445===_0x56bb72;},'vIEpo':_0x6ce067(0xb2),'ABTRY':_0x6ce067(0xc4)},_0x491ca3=Date[_0x6ce067(0xbb)]()+_0x561ac2['maEcc'](_0x3683f5,0x3e8);let _0x1ed411=_0x55ba29*0x3e8;while(_0x561ac2['SbMdR'](Date[_0x6ce067(0xbb)](),_0x491ca3)){await _0x561ac2['iirOT'](sleep,_0x1ed411);const _0x51f3ed=await _0x561ac2['qlpty'](fetch,WORKOS_TOKEN_URL,{'method':_0x6ce067(0xb7),'headers':{'Content-Type':_0x561ac2['jSHgs']},'body':new URLSearchParams({'client_id':_0x374213,'device_code':_0x33a927,'grant_type':_0x6ce067(0xd8)})});if(_0x51f3ed['ok'])return _0x51f3ed[_0x6ce067(0xe1)]();const _0x287153=await _0x51f3ed[_0x6ce067(0xe1)]();if(_0x561ac2[_0x6ce067(0xb8)](_0x287153['error'],_0x561ac2['vIEpo']))continue;if(_0x561ac2['KeMEb'](_0x287153['error'],_0x561ac2['ABTRY'])){_0x1ed411+=0x3e8;continue;}throw new Error(_0x287153[_0x6ce067(0xd2)]||_0x287153[_0x6ce067(0xbf)]||_0x6ce067(0xef));}throw new Error(_0x6ce067(0x101));}async function fetchUserProfile(_0x6c4527){const _0x290596=_0x3c3172,_0x347b19={'Yabpw':function(_0x5a08a,_0x2f5c1a,_0x964f1c){return _0x5a08a(_0x2f5c1a,_0x964f1c);},'ViJkj':'GET'},_0x351488=getApiBaseUrl();try{const _0x41b05e=await _0x347b19['Yabpw'](fetch,_0x351488+'/organization/me',{'method':_0x347b19[_0x290596(0xf3)],'headers':{'workos-token':_0x6c4527}});if(_0x41b05e['ok'])return _0x41b05e['json']();}catch{}return null;}function buildKeyName(_0x4eab35,_0x5a6c54){const _0xda95ea=_0x3c3172,_0x23b1af={'rHqAF':function(_0x15d720,_0x157262){return _0x15d720===_0x157262;}},_0x287562=_0x5a6c54['filter'](_0xa24245=>_0xa24245[_0xda95ea(0xf7)]===_0x4eab35||_0xa24245['name'][_0xda95ea(0xde)](_0x4eab35+'\x20('));if(_0x23b1af[_0xda95ea(0xc6)](_0x287562[_0xda95ea(0xbe)],0x0))return _0x4eab35;return _0x4eab35+'\x20('+(_0x287562[_0xda95ea(0xbe)]+0x1)+')';}export async function provisionApiKey(_0x102568){const _0x46aa2f=_0x3c3172,_0x3956b2={'nUjNc':function(_0x16dbc7,_0x4f225b){return _0x16dbc7(_0x4f225b);},'XjjqE':'CLI\x20Key','QJRuB':function(_0xaea8e2,_0x42c3a1,_0x14b92f){return _0xaea8e2(_0x42c3a1,_0x14b92f);},'jsExY':_0x46aa2f(0xcb),'lbqpA':_0x46aa2f(0xb7),'cBGBR':_0x46aa2f(0xce)},_0x63632d=getApiBaseUrl(),_0x2213e8={'Content-Type':'application/json','workos-token':_0x102568},_0x3706bb=await _0x3956b2[_0x46aa2f(0xd4)](fetchUserProfile,_0x102568),_0x57ef58=_0x3706bb?.[_0x46aa2f(0xc8)]||_0x3706bb?.[_0x46aa2f(0xd3)]?.[_0x46aa2f(0xc9)]('@')[0x0],_0x394d82=_0x57ef58?_0x57ef58+'\x27s\x20CLI\x20Key':_0x3956b2['XjjqE'];let _0x48ba91=[];try{const _0x189173=await _0x3956b2[_0x46aa2f(0xd5)](fetch,_0x63632d+'/api-keys',{'method':_0x3956b2[_0x46aa2f(0xcd)],'headers':_0x2213e8});if(_0x189173['ok']){const _0x2d5162=await _0x189173['json']();_0x48ba91=_0x2d5162[_0x46aa2f(0xba)];}}catch{}const _0x4bb57e=buildKeyName(_0x394d82,_0x48ba91),_0x3fd3f6=await fetch(_0x63632d+'/api-keys',{'method':_0x3956b2['lbqpA'],'headers':_0x2213e8,'body':JSON[_0x46aa2f(0xb6)]({'name':_0x4bb57e,'scope':_0x3956b2[_0x46aa2f(0x100)]})});if(!_0x3fd3f6['ok']){const _0x4ab9fe=await _0x3fd3f6[_0x46aa2f(0xf2)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x3fd3f6['status']+'\x20'+_0x4ab9fe);}const _0x2fafa0=await _0x3fd3f6[_0x46aa2f(0xe1)]();return _0x2fafa0['apiKey']['token'];}export function openBrowser(_0x26b924){const _0x1c8667=_0x3c3172,_0x2a40a9={'sXXgf':_0x1c8667(0xe4),'HeBMS':_0x1c8667(0xd9),'SOGim':function(_0x53d2dc,_0x1fa00b){return _0x53d2dc===_0x1fa00b;},'qNraI':_0x1c8667(0xed),'kjUZL':'xdg-open','EiJRJ':function(_0x2d42e7,_0x23917a,_0x1315a9,_0x13bb1f){return _0x2d42e7(_0x23917a,_0x1315a9,_0x13bb1f);}};try{if(process['platform']==='win32'){const _0x1e1b04=spawn(_0x2a40a9[_0x1c8667(0xe0)],['/c',_0x2a40a9['HeBMS'],'',_0x26b924],{'detached':!![],'stdio':_0x1c8667(0xf0),'windowsHide':!![]});_0x1e1b04[_0x1c8667(0xff)]();return;}const _0x2a75ee=_0x2a40a9['SOGim'](process[_0x1c8667(0xc3)],_0x2a40a9['qNraI'])?'open':_0x2a40a9['kjUZL'],_0x41a08c=_0x2a40a9[_0x1c8667(0xec)](spawn,_0x2a75ee,[_0x26b924],{'detached':!![],'stdio':'ignore'});_0x41a08c['unref']();}catch{}}function decodeJwtPayload(_0xad6ee8){const _0x12ac92=_0x3c3172,_0x2f8d9e={'WFajI':'base64url','syiJp':'utf-8'},_0x3aafe1=_0xad6ee8['split']('.');if(_0x3aafe1[_0x12ac92(0xbe)]!==0x3)throw new Error(_0x12ac92(0xf9));const _0x18c1fa=Buffer['from'](_0x3aafe1[0x1],_0x2f8d9e[_0x12ac92(0xb9)])[_0x12ac92(0xca)](_0x2f8d9e[_0x12ac92(0xbc)]);return JSON['parse'](_0x18c1fa);}async function selfServeSignup(_0xa38ccd){const _0x49be5d=_0x3c3172,_0x1fdb29={'lyZca':function(_0xf6a5db){return _0xf6a5db();},'HFmHp':function(_0x463544,_0xa36e45,_0x1899d0){return _0x463544(_0xa36e45,_0x1899d0);},'nYJfE':'POST','mKYJi':_0x49be5d(0xe8)},_0x48e849=_0x1fdb29['lyZca'](getApiBaseUrl),_0x49a7c4=await _0x1fdb29[_0x49be5d(0xfe)](fetch,_0x48e849+'/organization/self-serve-signup',{'method':_0x1fdb29[_0x49be5d(0xcc)],'headers':{'Content-Type':_0x1fdb29[_0x49be5d(0xd1)],'workos-token':_0xa38ccd}});if(!_0x49a7c4['ok']){const _0x3bd89c=await _0x49a7c4['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x49a7c4[_0x49be5d(0xc0)]+'\x20'+_0x3bd89c);}return _0x49a7c4[_0x49be5d(0xe1)]();}async function fetchMyMemberships(_0xf6f3dc){const _0x2ebb3c=_0x3c3172,_0x5bcb6b={'BlZHJ':_0x2ebb3c(0xcb)},_0x1811a8=getApiBaseUrl(),_0x59a88d=await fetch(_0x1811a8+_0x2ebb3c(0xc7),{'method':_0x5bcb6b['BlZHJ'],'headers':{'workos-token':_0xf6f3dc}});if(!_0x59a88d['ok']){const _0x39c1d2=await _0x59a88d['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x59a88d['status']+'\x20'+_0x39c1d2);}const _0x930ead=await _0x59a88d['json']();return _0x930ead['memberships'];}async function refreshTokenWithOrg(_0x5d22e0,_0x678e5a,_0x20ccc4){const _0xcbfd1a=_0x3c3172,_0x455d18={'ChMfi':_0xcbfd1a(0xb7)},_0x2975c0=await fetch(WORKOS_TOKEN_URL,{'method':_0x455d18['ChMfi'],'headers':{'Content-Type':_0xcbfd1a(0xe6)},'body':new URLSearchParams({'client_id':_0x5d22e0,'grant_type':_0xcbfd1a(0xfc),'refresh_token':_0x678e5a,'organization_id':_0x20ccc4})});if(!_0x2975c0['ok']){const _0x26bdea=await _0x2975c0['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x2975c0['status']+'\x20'+_0x26bdea);}return _0x2975c0[_0xcbfd1a(0xe1)]();}async function provisionCliToken(_0x5c6d35){const _0xe9365d=_0x3c3172,_0x29031d={'ySJVp':function(_0x1d600e){return _0x1d600e();},'DSvYc':function(_0x36efab,_0x1064f4,_0x3cdcf0){return _0x36efab(_0x1064f4,_0x3cdcf0);},'bAROR':_0xe9365d(0xb7),'HjylF':_0xe9365d(0xe8)},_0x297c79=_0x29031d['ySJVp'](getApiBaseUrl),_0x3a3883=await _0x29031d[_0xe9365d(0xda)](fetch,_0x297c79+'/cli-auth/token',{'method':_0x29031d['bAROR'],'headers':{'Content-Type':_0x29031d[_0xe9365d(0xe2)],'workos-token':_0x5c6d35}});if(!_0x3a3883['ok']){const _0x401a6c=await _0x3a3883['text']();throw new Error(_0xe9365d(0xd0)+_0x3a3883['status']+'\x20'+_0x401a6c);}return _0x3a3883[_0xe9365d(0xe1)]();}export async function runDeviceAuthFlow(){const _0x36161c=_0x3c3172,_0x484a44={'Hnywu':function(_0xc3dbf8,_0x505caf){return _0xc3dbf8(_0x505caf);},'VWbjZ':'\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','pkbeP':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','bAyZj':function(_0x2a5da1,_0x17df5e){return _0x2a5da1(_0x17df5e);},'HnNcb':'Waiting\x20for\x20authentication...','dyTKv':function(_0x5a2bd0,_0x160d95,_0x129ad7,_0x365256,_0x1ce4c8){return _0x5a2bd0(_0x160d95,_0x129ad7,_0x365256,_0x1ce4c8);},'NfjDU':function(_0x5756b1,_0x4a5aab){return _0x5756b1+_0x4a5aab;},'Vzkps':_0x36161c(0xfa),'mIJwM':_0x36161c(0xcf),'DZnBV':_0x36161c(0xe3)},_0x591e91=getCurrentEnvironment(),_0x35e2ec=ENVIRONMENT_CONFIGS[_0x591e91]['workosClientId'],_0x27de4e=await _0x484a44['Hnywu'](requestDeviceCode,_0x35e2ec);console['log'](_0x484a44['VWbjZ']),console['log'](_0x484a44['pkbeP']),_0x484a44['bAyZj'](openBrowser,_0x27de4e['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x27de4e['verification_uri_complete']),console['log'](_0x36161c(0xf4)+_0x27de4e[_0x36161c(0xb3)]+'\x0a'),process['stdout']['write'](_0x484a44['HnNcb']);let _0x4b55c9=await _0x484a44[_0x36161c(0xe9)](pollForTokens,_0x35e2ec,_0x27de4e[_0x36161c(0xe5)],_0x27de4e[_0x36161c(0xdd)],_0x27de4e['expires_in']);console['log']('\x20✓');const _0x564cb6=decodeJwtPayload(_0x4b55c9[_0x36161c(0xeb)]);if(!_0x564cb6['org_id']){const _0x29afa5=await fetchMyMemberships(_0x4b55c9['access_token']);let _0x57c803;if(_0x29afa5[_0x36161c(0xbe)]===0x0){process['stdout'][_0x36161c(0xdb)]('Setting\x20up\x20your\x20organization...');const _0x137a9b=await selfServeSignup(_0x4b55c9['access_token']);_0x57c803=_0x137a9b[_0x36161c(0xf6)],console['log']('\x20✓');}else{if(_0x29afa5[_0x36161c(0xbe)]===0x1)_0x57c803=_0x29afa5[0x0]['organizationId'],console[_0x36161c(0xc2)]('Using\x20organization:\x20'+_0x29afa5[0x0]['name']);else{const _0x3d8636=process['stdin'][_0x36161c(0xdc)]&&process['stdout']['isTTY'];if(!_0x3d8636)throw new Error(_0x484a44['NfjDU'](_0x484a44['Vzkps'],_0x484a44['mIJwM']));const {selected:_0x2ef108}=await _0x1f87d5[_0x36161c(0xee)]([{'type':'list','name':_0x36161c(0xf8),'message':_0x484a44['DZnBV'],'choices':_0x29afa5[_0x36161c(0xc1)](_0x1c1897=>({'name':_0x1c1897[_0x36161c(0xf7)],'value':_0x1c1897['organizationId']}))}]);_0x57c803=_0x2ef108;}}_0x4b55c9=await refreshTokenWithOrg(_0x35e2ec,_0x4b55c9['refresh_token'],_0x57c803);}process['stdout'][_0x36161c(0xdb)]('Provisioning\x20CLI\x20token...');const _0x245a8d=await provisionCliToken(_0x4b55c9['access_token']);return console['log']('\x20✓'),await _0x484a44['Hnywu'](storeToken,_0x245a8d['token']),_0x4b55c9['refresh_token']&&await _0x484a44[_0x36161c(0xbd)](storeRefreshToken,_0x4b55c9[_0x36161c(0xfc)]),_0x245a8d[_0x36161c(0xe7)];}function sleep(_0x482808){return new Promise(_0x4a5919=>setTimeout(_0x4a5919,_0x482808));}function _0x432e(){const _0x35bb93=['HFmHp','unref','cBGBR','Device\x20authorization\x20timed\x20out','authorization_pending','user_code','75177UvKLNZ','770797kpgsRU','stringify','POST','KeMEb','WFajI','apiKeys','now','syiJp','Hnywu','length','error','status','map','log','platform','slow_down','628885XPmOib','rHqAF','/organization/my-memberships','firstName','split','toString','GET','nYJfE','jsExY','mcp:write','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','Failed\x20to\x20provision\x20CLI\x20token:\x20','mKYJi','error_description','email','nUjNc','QJRuB','5903184mgrddl','1312lhSKhi','urn:ietf:params:oauth:grant-type:device_code','start','DSvYc','write','isTTY','interval','startsWith','3793300tbZvsg','sXXgf','json','HjylF','Select\x20an\x20organization:','cmd','device_code','application/x-www-form-urlencoded','token','application/json','dyTKv','https://api.workos.com/user_management/authenticate','access_token','EiJRJ','darwin','prompt','Authentication\x20failed','ignore','20186VcDOTe','text','ViJkj','Code:\x20','1765605DLyhqn','organizationId','name','selected','Invalid\x20JWT\x20format','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','TLdKW','refresh_token','4eOyXnE'];_0x432e=function(){return _0x35bb93;};return _0x432e();}
|
|
1
|
+
const _0x3f6f9d=_0x4677;(function(_0x4e7be1,_0x92ab58){const _0x24e268=_0x4677,_0x1f8f8b=_0x4e7be1();while(!![]){try{const _0x513f6c=parseInt(_0x24e268(0x13d))/0x1+-parseInt(_0x24e268(0x128))/0x2*(parseInt(_0x24e268(0x17f))/0x3)+parseInt(_0x24e268(0x133))/0x4*(parseInt(_0x24e268(0x170))/0x5)+-parseInt(_0x24e268(0x163))/0x6*(parseInt(_0x24e268(0x169))/0x7)+parseInt(_0x24e268(0x131))/0x8*(parseInt(_0x24e268(0x132))/0x9)+-parseInt(_0x24e268(0x146))/0xa+parseInt(_0x24e268(0x142))/0xb;if(_0x513f6c===_0x92ab58)break;else _0x1f8f8b['push'](_0x1f8f8b['shift']());}catch(_0x5bfb69){_0x1f8f8b['push'](_0x1f8f8b['shift']());}}}(_0x2d43,0xa898e));function _0x2d43(){const _0x34f110=['9Ahgzcz','fOvZd','apiKeys','workosClientId','499308hkhsog','dlVoI','isTTY','POST','UTzik','UECKA','wYpLo','access_token','length','86120BLfXPY','981rtXMqO','4aFxuDO','application/json','/api-keys','apiKey','json','qCgTg','IZdhc','ScRtZ','Device\x20authorization\x20timed\x20out','GET','1083682puhXts','CLI\x20Key','Failed\x20to\x20request\x20device\x20code:\x20','YJbAS','iHGuh','9147710YrCOBY','device_code','WkZIi','xdg-open','13531910GKMDNO','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','jqBYC','Setting\x20up\x20your\x20organization...','from','Using\x20organization:\x20','stdout','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','Zgffu','zSaIr','jZJaP','map','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','Code:\x20','user_code','stdin','egvMo','JmnMB','Failed\x20to\x20create\x20organization:\x20','https://api.workos.com/user_management/authorize/device','/organization/my-memberships','organizationId','ddjns','log','verification_uri_complete','startsWith','wTMRs','stringify','Authentication\x20failed','6033318FQxMhp','QSwGu','parse','SvmQh','urn:ietf:params:oauth:grant-type:device_code','win32','7ZtzSYh','XUAge','text','mcp:write','org_id','pqgXc','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','3548015rAzMsv','status','/organization/me','error','/cli-auth/token','expires_in','utf-8','now','aAJrV','application/x-www-form-urlencoded','memberships','toString','vthkH','Failed\x20to\x20provision\x20API\x20key:\x20','platform'];_0x2d43=function(){return _0x34f110;};return _0x2d43();}import{spawn}from'child_process';import _0x27f7aa from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x3f6f9d(0x159),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';function _0x4677(_0x1ba513,_0x341e22){_0x1ba513=_0x1ba513-0x128;const _0x2d43c3=_0x2d43();let _0x46776c=_0x2d43c3[_0x1ba513];return _0x46776c;}export async function requestDeviceCode(_0x4828ab){const _0x326104=_0x3f6f9d,_0x247b7b=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x326104(0x12b),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x4828ab})});if(!_0x247b7b['ok']){const _0x50761e=await _0x247b7b[_0x326104(0x16b)]();throw new Error(_0x326104(0x13f)+_0x247b7b['status']+'\x20'+_0x50761e);}return _0x247b7b['json']();}export async function pollForTokens(_0xe78bae,_0xd3e7fb,_0x402531,_0x189083){const _0x465749=_0x3f6f9d,_0x4eaf4d={'XUAge':function(_0x170287,_0x194fb1){return _0x170287+_0x194fb1;},'DcMMG':_0x465749(0x12b),'IKGXg':function(_0x4e1e74,_0x285116){return _0x4e1e74===_0x285116;},'SvmQh':'authorization_pending','BnSNN':function(_0x202546,_0x5cc41d){return _0x202546===_0x5cc41d;},'pqgXc':_0x465749(0x162),'wFeAp':_0x465749(0x13b)},_0x383372=_0x4eaf4d[_0x465749(0x16a)](Date[_0x465749(0x177)](),_0x189083*0x3e8);let _0x536e4d=_0x402531*0x3e8;while(Date['now']()<_0x383372){await sleep(_0x536e4d);const _0x2de856=await fetch(WORKOS_TOKEN_URL,{'method':_0x4eaf4d['DcMMG'],'headers':{'Content-Type':_0x465749(0x179)},'body':new URLSearchParams({'client_id':_0xe78bae,'device_code':_0xd3e7fb,'grant_type':_0x465749(0x167)})});if(_0x2de856['ok'])return _0x2de856['json']();const _0x41ea75=await _0x2de856['json']();if(_0x4eaf4d['IKGXg'](_0x41ea75[_0x465749(0x173)],_0x4eaf4d[_0x465749(0x166)]))continue;if(_0x4eaf4d['BnSNN'](_0x41ea75['error'],'slow_down')){_0x536e4d+=0x3e8;continue;}throw new Error(_0x41ea75['error_description']||_0x41ea75[_0x465749(0x173)]||_0x4eaf4d[_0x465749(0x16e)]);}throw new Error(_0x4eaf4d['wFeAp']);}async function fetchUserProfile(_0x3f844f){const _0x40dafb=_0x3f6f9d,_0x30f29c={'IZdhc':function(_0x44bcf3){return _0x44bcf3();},'wYpLo':function(_0x3bdf9f,_0x557a61,_0x111fdd){return _0x3bdf9f(_0x557a61,_0x111fdd);},'JmnMB':'GET'},_0x1b5ebf=_0x30f29c[_0x40dafb(0x139)](getApiBaseUrl);try{const _0x539a6d=await _0x30f29c[_0x40dafb(0x12e)](fetch,_0x1b5ebf+_0x40dafb(0x172),{'method':_0x30f29c[_0x40dafb(0x157)],'headers':{'workos-token':_0x3f844f}});if(_0x539a6d['ok'])return _0x539a6d['json']();}catch{}return null;}function buildKeyName(_0x1e33b2,_0x25a4a){const _0x5bdfd0=_0x3f6f9d,_0x1166f0={'iHGuh':function(_0x191dcb,_0x218b0d){return _0x191dcb===_0x218b0d;}},_0x26821b=_0x25a4a['filter'](_0x17d7c3=>_0x17d7c3['name']===_0x1e33b2||_0x17d7c3['name'][_0x5bdfd0(0x15f)](_0x1e33b2+'\x20('));if(_0x1166f0[_0x5bdfd0(0x141)](_0x26821b[_0x5bdfd0(0x130)],0x0))return _0x1e33b2;return _0x1e33b2+'\x20('+(_0x26821b[_0x5bdfd0(0x130)]+0x1)+')';}export async function provisionApiKey(_0x5a0be5){const _0x13346b=_0x3f6f9d,_0xea5b2a={'aAJrV':function(_0x3606f3){return _0x3606f3();},'ZNlis':'application/json','dlVoI':'GET','zSaIr':_0x13346b(0x16c)},_0x1d5393=_0xea5b2a[_0x13346b(0x178)](getApiBaseUrl),_0x58ebc1={'Content-Type':_0xea5b2a['ZNlis'],'workos-token':_0x5a0be5},_0x110d77=await fetchUserProfile(_0x5a0be5),_0xe355ec=_0x110d77?.['firstName']||_0x110d77?.['email']?.['split']('@')[0x0],_0xe09ef=_0xe355ec?_0xe355ec+'\x27s\x20CLI\x20Key':_0x13346b(0x13e);let _0x5daa75=[];try{const _0x1c78c2=await fetch(_0x1d5393+'/api-keys',{'method':_0xea5b2a[_0x13346b(0x129)],'headers':_0x58ebc1});if(_0x1c78c2['ok']){const _0xd6f800=await _0x1c78c2[_0x13346b(0x137)]();_0x5daa75=_0xd6f800[_0x13346b(0x181)];}}catch{}const _0x529b0c=buildKeyName(_0xe09ef,_0x5daa75),_0x132518=await fetch(_0x1d5393+_0x13346b(0x135),{'method':_0x13346b(0x12b),'headers':_0x58ebc1,'body':JSON[_0x13346b(0x161)]({'name':_0x529b0c,'scope':_0xea5b2a[_0x13346b(0x14f)]})});if(!_0x132518['ok']){const _0x592547=await _0x132518['text']();throw new Error(_0x13346b(0x17d)+_0x132518['status']+'\x20'+_0x592547);}const _0x1d7938=await _0x132518[_0x13346b(0x137)]();return _0x1d7938[_0x13346b(0x136)]['token'];}export function openBrowser(_0x2ee556){const _0x4c86b7=_0x3f6f9d,_0x1fccb1={'nMyUp':function(_0x18d6d7,_0x498246){return _0x18d6d7===_0x498246;},'illbl':_0x4c86b7(0x168),'fOvZd':function(_0x19639e,_0x24cf9b,_0x1f155c,_0x26827a){return _0x19639e(_0x24cf9b,_0x1f155c,_0x26827a);},'jqBYC':'cmd','sfIbI':'start','ffkpx':'ignore','YDaST':_0x4c86b7(0x145)};try{if(_0x1fccb1['nMyUp'](process[_0x4c86b7(0x17e)],_0x1fccb1['illbl'])){const _0x598306=_0x1fccb1[_0x4c86b7(0x180)](spawn,_0x1fccb1[_0x4c86b7(0x148)],['/c',_0x1fccb1['sfIbI'],'',_0x2ee556],{'detached':!![],'stdio':_0x1fccb1['ffkpx'],'windowsHide':!![]});_0x598306['unref']();return;}const _0x32a3d5=process[_0x4c86b7(0x17e)]==='darwin'?'open':_0x1fccb1['YDaST'],_0x38cbe3=spawn(_0x32a3d5,[_0x2ee556],{'detached':!![],'stdio':_0x1fccb1['ffkpx']});_0x38cbe3['unref']();}catch{}}function decodeJwtPayload(_0x96c3c9){const _0x1f6743=_0x3f6f9d,_0x5b99ce=_0x96c3c9['split']('.');if(_0x5b99ce['length']!==0x3)throw new Error('Invalid\x20JWT\x20format');const _0x4f6afd=Buffer[_0x1f6743(0x14a)](_0x5b99ce[0x1],'base64url')[_0x1f6743(0x17b)](_0x1f6743(0x176));return JSON[_0x1f6743(0x165)](_0x4f6afd);}async function selfServeSignup(_0x1c3c85){const _0x107eb2=_0x3f6f9d,_0x45b805={'CJuHs':function(_0x12cbf9){return _0x12cbf9();},'pProL':function(_0x11f7bc,_0x2e4e51,_0x580666){return _0x11f7bc(_0x2e4e51,_0x580666);},'ScRtZ':'application/json'},_0x376f57=_0x45b805['CJuHs'](getApiBaseUrl),_0x3992a6=await _0x45b805['pProL'](fetch,_0x376f57+'/organization/self-serve-signup',{'method':_0x107eb2(0x12b),'headers':{'Content-Type':_0x45b805[_0x107eb2(0x13a)],'workos-token':_0x1c3c85}});if(!_0x3992a6['ok']){const _0x734870=await _0x3992a6['text']();throw new Error(_0x107eb2(0x158)+_0x3992a6['status']+'\x20'+_0x734870);}return _0x3992a6['json']();}async function fetchMyMemberships(_0x4b8a43){const _0x33b53b=_0x3f6f9d,_0x7575ad={'UTzik':function(_0x5c214d,_0x5851ce,_0x32aaca){return _0x5c214d(_0x5851ce,_0x32aaca);}},_0x365594=getApiBaseUrl(),_0x2384aa=await _0x7575ad[_0x33b53b(0x12c)](fetch,_0x365594+_0x33b53b(0x15a),{'method':_0x33b53b(0x13c),'headers':{'workos-token':_0x4b8a43}});if(!_0x2384aa['ok']){const _0x4f9494=await _0x2384aa['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x2384aa['status']+'\x20'+_0x4f9494);}const _0x2bbeca=await _0x2384aa[_0x33b53b(0x137)]();return _0x2bbeca[_0x33b53b(0x17a)];}async function refreshTokenWithOrg(_0x187175,_0x59ac7c,_0x56fb73){const _0x43446a=_0x3f6f9d,_0x2c00ec={'IGtUl':function(_0x251175,_0x52b02c,_0x120e48){return _0x251175(_0x52b02c,_0x120e48);},'YIvBo':_0x43446a(0x12b),'NcdxK':'refresh_token'},_0x49e7df=await _0x2c00ec['IGtUl'](fetch,WORKOS_TOKEN_URL,{'method':_0x2c00ec['YIvBo'],'headers':{'Content-Type':_0x43446a(0x179)},'body':new URLSearchParams({'client_id':_0x187175,'grant_type':_0x2c00ec['NcdxK'],'refresh_token':_0x59ac7c,'organization_id':_0x56fb73})});if(!_0x49e7df['ok']){const _0x44c429=await _0x49e7df[_0x43446a(0x16b)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x49e7df[_0x43446a(0x171)]+'\x20'+_0x44c429);}return _0x49e7df['json']();}async function provisionCliToken(_0x14d876){const _0xc20ecd=_0x3f6f9d,_0x37627e={'XQCVa':function(_0x3029f2){return _0x3029f2();},'YJbAS':function(_0x5631f0,_0x460dd0,_0x5afd9c){return _0x5631f0(_0x460dd0,_0x5afd9c);},'jZJaP':_0xc20ecd(0x12b),'QSwGu':_0xc20ecd(0x134)},_0xa24f76=_0x37627e['XQCVa'](getApiBaseUrl),_0x5ecc51=await _0x37627e[_0xc20ecd(0x140)](fetch,_0xa24f76+_0xc20ecd(0x174),{'method':_0x37627e[_0xc20ecd(0x150)],'headers':{'Content-Type':_0x37627e[_0xc20ecd(0x164)],'workos-token':_0x14d876}});if(!_0x5ecc51['ok']){const _0x411d28=await _0x5ecc51['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x5ecc51[_0xc20ecd(0x171)]+'\x20'+_0x411d28);}return _0x5ecc51['json']();}export async function runDeviceAuthFlow(){const _0x2e1704=_0x3f6f9d,_0x5055f0={'wTMRs':function(_0x433720){return _0x433720();},'ddjns':function(_0x6e7838,_0x3867ce){return _0x6e7838(_0x3867ce);},'DJRbS':_0x2e1704(0x152),'qCgTg':'Waiting\x20for\x20authentication...','hAWIQ':function(_0x50fce0,_0x3c303d){return _0x50fce0(_0x3c303d);},'UECKA':function(_0x1a7085,_0x46e7b3){return _0x1a7085(_0x46e7b3);},'lyGZB':function(_0x14bcb3,_0x4a0e50){return _0x14bcb3(_0x4a0e50);},'Zgffu':function(_0x1ced2d,_0x24b3a6){return _0x1ced2d===_0x24b3a6;},'egvMo':function(_0x222c74,_0x3a26a5){return _0x222c74+_0x3a26a5;},'elnnn':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','vthkH':'selected','WkZIi':function(_0x37c656,_0x5ea30e,_0x542485,_0x138685){return _0x37c656(_0x5ea30e,_0x542485,_0x138685);},'TxhZp':function(_0x256e3e,_0x66e739){return _0x256e3e(_0x66e739);},'ojHru':function(_0x29db51,_0x22c9ce){return _0x29db51(_0x22c9ce);}},_0x381fec=_0x5055f0[_0x2e1704(0x160)](getCurrentEnvironment),_0x15ec78=ENVIRONMENT_CONFIGS[_0x381fec][_0x2e1704(0x182)],_0x3adfc6=await _0x5055f0[_0x2e1704(0x15c)](requestDeviceCode,_0x15ec78);console[_0x2e1704(0x15d)](_0x5055f0['DJRbS']),console[_0x2e1704(0x15d)](_0x2e1704(0x14d)),_0x5055f0['ddjns'](openBrowser,_0x3adfc6[_0x2e1704(0x15e)]),console[_0x2e1704(0x15d)](_0x2e1704(0x16f)+_0x3adfc6['verification_uri_complete']),console['log'](_0x2e1704(0x153)+_0x3adfc6[_0x2e1704(0x154)]+'\x0a'),process['stdout']['write'](_0x5055f0[_0x2e1704(0x138)]);let _0x15ec3f=await pollForTokens(_0x15ec78,_0x3adfc6[_0x2e1704(0x143)],_0x3adfc6['interval'],_0x3adfc6[_0x2e1704(0x175)]);console[_0x2e1704(0x15d)]('\x20✓');const _0x2bb197=_0x5055f0['hAWIQ'](decodeJwtPayload,_0x15ec3f['access_token']);if(!_0x2bb197[_0x2e1704(0x16d)]){const _0xdfa552=await _0x5055f0[_0x2e1704(0x12d)](fetchMyMemberships,_0x15ec3f['access_token']);let _0x4664e2;if(_0xdfa552[_0x2e1704(0x130)]===0x0){process[_0x2e1704(0x14c)]['write'](_0x2e1704(0x149));const _0x21848f=await _0x5055f0['lyGZB'](selfServeSignup,_0x15ec3f['access_token']);_0x4664e2=_0x21848f[_0x2e1704(0x15b)],console[_0x2e1704(0x15d)]('\x20✓');}else{if(_0x5055f0[_0x2e1704(0x14e)](_0xdfa552['length'],0x1))_0x4664e2=_0xdfa552[0x0]['organizationId'],console['log'](_0x2e1704(0x14b)+_0xdfa552[0x0]['name']);else{const _0x18591f=process[_0x2e1704(0x155)][_0x2e1704(0x12a)]&&process['stdout']['isTTY'];if(!_0x18591f)throw new Error(_0x5055f0[_0x2e1704(0x156)](_0x5055f0['elnnn'],_0x2e1704(0x147)));const {selected:_0x3c60e8}=await _0x27f7aa['prompt']([{'type':'list','name':_0x5055f0[_0x2e1704(0x17c)],'message':'Select\x20an\x20organization:','choices':_0xdfa552[_0x2e1704(0x151)](_0xd19f07=>({'name':_0xd19f07['name'],'value':_0xd19f07[_0x2e1704(0x15b)]}))}]);_0x4664e2=_0x3c60e8;}}_0x15ec3f=await _0x5055f0[_0x2e1704(0x144)](refreshTokenWithOrg,_0x15ec78,_0x15ec3f['refresh_token'],_0x4664e2);}process['stdout']['write']('Provisioning\x20CLI\x20token...');const _0x504610=await _0x5055f0['TxhZp'](provisionCliToken,_0x15ec3f[_0x2e1704(0x12f)]);return console[_0x2e1704(0x15d)]('\x20✓'),await _0x5055f0['ojHru'](storeToken,_0x504610['token']),_0x15ec3f['refresh_token']&&await storeRefreshToken(_0x15ec3f['refresh_token']),_0x504610['token'];}function sleep(_0x5eb155){return new Promise(_0xd97da8=>setTimeout(_0xd97da8,_0x5eb155));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x4b89(){const _0x1a404a=['XaWvJ','mvGMo','off','iyZeS','ZEtTL','http://localhost:8080/mcp','16816869bBvUze','5ykNKZj','\x22.\x20','RANGER_CLI_ENV','https://ai-proxy-301751771437.us-central1.run.app','https://ai-proxy-716115358910.us-central1.run.app','RANGER_USE_NOVA_ACT','https://mcp-auth.ranger.net/mcp','728QhXdzy','[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22','auto','525656vqidxC','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','72320AyRXdk','trim','env','https://mcp-auth.staging.ranger.net/mcp','http://localhost:8080','client_01J9CBYM2DKWV9HM17D95Z540K','error','toLowerCase','Btrjd','230398IOcpgo','117257aXAYdg','QDOkL','RXUiY','2029299CNWECk','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','https://api.ranger.net','RANGER_HOOKS','4062222dPLfow','RANGER_TRANSPORT','nova-act-cli','mcpAuthUrl','prod','true','client_01J9CBYM7M5ZETCF7G6614DXR2','http://localhost:8090','playwright-cli','pHfDO'];_0x4b89=function(){return _0x1a404a;};return _0x4b89();}const _0x26f9dd=_0x179f;(function(_0x238c7a,_0x14bc40){const _0x4e5393=_0x179f,_0x28d5a6=_0x238c7a();while(!![]){try{const _0x4a264c=parseInt(_0x4e5393(0xef))/0x1+parseInt(_0x4e5393(0xee))/0x2+parseInt(_0x4e5393(0xf2))/0x3+-parseInt(_0x4e5393(0xe3))/0x4*(parseInt(_0x4e5393(0xd9))/0x5)+parseInt(_0x4e5393(0xf6))/0x6+parseInt(_0x4e5393(0xe0))/0x7*(parseInt(_0x4e5393(0xe5))/0x8)+-parseInt(_0x4e5393(0xd8))/0x9;if(_0x4a264c===_0x14bc40)break;else _0x28d5a6['push'](_0x28d5a6['shift']());}catch(_0x13703b){_0x28d5a6['push'](_0x28d5a6['shift']());}}}(_0x4b89,0x80733));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x26f9dd(0xf4),'workosClientId':_0x26f9dd(0xfc),'aiProxyUrl':_0x26f9dd(0xdd),'mcpAuthUrl':_0x26f9dd(0xdf)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':_0x26f9dd(0xea),'aiProxyUrl':_0x26f9dd(0xdc),'mcpAuthUrl':_0x26f9dd(0xe8)},'local':{'apiBaseUrl':_0x26f9dd(0xe9),'workosClientId':_0x26f9dd(0xea),'aiProxyUrl':_0x26f9dd(0xfd),'mcpAuthUrl':_0x26f9dd(0xd7)}};export const DEFAULT_ENVIRONMENT=_0x26f9dd(0xfa);export function isValidEnvironment(_0x5e2500){const _0x5e9da9=_0x26f9dd,_0x5b96f3={'FgQln':'prod','ZEtTL':function(_0x3612fe,_0x58218c){return _0x3612fe===_0x58218c;},'Altcj':'local'};return _0x5e2500===_0x5b96f3['FgQln']||_0x5b96f3[_0x5e9da9(0xd6)](_0x5e2500,'staging')||_0x5b96f3[_0x5e9da9(0xd6)](_0x5e2500,_0x5b96f3['Altcj']);}export function getCurrentEnvironment(){const _0x2b58a9=_0x26f9dd,_0x38902c=process[_0x2b58a9(0xe7)][_0x2b58a9(0xdb)];if(_0x38902c&&isValidEnvironment(_0x38902c))return _0x38902c;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x3114d5=_0x26f9dd,_0x2b5f0d={'iyZeS':function(_0x27fa55){return _0x27fa55();}};return ENVIRONMENT_CONFIGS[_0x2b5f0d[_0x3114d5(0xd5)](getCurrentEnvironment)]['apiBaseUrl'];}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x54a432=_0x26f9dd;return process[_0x54a432(0xe7)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x54a432(0xf9)];}function _0x179f(_0x2840cd,_0x420999){_0x2840cd=_0x2840cd-0xd4;const _0x4b89e3=_0x4b89();let _0x179f9f=_0x4b89e3[_0x2840cd];return _0x179f9f;}export function isByokEnabled(){const _0x36617c=_0x26f9dd;return process[_0x36617c(0xe7)]['RANGER_BYOK']===_0x36617c(0xfb);}function isVerificationTransport(_0x419e3a){const _0x1e26ab=_0x26f9dd,_0xba4aae={'Btrjd':'mcp','pHfDO':function(_0x214f69,_0x28e71c){return _0x214f69===_0x28e71c;},'uxNnd':'rangerwright-cli'};return _0x419e3a===_0xba4aae[_0x1e26ab(0xed)]||_0xba4aae[_0x1e26ab(0xff)](_0x419e3a,_0x1e26ab(0xfe))||_0x419e3a===_0x1e26ab(0xf8)||_0xba4aae['pHfDO'](_0x419e3a,_0xba4aae['uxNnd']);}const LEGACY_TRANSPORT_ENV_VARS=[_0x26f9dd(0xde),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x479ebb=_0x26f9dd,_0x5813f0={'mvGMo':function(_0x1b46b5,_0x353bff){return _0x1b46b5(_0x353bff);}},_0x1bee7d=process[_0x479ebb(0xe7)][_0x479ebb(0xf7)]?.[_0x479ebb(0xe6)]();if(_0x1bee7d){if(_0x5813f0[_0x479ebb(0x101)](isVerificationTransport,_0x1bee7d))return _0x1bee7d;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x1bee7d+_0x479ebb(0xf3));}const _0x577a71=LEGACY_TRANSPORT_ENV_VARS['find'](_0x5c0704=>process[_0x479ebb(0xe7)][_0x5c0704]);if(_0x577a71)throw new Error(_0x577a71+_0x479ebb(0xe4));return'mcp';}export function resolveHookMode(_0x289207=process['env']){const _0x51eaf0=_0x26f9dd,_0x57c02f={'XaWvJ':function(_0x7f8122,_0xa8d186){return _0x7f8122===_0xa8d186;},'QDOkL':function(_0x3e0f11,_0x2908d0){return _0x3e0f11===_0x2908d0;},'RXUiY':function(_0x525af4,_0x3bf94c){return _0x525af4+_0x3bf94c;},'zeYGC':'auto'},_0xd7f12d=_0x289207[_0x51eaf0(0xf5)]?.[_0x51eaf0(0xe6)]()[_0x51eaf0(0xec)]();if(!_0xd7f12d)return'auto';if(_0x57c02f[_0x51eaf0(0x100)](_0xd7f12d,_0x51eaf0(0xd4))||_0xd7f12d==='on'||_0x57c02f[_0x51eaf0(0xf0)](_0xd7f12d,_0x51eaf0(0xe2)))return _0xd7f12d;return console[_0x51eaf0(0xeb)](_0x57c02f[_0x51eaf0(0xf1)](_0x51eaf0(0xe1)+_0x289207['RANGER_HOOKS']+_0x51eaf0(0xda),'Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.')),_0x57c02f['zeYGC'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x38d978,_0x4cebda){const _0x48619a=_0x951c,_0x582168=_0x38d978();while(!![]){try{const _0x407d08=parseInt(_0x48619a(0x151))/0x1*(parseInt(_0x48619a(0x132))/0x2)+parseInt(_0x48619a(0x10a))/0x3*(parseInt(_0x48619a(0x11e))/0x4)+-parseInt(_0x48619a(0x144))/0x5*(-parseInt(_0x48619a(0x105))/0x6)+-parseInt(_0x48619a(0x136))/0x7+parseInt(_0x48619a(0x119))/0x8*(parseInt(_0x48619a(0x145))/0x9)+parseInt(_0x48619a(0x113))/0xa*(-parseInt(_0x48619a(0x10e))/0xb)+parseInt(_0x48619a(0x127))/0xc;if(_0x407d08===_0x4cebda)break;else _0x582168['push'](_0x582168['shift']());}catch(_0x32d723){_0x582168['push'](_0x582168['shift']());}}}(_0x3e5a,0x36da8));function _0x3e5a(){const _0x349c16=['Bearer\x20','Failed\x20to\x20get\x20action\x20items:\x20','hwDSz','itemIds','Failed\x20to\x20update\x20feature\x20review:\x20','24PpuOeV','kmhlF','bPkqw','AjVlf','json','5816UvLyWp','kYfoK','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','set','EVPma','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','xGHdj','/comments/address','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','5688204VMMeIq','/sessions/','XCgTr','sessionId','qdUzR','Failed\x20to\x20restore\x20feature\x20review:\x20','offset','lXVWb','/start','pYSEk','qpscu','40bDGEKY','join','toString','/api/v1/mcp/features','1562477CXrCdu','/sessions','oxpCC','Failed\x20to\x20create\x20feature\x20review:\x20','TpRhx','Zcppy','Feature\x20limit\x20exceeded','FliRb','dYoue','YUfXg','VNOYD','/api/v1/mcp/features/','Failed\x20to\x20conclude\x20session:\x20','gitBranch','156305SQYkFS','190692lmtTGq','text','Failed\x20to\x20update\x20scenario:\x20','Failed\x20to\x20get\x20feature\x20review:\x20','hbCEO','style','PATCH','status','limit','/conclude','Failed\x20to\x20start\x20session:\x20','niVxK','1979OgWAmJ','42dUXbqx','POST','mKfao','bBkbH','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','207QccVrf','PrIsJ','application/json','stringify','11JtyvAe','length','billingUrl','TncBb','GET','4484230TEwcAy'];_0x3e5a=function(){return _0x349c16;};return _0x3e5a();}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';function _0x951c(_0x2ec3b1,_0x702528){_0x2ec3b1=_0x2ec3b1-0x105;const _0x3e5a97=_0x3e5a();let _0x951cee=_0x3e5a97[_0x2ec3b1];return _0x951cee;}export async function createFeature(_0x190fd6){const _0x2b38a7=_0x951c,_0x21b8d3={'bPkqw':function(_0x1c404e){return _0x1c404e();},'QLHyN':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','DJMXY':'https://dashboard.ranger.net/billing','hwDSz':_0x2b38a7(0x13c)},_0x2cfece=await _0x21b8d3[_0x2b38a7(0x11b)](getToken);if(!_0x2cfece)throw new Error(_0x21b8d3['QLHyN']);const _0x13a683=_0x21b8d3[_0x2b38a7(0x11b)](getApiBaseUrl),_0x36abf0=await fetch(_0x13a683+_0x2b38a7(0x135),{'method':_0x2b38a7(0x106),'headers':{'Authorization':_0x2b38a7(0x114)+_0x2cfece,'Content-Type':'application/json'},'body':JSON['stringify'](_0x190fd6)});if(!_0x36abf0['ok']){if(_0x36abf0[_0x2b38a7(0x14c)]===0x192){const _0x3f5b0e=await _0x36abf0[_0x2b38a7(0x11d)](),_0x1b9ec7=_0x3f5b0e[_0x2b38a7(0x110)]||_0x21b8d3['DJMXY'];throw new Error((_0x3f5b0e['message']||_0x21b8d3[_0x2b38a7(0x116)])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x1b9ec7);}const _0x10edf8=await _0x36abf0['text']();throw new Error(_0x2b38a7(0x139)+_0x10edf8);}return _0x36abf0[_0x2b38a7(0x11d)]();}export async function listFeatures(_0x36a943){const _0x24d048=_0x951c,_0x159629=await getToken();if(!_0x159629)throw new Error(_0x24d048(0x109));const _0x272ae1=getApiBaseUrl(),_0x4653ec=new URLSearchParams();if(_0x36a943?.['gitRepoUrl'])_0x4653ec['set']('gitRepoUrl',_0x36a943['gitRepoUrl']);if(_0x36a943?.[_0x24d048(0x143)])_0x4653ec['set'](_0x24d048(0x143),_0x36a943[_0x24d048(0x143)]);if(_0x36a943?.['limit'])_0x4653ec['set'](_0x24d048(0x14d),_0x36a943['limit'][_0x24d048(0x134)]());if(_0x36a943?.[_0x24d048(0x12d)])_0x4653ec['set'](_0x24d048(0x12d),_0x36a943['offset'][_0x24d048(0x134)]());if(_0x36a943?.['includeDeleted'])_0x4653ec[_0x24d048(0x121)]('includeDeleted','true');const _0x51d63d=_0x272ae1+'/api/v1/mcp/features'+(_0x4653ec['toString']()?'?'+_0x4653ec[_0x24d048(0x134)]():''),_0x4cf4a0=await fetch(_0x51d63d,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x159629}});if(!_0x4cf4a0['ok']){const _0x3abcb0=await _0x4cf4a0[_0x24d048(0x146)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x3abcb0);}return _0x4cf4a0['json']();}export async function getFeature(_0x25864b){const _0x23d536=_0x951c,_0xa69ae7={'TTJYV':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','pYSEk':function(_0x18c2bd){return _0x18c2bd();},'oBooP':function(_0x3758e8,_0x21f59b,_0x4a7d1a){return _0x3758e8(_0x21f59b,_0x4a7d1a);}},_0x2a94b2=await getToken();if(!_0x2a94b2)throw new Error(_0xa69ae7['TTJYV']);const _0x1e9fd5=_0xa69ae7[_0x23d536(0x130)](getApiBaseUrl),_0x6c3df1=await _0xa69ae7['oBooP'](fetch,_0x1e9fd5+_0x23d536(0x141)+_0x25864b,{'method':'GET','headers':{'Authorization':_0x23d536(0x114)+_0x2a94b2}});if(!_0x6c3df1['ok']){const _0x12a4ff=await _0x6c3df1[_0x23d536(0x146)]();throw new Error(_0x23d536(0x148)+_0x12a4ff);}return _0x6c3df1[_0x23d536(0x11d)]();}export async function updateFeature(_0x3d2fd7,_0x4cc37a){const _0x121ede=_0x951c,_0x56fd07={'uYMiw':function(_0x26ecb9){return _0x26ecb9();},'oxpCC':function(_0x1f43d1,_0x14810d,_0x33d96a){return _0x1f43d1(_0x14810d,_0x33d96a);},'FliRb':'PATCH'},_0x21ca2f=await _0x56fd07['uYMiw'](getToken);if(!_0x21ca2f)throw new Error(_0x121ede(0x109));const _0x31a1b9=getApiBaseUrl(),_0x2523cd=await _0x56fd07[_0x121ede(0x138)](fetch,_0x31a1b9+'/api/v1/mcp/features/'+_0x3d2fd7,{'method':_0x56fd07[_0x121ede(0x13d)],'headers':{'Authorization':_0x121ede(0x114)+_0x21ca2f,'Content-Type':'application/json'},'body':JSON[_0x121ede(0x10d)](_0x4cc37a)});if(!_0x2523cd['ok']){const _0x54fe1d=await _0x2523cd['text']();throw new Error(_0x121ede(0x118)+_0x54fe1d);}return _0x2523cd['json']();}export async function createChecklistItem(_0x2032e3,_0x265828,_0x570380){const _0x312624=_0x951c,_0x3dc530={'AjVlf':function(_0x358487){return _0x358487();},'hbCEO':function(_0x383c27,_0x52e28e,_0x28a671){return _0x383c27(_0x52e28e,_0x28a671);},'YUfXg':'POST'},_0xf93556=await _0x3dc530[_0x312624(0x11c)](getToken);if(!_0xf93556)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3c1d1d=_0x3dc530[_0x312624(0x11c)](getApiBaseUrl),_0x38e573=await _0x3dc530[_0x312624(0x149)](fetch,_0x3c1d1d+_0x312624(0x141)+_0x2032e3+'/checklist',{'method':_0x3dc530[_0x312624(0x13f)],'headers':{'Authorization':'Bearer\x20'+_0xf93556,'Content-Type':'application/json'},'body':JSON['stringify']({'description':_0x265828,'position':_0x570380})});if(!_0x38e573['ok']){const _0x551852=await _0x38e573['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x551852);}return _0x38e573[_0x312624(0x11d)]();}export async function updateChecklistItem(_0x12f257,_0x19dcd9,_0x408a83){const _0x5ca030=_0x951c,_0x4594eb={'TncBb':function(_0x38be85){return _0x38be85();},'lXVWb':_0x5ca030(0x109),'tdfMX':function(_0x3cb469){return _0x3cb469();}};return withRetry(async()=>{const _0x293098=_0x5ca030,_0x5b6bb8=await _0x4594eb[_0x293098(0x111)](getToken);if(!_0x5b6bb8)throw new Error(_0x4594eb[_0x293098(0x12e)]);const _0x1da1e9=_0x4594eb['tdfMX'](getApiBaseUrl),_0x32c3ac=await fetch(_0x1da1e9+'/api/v1/mcp/features/'+_0x12f257+'/checklist/'+_0x19dcd9,{'method':_0x293098(0x14b),'headers':{'Authorization':_0x293098(0x114)+_0x5b6bb8,'Content-Type':_0x293098(0x10c)},'body':JSON[_0x293098(0x10d)](_0x408a83)});if(!_0x32c3ac['ok']){const _0x4fd8ee=await _0x32c3ac[_0x293098(0x146)]();throw new Error(_0x293098(0x147)+_0x4fd8ee);}return _0x32c3ac[_0x293098(0x11d)]();},{'label':'updateChecklistItem'});}export async function getFeatureReport(_0x2cf6c6){const _0x21d94f=_0x951c,_0x5ad24e={'XCgTr':function(_0x47c45b){return _0x47c45b();},'WwhOe':_0x21d94f(0x112)},_0x3999b8=await _0x5ad24e[_0x21d94f(0x129)](getToken);if(!_0x3999b8)throw new Error(_0x21d94f(0x109));const _0x5563f2=getApiBaseUrl(),_0x239496=await fetch(_0x5563f2+_0x21d94f(0x141)+_0x2cf6c6+'/report',{'method':_0x5ad24e['WwhOe'],'headers':{'Authorization':_0x21d94f(0x114)+_0x3999b8}});if(!_0x239496['ok']){const _0x692870=await _0x239496[_0x21d94f(0x146)]();throw new Error(_0x21d94f(0x120)+_0x692870);}return _0x239496['json']();}export async function getFeatureReportMarkdown(_0x2650b8,_0x85677b){const _0x38c3b2=_0x951c,_0x14cb2f={'AXxRP':_0x38c3b2(0x109),'hsvvL':function(_0x190062){return _0x190062();},'KqTsa':function(_0x289c91,_0x32294b){return _0x289c91>_0x32294b;},'xGHdj':_0x38c3b2(0x12a),'qdUzR':'style'},_0x4ae781=await getToken();if(!_0x4ae781)throw new Error(_0x14cb2f['AXxRP']);const _0xa055d6=_0x14cb2f['hsvvL'](getApiBaseUrl),_0x300205=new URLSearchParams(),_0x49ea69=_0x14cb2f['KqTsa'](_0x85677b?.[_0x38c3b2(0x117)]?.[_0x38c3b2(0x10f)]??0x0,0x0),_0x17ba1b=Boolean(_0x85677b?.[_0x38c3b2(0x12a)]);_0x49ea69&&_0x85677b?.[_0x38c3b2(0x117)]&&_0x300205[_0x38c3b2(0x121)]('itemIds',_0x85677b['itemIds'][_0x38c3b2(0x133)](','));_0x17ba1b&&_0x85677b?.['sessionId']&&_0x300205[_0x38c3b2(0x121)](_0x14cb2f[_0x38c3b2(0x124)],_0x85677b['sessionId']);!_0x49ea69&&!_0x17ba1b&&_0x85677b?.[_0x38c3b2(0x14a)]&&_0x300205['set'](_0x14cb2f[_0x38c3b2(0x12b)],_0x85677b['style']);const _0x513c43=_0xa055d6+_0x38c3b2(0x141)+_0x2650b8+'/report/markdown',_0x9cc59f=''+_0x513c43+(_0x300205['toString']()?'?'+_0x300205['toString']():''),_0xf4f316=await fetch(_0x9cc59f,{'method':_0x38c3b2(0x112),'headers':{'Authorization':_0x38c3b2(0x114)+_0x4ae781}});if(!_0xf4f316['ok']){const _0xd1a057=await _0xf4f316[_0x38c3b2(0x146)]();throw new Error(_0x38c3b2(0x126)+_0xd1a057);}return _0xf4f316['text']();}export async function listFeatureSessions(_0x3a8db8){const _0x34b75e=_0x951c,_0x32c575={'dYoue':function(_0xbe93c6){return _0xbe93c6();},'RdeXu':_0x34b75e(0x109),'qpscu':function(_0x331e3e,_0x58485e,_0x30a352){return _0x331e3e(_0x58485e,_0x30a352);},'bBkbH':_0x34b75e(0x112)},_0x691827=await _0x32c575[_0x34b75e(0x13e)](getToken);if(!_0x691827)throw new Error(_0x32c575['RdeXu']);const _0x25b692=getApiBaseUrl(),_0x3f4b0b=await _0x32c575[_0x34b75e(0x131)](fetch,_0x25b692+_0x34b75e(0x141)+_0x3a8db8+_0x34b75e(0x137),{'method':_0x32c575[_0x34b75e(0x108)],'headers':{'Authorization':_0x34b75e(0x114)+_0x691827}});if(!_0x3f4b0b['ok']){const _0x17a3c8=await _0x3f4b0b['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x17a3c8);}return _0x3f4b0b[_0x34b75e(0x11d)]();}export async function startSession(_0x363b58,_0x4f04bb){const _0xd6e623=_0x951c,_0x4ae348={'PrIsJ':function(_0x3a272a){return _0x3a272a();},'VNOYD':_0xd6e623(0x106)},_0x28af1b=await _0x4ae348[_0xd6e623(0x10b)](getToken);if(!_0x28af1b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x17bf6c=getApiBaseUrl(),_0x301466=await fetch(_0x17bf6c+'/api/v1/mcp/features/'+_0x363b58+_0xd6e623(0x128)+_0x4f04bb+_0xd6e623(0x12f),{'method':_0x4ae348[_0xd6e623(0x140)],'headers':{'Authorization':'Bearer\x20'+_0x28af1b}});if(!_0x301466['ok']){const _0x3b2d3e=await _0x301466[_0xd6e623(0x146)]();throw new Error(_0xd6e623(0x14f)+_0x3b2d3e);}return _0x301466[_0xd6e623(0x11d)]();}export async function concludeSession(_0x3a62df,_0x258d4e){const _0x4a4685=_0x951c,_0x4efb2a={'Zcppy':function(_0x44bf09){return _0x44bf09();},'ulgLA':function(_0x416cd8){return _0x416cd8();},'mKfao':function(_0x35a8d3,_0x55a581,_0x23d70a){return _0x35a8d3(_0x55a581,_0x23d70a);}},_0x1802de=await _0x4efb2a[_0x4a4685(0x13b)](getToken);if(!_0x1802de)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x46a75f=_0x4efb2a['ulgLA'](getApiBaseUrl),_0x240a2e=await _0x4efb2a[_0x4a4685(0x107)](fetch,_0x46a75f+'/api/v1/mcp/features/'+_0x3a62df+_0x4a4685(0x128)+_0x258d4e+_0x4a4685(0x14e),{'method':_0x4a4685(0x106),'headers':{'Authorization':'Bearer\x20'+_0x1802de}});if(!_0x240a2e['ok']){const _0x81cda3=await _0x240a2e['text']();throw new Error(_0x4a4685(0x142)+_0x81cda3);}return _0x240a2e['json']();}export async function getActionItems(_0x464fba){const _0xb8c1c7=_0x951c,_0x5e5eef={'dXIsZ':function(_0x11f331){return _0x11f331();},'kYfoK':_0xb8c1c7(0x112)},_0x567c32=await getToken();if(!_0x567c32)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x6f0cd=_0x5e5eef['dXIsZ'](getApiBaseUrl),_0xd81811=await fetch(_0x6f0cd+_0xb8c1c7(0x141)+_0x464fba+'/action-items',{'method':_0x5e5eef[_0xb8c1c7(0x11f)],'headers':{'Authorization':_0xb8c1c7(0x114)+_0x567c32}});if(!_0xd81811['ok']){const _0x97098=await _0xd81811['text']();throw new Error(_0xb8c1c7(0x115)+_0x97098);}return _0xd81811['json']();}export async function getItemFeedback(_0x20054b,_0x3fc8f5){const _0x1d85d3=_0x951c,_0x15a2d9={'TpRhx':function(_0x35aa1e){return _0x35aa1e();},'xGFwW':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','nhupD':function(_0x518850,_0x4695c8,_0x403b06){return _0x518850(_0x4695c8,_0x403b06);}},_0x6e60cf=await _0x15a2d9['TpRhx'](getToken);if(!_0x6e60cf)throw new Error(_0x15a2d9['xGFwW']);const _0x2291cb=_0x15a2d9[_0x1d85d3(0x13a)](getApiBaseUrl),_0x4cd9b5=await _0x15a2d9['nhupD'](fetch,_0x2291cb+_0x1d85d3(0x141)+_0x20054b+'/checklist-items/'+_0x3fc8f5+'/feedback',{'method':_0x1d85d3(0x112),'headers':{'Authorization':'Bearer\x20'+_0x6e60cf}});if(!_0x4cd9b5['ok']){const _0x5585c4=await _0x4cd9b5['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x5585c4);}return _0x4cd9b5[_0x1d85d3(0x11d)]();}export async function markCommentsAddressed(_0x4e86a7,_0x52f010,_0x162f48){const _0x952f97=_0x951c,_0x5438d9={'EVPma':function(_0x51985a){return _0x51985a();},'kmhlF':'POST','LPWbi':'application/json'},_0x31a7ef=await getToken();if(!_0x31a7ef)throw new Error(_0x952f97(0x109));const _0x77ba4=_0x5438d9[_0x952f97(0x122)](getApiBaseUrl),_0x17bf0b=await fetch(_0x77ba4+'/api/v1/mcp/features/'+_0x4e86a7+_0x952f97(0x125),{'method':_0x5438d9[_0x952f97(0x11a)],'headers':{'Authorization':_0x952f97(0x114)+_0x31a7ef,'Content-Type':_0x5438d9['LPWbi']},'body':JSON[_0x952f97(0x10d)]({'checklistItemId':_0x52f010,'commentIds':_0x162f48})});if(!_0x17bf0b['ok']){const _0x2d0b56=await _0x17bf0b[_0x952f97(0x146)]();throw new Error(_0x952f97(0x123)+_0x2d0b56);}}export async function softDeleteFeature(_0x39f42c){const _0x2d5da4=_0x951c,_0x1fe540=await getToken();if(!_0x1fe540)throw new Error(_0x2d5da4(0x109));const _0x290f24=getApiBaseUrl(),_0x3e2d8c=await fetch(_0x290f24+_0x2d5da4(0x141)+_0x39f42c,{'method':'DELETE','headers':{'Authorization':_0x2d5da4(0x114)+_0x1fe540}});if(!_0x3e2d8c['ok']){const _0x2b1ef7=await _0x3e2d8c['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x2b1ef7);}}export async function restoreFeature(_0x255d74){const _0x3cb63f=_0x951c,_0x121e67={'niVxK':function(_0x535d8b){return _0x535d8b();}},_0x1f5e76=await getToken();if(!_0x1f5e76)throw new Error(_0x3cb63f(0x109));const _0x310361=_0x121e67[_0x3cb63f(0x150)](getApiBaseUrl),_0x164984=await fetch(_0x310361+_0x3cb63f(0x141)+_0x255d74+'/restore',{'method':'POST','headers':{'Authorization':_0x3cb63f(0x114)+_0x1f5e76}});if(!_0x164984['ok']){const _0x399f93=await _0x164984[_0x3cb63f(0x146)]();throw new Error(_0x3cb63f(0x12c)+_0x399f93);}}
|
|
1
|
+
(function(_0x359ece,_0x3523d0){const _0x44952e=_0x2434,_0x1c93df=_0x359ece();while(!![]){try{const _0x2dae9d=parseInt(_0x44952e(0x177))/0x1+-parseInt(_0x44952e(0x13e))/0x2*(parseInt(_0x44952e(0x137))/0x3)+parseInt(_0x44952e(0x132))/0x4*(parseInt(_0x44952e(0x173))/0x5)+-parseInt(_0x44952e(0x17b))/0x6+parseInt(_0x44952e(0x13f))/0x7+parseInt(_0x44952e(0x149))/0x8+-parseInt(_0x44952e(0x14a))/0x9*(parseInt(_0x44952e(0x174))/0xa);if(_0x2dae9d===_0x3523d0)break;else _0x1c93df['push'](_0x1c93df['shift']());}catch(_0x4949ba){_0x1c93df['push'](_0x1c93df['shift']());}}}(_0x2895,0xd5c94));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x2f295f){const _0x34e735=_0x2434,_0x15d5bc={'BCRSC':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ucPJt':_0x34e735(0x14e),'tWqnu':_0x34e735(0x17a)},_0x3df7da=await getToken();if(!_0x3df7da)throw new Error(_0x15d5bc[_0x34e735(0x158)]);const _0x17b346=getApiBaseUrl(),_0x355d96=await fetch(_0x17b346+'/api/v1/mcp/features',{'method':_0x34e735(0x15e),'headers':{'Authorization':'Bearer\x20'+_0x3df7da,'Content-Type':_0x15d5bc['ucPJt']},'body':JSON[_0x34e735(0x163)](_0x2f295f)});if(!_0x355d96['ok']){if(_0x355d96[_0x34e735(0x151)]===0x192){const _0xb33011=await _0x355d96[_0x34e735(0x139)](),_0x52f201=_0xb33011[_0x34e735(0x144)]||_0x15d5bc[_0x34e735(0x13b)];throw new Error((_0xb33011['message']||'Feature\x20limit\x20exceeded')+_0x34e735(0x14d)+_0x52f201);}const _0x24bde8=await _0x355d96['text']();throw new Error(_0x34e735(0x178)+_0x24bde8);}return _0x355d96[_0x34e735(0x139)]();}export async function listFeatures(_0x4eaedf){const _0x10cdc8=_0x2434,_0x461d40={'GneIT':'gitBranch','mpEDk':'offset','JheXL':_0x10cdc8(0x145),'RUBnr':'true','RPOwG':'GET'},_0x2a1860=await getToken();if(!_0x2a1860)throw new Error(_0x10cdc8(0x167));const _0x448a31=getApiBaseUrl(),_0x180e0a=new URLSearchParams();if(_0x4eaedf?.[_0x10cdc8(0x13d)])_0x180e0a['set'](_0x10cdc8(0x13d),_0x4eaedf['gitRepoUrl']);if(_0x4eaedf?.[_0x10cdc8(0x133)])_0x180e0a['set'](_0x461d40['GneIT'],_0x4eaedf[_0x10cdc8(0x133)]);if(_0x4eaedf?.['limit'])_0x180e0a['set']('limit',_0x4eaedf['limit'][_0x10cdc8(0x171)]());if(_0x4eaedf?.['offset'])_0x180e0a['set'](_0x461d40[_0x10cdc8(0x166)],_0x4eaedf['offset']['toString']());if(_0x4eaedf?.['includeDeleted'])_0x180e0a['set'](_0x461d40[_0x10cdc8(0x14f)],_0x461d40[_0x10cdc8(0x15b)]);const _0x5985f6=_0x448a31+_0x10cdc8(0x175)+(_0x180e0a[_0x10cdc8(0x171)]()?'?'+_0x180e0a[_0x10cdc8(0x171)]():''),_0x4b2455=await fetch(_0x5985f6,{'method':_0x461d40[_0x10cdc8(0x15d)],'headers':{'Authorization':_0x10cdc8(0x16b)+_0x2a1860}});if(!_0x4b2455['ok']){const _0x207ee1=await _0x4b2455[_0x10cdc8(0x16f)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x207ee1);}return _0x4b2455[_0x10cdc8(0x139)]();}export async function getFeature(_0x1d4242){const _0x58077b=_0x2434,_0xf0392c={'mcFIO':function(_0x31b0f1){return _0x31b0f1();},'XNUdl':_0x58077b(0x167)},_0x41c565=await _0xf0392c['mcFIO'](getToken);if(!_0x41c565)throw new Error(_0xf0392c['XNUdl']);const _0x2ec336=_0xf0392c[_0x58077b(0x153)](getApiBaseUrl),_0x5e4cda=await fetch(_0x2ec336+'/api/v1/mcp/features/'+_0x1d4242,{'method':'GET','headers':{'Authorization':_0x58077b(0x16b)+_0x41c565}});if(!_0x5e4cda['ok']){const _0x194f3c=await _0x5e4cda[_0x58077b(0x16f)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x194f3c);}return _0x5e4cda[_0x58077b(0x139)]();}export async function updateFeature(_0x7c448f,_0x1c1ba3){const _0x4598bb=_0x2434,_0x3b603b={'WqIKa':_0x4598bb(0x167),'GMCix':function(_0x289017,_0x3e70ff,_0x5b88df){return _0x289017(_0x3e70ff,_0x5b88df);},'TLHzG':'PATCH','Gvkwe':_0x4598bb(0x14e)},_0x263d2e=await getToken();if(!_0x263d2e)throw new Error(_0x3b603b[_0x4598bb(0x159)]);const _0x54f36b=getApiBaseUrl(),_0xad38b0=await _0x3b603b[_0x4598bb(0x136)](fetch,_0x54f36b+_0x4598bb(0x161)+_0x7c448f,{'method':_0x3b603b['TLHzG'],'headers':{'Authorization':_0x4598bb(0x16b)+_0x263d2e,'Content-Type':_0x3b603b['Gvkwe']},'body':JSON['stringify'](_0x1c1ba3)});if(!_0xad38b0['ok']){const _0xcdcfa=await _0xad38b0[_0x4598bb(0x16f)]();throw new Error(_0x4598bb(0x148)+_0xcdcfa);}return _0xad38b0[_0x4598bb(0x139)]();}export async function createChecklistItem(_0x42c896,_0x268bfe,_0x4f69c7){const _0x20328f=_0x2434,_0x1b13b9={'FhMmF':'POST'},_0x118f26=await getToken();if(!_0x118f26)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x51050a=getApiBaseUrl(),_0x120570=await fetch(_0x51050a+'/api/v1/mcp/features/'+_0x42c896+_0x20328f(0x16a),{'method':_0x1b13b9['FhMmF'],'headers':{'Authorization':_0x20328f(0x16b)+_0x118f26,'Content-Type':_0x20328f(0x14e)},'body':JSON[_0x20328f(0x163)]({'description':_0x268bfe,'position':_0x4f69c7})});if(!_0x120570['ok']){const _0x22fbf1=await _0x120570['text']();throw new Error(_0x20328f(0x16c)+_0x22fbf1);}return _0x120570[_0x20328f(0x139)]();}export async function updateChecklistItem(_0x3f4174,_0x4a4ef8,_0x1ffb4b){const _0x2e063b=_0x2434,_0x3878b5={'epLWM':function(_0x52b09d){return _0x52b09d();},'MVvei':function(_0x2d6d21,_0x3e20d0,_0x18e220){return _0x2d6d21(_0x3e20d0,_0x18e220);},'GFftK':'PATCH'};return withRetry(async()=>{const _0x3c621=_0x2434,_0x2bb566=await getToken();if(!_0x2bb566)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1c81b7=_0x3878b5[_0x3c621(0x146)](getApiBaseUrl),_0x31b995=await _0x3878b5['MVvei'](fetch,_0x1c81b7+_0x3c621(0x161)+_0x3f4174+_0x3c621(0x16e)+_0x4a4ef8,{'method':_0x3878b5[_0x3c621(0x17d)],'headers':{'Authorization':_0x3c621(0x16b)+_0x2bb566,'Content-Type':_0x3c621(0x14e)},'body':JSON['stringify'](_0x1ffb4b)});if(!_0x31b995['ok']){const _0x58f536=await _0x31b995['text']();throw new Error(_0x3c621(0x143)+_0x58f536);}return _0x31b995['json']();},{'label':_0x2e063b(0x156)});}export async function getFeatureReport(_0x410a65){const _0x54023a=_0x2434,_0x36bc3f={'Lkaax':function(_0xe99aea){return _0xe99aea();}},_0x2527a2=await _0x36bc3f[_0x54023a(0x142)](getToken);if(!_0x2527a2)throw new Error(_0x54023a(0x167));const _0x206cbc=getApiBaseUrl(),_0x268530=await fetch(_0x206cbc+'/api/v1/mcp/features/'+_0x410a65+'/report',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x2527a2}});if(!_0x268530['ok']){const _0x5b563c=await _0x268530['text']();throw new Error(_0x54023a(0x13a)+_0x5b563c);}return _0x268530[_0x54023a(0x139)]();}export async function getFeatureReportMarkdown(_0x1dc508,_0x2e38bd){const _0x5beab9=_0x2434,_0x1e5ad4={'EiiCm':_0x5beab9(0x167),'WZwBh':'style','FCSMs':function(_0x4ca8b1,_0x3c548b,_0x526ce9){return _0x4ca8b1(_0x3c548b,_0x526ce9);},'mBlqU':_0x5beab9(0x172)},_0x5aa60b=await getToken();if(!_0x5aa60b)throw new Error(_0x1e5ad4[_0x5beab9(0x13c)]);const _0x2ae395=getApiBaseUrl(),_0x4ab570=new URLSearchParams(),_0xecb6ea=(_0x2e38bd?.[_0x5beab9(0x170)]?.['length']??0x0)>0x0,_0x32155d=Boolean(_0x2e38bd?.[_0x5beab9(0x17c)]);_0xecb6ea&&_0x2e38bd?.[_0x5beab9(0x170)]&&_0x4ab570['set'](_0x5beab9(0x170),_0x2e38bd[_0x5beab9(0x170)][_0x5beab9(0x14c)](','));_0x32155d&&_0x2e38bd?.['sessionId']&&_0x4ab570['set']('sessionId',_0x2e38bd['sessionId']);!_0xecb6ea&&!_0x32155d&&_0x2e38bd?.[_0x5beab9(0x16d)]&&_0x4ab570[_0x5beab9(0x138)](_0x1e5ad4[_0x5beab9(0x157)],_0x2e38bd[_0x5beab9(0x16d)]);const _0x52e7a9=_0x2ae395+_0x5beab9(0x161)+_0x1dc508+'/report/markdown',_0x597dbf=''+_0x52e7a9+(_0x4ab570['toString']()?'?'+_0x4ab570[_0x5beab9(0x171)]():''),_0x5922f7=await _0x1e5ad4[_0x5beab9(0x14b)](fetch,_0x597dbf,{'method':_0x1e5ad4[_0x5beab9(0x154)],'headers':{'Authorization':'Bearer\x20'+_0x5aa60b}});if(!_0x5922f7['ok']){const _0x1ea21c=await _0x5922f7['text']();throw new Error(_0x5beab9(0x135)+_0x1ea21c);}return _0x5922f7['text']();}export async function listFeatureSessions(_0x2f35d1){const _0x2e1943=_0x2434,_0x517e37={'GieyB':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','rzWCO':'GET'},_0x2345df=await getToken();if(!_0x2345df)throw new Error(_0x517e37['GieyB']);const _0x419b12=getApiBaseUrl(),_0x52d8ed=await fetch(_0x419b12+'/api/v1/mcp/features/'+_0x2f35d1+_0x2e1943(0x15f),{'method':_0x517e37[_0x2e1943(0x15c)],'headers':{'Authorization':'Bearer\x20'+_0x2345df}});if(!_0x52d8ed['ok']){const _0x101d0d=await _0x52d8ed['text']();throw new Error(_0x2e1943(0x176)+_0x101d0d);}return _0x52d8ed[_0x2e1943(0x139)]();}export async function startSession(_0x47f830,_0x14c2c6){const _0x5ace23=_0x2434,_0x39ffaf={'rfzhx':function(_0x4b04d0){return _0x4b04d0();},'KbXrI':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','hLYVO':function(_0x4f82cd){return _0x4f82cd();}},_0x129536=await _0x39ffaf[_0x5ace23(0x152)](getToken);if(!_0x129536)throw new Error(_0x39ffaf[_0x5ace23(0x134)]);const _0x44ad67=_0x39ffaf['hLYVO'](getApiBaseUrl),_0xb71942=await fetch(_0x44ad67+'/api/v1/mcp/features/'+_0x47f830+_0x5ace23(0x162)+_0x14c2c6+_0x5ace23(0x150),{'method':'POST','headers':{'Authorization':_0x5ace23(0x16b)+_0x129536}});if(!_0xb71942['ok']){const _0x3496f9=await _0xb71942[_0x5ace23(0x16f)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x3496f9);}return _0xb71942[_0x5ace23(0x139)]();}export async function concludeSession(_0x27921a,_0x108373){const _0x3db3fb=_0x2434,_0x35c80f={'SkOlB':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','MnDvp':'POST'},_0xddc08e=await getToken();if(!_0xddc08e)throw new Error(_0x35c80f['SkOlB']);const _0x4c4740=getApiBaseUrl(),_0x1ccf39=await fetch(_0x4c4740+'/api/v1/mcp/features/'+_0x27921a+_0x3db3fb(0x162)+_0x108373+'/conclude',{'method':_0x35c80f['MnDvp'],'headers':{'Authorization':'Bearer\x20'+_0xddc08e}});if(!_0x1ccf39['ok']){const _0x28299f=await _0x1ccf39['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x28299f);}return _0x1ccf39['json']();}function _0x2895(){const _0x2ad3ec=['Failed\x20to\x20update\x20feature\x20review:\x20','13769624PwgZVT','26054181jncOaq','FCSMs','join','\x0a\x0aUpgrade\x20your\x20plan:\x20','application/json','JheXL','/start','status','rfzhx','mcFIO','mBlqU','Failed\x20to\x20delete\x20feature\x20review:\x20','updateChecklistItem','WZwBh','BCRSC','WqIKa','Boxim','RUBnr','rzWCO','RPOwG','POST','/sessions','Failed\x20to\x20get\x20item\x20feedback:\x20','/api/v1/mcp/features/','/sessions/','stringify','Failed\x20to\x20get\x20action\x20items:\x20','UDbBu','mpEDk','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','rtQEV','/restore','/checklist','Bearer\x20','Failed\x20to\x20create\x20scenario:\x20','style','/checklist/','text','itemIds','toString','GET','109715srHhUJ','10ABdKDj','/api/v1/mcp/features','Failed\x20to\x20list\x20sessions:\x20','1562809oOAKvB','Failed\x20to\x20create\x20feature\x20review:\x20','Failed\x20to\x20restore\x20feature\x20review:\x20','https://dashboard.ranger.net/billing','9947646vktjzK','sessionId','GFftK','188gEUZDI','gitBranch','KbXrI','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','GMCix','3JSxZNy','set','json','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','tWqnu','EiiCm','gitRepoUrl','939754AVTvuS','11081434jWXWAd','DwcEF','/comments/address','Lkaax','Failed\x20to\x20update\x20scenario:\x20','billingUrl','includeDeleted','epLWM','DELETE'];_0x2895=function(){return _0x2ad3ec;};return _0x2895();}export async function getActionItems(_0x31d6e2){const _0xde4eff=_0x2434,_0x5da453={'cqiQg':_0xde4eff(0x167),'kvLlk':function(_0x248845){return _0x248845();},'aqKQH':function(_0x2f6292,_0x5dc983,_0x4e7662){return _0x2f6292(_0x5dc983,_0x4e7662);},'TahvA':_0xde4eff(0x172)},_0x330992=await getToken();if(!_0x330992)throw new Error(_0x5da453['cqiQg']);const _0xa71241=_0x5da453['kvLlk'](getApiBaseUrl),_0x3c79e7=await _0x5da453['aqKQH'](fetch,_0xa71241+'/api/v1/mcp/features/'+_0x31d6e2+'/action-items',{'method':_0x5da453['TahvA'],'headers':{'Authorization':'Bearer\x20'+_0x330992}});if(!_0x3c79e7['ok']){const _0x2b9e2c=await _0x3c79e7[_0xde4eff(0x16f)]();throw new Error(_0xde4eff(0x164)+_0x2b9e2c);}return _0x3c79e7[_0xde4eff(0x139)]();}export async function getItemFeedback(_0x49fe6d,_0x55c160){const _0xd2f144=_0x2434,_0x5a0d89={'rtQEV':function(_0x541935){return _0x541935();},'JeaaC':function(_0x37eb3d,_0x245f44,_0x567aa2){return _0x37eb3d(_0x245f44,_0x567aa2);},'DwcEF':_0xd2f144(0x172)},_0x46c46e=await _0x5a0d89['rtQEV'](getToken);if(!_0x46c46e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x322ab4=_0x5a0d89[_0xd2f144(0x168)](getApiBaseUrl),_0x522ed9=await _0x5a0d89['JeaaC'](fetch,_0x322ab4+_0xd2f144(0x161)+_0x49fe6d+'/checklist-items/'+_0x55c160+'/feedback',{'method':_0x5a0d89[_0xd2f144(0x140)],'headers':{'Authorization':'Bearer\x20'+_0x46c46e}});if(!_0x522ed9['ok']){const _0x2e0b31=await _0x522ed9[_0xd2f144(0x16f)]();throw new Error(_0xd2f144(0x160)+_0x2e0b31);}return _0x522ed9['json']();}export async function markCommentsAddressed(_0x423b5a,_0x38d3bb,_0x12bbf9){const _0x1c256f=_0x2434,_0x49e271={'gGpcM':function(_0x367e5b){return _0x367e5b();},'sczyf':'POST','wkEig':_0x1c256f(0x14e)},_0x1f435b=await getToken();if(!_0x1f435b)throw new Error(_0x1c256f(0x167));const _0x34776c=_0x49e271['gGpcM'](getApiBaseUrl),_0x10d55a=await fetch(_0x34776c+_0x1c256f(0x161)+_0x423b5a+_0x1c256f(0x141),{'method':_0x49e271['sczyf'],'headers':{'Authorization':_0x1c256f(0x16b)+_0x1f435b,'Content-Type':_0x49e271['wkEig']},'body':JSON[_0x1c256f(0x163)]({'checklistItemId':_0x38d3bb,'commentIds':_0x12bbf9})});if(!_0x10d55a['ok']){const _0x37baee=await _0x10d55a['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x37baee);}}function _0x2434(_0x119529,_0x33758f){_0x119529=_0x119529-0x132;const _0x289532=_0x2895();let _0x24343b=_0x289532[_0x119529];return _0x24343b;}export async function softDeleteFeature(_0x1e550c){const _0x2502cc=_0x2434,_0x1d23f8={'Boxim':function(_0x2089ca){return _0x2089ca();},'htwlZ':function(_0x44b01f,_0x565187,_0x580c2b){return _0x44b01f(_0x565187,_0x580c2b);}},_0x2308f3=await getToken();if(!_0x2308f3)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1c6efd=_0x1d23f8[_0x2502cc(0x15a)](getApiBaseUrl),_0x4cd473=await _0x1d23f8['htwlZ'](fetch,_0x1c6efd+'/api/v1/mcp/features/'+_0x1e550c,{'method':_0x2502cc(0x147),'headers':{'Authorization':'Bearer\x20'+_0x2308f3}});if(!_0x4cd473['ok']){const _0x31bb82=await _0x4cd473[_0x2502cc(0x16f)]();throw new Error(_0x2502cc(0x155)+_0x31bb82);}}export async function restoreFeature(_0x868119){const _0xe06a49=_0x2434,_0x31bdbc={'MxRYR':function(_0x3f2846){return _0x3f2846();},'UDbBu':_0xe06a49(0x15e)},_0x516599=await _0x31bdbc['MxRYR'](getToken);if(!_0x516599)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xe28b8d=_0x31bdbc['MxRYR'](getApiBaseUrl),_0x1675c5=await fetch(_0xe28b8d+_0xe06a49(0x161)+_0x868119+_0xe06a49(0x169),{'method':_0x31bdbc[_0xe06a49(0x165)],'headers':{'Authorization':_0xe06a49(0x16b)+_0x516599}});if(!_0x1675c5['ok']){const _0x91900f=await _0x1675c5[_0xe06a49(0x16f)]();throw new Error(_0xe06a49(0x179)+_0x91900f);}}
|