@ranger-testing/ranger-cli 2.5.4-alpha.0e8b82c-9 → 2.5.4-alpha.36a12ca-10
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/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/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/opencodeConfig.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/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/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/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x456da1=_0x49f8;(function(_0x974778,_0x4fcbd3){const _0x5b9809=_0x49f8,_0x3aced4=_0x974778();while(!![]){try{const _0x2e5360=parseInt(_0x5b9809(0x167))/0x1+-parseInt(_0x5b9809(0x17a))/0x2*(-parseInt(_0x5b9809(0x19a))/0x3)+-parseInt(_0x5b9809(0x1ad))/0x4*(parseInt(_0x5b9809(0x18e))/0x5)+parseInt(_0x5b9809(0x1a6))/0x6*(-parseInt(_0x5b9809(0x15a))/0x7)+parseInt(_0x5b9809(0x150))/0x8+parseInt(_0x5b9809(0x192))/0x9+-parseInt(_0x5b9809(0x196))/0xa*(parseInt(_0x5b9809(0x177))/0xb);if(_0x2e5360===_0x4fcbd3)break;else _0x3aced4['push'](_0x3aced4['shift']());}catch(_0x49f558){_0x3aced4['push'](_0x3aced4['shift']());}}}(_0x391f,0xe1549));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x231bc4 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 _0x40d1f7=_0x49f8,_0x156c3f=await getToken();if(!_0x156c3f)throw new Error(_0x40d1f7(0x18d));return _0x156c3f;}async function apiRequest(_0x2d4328,_0x4335c5={}){const _0x276133=_0x49f8,_0x447cc9={'xnfLw':function(_0x58a054){return _0x58a054();},'kmMga':function(_0x2a649e,_0x406482,_0x22f5a1){return _0x2a649e(_0x406482,_0x22f5a1);},'fRxUF':_0x276133(0x188),'aZfDn':function(_0x459859,_0x17fad1){return _0x459859===_0x17fad1;},'JEjLj':function(_0x38e986,_0x11b2be){return _0x38e986===_0x11b2be;},'ZknGo':_0x276133(0x1af)},_0x11594f=await _0x447cc9[_0x276133(0x14c)](requireToken),_0x5c4913=getApiBaseUrl(),_0x58b4bb=await _0x447cc9[_0x276133(0x179)](fetch,''+_0x5c4913+_0x2d4328,{..._0x4335c5,'headers':{'Authorization':_0x276133(0x145)+_0x11594f,'Content-Type':_0x447cc9['fRxUF'],..._0x4335c5[_0x276133(0x183)]??{}}});if(!_0x58b4bb['ok']){let _0x1a68bd='',_0x564394;try{const _0xa76a22=await _0x58b4bb['json']();_0x1a68bd=(_0x447cc9[_0x276133(0x175)](typeof _0xa76a22['error'],_0x276133(0x1af))?_0xa76a22[_0x276133(0x162)]:undefined)??JSON['stringify'](_0xa76a22);if(_0x447cc9[_0x276133(0x16f)](typeof _0xa76a22['code'],_0x447cc9['ZknGo']))_0x564394=_0xa76a22['code'];}catch{_0x1a68bd=_0x58b4bb['statusText'];}throw new ApiError('API\x20request\x20'+_0x2d4328+_0x276133(0x19e)+_0x58b4bb[_0x276133(0x15f)]+_0x276133(0x185)+_0x1a68bd,_0x58b4bb['status'],_0x1a68bd,_0x564394);}return _0x58b4bb['json']();}export class ApiError extends Error{[_0x456da1(0x15f)];[_0x456da1(0x19c)];['code'];constructor(_0x28ad1f,_0x315cce,_0x1ee47a,_0x3a4d13){const _0x5abce4=_0x456da1,_0x1f400a={'nqnJV':'3|1|0|4|2'},_0x1c9ded=_0x1f400a['nqnJV']['split']('|');let _0x4da9c0=0x0;while(!![]){switch(_0x1c9ded[_0x4da9c0++]){case'0':this[_0x5abce4(0x19c)]=_0x1ee47a;continue;case'1':this[_0x5abce4(0x15f)]=_0x315cce;continue;case'2':this[_0x5abce4(0x172)]='ApiError';continue;case'3':super(_0x28ad1f);continue;case'4':this['code']=_0x3a4d13;continue;}break;}}}export async function fetchCloudProfile(_0x4b8a42){const _0x58708c=_0x456da1,_0x1299bd={'iHArN':function(_0x48198e,_0x1cd928){return _0x48198e(_0x1cd928);},'dvHPn':function(_0x4bcb7a,_0xe43aaf){return _0x4bcb7a(_0xe43aaf);},'Ktzyc':function(_0x5827c9,_0x187e74){return _0x5827c9 instanceof _0x187e74;}};try{return await _0x1299bd[_0x58708c(0x18f)](apiRequest,'/api/v1/profiles/'+_0x1299bd[_0x58708c(0x164)](encodeURIComponent,_0x4b8a42));}catch(_0x3fbeb7){if(_0x1299bd['Ktzyc'](_0x3fbeb7,ApiError)&&_0x3fbeb7[_0x58708c(0x15f)]===0x194)return null;throw _0x3fbeb7;}}export async function listCloudProfiles(){const _0x3f2b0f=await apiRequest('/api/v1/profiles');return _0x3f2b0f['profiles'];}export async function createCloudProfile(_0x4be505,_0x1f252b,_0x3826eb={}){const _0x507e33=_0x456da1,_0x246499={'XueHX':function(_0x55a721,_0x5f2e70){return _0x55a721>_0x5f2e70;}},_0x5e8d32={'name':_0x4be505};if(_0x1f252b)_0x5e8d32[_0x507e33(0x160)]=_0x1f252b;_0x3826eb[_0x507e33(0x197)]&&_0x246499[_0x507e33(0x1aa)](Object[_0x507e33(0x15b)](_0x3826eb['settings'])[_0x507e33(0x191)],0x0)&&(_0x5e8d32[_0x507e33(0x197)]=_0x3826eb['settings']);if(_0x3826eb[_0x507e33(0x1a7)])_0x5e8d32['username']=_0x3826eb[_0x507e33(0x1a7)];if(_0x3826eb['password'])_0x5e8d32[_0x507e33(0x174)]=_0x3826eb[_0x507e33(0x174)];return await apiRequest(_0x507e33(0x18b),{'method':_0x507e33(0x168),'body':JSON[_0x507e33(0x195)](_0x5e8d32)});}export async function uploadCloudProfileSession(_0x24dbdf,_0x2212a8){const _0x2baa69=_0x456da1,_0xbd1534={'AlTuo':function(_0x1e2a3a,_0x1c6f8b,_0x7694e4){return _0x1e2a3a(_0x1c6f8b,_0x7694e4);},'ePhWf':function(_0x3fced4,_0x2bb24c){return _0x3fced4(_0x2bb24c);},'dFoQM':'POST'};return await _0xbd1534['AlTuo'](apiRequest,_0x2baa69(0x16e)+_0xbd1534['ePhWf'](encodeURIComponent,_0x24dbdf)+'/session',{'method':_0xbd1534['dFoQM'],'body':JSON[_0x2baa69(0x195)]({'session_state':_0x2212a8})});}function _0x49f8(_0x75e58d,_0x4dcac4){_0x75e58d=_0x75e58d-0x143;const _0x391f68=_0x391f();let _0x49f8c9=_0x391f68[_0x75e58d];return _0x49f8c9;}export async function saveCloudProfileCredentials(_0x5a6673,_0xcd1dc3,_0xb72df7){const _0x41b1fd=_0x456da1;await apiRequest(_0x41b1fd(0x16e)+encodeURIComponent(_0x5a6673),{'method':_0x41b1fd(0x1a9),'body':JSON['stringify']({'username':_0xcd1dc3,'password':_0xb72df7})});}export async function fetchAuthConfig(){const _0x5a1314={'DvIky':'/api/v1/profiles/auth-config'};try{const _0x404422=await apiRequest(_0x5a1314['DvIky']);return _0x404422['auth_config'];}catch{return null;}}export function pickAdHocEnvKey(_0x4a52a6){const _0x28ef59=_0x456da1,_0x2fdcda={'MYCCs':function(_0x21fcea,_0x2f71b7){return _0x21fcea===_0x2f71b7;},'hHpDw':function(_0x108e95,_0x2e5cd0){return _0x108e95===_0x2e5cd0;}};if(!_0x4a52a6)return null;if(_0x4a52a6[_0x28ef59(0x1ac)])return _0x4a52a6['defaultEnvironmentKey'];const _0x5a2ddf=Object['keys'](_0x4a52a6[_0x28ef59(0x173)]??{});if(_0x2fdcda['MYCCs'](_0x5a2ddf['length'],0x1))return _0x5a2ddf[0x0];if(_0x2fdcda[_0x28ef59(0x146)](_0x5a2ddf['length'],0x0))return null;throw new Error('Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20('+_0x5a2ddf['join'](',\x20')+').\x20'+'Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.');}export async function resolveAdHocProfile(_0x39032a=process['env']){const _0x16dff0=_0x456da1,_0xa925ac={'cAnQZ':function(_0x4dea7e,_0x1db184){return _0x4dea7e(_0x1db184);},'hFgjF':function(_0x4df408){return _0x4df408();},'vpjqU':function(_0x1b6b69,_0xb9f9ce,_0x4214e0,_0x17a13a){return _0x1b6b69(_0xb9f9ce,_0x4214e0,_0x17a13a);}},_0x44b693=_0x39032a[_0x16dff0(0x1a5)];if(!_0x44b693)return null;const _0x5848bc=await _0xa925ac['cAnQZ'](fetchCloudProfile,_0x44b693);if(_0x5848bc)return{'name':_0x5848bc['name'],'profile':_0x5848bc};const _0x406ee6=await _0xa925ac['hFgjF'](fetchAuthConfig),_0x1fc0c5=_0xa925ac[_0x16dff0(0x16b)](pickAdHocEnvKey,_0x406ee6),_0x48bde2=_0x39032a[_0x16dff0(0x1a1)],_0x21d4d2=await _0xa925ac['vpjqU'](createCloudProfile,_0x44b693,_0x1fc0c5??undefined,{'username':_0x44b693,'password':_0x48bde2});return console['log'](_0x16dff0(0x16d)+_0x21d4d2['name']+'\x22\x20for\x20'+_0x44b693),{'name':_0x21d4d2['name'],'profile':_0x21d4d2};}export async function writeSessionToLocalCache(_0x30fb67,_0xc815cf,_0x48ad72,_0x5ad662,_0x3e92d3,_0x1beeda,_0x360c60){const _0x5511c1=_0x456da1,_0x58c122={'ceYlq':function(_0x452c6e,_0x50b917){return _0x452c6e(_0x50b917);},'BNeGH':function(_0x322c99){return _0x322c99();},'ewfMn':'auth'},_0x1e81d8=_0x58c122[_0x5511c1(0x198)](sessionCacheHash,{'orgId':_0xc815cf,'profileName':_0x30fb67,'effectiveBaseUrl':_0x48ad72,'setupHeaders':_0x5ad662,'sessionDeps':_0x360c60?.['sessionDeps'],'userAgent':_0x360c60?.[_0x5511c1(0x151)],'clientIp':_0x360c60?.['clientIp']}),_0xba375f=getSessionCachePath(_0x1e81d8,_0x30fb67),_0x3dd012=join(_0x58c122[_0x5511c1(0x14e)](getRangerHomeDir),_0x58c122[_0x5511c1(0x17c)]);!_0x58c122[_0x5511c1(0x198)](existsSync,_0x3dd012)&&await mkdir(_0x3dd012,{'recursive':!![]});const _0x12210a={..._0x3e92d3};_0x1beeda&&_0x1beeda[_0x5511c1(0x191)]>0x0&&Array['isArray'](_0x12210a['cookies'])&&(_0x12210a['cookies']=duplicateCookiesForDomains(_0x12210a['cookies'],_0x1beeda));const _0x493f90={'cached_at':new Date()[_0x5511c1(0x178)](),'session_state':_0x12210a};await writeFile(_0xba375f,JSON['stringify'](_0x493f90,null,0x2));const _0x436525=_0x58c122['ceYlq'](getStorageStatePath,_0xba375f);return await writeFile(_0x436525,JSON['stringify'](_0x12210a,null,0x2)),_0x436525;}export async function checkLocalCache(_0x3bf818,_0x3e9394,_0x42f047,_0x4a2b9e,_0x5cac0e){const _0x4358fe=_0x456da1,_0x49db7d={'AjmZh':function(_0x43703f,_0x196a8a,_0x365cc6){return _0x43703f(_0x196a8a,_0x365cc6);},'wrPoE':function(_0x7cbcdb,_0xb188e2){return _0x7cbcdb(_0xb188e2);},'FVSoa':function(_0x30c6ef,_0x457aad){return _0x30c6ef(_0x457aad);},'DcUZJ':_0x4358fe(0x169)},_0x21f8a3=sessionCacheHash({'orgId':_0x3e9394,'profileName':_0x3bf818,'effectiveBaseUrl':_0x42f047,'setupHeaders':_0x4a2b9e,'sessionDeps':_0x5cac0e?.['sessionDeps'],'userAgent':_0x5cac0e?.[_0x4358fe(0x151)],'clientIp':_0x5cac0e?.[_0x4358fe(0x143)]}),_0xfe2d57=_0x49db7d[_0x4358fe(0x186)](getSessionCachePath,_0x21f8a3,_0x3bf818),_0x553114=_0x49db7d['wrPoE'](getStorageStatePath,_0xfe2d57);if(!_0x49db7d['wrPoE'](existsSync,_0xfe2d57)||!_0x49db7d[_0x4358fe(0x190)](existsSync,_0x553114))return null;try{const _0x18a31d=await readFile(_0xfe2d57,_0x49db7d[_0x4358fe(0x1a3)]);return JSON[_0x4358fe(0x149)](_0x18a31d),{'storageStatePath':_0x553114};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}export async function serverSideLogin(_0x58c7e3,_0x37962c){const _0x6a0d01=_0x456da1,_0x1130ee={'WbOCW':function(_0x311ea2,_0x3ab998){return _0x311ea2===_0x3ab998;},'Quzos':'not_configured'},_0x1bb115=process['env']['RANGER_TEST_USERNAME'],_0x20c3ee=process['env']['RANGER_TEST_PASSWORD'],_0xb8418={};if(_0x1bb115)_0xb8418['username']=_0x1bb115;if(_0x20c3ee)_0xb8418[_0x6a0d01(0x174)]=_0x20c3ee;if(_0x37962c?.['force'])_0xb8418['force']=!![];try{return await apiRequest(_0x6a0d01(0x16e)+encodeURIComponent(_0x58c7e3)+_0x6a0d01(0x187),{'method':_0x6a0d01(0x168),'body':JSON['stringify'](_0xb8418)});}catch(_0x1160c3){if(_0x1160c3 instanceof ApiError&&_0x1130ee['WbOCW'](_0x1160c3['status'],0x190)&&_0x1160c3['code']===_0x1130ee[_0x6a0d01(0x15e)])return{'status':_0x1130ee['Quzos'],'error':_0x1160c3['detail']};throw _0x1160c3;}}function _0x391f(){const _0xdd2e3c=['\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','string','clientIp','storageStatePath','Bearer\x20','hHpDw','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','cli:manual-login','parse','\x22,\x20attempting\x20login...','ddbXZ','xnfLw','iqGtf','BNeGH','environmentKey','11824656XUFQPg','userAgent','close','NwetL','aANvX','newPage','about:blank','UDrXl','log','\x20\x20Login\x20successful.\x20Session\x20cached.','2443yZBCJO','keys','GswXq','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','Quzos','status','environment_key','sessionState','error','JJNws','dvHPn','sessionDeps','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','489249dWwIPr','POST','utf-8','confirm','cAnQZ','UkSdD','\x20\x20Created\x20cloud\x20profile\x20\x22','/api/v1/profiles/','JEjLj','\x20\x20No\x20live\x20session\x20for\x20\x22','setupHeaders','name','environments','password','aZfDn','\x20\x20Server-side\x20login\x20error:\x20','1741355hjQLvm','toISOString','kmMga','2134666rkOcGb','JvudE','ewfMn','baseUrl','Browser\x20login\x20timed\x20out\x20before\x20completion.','KPdtB','save','aIOnR','uITLC','headers','domains','):\x20','AjmZh','/login','application/json','sessionCheckPath','\x20\x20Cloud\x20session\x20for\x20\x22','/api/v1/profiles','CDTMv','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','211485eaSLmJ','iHArN','FVSoa','length','11231235sbawnE','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','extraHTTPHeaders','stringify','50dpYAGk','settings','ceYlq','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','3LERppI','uMGjG','detail','organizationId','\x20failed\x20(','rGNZh','OVEUx','RANGER_TEST_PASSWORD','\x20\x20Cached\x20session\x20for\x20\x22','DcUZJ','browserOptions','RANGER_TEST_USERNAME','23790cfqCJF','username','env','PUT','XueHX','Ntzzh','defaultEnvironmentKey','112zwrIbQ'];_0x391f=function(){return _0xdd2e3c;};return _0x391f();}export async function manualBrowserLogin(_0xc81a96,_0x449ac4){const _0x20a84b=_0x456da1,_0x5555fa={'ImVuL':function(_0x5f1852,_0x1e2fb8){return _0x5f1852(_0x1e2fb8);},'OVEUx':function(_0x4e4a66){return _0x4e4a66();},'ddbXZ':function(_0x46abb1,_0x586ef9,_0x144484){return _0x46abb1(_0x586ef9,_0x144484);},'JvudE':function(_0x1d4db7,_0x4a268b){return _0x1d4db7+_0x4a268b;},'WaxEo':_0x20a84b(0x193),'MmfSE':function(_0x4fc9e1,_0x555f6b){return _0x4fc9e1&&_0x555f6b;},'zrPwF':_0x20a84b(0x17e)};if(!_0x5555fa[_0x20a84b(0x1a0)](isInteractive))throw new Error(_0x5555fa[_0x20a84b(0x17b)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0xc81a96['name']+'\x22.\x0a',_0x20a84b(0x199))+_0x5555fa['WaxEo']);const _0x3f77c2=_0x449ac4&&_0x449ac4['domains'][_0x20a84b(0x191)]>0x0?_0x449ac4['domains'][0x0]:_0x20a84b(0x156);console['log'](_0x20a84b(0x15d)),console[_0x20a84b(0x158)]('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x11c455=>setTimeout(_0x11c455,0x7d0));const _0x278105=await chromium['launch']({'headless':![]});let _0x3845f0=null;try{const _0x31d84f={'ignoreHTTPSErrors':!![]};_0x449ac4?.['setupHeaders']&&(_0x31d84f[_0x20a84b(0x194)]=_0x449ac4['setupHeaders']);const _0x509fc6=await _0x278105['newContext'](_0x31d84f);await addProfileSetupBanner(_0x509fc6);const _0x33fd6a=await _0x509fc6[_0x20a84b(0x155)]();await _0x33fd6a['goto'](_0x3f77c2);let _0x162875=![];await new Promise(_0x84b9ae=>{const _0x5843e=_0x20a84b,_0x2ccc46={'rZgAz':function(_0x487021,_0x1cdfeb){return _0x487021/_0x1cdfeb;}},_0x24fcf4=_0x5555fa[_0x5843e(0x14b)](setTimeout,()=>{_0x162875=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+_0x2ccc46['rZgAz'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x84b9ae();},MANUAL_LOGIN_TIMEOUT_MS);_0x33fd6a['on'](_0x5843e(0x152),async()=>{_0x5555fa['ImVuL'](clearTimeout,_0x24fcf4);try{const _0xc937bf=await _0x509fc6['storageState']();_0x3845f0=_0xc937bf;}catch{}_0x5555fa['OVEUx'](_0x84b9ae);});});if(_0x5555fa['MmfSE'](_0x162875,!_0x3845f0))throw new Error(_0x5555fa['zrPwF']);}finally{await _0x278105['close']()['catch'](()=>{});}if(!_0x3845f0)throw new Error(_0x20a84b(0x166));return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0xc81a96['name'])+'/session',{'method':_0x20a84b(0x168),'body':JSON['stringify']({'session_state':_0x3845f0,'updated_by':_0x20a84b(0x148)})}),{'sessionState':_0x3845f0};}export async function promptSaveCredentials(_0x1bff6f){const _0x4d648b=_0x456da1,_0x2ce206={'uMGjG':function(_0x1b0257){return _0x1b0257();},'UDrXl':_0x4d648b(0x180),'aIOnR':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','UkSdD':function(_0x4a4311,_0xdcc43){return _0x4a4311(_0xdcc43);}},_0x4e9ac9=process[_0x4d648b(0x1a8)][_0x4d648b(0x1a5)],_0x1cd069=process['env']['RANGER_TEST_PASSWORD'];if(!_0x4e9ac9||!_0x1cd069)return;if(!_0x2ce206[_0x4d648b(0x19b)](isInteractive))return;const {save:_0xcaf51b}=await _0x231bc4['prompt']([{'type':_0x4d648b(0x16a),'name':_0x2ce206[_0x4d648b(0x157)],'message':_0x2ce206[_0x4d648b(0x181)],'default':![]}]);if(!_0xcaf51b)return;await apiRequest('/api/v1/profiles/'+_0x2ce206[_0x4d648b(0x16c)](encodeURIComponent,_0x1bff6f),{'method':'PUT','body':JSON[_0x4d648b(0x195)]({'username':_0x4e9ac9,'password':_0x1cd069})}),console[_0x4d648b(0x158)](_0x4d648b(0x1ae));}export async function resolveCloudProfileSession(_0x443fb1,_0x1d934f={}){const _0x21f1eb=_0x456da1,_0x315826={'GswXq':function(_0x4975c0,_0x1e0368,_0x24c646){return _0x4975c0(_0x1e0368,_0x24c646);},'iqGtf':function(_0x38a183,_0x5e3714){return _0x38a183>_0x5e3714;},'rGNZh':function(_0x5cf2cd,_0xa8e6ff,_0x1b7602,_0x249c85,_0x5e47cf){return _0x5cf2cd(_0xa8e6ff,_0x1b7602,_0x249c85,_0x5e47cf);},'PfsMP':function(_0x396d89,_0x1c9faa){return _0x396d89(_0x1c9faa);},'CDTMv':function(_0x41efbe,_0x1a76c4){return _0x41efbe(_0x1a76c4);},'JJNws':function(_0x2f894b,_0x3310f4){return _0x2f894b||_0x3310f4;},'KPdtB':'success','Rzvev':_0x21f1eb(0x159),'aANvX':function(_0x15d5c8,_0x3ceabc,_0x489ec7,_0x24d63a,_0x27ddf7,_0x2e8f0f,_0x37d4ba,_0x48f278){return _0x15d5c8(_0x3ceabc,_0x489ec7,_0x24d63a,_0x27ddf7,_0x2e8f0f,_0x37d4ba,_0x48f278);},'NwetL':_0x21f1eb(0x147),'YxqqX':function(_0x7f140c,_0xc90774){return _0x7f140c instanceof _0xc90774;},'Ntzzh':function(_0x2f026d,_0x2d9696){return _0x2f026d(_0x2d9696);},'uITLC':function(_0x3b4ab4,_0x37c4b3,_0x13142c){return _0x3b4ab4(_0x37c4b3,_0x13142c);}},_0x566abe=_0x443fb1[_0x21f1eb(0x197)]??{},_0x3c9145=await fetchAuthConfig(),_0x492460=_0x3c9145?_0x315826[_0x21f1eb(0x15c)](resolveAuthEnvironmentLocally,_0x3c9145,_0x443fb1[_0x21f1eb(0x14f)]):null,_0x5f2aad=_0x492460?.[_0x21f1eb(0x184)],_0x187f72=_0x566abe[_0x21f1eb(0x171)],_0x16c237=_0x187f72??_0x492460?.['setupHeaders'],_0x265c79=_0x1d934f['effectiveBaseUrl']??_0x566abe[_0x21f1eb(0x17d)]??(_0x5f2aad&&_0x315826[_0x21f1eb(0x14d)](_0x5f2aad['length'],0x0)?_0x5f2aad[0x0]:''),_0x26280b={'sessionDeps':_0x492460?.[_0x21f1eb(0x165)],'userAgent':_0x492460?.[_0x21f1eb(0x1a4)]?.[_0x21f1eb(0x151)]??_0x566abe[_0x21f1eb(0x151)]},_0x4cb71c=await checkLocalCache(_0x443fb1[_0x21f1eb(0x172)],_0x443fb1['organizationId'],_0x265c79,_0x16c237,_0x26280b);if(_0x4cb71c){if(_0x265c79){const _0x54fccb=await _0x315826[_0x21f1eb(0x19f)](isCachedSessionLive,_0x4cb71c['storageStatePath'],_0x265c79,{'sessionCheckPath':_0x492460?.[_0x21f1eb(0x189)],'setupHeaders':_0x16c237},{'launchBrowser':launchRealBrowser});if(_0x54fccb)return console[_0x21f1eb(0x158)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x443fb1['name']+'\x22'),{'authPath':_0x4cb71c[_0x21f1eb(0x144)],'settings':_0x566abe,'resolvedEnv':_0x492460};console[_0x21f1eb(0x158)](_0x21f1eb(0x1a2)+_0x443fb1[_0x21f1eb(0x172)]+'\x22\x20failed\x20validation\x20—\x20refreshing...');}else return{'authPath':_0x4cb71c[_0x21f1eb(0x144)],'settings':_0x566abe,'resolvedEnv':_0x492460};}if(_0x443fb1[_0x21f1eb(0x161)]){const _0x4eda43=await writeSessionToLocalCache(_0x443fb1['name'],_0x443fb1[_0x21f1eb(0x19d)],_0x265c79,_0x16c237,_0x443fb1['sessionState'],_0x5f2aad,_0x26280b);if(_0x265c79){const _0x37ad1b=await _0x315826['rGNZh'](isCachedSessionLive,_0x4eda43,_0x265c79,{'sessionCheckPath':_0x492460?.['sessionCheckPath'],'setupHeaders':_0x16c237},{'launchBrowser':launchRealBrowser});if(_0x37ad1b)return console[_0x21f1eb(0x158)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x443fb1['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x4eda43,'settings':_0x566abe,'resolvedEnv':_0x492460};console[_0x21f1eb(0x158)](_0x21f1eb(0x18a)+_0x443fb1['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...');}else return{'authPath':_0x4eda43,'settings':_0x566abe,'resolvedEnv':_0x492460};}console[_0x21f1eb(0x158)](_0x21f1eb(0x170)+_0x443fb1['name']+_0x21f1eb(0x14a));const _0x53e8f7=_0x315826['PfsMP'](Boolean,process['env'][_0x21f1eb(0x1a5)])&&_0x315826[_0x21f1eb(0x18c)](Boolean,process['env'][_0x21f1eb(0x1a1)]),_0x249098=Boolean(_0x443fb1['username']);if(_0x315826[_0x21f1eb(0x163)](_0x53e8f7,_0x249098))try{const _0x49b95b=await serverSideLogin(_0x443fb1[_0x21f1eb(0x172)]);if(_0x49b95b['status']==='not_configured')console[_0x21f1eb(0x158)]('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x49b95b['status']===_0x315826[_0x21f1eb(0x17f)]&&_0x49b95b['session_state']){console['log'](_0x315826['Rzvev']);const _0x4a1d3b=await _0x315826[_0x21f1eb(0x154)](writeSessionToLocalCache,_0x443fb1['name'],_0x443fb1[_0x21f1eb(0x19d)],_0x265c79,_0x16c237,_0x49b95b['session_state'],_0x5f2aad,_0x26280b);return _0x53e8f7&&!_0x249098&&await _0x315826[_0x21f1eb(0x18c)](promptSaveCredentials,_0x443fb1[_0x21f1eb(0x172)]),{'authPath':_0x4a1d3b,'settings':_0x566abe,'resolvedEnv':_0x492460};}else _0x49b95b['test_output']&&(console[_0x21f1eb(0x158)]('\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'),console['log'](_0x49b95b['test_output'])),console['log'](_0x315826[_0x21f1eb(0x153)]);}}catch(_0x2bc204){console['log'](_0x21f1eb(0x176)+(_0x315826['YxqqX'](_0x2bc204,Error)?_0x2bc204['message']:_0x315826[_0x21f1eb(0x1ab)](String,_0x2bc204))),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x5bef9f}=await _0x315826[_0x21f1eb(0x182)](manualBrowserLogin,_0x443fb1,_0x492460),_0x3d605f=await writeSessionToLocalCache(_0x443fb1[_0x21f1eb(0x172)],_0x443fb1[_0x21f1eb(0x19d)],_0x265c79,_0x16c237,_0x5bef9f,_0x5f2aad,_0x26280b);return{'authPath':_0x3d605f,'settings':_0x566abe,'resolvedEnv':_0x492460};}
|
|
1
|
+
const _0x5da5f9=_0x3e63;(function(_0x53e27e,_0x1b9dd0){const _0x2e1cc3=_0x3e63,_0x4a4a78=_0x53e27e();while(!![]){try{const _0x51fa93=-parseInt(_0x2e1cc3(0xe9))/0x1+parseInt(_0x2e1cc3(0xfb))/0x2+-parseInt(_0x2e1cc3(0xf9))/0x3*(-parseInt(_0x2e1cc3(0xef))/0x4)+-parseInt(_0x2e1cc3(0xd9))/0x5*(parseInt(_0x2e1cc3(0x125))/0x6)+-parseInt(_0x2e1cc3(0x10c))/0x7+parseInt(_0x2e1cc3(0x126))/0x8*(parseInt(_0x2e1cc3(0xea))/0x9)+parseInt(_0x2e1cc3(0x137))/0xa;if(_0x51fa93===_0x1b9dd0)break;else _0x4a4a78['push'](_0x4a4a78['shift']());}catch(_0x2e5e2f){_0x4a4a78['push'](_0x4a4a78['shift']());}}}(_0x59c9,0x939eb));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x5a9977 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 _0x136a7b=_0x3e63,_0x3c8508={'brLmX':function(_0x44d399){return _0x44d399();},'udfzu':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x4956c8=await _0x3c8508[_0x136a7b(0x122)](getToken);if(!_0x4956c8)throw new Error(_0x3c8508[_0x136a7b(0xe5)]);return _0x4956c8;}async function apiRequest(_0x576bd3,_0x4c630d={}){const _0x365263=_0x3e63,_0x26fb79={'fRJND':function(_0x4f6406){return _0x4f6406();},'wzAOG':'application/json','AJiCP':function(_0x4d2a85,_0x56483a){return _0x4d2a85===_0x56483a;}},_0x20ae82=await _0x26fb79['fRJND'](requireToken),_0x27bef1=getApiBaseUrl(),_0x13c051=await fetch(''+_0x27bef1+_0x576bd3,{..._0x4c630d,'headers':{'Authorization':_0x365263(0xe4)+_0x20ae82,'Content-Type':_0x26fb79[_0x365263(0xf4)],..._0x4c630d[_0x365263(0x127)]??{}}});if(!_0x13c051['ok']){let _0x2d80ff='',_0x4a60bb;try{const _0xe9004a=await _0x13c051['json']();_0x2d80ff=(typeof _0xe9004a['error']===_0x365263(0xd3)?_0xe9004a[_0x365263(0x110)]:undefined)??JSON['stringify'](_0xe9004a);if(_0x26fb79[_0x365263(0xd7)](typeof _0xe9004a['code'],'string'))_0x4a60bb=_0xe9004a[_0x365263(0x128)];}catch{_0x2d80ff=_0x13c051[_0x365263(0x139)];}throw new ApiError('API\x20request\x20'+_0x576bd3+_0x365263(0x12b)+_0x13c051[_0x365263(0x13a)]+_0x365263(0x10d)+_0x2d80ff,_0x13c051[_0x365263(0x13a)],_0x2d80ff,_0x4a60bb);}return _0x13c051['json']();}export class ApiError extends Error{['status'];[_0x5da5f9(0x105)];[_0x5da5f9(0x128)];constructor(_0x577b00,_0x36d2e4,_0x382207,_0x118e63){const _0x418654=_0x5da5f9,_0xbc4094=_0x418654(0x123)['split']('|');let _0x24799f=0x0;while(!![]){switch(_0xbc4094[_0x24799f++]){case'0':this[_0x418654(0x105)]=_0x382207;continue;case'1':this['name']=_0x418654(0x103);continue;case'2':this['status']=_0x36d2e4;continue;case'3':super(_0x577b00);continue;case'4':this['code']=_0x118e63;continue;}break;}}}export async function fetchCloudProfile(_0x38a0bd){const _0xb72e52=_0x5da5f9,_0x1d7bb1={'zByoE':function(_0x124b74,_0xb838fd){return _0x124b74(_0xb838fd);},'iVllD':function(_0x4e25fe,_0x1f1909){return _0x4e25fe===_0x1f1909;}};try{return await apiRequest(_0xb72e52(0x12f)+_0x1d7bb1['zByoE'](encodeURIComponent,_0x38a0bd));}catch(_0x39a6dd){if(_0x39a6dd instanceof ApiError&&_0x1d7bb1[_0xb72e52(0xda)](_0x39a6dd['status'],0x194))return null;throw _0x39a6dd;}}export async function listCloudProfiles(){const _0x339eae={'ycPwr':'/api/v1/profiles'},_0x4db33b=await apiRequest(_0x339eae['ycPwr']);return _0x4db33b['profiles'];}function _0x59c9(){const _0x2ae0bd=['error','keys','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','test_output','message','plkrM','wJuyX','dYqym','\x22,\x20attempting\x20login...','\x22\x20for\x20','EpaTP','stringify','Fgmgs','PUT','storageState','utf-8','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','FYyws','brLmX','3|2|0|4|1','environment_key','572910hFBKLG','207968ssHICx','headers','code','organizationId','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','\x20failed\x20(','HjJvd','session_state','browserOptions','/api/v1/profiles/','hzVbp','WEPNc','close','cookies','sessionState','name','prompt','1090310ClRdVU','domains','statusText','status','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','not_configured','lgLJj','loodZ','DDjvQ','NGPyW','password','\x20\x20Login\x20successful.\x20Session\x20cached.','RANGER_TEST_USERNAME','cDnzA','userAgent','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','NHZtZ','launch','sessionDeps','JeJdf','settings','string','iWlih','clientIp','Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.','AJiCP','/login','5WZdjyI','iVllD','environmentKey','goto','Browser\x20login\x20timed\x20out\x20before\x20completion.','ISfZp','zjfCq','VhiaD','BSRjc','save','setupHeaders','Bearer\x20','udfzu','\x22.\x0a','storageStatePath','POST','1198564rfzzpo','180ZCcypK','isArray','newContext','cUyeC','QxBxE','4uvInyl','env','IuSSa','xLXYW','/session','wzAOG','ezzeB','NPGAW','force','log','1761702XKLUZZ','Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20(','1582398gcobcL','cli:manual-login','cZLDa','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','username','newPage','Huciz','qYHka','ApiError','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','detail','\x22,\x20cached\x20locally','catch','defaultEnvironmentKey','XSWzY','auth','length','760788hLmhOm','):\x20','NKZAF','RANGER_TEST_PASSWORD'];_0x59c9=function(){return _0x2ae0bd;};return _0x59c9();}export async function createCloudProfile(_0x10128e,_0x5dfe1c,_0x3400f7={}){const _0x25bbdc=_0x5da5f9,_0x3e63bb={'FYyws':function(_0x5f58bb,_0x3fdf29){return _0x5f58bb>_0x3fdf29;},'Fgmgs':function(_0x3ab604,_0x37ea28,_0x5736b4){return _0x3ab604(_0x37ea28,_0x5736b4);}},_0x1140ca={'name':_0x10128e};if(_0x5dfe1c)_0x1140ca[_0x25bbdc(0x124)]=_0x5dfe1c;_0x3400f7[_0x25bbdc(0xd2)]&&_0x3e63bb[_0x25bbdc(0x121)](Object[_0x25bbdc(0x111)](_0x3400f7[_0x25bbdc(0xd2)])['length'],0x0)&&(_0x1140ca['settings']=_0x3400f7[_0x25bbdc(0xd2)]);if(_0x3400f7['username'])_0x1140ca[_0x25bbdc(0xff)]=_0x3400f7['username'];if(_0x3400f7['password'])_0x1140ca[_0x25bbdc(0x141)]=_0x3400f7[_0x25bbdc(0x141)];return await _0x3e63bb[_0x25bbdc(0x11c)](apiRequest,'/api/v1/profiles',{'method':_0x25bbdc(0xe8),'body':JSON[_0x25bbdc(0x11b)](_0x1140ca)});}export async function uploadCloudProfileSession(_0x6373d7,_0x86f343){const _0x1d0917=_0x5da5f9,_0x297f26={'XFizh':function(_0x3c42fa,_0x559a3a,_0x411b8a){return _0x3c42fa(_0x559a3a,_0x411b8a);},'FNvem':function(_0x8ffa8f,_0x3698ee){return _0x8ffa8f(_0x3698ee);}};return await _0x297f26['XFizh'](apiRequest,_0x1d0917(0x12f)+_0x297f26['FNvem'](encodeURIComponent,_0x6373d7)+'/session',{'method':_0x1d0917(0xe8),'body':JSON[_0x1d0917(0x11b)]({'session_state':_0x86f343})});}export async function saveCloudProfileCredentials(_0x1c295b,_0x365f7a,_0x4b133f){const _0x51d423=_0x5da5f9;await apiRequest(_0x51d423(0x12f)+encodeURIComponent(_0x1c295b),{'method':'PUT','body':JSON['stringify']({'username':_0x365f7a,'password':_0x4b133f})});}export async function fetchAuthConfig(){const _0x2e140f=_0x5da5f9,_0x43417e={'cZLDa':'/api/v1/profiles/auth-config'};try{const _0x5b59aa=await apiRequest(_0x43417e[_0x2e140f(0xfd)]);return _0x5b59aa['auth_config'];}catch{return null;}}function _0x3e63(_0x437b78,_0x5f5d5a){_0x437b78=_0x437b78-0xca;const _0x59c97c=_0x59c9();let _0x3e63f5=_0x59c97c[_0x437b78];return _0x3e63f5;}export function pickAdHocEnvKey(_0x5d5ad3){const _0x431834=_0x5da5f9;if(!_0x5d5ad3)return null;if(_0x5d5ad3[_0x431834(0x108)])return _0x5d5ad3[_0x431834(0x108)];const _0x1bf745=Object[_0x431834(0x111)](_0x5d5ad3['environments']??{});if(_0x1bf745[_0x431834(0x10b)]===0x1)return _0x1bf745[0x0];if(_0x1bf745['length']===0x0)return null;throw new Error(_0x431834(0xfa)+_0x1bf745['join'](',\x20')+').\x20'+_0x431834(0xd6));}export async function resolveAdHocProfile(_0x888468=process[_0x5da5f9(0xf0)]){const _0x36c9e3=_0x5da5f9,_0x320f24={'cUyeC':function(_0x3a9620,_0x3cd16e){return _0x3a9620(_0x3cd16e);},'onwuR':function(_0xd15e25,_0x56f0c0){return _0xd15e25(_0x56f0c0);},'qYHka':function(_0x559b69,_0x53fa2f){return _0x559b69??_0x53fa2f;}},_0x5d7ff0=_0x888468['RANGER_TEST_USERNAME'];if(!_0x5d7ff0)return null;const _0x19efba=await _0x320f24[_0x36c9e3(0xed)](fetchCloudProfile,_0x5d7ff0);if(_0x19efba)return{'name':_0x19efba['name'],'profile':_0x19efba};const _0x3439eb=await fetchAuthConfig(),_0x2abfa0=_0x320f24['onwuR'](pickAdHocEnvKey,_0x3439eb),_0x2d88d0=_0x888468['RANGER_TEST_PASSWORD'],_0x4b811c=await createCloudProfile(_0x5d7ff0,_0x320f24[_0x36c9e3(0x102)](_0x2abfa0,undefined),{'username':_0x5d7ff0,'password':_0x2d88d0});return console[_0x36c9e3(0xf8)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x4b811c[_0x36c9e3(0x135)]+_0x36c9e3(0x119)+_0x5d7ff0),{'name':_0x4b811c[_0x36c9e3(0x135)],'profile':_0x4b811c};}export async function writeSessionToLocalCache(_0x3eaee9,_0x3cc23b,_0x1149fc,_0x500bba,_0x22d959,_0x5a5aaf,_0x561649){const _0x50f851=_0x5da5f9,_0x243858={'HjJvd':function(_0x115585,_0x32e61d,_0x1d7369){return _0x115585(_0x32e61d,_0x1d7369);},'IuSSa':function(_0x2d1f27){return _0x2d1f27();},'plkrM':function(_0x5adc7e,_0x5b7cff){return _0x5adc7e>_0x5b7cff;},'DDjvQ':function(_0x236660,_0x22898f,_0x27675a){return _0x236660(_0x22898f,_0x27675a);}},_0x469290=sessionCacheHash({'orgId':_0x3cc23b,'profileName':_0x3eaee9,'effectiveBaseUrl':_0x1149fc,'setupHeaders':_0x500bba,'sessionDeps':_0x561649?.['sessionDeps'],'userAgent':_0x561649?.[_0x50f851(0xcc)],'clientIp':_0x561649?.['clientIp']}),_0x22987e=_0x243858[_0x50f851(0x12c)](getSessionCachePath,_0x469290,_0x3eaee9),_0x4b1ab2=join(_0x243858[_0x50f851(0xf1)](getRangerHomeDir),_0x50f851(0x10a));!existsSync(_0x4b1ab2)&&await mkdir(_0x4b1ab2,{'recursive':!![]});const _0x32b55c={..._0x22d959};_0x5a5aaf&&_0x243858[_0x50f851(0x115)](_0x5a5aaf[_0x50f851(0x10b)],0x0)&&Array[_0x50f851(0xeb)](_0x32b55c[_0x50f851(0x133)])&&(_0x32b55c[_0x50f851(0x133)]=duplicateCookiesForDomains(_0x32b55c['cookies'],_0x5a5aaf));const _0x56a6d0={'cached_at':new Date()['toISOString'](),'session_state':_0x32b55c};await writeFile(_0x22987e,JSON[_0x50f851(0x11b)](_0x56a6d0,null,0x2));const _0x4591b7=getStorageStatePath(_0x22987e);return await _0x243858[_0x50f851(0x13f)](writeFile,_0x4591b7,JSON['stringify'](_0x32b55c,null,0x2)),_0x4591b7;}export async function checkLocalCache(_0x1e43ae,_0x46350f,_0x59f508,_0x4b9245,_0x15adfe){const _0x1f477b=_0x5da5f9,_0x54ddaa={'BSRjc':function(_0x47b3f3,_0x465615,_0x48d6d2){return _0x47b3f3(_0x465615,_0x48d6d2);},'cgBoJ':function(_0x270deb,_0x945e68){return _0x270deb(_0x945e68);},'Huciz':function(_0x8a3130,_0x23da37){return _0x8a3130(_0x23da37);},'qIFxB':_0x1f477b(0x11f)},_0x473d68=sessionCacheHash({'orgId':_0x46350f,'profileName':_0x1e43ae,'effectiveBaseUrl':_0x59f508,'setupHeaders':_0x4b9245,'sessionDeps':_0x15adfe?.['sessionDeps'],'userAgent':_0x15adfe?.['userAgent'],'clientIp':_0x15adfe?.[_0x1f477b(0xd5)]}),_0x1b55ea=_0x54ddaa[_0x1f477b(0xe1)](getSessionCachePath,_0x473d68,_0x1e43ae),_0x3143c6=_0x54ddaa['cgBoJ'](getStorageStatePath,_0x1b55ea);if(!existsSync(_0x1b55ea)||!_0x54ddaa[_0x1f477b(0x101)](existsSync,_0x3143c6))return null;try{const _0x135f2e=await _0x54ddaa[_0x1f477b(0xe1)](readFile,_0x1b55ea,_0x54ddaa['qIFxB']);return JSON['parse'](_0x135f2e),{'storageStatePath':_0x3143c6};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}export async function serverSideLogin(_0x178723,_0x1d280d){const _0x5f3321=_0x5da5f9,_0x494f12={'cDnzA':_0x5f3321(0xe8),'qKIJg':_0x5f3321(0x13c)},_0x33e1cf=process['env'][_0x5f3321(0xca)],_0x291177=process[_0x5f3321(0xf0)]['RANGER_TEST_PASSWORD'],_0x52a9d5={};if(_0x33e1cf)_0x52a9d5[_0x5f3321(0xff)]=_0x33e1cf;if(_0x291177)_0x52a9d5['password']=_0x291177;if(_0x1d280d?.[_0x5f3321(0xf7)])_0x52a9d5[_0x5f3321(0xf7)]=!![];try{return await apiRequest(_0x5f3321(0x12f)+encodeURIComponent(_0x178723)+_0x5f3321(0xd8),{'method':_0x494f12[_0x5f3321(0xcb)],'body':JSON['stringify'](_0x52a9d5)});}catch(_0x585aa0){if(_0x585aa0 instanceof ApiError&&_0x585aa0[_0x5f3321(0x13a)]===0x190&&_0x585aa0[_0x5f3321(0x128)]==='not_configured')return{'status':_0x494f12['qKIJg'],'error':_0x585aa0[_0x5f3321(0x105)]};throw _0x585aa0;}}export async function manualBrowserLogin(_0x4cca10,_0x431f6a){const _0x19e5ea=_0x5da5f9,_0x453cd2={'WEPNc':function(_0x1447ae,_0x581a46){return _0x1447ae/_0x581a46;},'GFwNS':function(_0x579acf){return _0x579acf();},'GeIAn':function(_0x4bc586,_0x2d3c4e){return _0x4bc586(_0x2d3c4e);},'xQQOb':_0x19e5ea(0x132),'OBXAx':function(_0x39ddc4,_0x1031f2){return _0x39ddc4+_0x1031f2;},'dYqym':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','iJZuM':function(_0x108c20,_0x486f44){return _0x108c20>_0x486f44;},'hzVbp':'about:blank','NGPyW':_0x19e5ea(0x112),'XSWzY':'\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','wJuyX':function(_0x2d1282,_0x199a13){return _0x2d1282(_0x199a13);},'NKZAF':function(_0x192622,_0x22544b){return _0x192622&&_0x22544b;},'NPGAW':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','YsruB':function(_0x341a93,_0x2876e6,_0x42682a){return _0x341a93(_0x2876e6,_0x42682a);},'RBHsG':function(_0x3e5616,_0x5bd0fc){return _0x3e5616(_0x5bd0fc);},'ISfZp':_0x19e5ea(0xfc)};if(!isInteractive())throw new Error(_0x453cd2['OBXAx'](_0x19e5ea(0xcd)+_0x4cca10[_0x19e5ea(0x135)]+_0x19e5ea(0xe6)+_0x453cd2[_0x19e5ea(0x117)],_0x19e5ea(0xfe)));const _0x9f702c=_0x431f6a&&_0x453cd2['iJZuM'](_0x431f6a[_0x19e5ea(0x138)]['length'],0x0)?_0x431f6a[_0x19e5ea(0x138)][0x0]:_0x453cd2[_0x19e5ea(0x130)];console['log'](_0x453cd2[_0x19e5ea(0x140)]),console[_0x19e5ea(0xf8)](_0x453cd2[_0x19e5ea(0x109)]),await new Promise(_0x2e221c=>setTimeout(_0x2e221c,0x7d0));const _0x34a327=await chromium[_0x19e5ea(0xcf)]({'headless':![]});let _0x158eb5=null;try{const _0x58d2a4={'ignoreHTTPSErrors':!![]};_0x431f6a?.['setupHeaders']&&(_0x58d2a4['extraHTTPHeaders']=_0x431f6a[_0x19e5ea(0xe3)]);const _0xbbaed8=await _0x34a327[_0x19e5ea(0xec)](_0x58d2a4);await _0x453cd2[_0x19e5ea(0x116)](addProfileSetupBanner,_0xbbaed8);const _0x524135=await _0xbbaed8[_0x19e5ea(0x100)]();await _0x524135[_0x19e5ea(0xdc)](_0x9f702c);let _0x2a20ca=![];await new Promise(_0x40a944=>{const _0x1046dc={'NHZtZ':function(_0x3863f2,_0x3140d6){const _0x1eb989=_0x3e63;return _0x453cd2[_0x1eb989(0x131)](_0x3863f2,_0x3140d6);},'EpaTP':function(_0x1fed6e){return _0x453cd2['GFwNS'](_0x1fed6e);},'KvcfI':function(_0xbc9ab9,_0x3d36be){return _0x453cd2['GeIAn'](_0xbc9ab9,_0x3d36be);}},_0x1ca08e=setTimeout(()=>{const _0x24c72a=_0x3e63;_0x2a20ca=!![],console[_0x24c72a(0x110)]('Browser\x20login\x20timed\x20out\x20after\x20'+_0x1046dc[_0x24c72a(0xce)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x24c72a(0x104)),_0x1046dc[_0x24c72a(0x11a)](_0x40a944);},MANUAL_LOGIN_TIMEOUT_MS);_0x524135['on'](_0x453cd2['xQQOb'],async()=>{const _0x46fa10=_0x3e63;_0x1046dc['KvcfI'](clearTimeout,_0x1ca08e);try{const _0x4e2f6e=await _0xbbaed8[_0x46fa10(0x11e)]();_0x158eb5=_0x4e2f6e;}catch{}_0x40a944();});});if(_0x453cd2[_0x19e5ea(0x10e)](_0x2a20ca,!_0x158eb5))throw new Error(_0x19e5ea(0xdd));}finally{await _0x34a327['close']()[_0x19e5ea(0x107)](()=>{});}if(!_0x158eb5)throw new Error(_0x453cd2[_0x19e5ea(0xf6)]);return await _0x453cd2['YsruB'](apiRequest,'/api/v1/profiles/'+_0x453cd2['RBHsG'](encodeURIComponent,_0x4cca10['name'])+_0x19e5ea(0xf3),{'method':_0x19e5ea(0xe8),'body':JSON['stringify']({'session_state':_0x158eb5,'updated_by':_0x453cd2[_0x19e5ea(0xde)]})}),{'sessionState':_0x158eb5};}export async function promptSaveCredentials(_0x505299){const _0x54abfd=_0x5da5f9,_0x4339e2={'zjfCq':'confirm','iWlih':_0x54abfd(0x11d)},_0x19c914=process['env'][_0x54abfd(0xca)],_0x6a6e21=process[_0x54abfd(0xf0)][_0x54abfd(0x10f)];if(!_0x19c914||!_0x6a6e21)return;if(!isInteractive())return;const {save:_0xd52f46}=await _0x5a9977[_0x54abfd(0x136)]([{'type':_0x4339e2[_0x54abfd(0xdf)],'name':_0x54abfd(0xe2),'message':_0x54abfd(0x12a),'default':![]}]);if(!_0xd52f46)return;await apiRequest(_0x54abfd(0x12f)+encodeURIComponent(_0x505299),{'method':_0x4339e2[_0x54abfd(0xd4)],'body':JSON[_0x54abfd(0x11b)]({'username':_0x19c914,'password':_0x6a6e21})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x34012f,_0x380c37={}){const _0x5e2601=_0x5da5f9,_0x10ab84={'AThjS':function(_0x1e6ebb){return _0x1e6ebb();},'lgLJj':function(_0x906425,_0x53f55f,_0x25dc79,_0x1acafd,_0x4a0ef1,_0x4472a5){return _0x906425(_0x53f55f,_0x25dc79,_0x1acafd,_0x4a0ef1,_0x4472a5);},'JeJdf':function(_0x3fa5b2,_0x197ac5,_0x31adc0,_0x5a4bdd,_0x3d5935){return _0x3fa5b2(_0x197ac5,_0x31adc0,_0x5a4bdd,_0x3d5935);},'QxBxE':function(_0x27c647,_0x23973d){return _0x27c647(_0x23973d);},'VhiaD':function(_0x1adf6a,_0x2d99b2){return _0x1adf6a(_0x2d99b2);},'xLXYW':function(_0x28a572,_0x2d330a){return _0x28a572===_0x2d330a;},'ezzeB':'success','cUMRq':_0x5e2601(0x142),'Qzeqr':function(_0x5f1e86,_0x3daad0,_0x2a5b22,_0x9fe995,_0x3a51e0,_0x2ed763,_0x40b402,_0x86c204){return _0x5f1e86(_0x3daad0,_0x2a5b22,_0x9fe995,_0x3a51e0,_0x2ed763,_0x40b402,_0x86c204);},'ASpdg':_0x5e2601(0x13b),'wiAUz':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','loodZ':function(_0x2e0b5e,_0x3d2834,_0x33da07){return _0x2e0b5e(_0x3d2834,_0x33da07);}},_0x83db79=_0x34012f['settings']??{},_0xe4004b=await _0x10ab84['AThjS'](fetchAuthConfig),_0x506b24=_0xe4004b?resolveAuthEnvironmentLocally(_0xe4004b,_0x34012f[_0x5e2601(0xdb)]):null,_0x274be8=_0x506b24?.[_0x5e2601(0x138)],_0x4ad562=_0x83db79['setupHeaders'],_0x19117a=_0x4ad562??_0x506b24?.[_0x5e2601(0xe3)],_0x2400a6=_0x380c37['effectiveBaseUrl']??_0x83db79['baseUrl']??(_0x274be8&&_0x274be8[_0x5e2601(0x10b)]>0x0?_0x274be8[0x0]:''),_0x9af0bf={'sessionDeps':_0x506b24?.[_0x5e2601(0xd0)],'userAgent':_0x506b24?.[_0x5e2601(0x12e)]?.['userAgent']??_0x83db79['userAgent']},_0x56275d=await _0x10ab84[_0x5e2601(0x13d)](checkLocalCache,_0x34012f['name'],_0x34012f[_0x5e2601(0x129)],_0x2400a6,_0x19117a,_0x9af0bf);if(_0x56275d){if(_0x2400a6){const _0x4d8311=await _0x10ab84[_0x5e2601(0xd1)](isCachedSessionLive,_0x56275d['storageStatePath'],_0x2400a6,{'sessionCheckPath':_0x506b24?.['sessionCheckPath'],'setupHeaders':_0x19117a},{'launchBrowser':launchRealBrowser});if(_0x4d8311)return console['log'](_0x5e2601(0x120)+_0x34012f['name']+'\x22'),{'authPath':_0x56275d[_0x5e2601(0xe7)],'settings':_0x83db79,'resolvedEnv':_0x506b24};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x34012f['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...');}else return{'authPath':_0x56275d[_0x5e2601(0xe7)],'settings':_0x83db79,'resolvedEnv':_0x506b24};}if(_0x34012f[_0x5e2601(0x134)]){const _0x471ea8=await writeSessionToLocalCache(_0x34012f[_0x5e2601(0x135)],_0x34012f[_0x5e2601(0x129)],_0x2400a6,_0x19117a,_0x34012f[_0x5e2601(0x134)],_0x274be8,_0x9af0bf);if(_0x2400a6){const _0x3bbff3=await isCachedSessionLive(_0x471ea8,_0x2400a6,{'sessionCheckPath':_0x506b24?.['sessionCheckPath'],'setupHeaders':_0x19117a},{'launchBrowser':launchRealBrowser});if(_0x3bbff3)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x34012f[_0x5e2601(0x135)]+_0x5e2601(0x106)),{'authPath':_0x471ea8,'settings':_0x83db79,'resolvedEnv':_0x506b24};console[_0x5e2601(0xf8)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x34012f[_0x5e2601(0x135)]+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...');}else return{'authPath':_0x471ea8,'settings':_0x83db79,'resolvedEnv':_0x506b24};}console[_0x5e2601(0xf8)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x34012f['name']+_0x5e2601(0x118));const _0x935d8d=Boolean(process[_0x5e2601(0xf0)]['RANGER_TEST_USERNAME'])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x581b10=_0x10ab84[_0x5e2601(0xee)](Boolean,_0x34012f[_0x5e2601(0xff)]);if(_0x935d8d||_0x581b10)try{const _0x53c245=await _0x10ab84[_0x5e2601(0xe0)](serverSideLogin,_0x34012f[_0x5e2601(0x135)]);if(_0x53c245['status']===_0x5e2601(0x13c))console['log']('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x10ab84[_0x5e2601(0xf2)](_0x53c245['status'],_0x10ab84[_0x5e2601(0xf5)])&&_0x53c245['session_state']){console[_0x5e2601(0xf8)](_0x10ab84['cUMRq']);const _0x23ff0d=await _0x10ab84['Qzeqr'](writeSessionToLocalCache,_0x34012f[_0x5e2601(0x135)],_0x34012f['organizationId'],_0x2400a6,_0x19117a,_0x53c245[_0x5e2601(0x12d)],_0x274be8,_0x9af0bf);return _0x935d8d&&!_0x581b10&&await promptSaveCredentials(_0x34012f[_0x5e2601(0x135)]),{'authPath':_0x23ff0d,'settings':_0x83db79,'resolvedEnv':_0x506b24};}else _0x53c245[_0x5e2601(0x113)]&&(console['log'](_0x10ab84['ASpdg']),console['log'](_0x53c245['test_output'])),console[_0x5e2601(0xf8)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x55b917){console[_0x5e2601(0xf8)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x55b917 instanceof Error?_0x55b917[_0x5e2601(0x114)]:String(_0x55b917))),console[_0x5e2601(0xf8)](_0x10ab84['wiAUz']);}const {sessionState:_0x1b976f}=await _0x10ab84[_0x5e2601(0x13e)](manualBrowserLogin,_0x34012f,_0x506b24),_0x498207=await writeSessionToLocalCache(_0x34012f['name'],_0x34012f['organizationId'],_0x2400a6,_0x19117a,_0x1b976f,_0x274be8,_0x9af0bf);return{'authPath':_0x498207,'settings':_0x83db79,'resolvedEnv':_0x506b24};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x5d12e5=_0x252d;(function(_0x2c8cb0,_0x113845){const _0xdc0031=_0x252d,_0x17949a=_0x2c8cb0();while(!![]){try{const _0x2dccb4=-parseInt(_0xdc0031(0x90))/0x1+-parseInt(_0xdc0031(0xac))/0x2*(parseInt(_0xdc0031(0xae))/0x3)+-parseInt(_0xdc0031(0xa4))/0x4+parseInt(_0xdc0031(0xa1))/0x5+parseInt(_0xdc0031(0xa0))/0x6*(-parseInt(_0xdc0031(0xa7))/0x7)+-parseInt(_0xdc0031(0x9c))/0x8*(parseInt(_0xdc0031(0x8c))/0x9)+parseInt(_0xdc0031(0x94))/0xa;if(_0x2dccb4===_0x113845)break;else _0x17949a['push'](_0x17949a['shift']());}catch(_0x256461){_0x17949a['push'](_0x17949a['shift']());}}}(_0x39d4,0x97aca));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x7b4089=process[_0x5d12e5(0x8a)],_0x1a4f10={'stdin':process['stdin'],'stdout':process[_0x5d12e5(0x9a)]}){const _0x4a5dbc=_0x5d12e5,_0x2b307d={'MsjjJ':function(_0x3ead8c,_0x17b794){return _0x3ead8c(_0x17b794);}};if(_0x7b4089['CI'])return![];return Boolean(_0x1a4f10['stdin']['isTTY'])&&_0x2b307d[_0x4a5dbc(0x9d)](Boolean,_0x1a4f10['stdout'][_0x4a5dbc(0x95)]);}function _0x252d(_0x55cd10,_0x1d978a){_0x55cd10=_0x55cd10-0x88;const _0x39d44f=_0x39d4();let _0x252d4a=_0x39d44f[_0x55cd10];return _0x252d4a;}export const DEFAULT_SESSION_DEPS=[];export function sessionCacheHash(_0x12ca9f){const _0x3ed702=_0x5d12e5,_0x550758={'SLlHD':'baseUrl','lGDYn':function(_0x52ec42,_0x3b9c22){return _0x52ec42(_0x3b9c22);},'ceySS':'userAgent','rpNit':_0x3ed702(0x96),'GdJPO':function(_0x5f4fbe,_0x15a0f3){return _0x5f4fbe!==_0x15a0f3;},'ohOSx':_0x3ed702(0xb8)},_0x4759cd=new Set(_0x12ca9f['sessionDeps']??DEFAULT_SESSION_DEPS),_0x542196={'orgId':_0x12ca9f[_0x3ed702(0x8f)],'profileName':_0x12ca9f['profileName']};return _0x4759cd[_0x3ed702(0xa8)](_0x550758['SLlHD'])&&(_0x542196[_0x3ed702(0x9e)]=_0x12ca9f[_0x3ed702(0x9e)]),_0x4759cd['has'](_0x3ed702(0xb4))&&(_0x542196['setupHeaders']=_0x12ca9f[_0x3ed702(0xb4)]?_0x550758['lGDYn'](sortObjectKeys,_0x12ca9f['setupHeaders']):_0x12ca9f[_0x3ed702(0xb4)]),_0x4759cd['has'](_0x3ed702(0xb7))&&(_0x542196['port']=extractPort(_0x12ca9f[_0x3ed702(0x9e)])),_0x4759cd['has'](_0x550758['ceySS'])&&_0x12ca9f[_0x3ed702(0x97)]!==undefined&&(_0x542196['userAgent']=_0x12ca9f['userAgent']),_0x4759cd[_0x3ed702(0xa8)](_0x550758['rpNit'])&&_0x550758[_0x3ed702(0xb3)](_0x12ca9f['clientIp'],undefined)&&(_0x542196[_0x3ed702(0x96)]=_0x12ca9f[_0x3ed702(0x96)]),createHash(_0x550758[_0x3ed702(0x9b)])[_0x3ed702(0x8d)](JSON['stringify'](_0x542196))['digest'](_0x3ed702(0x88))['slice'](0x0,0xc);}function extractPort(_0x59624b){const _0x56b0e7=_0x5d12e5;try{return new URL(_0x59624b)[_0x56b0e7(0xb7)];}catch{return'';}}function _0x39d4(){const _0x395ec9=['setupHeaders','.json','.storageState.json','port','sha256','defaultEnvironmentKey','hex','.localhost','env','sessionCheckPath','4777695vYqUnj','update','toString','orgId','1142230FuTYRQ','map','sort','keys','45460980THpUkd','isTTY','clientIp','userAgent','knydP','hostname','stdout','ohOSx','8nJblBf','MsjjJ','effectiveBaseUrl','startsWith','3530886OTuyPO','763475OWLheL','PIkms','push','4831868wMaMlQ','KnRWx','launchBrowser','7XPqFzT','has','includes','status','newPage','608002QtQtzq','close','6Pqfncs','goto','test','NDjUU','url','GdJPO'];_0x39d4=function(){return _0x395ec9;};return _0x39d4();}function sortObjectKeys(_0x4fcaa4){const _0x4ecf6f=_0x5d12e5,_0x378361={};for(const _0x3aefe9 of Object[_0x4ecf6f(0x93)](_0x4fcaa4)[_0x4ecf6f(0x92)]()){_0x378361[_0x3aefe9]=_0x4fcaa4[_0x3aefe9];}return _0x378361;}export function getSessionCachePath(_0x41e163,_0x5448b3){const _0x34a7d2=_0x5d12e5,_0x54d87c={'KnRWx':'auth'};return join(getRangerHomeDir(),_0x54d87c[_0x34a7d2(0xa5)],_0x41e163+'-'+_0x5448b3+_0x34a7d2(0xb5));}export function getStorageStatePath(_0xef010e){const _0x54c514=_0x5d12e5;return _0xef010e['replace'](/\.json$/,_0x54c514(0xb6));}export function needsTunnel(_0x48d26e){const _0x4ea57e=_0x5d12e5,_0x4f1427={'WGylg':'localhost'};let _0x59dd71;try{_0x59dd71=new URL(_0x48d26e)[_0x4ea57e(0x99)];}catch{return![];}if(_0x59dd71===_0x4f1427['WGylg']||_0x59dd71==='127.0.0.1')return!![];if(_0x59dd71['endsWith'](_0x4ea57e(0x89)))return!![];if(_0x59dd71[_0x4ea57e(0xa9)]('localhost.'))return!![];return![];}export function hostnameOf(_0x1b9dfa){const _0x423050=_0x5d12e5;return new URL(_0x1b9dfa)[_0x423050(0x99)];}export function duplicateCookiesForDomains(_0x1c62d2,_0x369d26){const _0x213aa2=_0x5d12e5,_0x1360d4=[..._0x1c62d2],_0x33a779=new Set(_0x1c62d2[_0x213aa2(0x91)](_0x252318=>_0x252318['domain']));for(const _0x5dd0fb of _0x369d26){let _0x36469b;try{_0x36469b=hostnameOf(_0x5dd0fb);}catch{continue;}if(!_0x36469b)continue;const _0x930c9f=_0x36469b[_0x213aa2(0x9f)]('.')?_0x36469b:'.'+_0x36469b;if(_0x33a779['has'](_0x36469b)||_0x33a779['has'](_0x930c9f))continue;for(const _0x54e830 of _0x1c62d2){_0x1360d4[_0x213aa2(0xa3)]({..._0x54e830,'domain':_0x930c9f});}_0x33a779['add'](_0x930c9f);}return _0x1360d4;}export function resolveAuthEnvironmentLocally(_0x54f4ac,_0x491cba){const _0x4d5a7d=_0x5d12e5,_0x4aaf8d={'knydP':function(_0x80c023,_0x1978ca){return _0x80c023===_0x1978ca;}},_0x4e9211=_0x54f4ac['environments'];if(_0x491cba){const _0x220c65=_0x4e9211[_0x491cba];if(!_0x220c65)return null;return{'key':_0x491cba,..._0x220c65};}if(_0x54f4ac[_0x4d5a7d(0xb9)]){const _0x581ebe=_0x4e9211[_0x54f4ac[_0x4d5a7d(0xb9)]];if(!_0x581ebe)return null;return{'key':_0x54f4ac['defaultEnvironmentKey'],..._0x581ebe};}const _0x35ca13=Object['keys'](_0x4e9211);if(_0x4aaf8d[_0x4d5a7d(0x98)](_0x35ca13['length'],0x1)){const _0x3de154=_0x35ca13[0x0];return{'key':_0x3de154,..._0x4e9211[_0x3de154]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x16fc65,_0x4059c4){const _0x52e96f=_0x5d12e5;try{if(_0x4059c4)return new URL(_0x4059c4,_0x16fc65)[_0x52e96f(0x8e)]();return new URL(_0x16fc65)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x52023f){const _0x294a47=_0x5d12e5;try{const _0x4f38c8=new URL(_0x52023f);return LOGIN_URL_PATTERN['test'](_0x4f38c8['pathname']);}catch{return LOGIN_URL_PATTERN[_0x294a47(0xb0)](_0x52023f);}}export async function isCachedSessionLive(_0x39ccb7,_0x366f94,_0x5b59fe={},_0x1b7368={}){const _0xe8a65f=_0x5d12e5,_0x54f0d8={'PIkms':'domcontentloaded','NDjUU':function(_0x45eb1c,_0xdcfd6b){return _0x45eb1c===_0xdcfd6b;}},_0x32b1dd=buildSessionCheckUrl(_0x366f94,_0x5b59fe[_0xe8a65f(0x8b)]);if(!_0x32b1dd)return!![];if(!_0x1b7368[_0xe8a65f(0xa6)])return!![];let _0x2e88bc=null;try{_0x2e88bc=await _0x1b7368[_0xe8a65f(0xa6)]();const _0x52f639=await _0x2e88bc['newContext']({'storageState':_0x39ccb7,'ignoreHTTPSErrors':!![],..._0x5b59fe['setupHeaders']?{'extraHTTPHeaders':_0x5b59fe[_0xe8a65f(0xb4)]}:{}}),_0x2b0c26=await _0x52f639[_0xe8a65f(0xab)](),_0x4adb94=await _0x2b0c26[_0xe8a65f(0xaf)](_0x32b1dd,{'waitUntil':_0x54f0d8[_0xe8a65f(0xa2)],'timeout':0x3a98}),_0x16cadf=_0x4adb94?.[_0xe8a65f(0xaa)]();if(_0x54f0d8['NDjUU'](_0x16cadf,0x191)||_0x54f0d8[_0xe8a65f(0xb1)](_0x16cadf,0x193))return![];const _0x4637de=_0x2b0c26[_0xe8a65f(0xb2)]();if(looksLikeLoginUrl(_0x4637de))return![];return!![];}catch{return![];}finally{if(_0x2e88bc)await _0x2e88bc[_0xe8a65f(0xad)]()['catch'](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x23e8(_0x54fd10,_0xaa8e6c){_0x54fd10=_0x54fd10-0x1b9;const _0x173b26=_0x173b();let _0x23e899=_0x173b26[_0x54fd10];return _0x23e899;}function _0x173b(){const _0x497e06=['248ZNRNQT','sha256','final','subarray','update','1290883teYcin','9781440krOodR','bPXPO','476739vGPTQL','28835268tWzhjM','12XBGEmA','113352jHJthv','6724QbbjNM','utf8','214308ewjhho','126vpbTNh','concat','3910WDyTrK','JVCaK'];_0x173b=function(){return _0x497e06;};return _0x173b();}(function(_0x3020dc,_0x4e4108){const _0x29d6bb=_0x23e8,_0x2b7252=_0x3020dc();while(!![]){try{const _0x3b9190=parseInt(_0x29d6bb(0x1ba))/0x1+-parseInt(_0x29d6bb(0x1c0))/0x2*(-parseInt(_0x29d6bb(0x1bf))/0x3)+-parseInt(_0x29d6bb(0x1c1))/0x4*(parseInt(_0x29d6bb(0x1c6))/0x5)+-parseInt(_0x29d6bb(0x1c3))/0x6*(-parseInt(_0x29d6bb(0x1c4))/0x7)+-parseInt(_0x29d6bb(0x1c8))/0x8*(parseInt(_0x29d6bb(0x1bd))/0x9)+-parseInt(_0x29d6bb(0x1bb))/0xa+parseInt(_0x29d6bb(0x1be))/0xb;if(_0x3b9190===_0x4e4108)break;else _0x2b7252['push'](_0x2b7252['shift']());}catch(_0x2733e5){_0x2b7252['push'](_0x2b7252['shift']());}}}(_0x173b,0xced08));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;export function deriveKey(_0xb31f10){const _0x3808c2=_0x23e8,_0x4b67ce={'FRDZN':function(_0x40dc01,_0x14a814,_0x5d69d5,_0x1a7194,_0x59f532,_0x188134){return _0x40dc01(_0x14a814,_0x5d69d5,_0x1a7194,_0x59f532,_0x188134);}};return _0x4b67ce['FRDZN'](pbkdf2Sync,_0xb31f10,SALT,0x186a0,KEY_LENGTH,_0x3808c2(0x1c9));}export function encrypt(_0x2f1c82,_0x2ecae5){const _0x5e41d9=_0x23e8,_0xc7ecc4={'bPXPO':function(_0x6342ed,_0x50046c){return _0x6342ed(_0x50046c);},'Kcqtn':function(_0x2e3d9e,_0x12fee9,_0xd3398f,_0x19889e){return _0x2e3d9e(_0x12fee9,_0xd3398f,_0x19889e);}},_0x46a2d3=_0xc7ecc4[_0x5e41d9(0x1bc)](deriveKey,_0x2ecae5),_0x114ef0=_0xc7ecc4[_0x5e41d9(0x1bc)](randomBytes,IV_LENGTH),_0x6600a4=_0xc7ecc4['Kcqtn'](createCipheriv,ALGORITHM,_0x46a2d3,_0x114ef0),_0x16ac43=Buffer[_0x5e41d9(0x1c5)]([_0x6600a4[_0x5e41d9(0x1b9)](_0x2f1c82,'utf8'),_0x6600a4['final']()]),_0x5d3ba6=_0x6600a4['getAuthTag']();return Buffer[_0x5e41d9(0x1c5)]([_0x114ef0,_0x5d3ba6,_0x16ac43]);}export function decrypt(_0x165a99,_0x1279d0){const _0x337135=_0x23e8,_0xd5b425={'JVCaK':function(_0x4e3f35,_0x228560,_0x2f0f13,_0x2960e8){return _0x4e3f35(_0x228560,_0x2f0f13,_0x2960e8);},'LliMs':_0x337135(0x1c2)},_0x2a4f4b=deriveKey(_0x1279d0),_0xd94ef=_0x165a99[_0x337135(0x1cb)](0x0,IV_LENGTH),_0x17defe=_0x165a99[_0x337135(0x1cb)](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x34442f=_0x165a99[_0x337135(0x1cb)](IV_LENGTH+TAG_LENGTH),_0x591c2f=_0xd5b425[_0x337135(0x1c7)](createDecipheriv,ALGORITHM,_0x2a4f4b,_0xd94ef);return _0x591c2f['setAuthTag'](_0x17defe),_0x591c2f['update'](_0x34442f)+_0x591c2f[_0x337135(0x1ca)](_0xd5b425['LliMs']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x3625(_0xe3e97d,_0x3856f2){_0xe3e97d=_0xe3e97d-0x1c1;const _0x51a37f=_0x51a3();let _0x3625f0=_0x51a37f[_0xe3e97d];return _0x3625f0;}const _0x56ef74=_0x3625;(function(_0x28865a,_0x25e349){const _0xfdff62=_0x3625,_0x33575d=_0x28865a();while(!![]){try{const _0x47137e=-parseInt(_0xfdff62(0x1ca))/0x1+-parseInt(_0xfdff62(0x1f1))/0x2+parseInt(_0xfdff62(0x1e2))/0x3*(parseInt(_0xfdff62(0x1e0))/0x4)+-parseInt(_0xfdff62(0x1ef))/0x5+parseInt(_0xfdff62(0x1cc))/0x6*(parseInt(_0xfdff62(0x1d3))/0x7)+-parseInt(_0xfdff62(0x1d0))/0x8+parseInt(_0xfdff62(0x1c7))/0x9;if(_0x47137e===_0x25e349)break;else _0x33575d['push'](_0x33575d['shift']());}catch(_0x24700b){_0x33575d['push'](_0x33575d['shift']());}}}(_0x51a3,0xde851));function _0x51a3(){const _0x2baec9=['application/json','join','1509201AdxSmq','YlegU','60yzVgTk','skcNV','rawCommand','[desire-path]\x20Sending\x20log\x20to\x20','4598360LnwTzu','has_token','errorType','1192163pRDVVd','lqfPA','stdout','mgGMb','DEBUG','runtime_error','[REDACTED]','some','push','--api-key','--authorization','isTTY','error','4qIjTmC','includes','2118405nEEhoo','Not\x20enough\x20non-option\x20arguments','QZBsX','sessionId','stringify','unknown_command','--password','--auth','no_token','length','--credentials','Missing\x20required\x20argument','env','512755bocHAl','[desire-path]\x20Payload:\x20','700442fyPoLh','--header','test','errorMessage','has','--key','/api/v1/mcp/desire-path-logs','9350856Tcleue'];_0x51a3=function(){return _0x2baec9;};return _0x51a3();}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret',_0x56ef74(0x1dc),'--apikey',_0x56ef74(0x1c5),_0x56ef74(0x1e8),'--pass',_0x56ef74(0x1e9),_0x56ef74(0x1dd),_0x56ef74(0x1c1),'--cookie',_0x56ef74(0x1ec)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x207f0a){const _0x4413ea=_0x56ef74;return TOKEN_PATTERNS[_0x4413ea(0x1da)](_0x595c3b=>_0x595c3b[_0x4413ea(0x1c2)](_0x207f0a));}export function sanitizeArgs(_0x28a5d9){const _0x17c100=_0x56ef74,_0x11a5a5={'BobfW':_0x17c100(0x1d9),'lqfPA':function(_0x4f7cd5,_0x2cfb6e){return _0x4f7cd5!==_0x2cfb6e;},'yUVLG':function(_0x1e0b26,_0x54e6b3){return _0x1e0b26(_0x54e6b3);}},_0x551b74=[];let _0x14f785=![];for(let _0x208125=0x0;_0x208125<_0x28a5d9[_0x17c100(0x1eb)];_0x208125++){const _0x21bed3=_0x28a5d9[_0x208125];if(_0x14f785){_0x551b74['push'](_0x11a5a5['BobfW']),_0x14f785=![];continue;}if(_0x21bed3['startsWith']('--')||_0x21bed3['startsWith']('-')){const _0x229009=_0x21bed3['indexOf']('=');if(_0x11a5a5[_0x17c100(0x1d4)](_0x229009,-0x1)){const _0x392e87=_0x21bed3['slice'](0x0,_0x229009)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x392e87)){_0x551b74['push'](_0x21bed3['slice'](0x0,_0x229009)+'=[REDACTED]');continue;}}else{const _0x48c4c9=_0x21bed3['toLowerCase']();SENSITIVE_FLAGS[_0x17c100(0x1c4)](_0x48c4c9)&&(_0x14f785=!![]);}_0x551b74[_0x17c100(0x1db)](_0x21bed3);}else _0x11a5a5['yUVLG'](looksLikeToken,_0x21bed3)?_0x551b74[_0x17c100(0x1db)](_0x17c100(0x1d9)):_0x551b74['push'](_0x21bed3);}return _0x551b74[_0x17c100(0x1c9)]('\x20');}export async function logDesirePath(_0x4c9b96){const _0x1e9dd4=_0x56ef74,_0x1718a4={'Yvsqf':_0x1e9dd4(0x1d1),'MjWmJ':_0x1e9dd4(0x1ea),'Yblik':_0x1e9dd4(0x1c8),'QTVwT':'Authorization','YWsiW':function(_0x11f4e6,_0x3f910b,_0xaad990){return _0x11f4e6(_0x3f910b,_0xaad990);}};try{const _0x493364=await getToken()['catch'](()=>null),_0x299bcb=getApiBaseUrl(),_0x986800=getCurrentVersion(),_0xfe7706=_0x493364?_0x1718a4['Yvsqf']:_0x1718a4['MjWmJ'],_0x588456={..._0x4c9b96['metadata'],'authStatus':_0xfe7706,'isTty':process[_0x1e9dd4(0x1d5)][_0x1e9dd4(0x1de)]??![]},_0x1d8aa7={'Content-Type':_0x1718a4['Yblik']};_0x493364&&(_0x1d8aa7[_0x1718a4['QTVwT']]='Bearer\x20'+_0x493364);const _0xe3331={'rawCommand':_0x4c9b96[_0x1e9dd4(0x1ce)],'errorMessage':_0x4c9b96[_0x1e9dd4(0x1c3)],'errorType':_0x4c9b96[_0x1e9dd4(0x1d2)],'featureId':_0x4c9b96['featureId'],'sessionId':_0x4c9b96[_0x1e9dd4(0x1e5)],'metadata':_0x588456,'cliVersion':_0x986800};process[_0x1e9dd4(0x1ee)][_0x1e9dd4(0x1d7)]&&(console[_0x1e9dd4(0x1df)](_0x1e9dd4(0x1cf)+_0x299bcb+_0x1e9dd4(0x1c6)),console['error'](_0x1e9dd4(0x1f0)+JSON[_0x1e9dd4(0x1e6)](_0xe3331,null,0x2))),await _0x1718a4['YWsiW'](fetch,_0x299bcb+'/api/v1/mcp/desire-path-logs',{'method':'POST','headers':_0x1d8aa7,'body':JSON[_0x1e9dd4(0x1e6)](_0xe3331)});}catch(_0x17cfba){process['env']['DEBUG']&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x17cfba);}}export function getErrorType(_0xebb8ad,_0x28cf40){const _0x1f8bef=_0x56ef74,_0x44fd0f={'YlegU':'unknown','QZBsX':'Unknown\x20command','JAaKC':_0x1f8bef(0x1e7),'AaiuL':'Unknown\x20argument','mgGMb':_0x1f8bef(0x1e3),'psbdY':'missing_required_argument','RECTO':'Invalid\x20values','skcNV':_0x1f8bef(0x1ed)};if(_0x28cf40)return _0x1f8bef(0x1d8);if(!_0xebb8ad)return _0x44fd0f[_0x1f8bef(0x1cb)];if(_0xebb8ad[_0x1f8bef(0x1e1)](_0x44fd0f[_0x1f8bef(0x1e4)]))return _0x44fd0f['JAaKC'];if(_0xebb8ad['includes'](_0x44fd0f['AaiuL']))return'unknown_argument';if(_0xebb8ad[_0x1f8bef(0x1e1)](_0x44fd0f[_0x1f8bef(0x1d6)]))return _0x44fd0f['psbdY'];if(_0xebb8ad['includes'](_0x44fd0f['RECTO']))return'invalid_option_value';if(_0xebb8ad['includes'](_0x44fd0f[_0x1f8bef(0x1cd)]))return'missing_option';return'syntax_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xcd1037,_0x2697ae){const _0x540af2=_0x33dc,_0x4af8a2=_0xcd1037();while(!![]){try{const _0x4ea8d2=-parseInt(_0x540af2(0x1a6))/0x1+-parseInt(_0x540af2(0x18c))/0x2+-parseInt(_0x540af2(0x1a0))/0x3*(-parseInt(_0x540af2(0x1b9))/0x4)+-parseInt(_0x540af2(0x195))/0x5+parseInt(_0x540af2(0x1c0))/0x6+-parseInt(_0x540af2(0x1ba))/0x7+parseInt(_0x540af2(0x190))/0x8*(parseInt(_0x540af2(0x1bf))/0x9);if(_0x4ea8d2===_0x2697ae)break;else _0x4af8a2['push'](_0x4af8a2['shift']());}catch(_0x3a5d4f){_0x4af8a2['push'](_0x4af8a2['shift']());}}}(_0x19ff,0xe285b));import{spawn}from'child_process';import _0x212697 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='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x45ff83){const _0x551315=_0x33dc,_0x5d978f={'NqQck':function(_0x4f5dc6,_0x40cea8,_0x4d3aa6){return _0x4f5dc6(_0x40cea8,_0x4d3aa6);},'ulkmO':_0x551315(0x192)},_0x1a7cff=await _0x5d978f[_0x551315(0x199)](fetch,WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0x5d978f['ulkmO']},'body':new URLSearchParams({'client_id':_0x45ff83})});if(!_0x1a7cff['ok']){const _0x9c2e64=await _0x1a7cff[_0x551315(0x1a2)]();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x1a7cff[_0x551315(0x1be)]+'\x20'+_0x9c2e64);}return _0x1a7cff['json']();}export async function pollForTokens(_0x456e8a,_0x48c63e,_0x3548f5,_0x24c350){const _0x3ba62b=_0x33dc,_0x1d5cab={'FbVQW':function(_0x44ad44,_0x5d0613,_0x3fa301){return _0x44ad44(_0x5d0613,_0x3fa301);},'rwcko':'POST','acJkI':_0x3ba62b(0x177),'UyICi':function(_0x27dfa2,_0x1e70f){return _0x27dfa2===_0x1e70f;},'VFLyn':_0x3ba62b(0x1a3),'heHEN':'Device\x20authorization\x20timed\x20out'},_0x34040b=Date[_0x3ba62b(0x1ab)]()+_0x24c350*0x3e8;let _0x75eae7=_0x3548f5*0x3e8;while(Date[_0x3ba62b(0x1ab)]()<_0x34040b){await sleep(_0x75eae7);const _0x40a911=await _0x1d5cab[_0x3ba62b(0x18f)](fetch,WORKOS_TOKEN_URL,{'method':_0x1d5cab['rwcko'],'headers':{'Content-Type':_0x3ba62b(0x192)},'body':new URLSearchParams({'client_id':_0x456e8a,'device_code':_0x48c63e,'grant_type':_0x1d5cab['acJkI']})});if(_0x40a911['ok'])return _0x40a911[_0x3ba62b(0x183)]();const _0x3c4815=await _0x40a911[_0x3ba62b(0x183)]();if(_0x3c4815['error']===_0x3ba62b(0x1bb))continue;if(_0x1d5cab[_0x3ba62b(0x19f)](_0x3c4815['error'],'slow_down')){_0x75eae7+=0x3e8;continue;}throw new Error(_0x3c4815['error_description']||_0x3c4815[_0x3ba62b(0x16d)]||_0x1d5cab[_0x3ba62b(0x17f)]);}throw new Error(_0x1d5cab[_0x3ba62b(0x181)]);}async function fetchUserProfile(_0x55ca0a){const _0x11e546=_0x33dc,_0x134d50={'QVOsI':function(_0x173499){return _0x173499();}},_0x20fb4f=_0x134d50['QVOsI'](getApiBaseUrl);try{const _0x350ad0=await fetch(_0x20fb4f+'/organization/me',{'method':'GET','headers':{'workos-token':_0x55ca0a}});if(_0x350ad0['ok'])return _0x350ad0[_0x11e546(0x183)]();}catch{}return null;}function buildKeyName(_0x8a255d,_0x5cad76){const _0x123ce8=_0x33dc,_0x52562f=_0x5cad76[_0x123ce8(0x178)](_0x589c3a=>_0x589c3a['name']===_0x8a255d||_0x589c3a[_0x123ce8(0x1b7)]['startsWith'](_0x8a255d+'\x20('));if(_0x52562f['length']===0x0)return _0x8a255d;return _0x8a255d+'\x20('+(_0x52562f['length']+0x1)+')';}export async function provisionApiKey(_0x30363d){const _0x215a57=_0x33dc,_0x374b2a={'BwJVy':function(_0x2664fd){return _0x2664fd();},'vraCh':function(_0x5cb428,_0x421233,_0x5ab7c8){return _0x5cb428(_0x421233,_0x5ab7c8);},'IDFjF':'POST','fRkTr':_0x215a57(0x17b)},_0x257da4=_0x374b2a[_0x215a57(0x193)](getApiBaseUrl),_0x2c1b5f={'Content-Type':_0x215a57(0x18a),'workos-token':_0x30363d},_0x1326ee=await fetchUserProfile(_0x30363d),_0x384c72=_0x1326ee?.['firstName']||_0x1326ee?.[_0x215a57(0x1b4)]?.['split']('@')[0x0],_0x22c61b=_0x384c72?_0x384c72+_0x215a57(0x16e):_0x215a57(0x1b3);let _0x8eb1ea=[];try{const _0x495dfc=await fetch(_0x257da4+_0x215a57(0x1b2),{'method':'GET','headers':_0x2c1b5f});if(_0x495dfc['ok']){const _0x55dcda=await _0x495dfc['json']();_0x8eb1ea=_0x55dcda['apiKeys'];}}catch{}const _0x37e6c2=_0x374b2a['vraCh'](buildKeyName,_0x22c61b,_0x8eb1ea),_0xa8cd42=await _0x374b2a['vraCh'](fetch,_0x257da4+'/api-keys',{'method':_0x374b2a[_0x215a57(0x1ae)],'headers':_0x2c1b5f,'body':JSON['stringify']({'name':_0x37e6c2,'scope':_0x374b2a['fRkTr']})});if(!_0xa8cd42['ok']){const _0x11499c=await _0xa8cd42[_0x215a57(0x1a2)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0xa8cd42['status']+'\x20'+_0x11499c);}const _0x54f38d=await _0xa8cd42['json']();return _0x54f38d['apiKey']['token'];}export function openBrowser(_0x51e4ef){const _0x584065=_0x33dc,_0x4e59b3={'xOfTj':_0x584065(0x19e),'amhJB':_0x584065(0x1a9),'uLRGO':'xdg-open'};try{if(process['platform']===_0x584065(0x1af)){const _0x546951=spawn('cmd',['/c','start','',_0x51e4ef],{'detached':!![],'stdio':_0x4e59b3[_0x584065(0x175)],'windowsHide':!![]});_0x546951['unref']();return;}const _0x50e295=process[_0x584065(0x1b6)]===_0x4e59b3['amhJB']?'open':_0x4e59b3[_0x584065(0x198)],_0x454fa1=spawn(_0x50e295,[_0x51e4ef],{'detached':!![],'stdio':_0x584065(0x19e)});_0x454fa1[_0x584065(0x185)]();}catch{}}function decodeJwtPayload(_0x34e414){const _0x1b3339=_0x33dc,_0x255cf3={'tMNCM':function(_0x16ebc9,_0x1d7e40){return _0x16ebc9!==_0x1d7e40;},'UCrQb':_0x1b3339(0x172),'Kxmap':_0x1b3339(0x16c)},_0x5cb9f3=_0x34e414[_0x1b3339(0x17e)]('.');if(_0x255cf3[_0x1b3339(0x1b1)](_0x5cb9f3['length'],0x3))throw new Error(_0x255cf3[_0x1b3339(0x176)]);const _0x5e52bb=Buffer[_0x1b3339(0x1ac)](_0x5cb9f3[0x1],'base64url')[_0x1b3339(0x16f)](_0x255cf3[_0x1b3339(0x18b)]);return JSON['parse'](_0x5e52bb);}async function selfServeSignup(_0x3f5290){const _0x5330c0=_0x33dc,_0x4fb101={'FpCsT':function(_0x22553b,_0x116891,_0x30cb40){return _0x22553b(_0x116891,_0x30cb40);},'jCnNN':_0x5330c0(0x18a)},_0x440b22=getApiBaseUrl(),_0x23f34a=await _0x4fb101['FpCsT'](fetch,_0x440b22+'/organization/self-serve-signup',{'method':'POST','headers':{'Content-Type':_0x4fb101[_0x5330c0(0x16b)],'workos-token':_0x3f5290}});if(!_0x23f34a['ok']){const _0xd8dfcd=await _0x23f34a['text']();throw new Error(_0x5330c0(0x19a)+_0x23f34a[_0x5330c0(0x1be)]+'\x20'+_0xd8dfcd);}return _0x23f34a['json']();}async function fetchMyMemberships(_0xedb7f0){const _0x568d88=_0x33dc,_0x1a0b5a={'LkBOV':function(_0x5e6544,_0x204e24,_0x912c3d){return _0x5e6544(_0x204e24,_0x912c3d);},'IpYNe':_0x568d88(0x17d)},_0xe525df=getApiBaseUrl(),_0x3b403e=await _0x1a0b5a['LkBOV'](fetch,_0xe525df+_0x568d88(0x197),{'method':_0x1a0b5a[_0x568d88(0x188)],'headers':{'workos-token':_0xedb7f0}});if(!_0x3b403e['ok']){const _0x4aee6c=await _0x3b403e['text']();throw new Error(_0x568d88(0x19c)+_0x3b403e[_0x568d88(0x1be)]+'\x20'+_0x4aee6c);}const _0x13c06d=await _0x3b403e[_0x568d88(0x183)]();return _0x13c06d[_0x568d88(0x17a)];}function _0x33dc(_0xbe3089,_0x4c442f){_0xbe3089=_0xbe3089-0x16b;const _0x19ff31=_0x19ff();let _0x33dceb=_0x19ff31[_0xbe3089];return _0x33dceb;}async function refreshTokenWithOrg(_0x4620c8,_0xe9711e,_0x57a63c){const _0x5d8804=_0x33dc,_0x2e5367={'nUUmD':function(_0x562a2e,_0x53be33,_0x10823e){return _0x562a2e(_0x53be33,_0x10823e);},'SunyO':_0x5d8804(0x179),'OXvuE':'application/x-www-form-urlencoded'},_0x1ee6bb=await _0x2e5367['nUUmD'](fetch,WORKOS_TOKEN_URL,{'method':_0x2e5367[_0x5d8804(0x171)],'headers':{'Content-Type':_0x2e5367[_0x5d8804(0x17c)]},'body':new URLSearchParams({'client_id':_0x4620c8,'grant_type':'refresh_token','refresh_token':_0xe9711e,'organization_id':_0x57a63c})});if(!_0x1ee6bb['ok']){const _0x3495e2=await _0x1ee6bb[_0x5d8804(0x1a2)]();throw new Error(_0x5d8804(0x18d)+_0x1ee6bb[_0x5d8804(0x1be)]+'\x20'+_0x3495e2);}return _0x1ee6bb[_0x5d8804(0x183)]();}async function provisionCliToken(_0x437c86){const _0x726a=_0x33dc,_0x3bbc7c={'xdimS':function(_0x51cb2a){return _0x51cb2a();},'MhXrt':function(_0x135322,_0x22b1ab,_0x48f3c2){return _0x135322(_0x22b1ab,_0x48f3c2);}},_0x3119fc=_0x3bbc7c[_0x726a(0x191)](getApiBaseUrl),_0x50c8b9=await _0x3bbc7c[_0x726a(0x196)](fetch,_0x3119fc+'/cli-auth/token',{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x437c86}});if(!_0x50c8b9['ok']){const _0x3cdb04=await _0x50c8b9[_0x726a(0x1a2)]();throw new Error(_0x726a(0x1ad)+_0x50c8b9[_0x726a(0x1be)]+'\x20'+_0x3cdb04);}return _0x50c8b9[_0x726a(0x183)]();}function _0x19ff(){const _0x5460ae=['mcp:write','OXvuE','GET','split','VFLyn','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','heHEN','BylfG','json','length','unref','refresh_token','access_token','IpYNe','stdout','application/json','Kxmap','647796WLcqLr','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','JEppE','FbVQW','3975256feLHRR','xdimS','application/x-www-form-urlencoded','BwJVy','log','4565035PYwWyl','MhXrt','/organization/my-memberships','uLRGO','NqQck','Failed\x20to\x20create\x20organization:\x20','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','Failed\x20to\x20fetch\x20memberships:\x20','stdin','ignore','UyICi','6BwsPvH','workosClientId','text','Authentication\x20failed','list','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','756535bcldOH','fgLnP','verification_uri_complete','darwin','user_code','now','from','Failed\x20to\x20provision\x20CLI\x20token:\x20','IDFjF','win32','selected','tMNCM','/api-keys','CLI\x20Key','email','organizationId','platform','name','token','3545252GrdzKX','12225129NCjnhx','authorization_pending','device_code','Using\x20organization:\x20','status','27jMQfJf','8426250dCHfkp','jCnNN','utf-8','error','\x27s\x20CLI\x20Key','toString','write','SunyO','Invalid\x20JWT\x20format','FKYmt','expires_in','xOfTj','UCrQb','urn:ietf:params:oauth:grant-type:device_code','filter','POST','memberships'];_0x19ff=function(){return _0x5460ae;};return _0x19ff();}export async function runDeviceAuthFlow(){const _0x23474d=_0x33dc,_0x704aad={'fgLnP':function(_0x51cd96,_0xa91cad){return _0x51cd96(_0xa91cad);},'BylfG':function(_0x25a486,_0x2e205b){return _0x25a486(_0x2e205b);},'uhGEO':function(_0xc703b7,_0x101a56){return _0xc703b7===_0x101a56;},'fPQUL':function(_0x276369,_0x1cdfe1){return _0x276369(_0x1cdfe1);},'JEppE':_0x23474d(0x180),'vUkwn':_0x23474d(0x19b),'OtbNc':_0x23474d(0x1a4),'YkLIS':'Select\x20an\x20organization:','FKYmt':function(_0x17800c,_0x351d82,_0x299174,_0x3a6972){return _0x17800c(_0x351d82,_0x299174,_0x3a6972);},'eSJCc':function(_0x2d6b5f,_0x41f051){return _0x2d6b5f(_0x41f051);}},_0x578064=getCurrentEnvironment(),_0x11427e=ENVIRONMENT_CONFIGS[_0x578064][_0x23474d(0x1a1)],_0x3ee12c=await _0x704aad['fgLnP'](requestDeviceCode,_0x11427e);console[_0x23474d(0x194)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console['log']('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),_0x704aad[_0x23474d(0x1a7)](openBrowser,_0x3ee12c['verification_uri_complete']),console[_0x23474d(0x194)](_0x23474d(0x1a5)+_0x3ee12c[_0x23474d(0x1a8)]),console[_0x23474d(0x194)]('Code:\x20'+_0x3ee12c[_0x23474d(0x1aa)]+'\x0a'),process['stdout'][_0x23474d(0x170)]('Waiting\x20for\x20authentication...');let _0x29719d=await pollForTokens(_0x11427e,_0x3ee12c[_0x23474d(0x1bc)],_0x3ee12c['interval'],_0x3ee12c[_0x23474d(0x174)]);console[_0x23474d(0x194)]('\x20✓');const _0x400759=_0x704aad['BylfG'](decodeJwtPayload,_0x29719d[_0x23474d(0x187)]);if(!_0x400759['org_id']){const _0x3bb94c=await _0x704aad[_0x23474d(0x182)](fetchMyMemberships,_0x29719d[_0x23474d(0x187)]);let _0x3ee13f;if(_0x704aad['uhGEO'](_0x3bb94c[_0x23474d(0x184)],0x0)){process[_0x23474d(0x189)]['write']('Setting\x20up\x20your\x20organization...');const _0x107cd8=await _0x704aad['fPQUL'](selfServeSignup,_0x29719d['access_token']);_0x3ee13f=_0x107cd8[_0x23474d(0x1b5)],console['log']('\x20✓');}else{if(_0x704aad['uhGEO'](_0x3bb94c['length'],0x1))_0x3ee13f=_0x3bb94c[0x0]['organizationId'],console[_0x23474d(0x194)](_0x23474d(0x1bd)+_0x3bb94c[0x0]['name']);else{const _0x27de03=process[_0x23474d(0x19d)]['isTTY']&&process[_0x23474d(0x189)]['isTTY'];if(!_0x27de03)throw new Error(_0x704aad[_0x23474d(0x18e)]+_0x704aad['vUkwn']);const {selected:_0x330dd6}=await _0x212697['prompt']([{'type':_0x704aad['OtbNc'],'name':_0x23474d(0x1b0),'message':_0x704aad['YkLIS'],'choices':_0x3bb94c['map'](_0x2b9678=>({'name':_0x2b9678['name'],'value':_0x2b9678[_0x23474d(0x1b5)]}))}]);_0x3ee13f=_0x330dd6;}}_0x29719d=await _0x704aad[_0x23474d(0x173)](refreshTokenWithOrg,_0x11427e,_0x29719d[_0x23474d(0x186)],_0x3ee13f);}process[_0x23474d(0x189)]['write']('Provisioning\x20CLI\x20token...');const _0x1f40c6=await provisionCliToken(_0x29719d['access_token']);return console['log']('\x20✓'),await storeToken(_0x1f40c6['token']),_0x29719d[_0x23474d(0x186)]&&await _0x704aad['eSJCc'](storeRefreshToken,_0x29719d['refresh_token']),_0x1f40c6[_0x23474d(0x1b8)];}function sleep(_0x5ad8e1){return new Promise(_0x4744b8=>setTimeout(_0x4744b8,_0x5ad8e1));}
|
|
1
|
+
(function(_0xb64aff,_0x1cf71a){const _0x2d6378=_0x23f7,_0x1704a4=_0xb64aff();while(!![]){try{const _0x25db56=-parseInt(_0x2d6378(0x11e))/0x1+parseInt(_0x2d6378(0xf4))/0x2+parseInt(_0x2d6378(0xe4))/0x3+parseInt(_0x2d6378(0x131))/0x4*(-parseInt(_0x2d6378(0xfe))/0x5)+parseInt(_0x2d6378(0x12a))/0x6*(-parseInt(_0x2d6378(0xec))/0x7)+-parseInt(_0x2d6378(0xef))/0x8+parseInt(_0x2d6378(0x12b))/0x9;if(_0x25db56===_0x1cf71a)break;else _0x1704a4['push'](_0x1704a4['shift']());}catch(_0x1ba57c){_0x1704a4['push'](_0x1704a4['shift']());}}}(_0x51ab,0x4a420));import{spawn}from'child_process';function _0x23f7(_0x53bf9b,_0x29ccab){_0x53bf9b=_0x53bf9b-0xdf;const _0x51ab70=_0x51ab();let _0x23f745=_0x51ab70[_0x53bf9b];return _0x23f745;}import _0xc53e52 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='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0xf2566d){const _0x1fda72=_0x23f7,_0x2bb6e4={'AhQIQ':'POST','cqFos':_0x1fda72(0x102)},_0x1c1b05=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x2bb6e4['AhQIQ'],'headers':{'Content-Type':_0x2bb6e4[_0x1fda72(0x12e)]},'body':new URLSearchParams({'client_id':_0xf2566d})});if(!_0x1c1b05['ok']){const _0x24ced5=await _0x1c1b05['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x1c1b05[_0x1fda72(0x100)]+'\x20'+_0x24ced5);}return _0x1c1b05['json']();}export async function pollForTokens(_0x1eb53f,_0x2ac427,_0x310732,_0x41a825){const _0x3d41b8=_0x23f7,_0x40e9c6={'mjUXz':function(_0x371722,_0x21e504){return _0x371722*_0x21e504;},'OoTsh':function(_0x2de37b,_0x2a9073){return _0x2de37b*_0x2a9073;},'wtoVj':function(_0x233135,_0x1ab640){return _0x233135<_0x1ab640;},'aSIQQ':_0x3d41b8(0x102),'MtHkZ':_0x3d41b8(0x115),'oNUaX':function(_0x2731c5,_0x3f4bca){return _0x2731c5===_0x3f4bca;},'TmpJi':_0x3d41b8(0xf5),'IFucC':'Device\x20authorization\x20timed\x20out'},_0x5e9f4c=Date['now']()+_0x40e9c6['mjUXz'](_0x41a825,0x3e8);let _0x51d2ee=_0x40e9c6[_0x3d41b8(0xe6)](_0x310732,0x3e8);while(_0x40e9c6[_0x3d41b8(0xe8)](Date['now'](),_0x5e9f4c)){await sleep(_0x51d2ee);const _0xb1a87b=await fetch(WORKOS_TOKEN_URL,{'method':_0x3d41b8(0x116),'headers':{'Content-Type':_0x40e9c6['aSIQQ']},'body':new URLSearchParams({'client_id':_0x1eb53f,'device_code':_0x2ac427,'grant_type':_0x40e9c6[_0x3d41b8(0xed)]})});if(_0xb1a87b['ok'])return _0xb1a87b['json']();const _0x478c15=await _0xb1a87b[_0x3d41b8(0x10f)]();if(_0x478c15[_0x3d41b8(0x11b)]==='authorization_pending')continue;if(_0x40e9c6['oNUaX'](_0x478c15[_0x3d41b8(0x11b)],_0x3d41b8(0x126))){_0x51d2ee+=0x3e8;continue;}throw new Error(_0x478c15[_0x3d41b8(0x113)]||_0x478c15[_0x3d41b8(0x11b)]||_0x40e9c6['TmpJi']);}throw new Error(_0x40e9c6[_0x3d41b8(0xf8)]);}async function fetchUserProfile(_0x391d06){const _0x137ec5=_0x23f7,_0x402967={'aFrqT':'GET'},_0x4d64ef=getApiBaseUrl();try{const _0x40b32a=await fetch(_0x4d64ef+_0x137ec5(0x11f),{'method':_0x402967[_0x137ec5(0x103)],'headers':{'workos-token':_0x391d06}});if(_0x40b32a['ok'])return _0x40b32a['json']();}catch{}return null;}function buildKeyName(_0x1e3013,_0x25abd4){const _0x4c582d=_0x23f7,_0x1948a4={'aVbjD':function(_0x148e2f,_0x2ed5cc){return _0x148e2f+_0x2ed5cc;}},_0x26b9b6=_0x25abd4['filter'](_0x5664a6=>_0x5664a6[_0x4c582d(0x11a)]===_0x1e3013||_0x5664a6['name'][_0x4c582d(0x124)](_0x1e3013+'\x20('));if(_0x26b9b6[_0x4c582d(0xdf)]===0x0)return _0x1e3013;return _0x1e3013+'\x20('+_0x1948a4[_0x4c582d(0x112)](_0x26b9b6['length'],0x1)+')';}export async function provisionApiKey(_0x323301){const _0xc799c6=_0x23f7,_0x3a8c79={'JRgQa':function(_0x3660b0){return _0x3660b0();},'GsZyR':function(_0x19239b,_0x48ee2a){return _0x19239b(_0x48ee2a);},'kqNwG':_0xc799c6(0x119),'oidPM':'GET','TdBSy':function(_0x46aa2e,_0xb05508,_0xe9bf8e){return _0x46aa2e(_0xb05508,_0xe9bf8e);},'DIbxS':'mcp:write'},_0x1441b8=_0x3a8c79['JRgQa'](getApiBaseUrl),_0x5eab55={'Content-Type':_0xc799c6(0x128),'workos-token':_0x323301},_0x10ff51=await _0x3a8c79[_0xc799c6(0x10a)](fetchUserProfile,_0x323301),_0x55e718=_0x10ff51?.['firstName']||_0x10ff51?.[_0xc799c6(0x101)]?.['split']('@')[0x0],_0x205bd0=_0x55e718?_0x55e718+'\x27s\x20CLI\x20Key':_0x3a8c79['kqNwG'];let _0x429a4f=[];try{const _0x221c1a=await fetch(_0x1441b8+_0xc799c6(0xf7),{'method':_0x3a8c79['oidPM'],'headers':_0x5eab55});if(_0x221c1a['ok']){const _0xcce9b1=await _0x221c1a['json']();_0x429a4f=_0xcce9b1['apiKeys'];}}catch{}const _0x5385f3=_0x3a8c79['TdBSy'](buildKeyName,_0x205bd0,_0x429a4f),_0x1e75f1=await _0x3a8c79[_0xc799c6(0x122)](fetch,_0x1441b8+_0xc799c6(0xf7),{'method':_0xc799c6(0x116),'headers':_0x5eab55,'body':JSON['stringify']({'name':_0x5385f3,'scope':_0x3a8c79['DIbxS']})});if(!_0x1e75f1['ok']){const _0x171ee6=await _0x1e75f1[_0xc799c6(0xf3)]();throw new Error(_0xc799c6(0x125)+_0x1e75f1['status']+'\x20'+_0x171ee6);}const _0xc2c701=await _0x1e75f1[_0xc799c6(0x10f)]();return _0xc2c701['apiKey']['token'];}export function openBrowser(_0x33a17b){const _0x30a7fa=_0x23f7,_0x2ed8d1={'UnGEm':function(_0x53b946,_0x511c6e){return _0x53b946===_0x511c6e;},'mJoGn':_0x30a7fa(0x123),'muNLB':'start','OrieN':'open','qeUtJ':'xdg-open','ycYJG':'ignore'};try{if(_0x2ed8d1[_0x30a7fa(0xfa)](process[_0x30a7fa(0x114)],_0x2ed8d1[_0x30a7fa(0x12f)])){const _0x238dcf=spawn(_0x30a7fa(0x10d),['/c',_0x2ed8d1['muNLB'],'',_0x33a17b],{'detached':!![],'stdio':_0x30a7fa(0xe3),'windowsHide':!![]});_0x238dcf['unref']();return;}const _0x340013=process['platform']===_0x30a7fa(0xff)?_0x2ed8d1[_0x30a7fa(0x105)]:_0x2ed8d1[_0x30a7fa(0xe1)],_0x195cd0=spawn(_0x340013,[_0x33a17b],{'detached':!![],'stdio':_0x2ed8d1['ycYJG']});_0x195cd0['unref']();}catch{}}function _0x51ab(){const _0x5196d4=['organizationId','json','rWfPC','VBasb','aVbjD','error_description','platform','urn:ietf:params:oauth:grant-type:device_code','POST','Provisioning\x20CLI\x20token...','Select\x20an\x20organization:','CLI\x20Key','name','error','mdzLu','CCtEW','332320HWvlyT','/organization/me','refresh_token','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','TdBSy','win32','startsWith','Failed\x20to\x20provision\x20API\x20key:\x20','slow_down','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','application/json','write','2406pEbOsl','1284003bHQCbT','/organization/self-serve-signup','kWoyr','cqFos','mJoGn','toString','28004yAMbpn','length','Code:\x20','qeUtJ','access_token','ignore','1260006mLKUnM','workosClientId','OoTsh','Invalid\x20JWT\x20format','wtoVj','QvsUP','DLWuu','gYhyJ','1099dwYxJt','MtHkZ','stdin','1357544FsRcoG','log','/organization/my-memberships','selected','text','906964fuABpa','Authentication\x20failed','parse','/api-keys','IFucC','/cli-auth/token','UnGEm','interval','token','GET','105UvDejO','darwin','status','email','application/x-www-form-urlencoded','aFrqT','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','OrieN','list','utf-8','Waiting\x20for\x20authentication...','pFyYu','GsZyR','stdout','isTTY','cmd'];_0x51ab=function(){return _0x5196d4;};return _0x51ab();}function decodeJwtPayload(_0x5a9030){const _0x5f3890=_0x23f7,_0x27842a={'CCtEW':_0x5f3890(0xe7),'gYhyJ':'base64url','pFyYu':_0x5f3890(0x107)},_0x1a30b1=_0x5a9030['split']('.');if(_0x1a30b1[_0x5f3890(0xdf)]!==0x3)throw new Error(_0x27842a[_0x5f3890(0x11d)]);const _0x39ef98=Buffer['from'](_0x1a30b1[0x1],_0x27842a[_0x5f3890(0xeb)])[_0x5f3890(0x130)](_0x27842a[_0x5f3890(0x109)]);return JSON[_0x5f3890(0xf6)](_0x39ef98);}async function selfServeSignup(_0x4fc43f){const _0x236d36=_0x23f7,_0x455ecd={'SylCw':function(_0x441c20){return _0x441c20();},'VBasb':function(_0x1e891,_0x1c4f2c,_0x2c7866){return _0x1e891(_0x1c4f2c,_0x2c7866);}},_0x433c2e=_0x455ecd['SylCw'](getApiBaseUrl),_0xee6d0e=await _0x455ecd[_0x236d36(0x111)](fetch,_0x433c2e+_0x236d36(0x12c),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x4fc43f}});if(!_0xee6d0e['ok']){const _0x49f7bd=await _0xee6d0e[_0x236d36(0xf3)]();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0xee6d0e['status']+'\x20'+_0x49f7bd);}return _0xee6d0e['json']();}async function fetchMyMemberships(_0x46caae){const _0x53d9f3=_0x23f7,_0x2aaa70={'Gfdra':function(_0x5eda53){return _0x5eda53();}},_0x216607=_0x2aaa70['Gfdra'](getApiBaseUrl),_0x62c999=await fetch(_0x216607+_0x53d9f3(0xf1),{'method':_0x53d9f3(0xfd),'headers':{'workos-token':_0x46caae}});if(!_0x62c999['ok']){const _0x354781=await _0x62c999['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x62c999['status']+'\x20'+_0x354781);}const _0x4094ff=await _0x62c999[_0x53d9f3(0x10f)]();return _0x4094ff['memberships'];}async function refreshTokenWithOrg(_0x3e42b6,_0x1a9d61,_0x28e38a){const _0x4a4f5d=_0x23f7,_0x1d9335={'KFCYe':'refresh_token'},_0x297748=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x4a4f5d(0x102)},'body':new URLSearchParams({'client_id':_0x3e42b6,'grant_type':_0x1d9335['KFCYe'],'refresh_token':_0x1a9d61,'organization_id':_0x28e38a})});if(!_0x297748['ok']){const _0x2a719d=await _0x297748['text']();throw new Error(_0x4a4f5d(0x127)+_0x297748[_0x4a4f5d(0x100)]+'\x20'+_0x2a719d);}return _0x297748[_0x4a4f5d(0x10f)]();}async function provisionCliToken(_0x386786){const _0x2fa11c=_0x23f7,_0x50ec8c={'yXNjD':_0x2fa11c(0x128)},_0x4ef734=getApiBaseUrl(),_0x406d62=await fetch(_0x4ef734+_0x2fa11c(0xf9),{'method':'POST','headers':{'Content-Type':_0x50ec8c['yXNjD'],'workos-token':_0x386786}});if(!_0x406d62['ok']){const _0x32a066=await _0x406d62[_0x2fa11c(0xf3)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x406d62[_0x2fa11c(0x100)]+'\x20'+_0x32a066);}return _0x406d62['json']();}export async function runDeviceAuthFlow(){const _0x280aec=_0x23f7,_0x300a75={'Zqdpu':function(_0x282ee8){return _0x282ee8();},'NTBdx':function(_0x204f01,_0x129194){return _0x204f01(_0x129194);},'kWoyr':_0x280aec(0x108),'RARnI':function(_0x585bb5,_0x241761){return _0x585bb5(_0x241761);},'rWfPC':function(_0x444085,_0x32b6f9){return _0x444085===_0x32b6f9;},'gIVIm':function(_0xbc8be7,_0x5c8c4e){return _0xbc8be7(_0x5c8c4e);},'mdzLu':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','QvsUP':_0x280aec(0x106),'DLWuu':_0x280aec(0xf2),'CQtHC':function(_0x2b49b3,_0x3abff8){return _0x2b49b3(_0x3abff8);}},_0x319a5c=_0x300a75['Zqdpu'](getCurrentEnvironment),_0x95ff6a=ENVIRONMENT_CONFIGS[_0x319a5c][_0x280aec(0xe5)],_0x350509=await _0x300a75['NTBdx'](requestDeviceCode,_0x95ff6a);console['log'](_0x280aec(0x121)),console[_0x280aec(0xf0)]('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),openBrowser(_0x350509['verification_uri_complete']),console['log'](_0x280aec(0x104)+_0x350509['verification_uri_complete']),console[_0x280aec(0xf0)](_0x280aec(0xe0)+_0x350509['user_code']+'\x0a'),process[_0x280aec(0x10b)]['write'](_0x300a75[_0x280aec(0x12d)]);let _0x50654a=await pollForTokens(_0x95ff6a,_0x350509['device_code'],_0x350509[_0x280aec(0xfb)],_0x350509['expires_in']);console['log']('\x20✓');const _0x49d8a1=_0x300a75['RARnI'](decodeJwtPayload,_0x50654a[_0x280aec(0xe2)]);if(!_0x49d8a1['org_id']){const _0x1f7815=await fetchMyMemberships(_0x50654a[_0x280aec(0xe2)]);let _0x113635;if(_0x300a75[_0x280aec(0x110)](_0x1f7815['length'],0x0)){process['stdout']['write']('Setting\x20up\x20your\x20organization...');const _0x133797=await _0x300a75['gIVIm'](selfServeSignup,_0x50654a[_0x280aec(0xe2)]);_0x113635=_0x133797[_0x280aec(0x10e)],console['log']('\x20✓');}else{if(_0x1f7815['length']===0x1)_0x113635=_0x1f7815[0x0][_0x280aec(0x10e)],console[_0x280aec(0xf0)]('Using\x20organization:\x20'+_0x1f7815[0x0][_0x280aec(0x11a)]);else{const _0x149d5f=process[_0x280aec(0xee)][_0x280aec(0x10c)]&&process['stdout'][_0x280aec(0x10c)];if(!_0x149d5f)throw new Error(_0x300a75[_0x280aec(0x11c)]+'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');const {selected:_0x5e1e71}=await _0xc53e52['prompt']([{'type':_0x300a75[_0x280aec(0xe9)],'name':_0x300a75[_0x280aec(0xea)],'message':_0x280aec(0x118),'choices':_0x1f7815['map'](_0xc9f1c1=>({'name':_0xc9f1c1['name'],'value':_0xc9f1c1['organizationId']}))}]);_0x113635=_0x5e1e71;}}_0x50654a=await refreshTokenWithOrg(_0x95ff6a,_0x50654a[_0x280aec(0x120)],_0x113635);}process[_0x280aec(0x10b)][_0x280aec(0x129)](_0x280aec(0x117));const _0x5a49a6=await provisionCliToken(_0x50654a['access_token']);return console['log']('\x20✓'),await storeToken(_0x5a49a6['token']),_0x50654a['refresh_token']&&await _0x300a75['CQtHC'](storeRefreshToken,_0x50654a[_0x280aec(0x120)]),_0x5a49a6[_0x280aec(0xfc)];}function sleep(_0x32e535){return new Promise(_0x350a64=>setTimeout(_0x350a64,_0x32e535));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x242bc1=_0x2067;(function(_0x26711a,_0x114936){const _0x2df0ed=_0x2067,_0x2db58d=_0x26711a();while(!![]){try{const _0x568ebd=-parseInt(_0x2df0ed(0x148))/0x1+-parseInt(_0x2df0ed(0x144))/0x2+-parseInt(_0x2df0ed(0x14e))/0x3+-parseInt(_0x2df0ed(0x151))/0x4*(-parseInt(_0x2df0ed(0x13f))/0x5)+parseInt(_0x2df0ed(0x157))/0x6+-parseInt(_0x2df0ed(0x14b))/0x7*(parseInt(_0x2df0ed(0x156))/0x8)+-parseInt(_0x2df0ed(0x13e))/0x9*(-parseInt(_0x2df0ed(0x14d))/0xa);if(_0x568ebd===_0x114936)break;else _0x2db58d['push'](_0x2db58d['shift']());}catch(_0x595fb7){_0x2db58d['push'](_0x2db58d['shift']());}}}(_0x512c,0x42482));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x242bc1(0x14f),'workosClientId':_0x242bc1(0x141),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x242bc1(0x150)},'staging':{'apiBaseUrl':_0x242bc1(0x159),'workosClientId':_0x242bc1(0x13d),'aiProxyUrl':_0x242bc1(0x140),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x242bc1(0x149),'workosClientId':_0x242bc1(0x13d),'aiProxyUrl':_0x242bc1(0x154),'mcpAuthUrl':_0x242bc1(0x158)}};function _0x2067(_0x326bf2,_0x5c926c){_0x326bf2=_0x326bf2-0x13d;const _0x512cb7=_0x512c();let _0x20674b=_0x512cb7[_0x326bf2];return _0x20674b;}export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x3e7954){const _0x59e73b=_0x242bc1,_0x12dc2c={'oTQdM':'prod','mZsWC':function(_0x385cd3,_0x3d2977){return _0x385cd3===_0x3d2977;},'eIzAf':_0x59e73b(0x14a),'yjNOv':_0x59e73b(0x152)};return _0x3e7954===_0x12dc2c['oTQdM']||_0x12dc2c['mZsWC'](_0x3e7954,_0x12dc2c[_0x59e73b(0x145)])||_0x3e7954===_0x12dc2c['yjNOv'];}function _0x512c(){const _0x1a1124=['eIzAf','CbPQn','RANGER_MCP_AUTH_URL','48666biBuRm','http://localhost:8080','staging','1062691SWpiCT','eqpSS','6170230IyuGmH','707382MBxFrd','https://api.ranger.net','https://mcp-auth.ranger.net/mcp','4hYDLfm','local','env','http://localhost:8090','aiProxyUrl','8zlWNHS','1039722bHXKvV','http://localhost:8080/mcp','https://api.staging.ranger.net','LvixW','client_01J9CBYM2DKWV9HM17D95Z540K','9hqhCvC','1949015mqkcKZ','https://ai-proxy-301751771437.us-central1.run.app','client_01J9CBYM7M5ZETCF7G6614DXR2','apiBaseUrl','EqzKI','944700eHJoOq'];_0x512c=function(){return _0x1a1124;};return _0x512c();}export function getCurrentEnvironment(){const _0x332833=_0x242bc1,_0x125aa6=process[_0x332833(0x153)]['RANGER_CLI_ENV'];if(_0x125aa6&&isValidEnvironment(_0x125aa6))return _0x125aa6;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x260077=_0x242bc1;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x260077(0x142)];}export function getAiProxyUrl(){const _0x5acc87=_0x242bc1,_0x3a2062={'RwZRX':function(_0x22c4e2){return _0x22c4e2();}};return ENVIRONMENT_CONFIGS[_0x3a2062['RwZRX'](getCurrentEnvironment)][_0x5acc87(0x155)];}export function getMcpAuthUrl(){const _0x2271e7=_0x242bc1,_0x7fbc4f={'LvixW':function(_0x30b9cd){return _0x30b9cd();}};return process[_0x2271e7(0x153)][_0x2271e7(0x147)]??ENVIRONMENT_CONFIGS[_0x7fbc4f[_0x2271e7(0x15a)](getCurrentEnvironment)]['mcpAuthUrl'];}export function isByokEnabled(){const _0x10d8b4=_0x242bc1,_0x50049e={'ckcst':function(_0xd22949,_0x29e1d8){return _0xd22949===_0x29e1d8;},'CbPQn':'true'};return _0x50049e['ckcst'](process[_0x10d8b4(0x153)]['RANGER_BYOK'],_0x50049e[_0x10d8b4(0x146)]);}export function isMcpDisabled(){const _0x513b32=_0x242bc1,_0x51a82a={'eqpSS':'true'};return process['env']['RANGER_DISABLE_MCP']===_0x51a82a[_0x513b32(0x14c)];}export function getVerificationTransport(){const _0x368e42=_0x242bc1,_0x50b3db={'EqzKI':function(_0x2dfa1e){return _0x2dfa1e();},'VUhqu':'playwright-cli'};return _0x50b3db[_0x368e42(0x143)](isMcpDisabled)?_0x50b3db['VUhqu']:'mcp';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x101e30,_0x521fb7){const _0x5e1142=_0x90f3,_0x32a9f1=_0x101e30();while(!![]){try{const _0x4faa92=-parseInt(_0x5e1142(0x175))/0x1+-parseInt(_0x5e1142(0x137))/0x2*(-parseInt(_0x5e1142(0x15d))/0x3)+parseInt(_0x5e1142(0x143))/0x4*(-parseInt(_0x5e1142(0x16d))/0x5)+-parseInt(_0x5e1142(0x171))/0x6*(parseInt(_0x5e1142(0x166))/0x7)+parseInt(_0x5e1142(0x13a))/0x8*(parseInt(_0x5e1142(0x13c))/0x9)+parseInt(_0x5e1142(0x168))/0xa*(-parseInt(_0x5e1142(0x15a))/0xb)+parseInt(_0x5e1142(0x16b))/0xc;if(_0x4faa92===_0x521fb7)break;else _0x32a9f1['push'](_0x32a9f1['shift']());}catch(_0x22bd40){_0x32a9f1['push'](_0x32a9f1['shift']());}}}(_0x4c15,0xb1085));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x1953df){const _0x1947d0=_0x90f3,_0x4cbf73={'ivKpS':function(_0x66bb5b){return _0x66bb5b();},'GyMWz':_0x1947d0(0x140),'vvRJH':'application/json','wSUBp':function(_0x542f02,_0x316b5c){return _0x542f02===_0x316b5c;},'yJGRb':'https://dashboard.ranger.net/billing','sjzZH':'Feature\x20limit\x20exceeded'},_0x517dd5=await _0x4cbf73['ivKpS'](getToken);if(!_0x517dd5)throw new Error(_0x4cbf73[_0x1947d0(0x169)]);const _0x562725=getApiBaseUrl(),_0x580435=await fetch(_0x562725+'/api/v1/mcp/features',{'method':_0x1947d0(0x167),'headers':{'Authorization':_0x1947d0(0x146)+_0x517dd5,'Content-Type':_0x4cbf73['vvRJH']},'body':JSON['stringify'](_0x1953df)});if(!_0x580435['ok']){if(_0x4cbf73[_0x1947d0(0x132)](_0x580435[_0x1947d0(0x14c)],0x192)){const _0xdbcb08=await _0x580435['json'](),_0x323c82=_0xdbcb08['billingUrl']||_0x4cbf73[_0x1947d0(0x15e)];throw new Error((_0xdbcb08[_0x1947d0(0x158)]||_0x4cbf73[_0x1947d0(0x157)])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x323c82);}const _0x31467b=await _0x580435['text']();throw new Error(_0x1947d0(0x144)+_0x31467b);}return _0x580435[_0x1947d0(0x141)]();}function _0x90f3(_0x2d9a3d,_0x7e0070){_0x2d9a3d=_0x2d9a3d-0x12a;const _0x4c1579=_0x4c15();let _0x90f39c=_0x4c1579[_0x2d9a3d];return _0x90f39c;}export async function listFeatures(_0x475e18){const _0x5905af=_0x90f3,_0x26d95f={'bWgKs':function(_0x1e9631){return _0x1e9631();},'RCRdQ':'gitRepoUrl','jAWtV':'gitBranch','uOuxh':'limit','hoyLw':'offset','IAgiU':_0x5905af(0x161)},_0x189747=await getToken();if(!_0x189747)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x174fbf=_0x26d95f['bWgKs'](getApiBaseUrl),_0x3294aa=new URLSearchParams();if(_0x475e18?.['gitRepoUrl'])_0x3294aa[_0x5905af(0x135)](_0x26d95f['RCRdQ'],_0x475e18[_0x5905af(0x131)]);if(_0x475e18?.[_0x5905af(0x12a)])_0x3294aa['set'](_0x26d95f['jAWtV'],_0x475e18['gitBranch']);if(_0x475e18?.['limit'])_0x3294aa[_0x5905af(0x135)](_0x26d95f[_0x5905af(0x13f)],_0x475e18[_0x5905af(0x16c)][_0x5905af(0x13b)]());if(_0x475e18?.['offset'])_0x3294aa[_0x5905af(0x135)](_0x26d95f[_0x5905af(0x165)],_0x475e18[_0x5905af(0x13e)][_0x5905af(0x13b)]());if(_0x475e18?.['includeDeleted'])_0x3294aa['set'](_0x26d95f['IAgiU'],_0x5905af(0x174));const _0x322486=_0x174fbf+'/api/v1/mcp/features'+(_0x3294aa[_0x5905af(0x13b)]()?'?'+_0x3294aa[_0x5905af(0x13b)]():''),_0x2f6100=await fetch(_0x322486,{'method':_0x5905af(0x176),'headers':{'Authorization':'Bearer\x20'+_0x189747}});if(!_0x2f6100['ok']){const _0x45bbf0=await _0x2f6100['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x45bbf0);}return _0x2f6100['json']();}export async function getFeature(_0x3da5fe){const _0x4b314d=_0x90f3,_0x108e96={'ZHRMP':function(_0x591069){return _0x591069();},'PGYsD':'GET'},_0x54c4be=await _0x108e96['ZHRMP'](getToken);if(!_0x54c4be)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3e905a=_0x108e96[_0x4b314d(0x12f)](getApiBaseUrl),_0x569550=await fetch(_0x3e905a+'/api/v1/mcp/features/'+_0x3da5fe,{'method':_0x108e96[_0x4b314d(0x16f)],'headers':{'Authorization':_0x4b314d(0x146)+_0x54c4be}});if(!_0x569550['ok']){const _0x5e2892=await _0x569550['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x5e2892);}return _0x569550[_0x4b314d(0x141)]();}export async function updateFeature(_0x3ff10b,_0x481382){const _0x2d286f=_0x90f3,_0x2eb664={'oiNAu':function(_0x470814){return _0x470814();},'zUwvZ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','Mjgub':function(_0x4911c8){return _0x4911c8();},'AlUFV':_0x2d286f(0x14b),'krRBV':_0x2d286f(0x12c)},_0xb7559e=await _0x2eb664[_0x2d286f(0x170)](getToken);if(!_0xb7559e)throw new Error(_0x2eb664['zUwvZ']);const _0x272e89=_0x2eb664[_0x2d286f(0x14f)](getApiBaseUrl),_0x4f1b33=await fetch(_0x272e89+'/api/v1/mcp/features/'+_0x3ff10b,{'method':_0x2eb664[_0x2d286f(0x173)],'headers':{'Authorization':'Bearer\x20'+_0xb7559e,'Content-Type':_0x2eb664['krRBV']},'body':JSON['stringify'](_0x481382)});if(!_0x4f1b33['ok']){const _0x5c9cfe=await _0x4f1b33['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x5c9cfe);}return _0x4f1b33['json']();}export async function createChecklistItem(_0x3a4627,_0x25e1aa,_0x1dff4c){const _0x4e380d=_0x90f3,_0x4f1a98={'jqeXF':function(_0x45ef21){return _0x45ef21();},'TxfDl':_0x4e380d(0x140),'TAbpk':'POST'},_0x5b94e8=await _0x4f1a98[_0x4e380d(0x142)](getToken);if(!_0x5b94e8)throw new Error(_0x4f1a98[_0x4e380d(0x164)]);const _0x43b3e8=getApiBaseUrl(),_0x419938=await fetch(_0x43b3e8+'/api/v1/mcp/features/'+_0x3a4627+_0x4e380d(0x151),{'method':_0x4f1a98['TAbpk'],'headers':{'Authorization':'Bearer\x20'+_0x5b94e8,'Content-Type':_0x4e380d(0x12c)},'body':JSON[_0x4e380d(0x12b)]({'description':_0x25e1aa,'position':_0x1dff4c})});if(!_0x419938['ok']){const _0x23a265=await _0x419938[_0x4e380d(0x16a)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x23a265);}return _0x419938[_0x4e380d(0x141)]();}export async function updateChecklistItem(_0x2932cd,_0x8bed01,_0x3b34bf){const _0x3bf679={'GRIKa':function(_0x9bafa5,_0xab4421,_0x2eb5b5){return _0x9bafa5(_0xab4421,_0x2eb5b5);},'IfKtW':'application/json'};return withRetry(async()=>{const _0x57f7c4=_0x90f3,_0x3dda55=await getToken();if(!_0x3dda55)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1ffec2=getApiBaseUrl(),_0x5b4b7e=await _0x3bf679['GRIKa'](fetch,_0x1ffec2+'/api/v1/mcp/features/'+_0x2932cd+_0x57f7c4(0x177)+_0x8bed01,{'method':_0x57f7c4(0x14b),'headers':{'Authorization':'Bearer\x20'+_0x3dda55,'Content-Type':_0x3bf679['IfKtW']},'body':JSON['stringify'](_0x3b34bf)});if(!_0x5b4b7e['ok']){const _0x54cac9=await _0x5b4b7e[_0x57f7c4(0x16a)]();throw new Error(_0x57f7c4(0x163)+_0x54cac9);}return _0x5b4b7e['json']();},{'label':'updateChecklistItem'});}export async function getFeatureReport(_0x56726d){const _0xe7d15d=_0x90f3,_0x5945a1={'WYIGP':function(_0x584b8c){return _0x584b8c();},'ZuYOS':function(_0x54b684,_0x14beb1,_0x4ddc74){return _0x54b684(_0x14beb1,_0x4ddc74);},'lPzAM':'GET'},_0x389314=await getToken();if(!_0x389314)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x68b4af=_0x5945a1[_0xe7d15d(0x172)](getApiBaseUrl),_0x27d566=await _0x5945a1['ZuYOS'](fetch,_0x68b4af+_0xe7d15d(0x145)+_0x56726d+_0xe7d15d(0x162),{'method':_0x5945a1['lPzAM'],'headers':{'Authorization':'Bearer\x20'+_0x389314}});if(!_0x27d566['ok']){const _0x57ce92=await _0x27d566['text']();throw new Error(_0xe7d15d(0x149)+_0x57ce92);}return _0x27d566['json']();}export async function getFeatureReportMarkdown(_0x2a0044,_0x2b8ef1){const _0x82dcd2=_0x90f3,_0x56f153={'lkzoY':function(_0x17451b){return _0x17451b();},'erhMp':function(_0x54067b,_0x54e4e8){return _0x54067b(_0x54e4e8);},'ZNlrd':'itemIds','GrHok':'sessionId','NUIdU':function(_0x14952e,_0x4864b3){return _0x14952e&&_0x4864b3;},'epWgV':function(_0x26ae07,_0x4bd559,_0x5e60d3){return _0x26ae07(_0x4bd559,_0x5e60d3);}},_0xee00a=await _0x56f153[_0x82dcd2(0x134)](getToken);if(!_0xee00a)throw new Error(_0x82dcd2(0x140));const _0x20b437=_0x56f153[_0x82dcd2(0x134)](getApiBaseUrl),_0x14d453=new URLSearchParams(),_0x40394d=(_0x2b8ef1?.['itemIds']?.['length']??0x0)>0x0,_0x431416=_0x56f153[_0x82dcd2(0x15b)](Boolean,_0x2b8ef1?.[_0x82dcd2(0x156)]);_0x40394d&&_0x2b8ef1?.['itemIds']&&_0x14d453[_0x82dcd2(0x135)](_0x56f153['ZNlrd'],_0x2b8ef1['itemIds']['join'](','));_0x431416&&_0x2b8ef1?.['sessionId']&&_0x14d453['set'](_0x56f153[_0x82dcd2(0x160)],_0x2b8ef1[_0x82dcd2(0x156)]);_0x56f153['NUIdU'](!_0x40394d,!_0x431416)&&_0x2b8ef1?.['style']&&_0x14d453['set'](_0x82dcd2(0x15f),_0x2b8ef1['style']);const _0x399bc5=_0x20b437+_0x82dcd2(0x145)+_0x2a0044+'/report/markdown',_0x24c04b=''+_0x399bc5+(_0x14d453[_0x82dcd2(0x13b)]()?'?'+_0x14d453['toString']():''),_0xdc575b=await _0x56f153[_0x82dcd2(0x159)](fetch,_0x24c04b,{'method':_0x82dcd2(0x176),'headers':{'Authorization':_0x82dcd2(0x146)+_0xee00a}});if(!_0xdc575b['ok']){const _0x2edc83=await _0xdc575b[_0x82dcd2(0x16a)]();throw new Error(_0x82dcd2(0x153)+_0x2edc83);}return _0xdc575b[_0x82dcd2(0x16a)]();}export async function listFeatureSessions(_0x6c3322){const _0x28500e=_0x90f3,_0x1792f9={'yJkDF':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','WmgrZ':function(_0x2088b4){return _0x2088b4();}},_0x92a24f=await getToken();if(!_0x92a24f)throw new Error(_0x1792f9[_0x28500e(0x13d)]);const _0x151128=_0x1792f9[_0x28500e(0x155)](getApiBaseUrl),_0x6744f3=await fetch(_0x151128+_0x28500e(0x145)+_0x6c3322+_0x28500e(0x154),{'method':'GET','headers':{'Authorization':_0x28500e(0x146)+_0x92a24f}});if(!_0x6744f3['ok']){const _0x3675fc=await _0x6744f3['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x3675fc);}return _0x6744f3[_0x28500e(0x141)]();}export async function startSession(_0x4e65a1,_0x4ee205){const _0x5e0d66=_0x90f3,_0x38e05c={'VYeWL':function(_0x193fb8){return _0x193fb8();},'hqKQB':function(_0xf75759){return _0xf75759();},'nsplA':function(_0x54ef40,_0x5dc9f0,_0x5d8747){return _0x54ef40(_0x5dc9f0,_0x5d8747);},'nndJS':'POST'},_0x4ebe12=await _0x38e05c[_0x5e0d66(0x138)](getToken);if(!_0x4ebe12)throw new Error(_0x5e0d66(0x140));const _0x413447=_0x38e05c['hqKQB'](getApiBaseUrl),_0x3c61fc=await _0x38e05c['nsplA'](fetch,_0x413447+'/api/v1/mcp/features/'+_0x4e65a1+_0x5e0d66(0x12d)+_0x4ee205+'/start',{'method':_0x38e05c['nndJS'],'headers':{'Authorization':'Bearer\x20'+_0x4ebe12}});if(!_0x3c61fc['ok']){const _0x530cd4=await _0x3c61fc[_0x5e0d66(0x16a)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x530cd4);}return _0x3c61fc[_0x5e0d66(0x141)]();}export async function concludeSession(_0x20fa2b,_0x569bc5){const _0x3c5ba7=_0x90f3,_0x316dea={'rkIeY':'POST'},_0x1e7cea=await getToken();if(!_0x1e7cea)throw new Error(_0x3c5ba7(0x140));const _0x592f44=getApiBaseUrl(),_0x2009d9=await fetch(_0x592f44+'/api/v1/mcp/features/'+_0x20fa2b+'/sessions/'+_0x569bc5+'/conclude',{'method':_0x316dea['rkIeY'],'headers':{'Authorization':'Bearer\x20'+_0x1e7cea}});if(!_0x2009d9['ok']){const _0x5924c3=await _0x2009d9['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x5924c3);}return _0x2009d9['json']();}export async function getActionItems(_0x23476){const _0x53ba5f=_0x90f3,_0x4f47b1={'TeRXU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','hkgNF':function(_0xa17a42){return _0xa17a42();},'WheTM':function(_0x5595f7,_0x4d01b2,_0xf2f79a){return _0x5595f7(_0x4d01b2,_0xf2f79a);},'znvxy':'GET'},_0x2fa61b=await getToken();if(!_0x2fa61b)throw new Error(_0x4f47b1[_0x53ba5f(0x139)]);const _0xfc04cd=_0x4f47b1['hkgNF'](getApiBaseUrl),_0x2d3bb5=await _0x4f47b1[_0x53ba5f(0x12e)](fetch,_0xfc04cd+'/api/v1/mcp/features/'+_0x23476+_0x53ba5f(0x15c),{'method':_0x4f47b1[_0x53ba5f(0x152)],'headers':{'Authorization':_0x53ba5f(0x146)+_0x2fa61b}});if(!_0x2d3bb5['ok']){const _0x202706=await _0x2d3bb5[_0x53ba5f(0x16a)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x202706);}return _0x2d3bb5['json']();}function _0x4c15(){const _0x1202fb=['style','GrHok','includeDeleted','/report','Failed\x20to\x20update\x20scenario:\x20','TxfDl','hoyLw','1637321tZQTGJ','POST','70DFqOYK','GyMWz','text','26902320IiYoHW','limit','10JxPlKC','/feedback','PGYsD','oiNAu','24dUfIpG','WYIGP','AlUFV','true','159833jdbgDo','GET','/checklist/','gitBranch','stringify','application/json','/sessions/','WheTM','ZHRMP','oCaSw','gitRepoUrl','wSUBp','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','lkzoY','set','RxWjr','90aWOXju','VYeWL','TeRXU','8FjWjdz','toString','11820186LCddwl','yJkDF','offset','uOuxh','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','json','jqeXF','2443852CExnwE','Failed\x20to\x20create\x20feature\x20review:\x20','/api/v1/mcp/features/','Bearer\x20','Failed\x20to\x20delete\x20feature\x20review:\x20','cgxtz','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','/checklist-items/','PATCH','status','FPsXk','/restore','Mjgub','xAglA','/checklist','znvxy','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','/sessions','WmgrZ','sessionId','sjzZH','message','epWgV','893739joWwbp','erhMp','/action-items','3735EbwXLr','yJGRb'];_0x4c15=function(){return _0x1202fb;};return _0x4c15();}export async function getItemFeedback(_0x4b53fd,_0x15c928){const _0x5e4f98=_0x90f3,_0x419781={'HqpcG':function(_0x571cb8){return _0x571cb8();},'cgxtz':function(_0x482375){return _0x482375();},'FPsXk':_0x5e4f98(0x176)},_0x247393=await _0x419781['HqpcG'](getToken);if(!_0x247393)throw new Error(_0x5e4f98(0x140));const _0x1ed3f4=_0x419781[_0x5e4f98(0x148)](getApiBaseUrl),_0x476458=await fetch(_0x1ed3f4+_0x5e4f98(0x145)+_0x4b53fd+_0x5e4f98(0x14a)+_0x15c928+_0x5e4f98(0x16e),{'method':_0x419781[_0x5e4f98(0x14d)],'headers':{'Authorization':_0x5e4f98(0x146)+_0x247393}});if(!_0x476458['ok']){const _0xf6c91d=await _0x476458['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0xf6c91d);}return _0x476458['json']();}export async function markCommentsAddressed(_0x1b6352,_0x3cb390,_0x5a53d2){const _0x1203f1=_0x90f3,_0x9da954={'xAglA':_0x1203f1(0x140),'CYltl':function(_0x44e28e,_0xe3d88,_0x31370){return _0x44e28e(_0xe3d88,_0x31370);}},_0x4cbe95=await getToken();if(!_0x4cbe95)throw new Error(_0x9da954[_0x1203f1(0x150)]);const _0x2a193a=getApiBaseUrl(),_0x377256=await _0x9da954['CYltl'](fetch,_0x2a193a+'/api/v1/mcp/features/'+_0x1b6352+'/comments/address',{'method':_0x1203f1(0x167),'headers':{'Authorization':_0x1203f1(0x146)+_0x4cbe95,'Content-Type':_0x1203f1(0x12c)},'body':JSON[_0x1203f1(0x12b)]({'checklistItemId':_0x3cb390,'commentIds':_0x5a53d2})});if(!_0x377256['ok']){const _0x55dbbb=await _0x377256['text']();throw new Error(_0x1203f1(0x133)+_0x55dbbb);}}export async function softDeleteFeature(_0x269bd2){const _0x9dc4ed=_0x90f3,_0x58a169={'oCaSw':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','yhWpg':function(_0x1b7e90,_0x3cfe23,_0x5a69e3){return _0x1b7e90(_0x3cfe23,_0x5a69e3);}},_0x373b18=await getToken();if(!_0x373b18)throw new Error(_0x58a169[_0x9dc4ed(0x130)]);const _0x599dc0=getApiBaseUrl(),_0xcf878e=await _0x58a169['yhWpg'](fetch,_0x599dc0+_0x9dc4ed(0x145)+_0x269bd2,{'method':'DELETE','headers':{'Authorization':_0x9dc4ed(0x146)+_0x373b18}});if(!_0xcf878e['ok']){const _0x6941dc=await _0xcf878e[_0x9dc4ed(0x16a)]();throw new Error(_0x9dc4ed(0x147)+_0x6941dc);}}export async function restoreFeature(_0x198205){const _0x2a7f86=_0x90f3,_0x22c20b={'wfsKG':function(_0x35b8d4){return _0x35b8d4();},'RxWjr':function(_0x2f7869,_0x1a80a6,_0x232a3e){return _0x2f7869(_0x1a80a6,_0x232a3e);},'GIxfj':'POST'},_0x5dc673=await _0x22c20b['wfsKG'](getToken);if(!_0x5dc673)throw new Error(_0x2a7f86(0x140));const _0x4d97b0=getApiBaseUrl(),_0xe10210=await _0x22c20b[_0x2a7f86(0x136)](fetch,_0x4d97b0+'/api/v1/mcp/features/'+_0x198205+_0x2a7f86(0x14e),{'method':_0x22c20b['GIxfj'],'headers':{'Authorization':_0x2a7f86(0x146)+_0x5dc673}});if(!_0xe10210['ok']){const _0x5852f6=await _0xe10210[_0x2a7f86(0x16a)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x5852f6);}}
|
|
1
|
+
(function(_0x523823,_0x473b46){const _0x5cd9c6=_0x10c3,_0x23e29b=_0x523823();while(!![]){try{const _0x39e144=-parseInt(_0x5cd9c6(0x218))/0x1+-parseInt(_0x5cd9c6(0x1f6))/0x2*(-parseInt(_0x5cd9c6(0x1ec))/0x3)+parseInt(_0x5cd9c6(0x1ef))/0x4*(-parseInt(_0x5cd9c6(0x1e5))/0x5)+parseInt(_0x5cd9c6(0x1dd))/0x6+-parseInt(_0x5cd9c6(0x1e4))/0x7+parseInt(_0x5cd9c6(0x1fc))/0x8*(-parseInt(_0x5cd9c6(0x1f5))/0x9)+parseInt(_0x5cd9c6(0x21d))/0xa;if(_0x39e144===_0x473b46)break;else _0x23e29b['push'](_0x23e29b['shift']());}catch(_0x108b66){_0x23e29b['push'](_0x23e29b['shift']());}}}(_0x2dae,0x30ad2));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x287dcc){const _0x530cc5=_0x10c3,_0x52f9e4={'JMYHv':function(_0x7a83ce){return _0x7a83ce();},'vipBi':function(_0x13f0f0,_0xee56c6,_0x241e21){return _0x13f0f0(_0xee56c6,_0x241e21);},'xmGDy':_0x530cc5(0x1e8),'MukaT':function(_0x18adc8,_0x1944fb){return _0x18adc8===_0x1944fb;}},_0x35aaa1=await getToken();if(!_0x35aaa1)throw new Error(_0x530cc5(0x215));const _0x1baea4=_0x52f9e4['JMYHv'](getApiBaseUrl),_0x27c135=await _0x52f9e4['vipBi'](fetch,_0x1baea4+'/api/v1/mcp/features',{'method':_0x530cc5(0x213),'headers':{'Authorization':_0x530cc5(0x227)+_0x35aaa1,'Content-Type':_0x52f9e4[_0x530cc5(0x20d)]},'body':JSON[_0x530cc5(0x1eb)](_0x287dcc)});if(!_0x27c135['ok']){if(_0x52f9e4['MukaT'](_0x27c135[_0x530cc5(0x20f)],0x192)){const _0x2ee24d=await _0x27c135[_0x530cc5(0x20b)](),_0x8f0d61=_0x2ee24d[_0x530cc5(0x202)]||'https://dashboard.ranger.net/billing';throw new Error((_0x2ee24d['message']||_0x530cc5(0x221))+_0x530cc5(0x224)+_0x8f0d61);}const _0x4e134e=await _0x27c135[_0x530cc5(0x207)]();throw new Error(_0x530cc5(0x217)+_0x4e134e);}return _0x27c135[_0x530cc5(0x20b)]();}export async function listFeatures(_0x3282ad){const _0x19a2b1=_0x10c3,_0x301e57={'Ytjzi':function(_0x5cb97c){return _0x5cb97c();},'PXHQf':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ZOWbP':_0x19a2b1(0x1da),'alReG':_0x19a2b1(0x1db),'XADwT':'true','bjYnD':_0x19a2b1(0x1f9)},_0x366a91=await _0x301e57[_0x19a2b1(0x208)](getToken);if(!_0x366a91)throw new Error(_0x301e57['PXHQf']);const _0x155a71=_0x301e57[_0x19a2b1(0x208)](getApiBaseUrl),_0x45c1ba=new URLSearchParams();if(_0x3282ad?.[_0x19a2b1(0x1e6)])_0x45c1ba[_0x19a2b1(0x214)](_0x19a2b1(0x1e6),_0x3282ad[_0x19a2b1(0x1e6)]);if(_0x3282ad?.[_0x19a2b1(0x1da)])_0x45c1ba[_0x19a2b1(0x214)](_0x301e57[_0x19a2b1(0x1d2)],_0x3282ad[_0x19a2b1(0x1da)]);if(_0x3282ad?.['limit'])_0x45c1ba['set'](_0x301e57[_0x19a2b1(0x1f0)],_0x3282ad[_0x19a2b1(0x1db)][_0x19a2b1(0x203)]());if(_0x3282ad?.['offset'])_0x45c1ba['set']('offset',_0x3282ad['offset'][_0x19a2b1(0x203)]());if(_0x3282ad?.['includeDeleted'])_0x45c1ba[_0x19a2b1(0x214)](_0x19a2b1(0x205),_0x301e57[_0x19a2b1(0x1fd)]);const _0x533553=_0x155a71+_0x19a2b1(0x1d9)+(_0x45c1ba['toString']()?'?'+_0x45c1ba[_0x19a2b1(0x203)]():''),_0x2ac773=await fetch(_0x533553,{'method':_0x301e57[_0x19a2b1(0x1e3)],'headers':{'Authorization':_0x19a2b1(0x227)+_0x366a91}});if(!_0x2ac773['ok']){const _0x28059c=await _0x2ac773[_0x19a2b1(0x207)]();throw new Error(_0x19a2b1(0x200)+_0x28059c);}return _0x2ac773[_0x19a2b1(0x20b)]();}export async function getFeature(_0xc7bf67){const _0x3e91eb=_0x10c3,_0x21efd2={'sDFYB':function(_0x41fad0){return _0x41fad0();},'evaFv':function(_0x455315,_0x54a6f1,_0x1d17de){return _0x455315(_0x54a6f1,_0x1d17de);}},_0x3cf710=await _0x21efd2[_0x3e91eb(0x1f8)](getToken);if(!_0x3cf710)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x14eb70=_0x21efd2['sDFYB'](getApiBaseUrl),_0x2494b8=await _0x21efd2['evaFv'](fetch,_0x14eb70+'/api/v1/mcp/features/'+_0xc7bf67,{'method':_0x3e91eb(0x1f9),'headers':{'Authorization':'Bearer\x20'+_0x3cf710}});if(!_0x2494b8['ok']){const _0x2e7640=await _0x2494b8['text']();throw new Error(_0x3e91eb(0x1dc)+_0x2e7640);}return _0x2494b8[_0x3e91eb(0x20b)]();}export async function updateFeature(_0x3abbfd,_0x21cc23){const _0x587a9b=_0x10c3,_0x5969b1={'RTsps':function(_0x28ab3e){return _0x28ab3e();},'sIcOq':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','TLZjs':_0x587a9b(0x1e8)},_0x5a2649=await _0x5969b1['RTsps'](getToken);if(!_0x5a2649)throw new Error(_0x5969b1[_0x587a9b(0x1d6)]);const _0xf83373=getApiBaseUrl(),_0x38249c=await fetch(_0xf83373+_0x587a9b(0x21a)+_0x3abbfd,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x5a2649,'Content-Type':_0x5969b1[_0x587a9b(0x1e9)]},'body':JSON[_0x587a9b(0x1eb)](_0x21cc23)});if(!_0x38249c['ok']){const _0x410b5c=await _0x38249c['text']();throw new Error(_0x587a9b(0x1e1)+_0x410b5c);}return _0x38249c['json']();}export async function createChecklistItem(_0x1a861f,_0x5091c3,_0x1d1903){const _0x353637=_0x10c3,_0x154cd4={'uBeUT':function(_0xed1711,_0x41b556,_0x39ba90){return _0xed1711(_0x41b556,_0x39ba90);},'pbimA':_0x353637(0x213)},_0x4d67d2=await getToken();if(!_0x4d67d2)throw new Error(_0x353637(0x215));const _0x208e35=getApiBaseUrl(),_0x3a494e=await _0x154cd4[_0x353637(0x210)](fetch,_0x208e35+'/api/v1/mcp/features/'+_0x1a861f+_0x353637(0x1ea),{'method':_0x154cd4['pbimA'],'headers':{'Authorization':'Bearer\x20'+_0x4d67d2,'Content-Type':'application/json'},'body':JSON[_0x353637(0x1eb)]({'description':_0x5091c3,'position':_0x1d1903})});if(!_0x3a494e['ok']){const _0x160604=await _0x3a494e[_0x353637(0x207)]();throw new Error(_0x353637(0x1f2)+_0x160604);}return _0x3a494e['json']();}export async function updateChecklistItem(_0x227c68,_0x22671f,_0x17bb5b){const _0x30bd2f=_0x10c3,_0x125ef0={'RpDSs':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','wlEFW':function(_0x362872,_0x42e1d8,_0x2b8d66){return _0x362872(_0x42e1d8,_0x2b8d66);},'fvSie':function(_0x40295d,_0x247ad7,_0x551a00){return _0x40295d(_0x247ad7,_0x551a00);},'UGdOs':_0x30bd2f(0x1d3)};return _0x125ef0[_0x30bd2f(0x206)](withRetry,async()=>{const _0x12b12e=_0x30bd2f,_0xaa9c01=await getToken();if(!_0xaa9c01)throw new Error(_0x125ef0[_0x12b12e(0x225)]);const _0x4d6eeb=getApiBaseUrl(),_0x15757a=await _0x125ef0[_0x12b12e(0x1fa)](fetch,_0x4d6eeb+_0x12b12e(0x21a)+_0x227c68+'/checklist/'+_0x22671f,{'method':_0x12b12e(0x1ff),'headers':{'Authorization':_0x12b12e(0x227)+_0xaa9c01,'Content-Type':'application/json'},'body':JSON['stringify'](_0x17bb5b)});if(!_0x15757a['ok']){const _0x5ca092=await _0x15757a[_0x12b12e(0x207)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x5ca092);}return _0x15757a[_0x12b12e(0x20b)]();},{'label':_0x125ef0[_0x30bd2f(0x20a)]});}export async function getFeatureReport(_0x4f29b7){const _0x494a1a=_0x10c3,_0x8afbc1={'IZmSO':_0x494a1a(0x1f9)},_0x3c0de4=await getToken();if(!_0x3c0de4)throw new Error(_0x494a1a(0x215));const _0x2e1a19=getApiBaseUrl(),_0x93312c=await fetch(_0x2e1a19+_0x494a1a(0x21a)+_0x4f29b7+'/report',{'method':_0x8afbc1['IZmSO'],'headers':{'Authorization':'Bearer\x20'+_0x3c0de4}});if(!_0x93312c['ok']){const _0x1dd5d8=await _0x93312c[_0x494a1a(0x207)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x1dd5d8);}return _0x93312c['json']();}function _0x10c3(_0x2bf5d3,_0x297817){_0x2bf5d3=_0x2bf5d3-0x1d2;const _0x2dae9e=_0x2dae();let _0x10c366=_0x2dae9e[_0x2bf5d3];return _0x10c366;}export async function getFeatureReportMarkdown(_0x452287,_0x53f406){const _0x23424a=_0x10c3,_0x1b6256={'YlLxL':function(_0x30074d){return _0x30074d();},'DxMCA':function(_0x1a7deb,_0x30a945){return _0x1a7deb(_0x30a945);},'Ddifj':_0x23424a(0x204),'Fqcde':function(_0x2b7a94,_0x54d54b){return _0x2b7a94&&_0x54d54b;}},_0x40759a=await getToken();if(!_0x40759a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x131d8f=_0x1b6256['YlLxL'](getApiBaseUrl),_0x2ec421=new URLSearchParams(),_0x3c1b7f=(_0x53f406?.[_0x23424a(0x204)]?.[_0x23424a(0x1ed)]??0x0)>0x0,_0x11d789=_0x1b6256['DxMCA'](Boolean,_0x53f406?.[_0x23424a(0x1e2)]);_0x3c1b7f&&_0x53f406?.['itemIds']&&_0x2ec421['set'](_0x1b6256[_0x23424a(0x1d4)],_0x53f406['itemIds'][_0x23424a(0x201)](','));_0x11d789&&_0x53f406?.['sessionId']&&_0x2ec421[_0x23424a(0x214)]('sessionId',_0x53f406[_0x23424a(0x1e2)]);_0x1b6256[_0x23424a(0x1f7)](!_0x3c1b7f,!_0x11d789)&&_0x53f406?.[_0x23424a(0x21f)]&&_0x2ec421[_0x23424a(0x214)]('style',_0x53f406['style']);const _0x5e4626=_0x131d8f+'/api/v1/mcp/features/'+_0x452287+_0x23424a(0x223),_0x265203=''+_0x5e4626+(_0x2ec421['toString']()?'?'+_0x2ec421['toString']():''),_0x4b2c9b=await fetch(_0x265203,{'method':_0x23424a(0x1f9),'headers':{'Authorization':_0x23424a(0x227)+_0x40759a}});if(!_0x4b2c9b['ok']){const _0x248345=await _0x4b2c9b['text']();throw new Error(_0x23424a(0x20c)+_0x248345);}return _0x4b2c9b['text']();}function _0x2dae(){const _0x54f961=['includeDeleted','fvSie','text','Ytjzi','FCXEx','UGdOs','json','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','xmGDy','NiDeT','status','uBeUT','Failed\x20to\x20get\x20action\x20items:\x20','PbWXa','POST','set','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','/restore','Failed\x20to\x20create\x20feature\x20review:\x20','219008vnDiat','/sessions','/api/v1/mcp/features/','Failed\x20to\x20get\x20item\x20feedback:\x20','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','1798900qjAaEu','hYFYV','style','IAgtA','Feature\x20limit\x20exceeded','Failed\x20to\x20delete\x20feature\x20review:\x20','/report/markdown','\x0a\x0aUpgrade\x20your\x20plan:\x20','RpDSs','APtYJ','Bearer\x20','deJVl','ZOWbP','updateChecklistItem','Ddifj','FvyDb','sIcOq','aEfDg','/feedback','/api/v1/mcp/features','gitBranch','limit','Failed\x20to\x20get\x20feature\x20review:\x20','2380182UwYGcJ','/conclude','DELETE','Failed\x20to\x20list\x20sessions:\x20','Failed\x20to\x20update\x20feature\x20review:\x20','sessionId','bjYnD','498176OxFJcw','8755pxYkxi','gitRepoUrl','EFRvD','application/json','TLZjs','/checklist','stringify','162312XtZXqm','length','WHSDY','684eLAzzc','alReG','Failed\x20to\x20restore\x20feature\x20review:\x20','Failed\x20to\x20create\x20scenario:\x20','XYmaJ','vQYUZ','261594VNEFFr','10ojwuUo','Fqcde','sDFYB','GET','wlEFW','Failed\x20to\x20conclude\x20session:\x20','16IDvmZu','XADwT','/action-items','PATCH','Failed\x20to\x20list\x20feature\x20reviews:\x20','join','billingUrl','toString','itemIds'];_0x2dae=function(){return _0x54f961;};return _0x2dae();}export async function listFeatureSessions(_0x15b908){const _0x18ca8a=_0x10c3,_0x560be9={'BwLck':function(_0x43f78c,_0x18a436,_0x37e8a1){return _0x43f78c(_0x18a436,_0x37e8a1);}},_0x262cd2=await getToken();if(!_0x262cd2)throw new Error(_0x18ca8a(0x215));const _0x3e4717=getApiBaseUrl(),_0x57f4d2=await _0x560be9['BwLck'](fetch,_0x3e4717+_0x18ca8a(0x21a)+_0x15b908+_0x18ca8a(0x219),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x262cd2}});if(!_0x57f4d2['ok']){const _0x9e9eba=await _0x57f4d2[_0x18ca8a(0x207)]();throw new Error(_0x18ca8a(0x1e0)+_0x9e9eba);}return _0x57f4d2['json']();}export async function startSession(_0x35f5c5,_0xd3292d){const _0x1cee31=_0x10c3,_0x2df8d8={'fyPPy':function(_0x56c3e2){return _0x56c3e2();},'ZCUZl':function(_0x49ebba){return _0x49ebba();},'vQYUZ':function(_0x1b2b02,_0x5be72e,_0x10b5e3){return _0x1b2b02(_0x5be72e,_0x10b5e3);},'APtYJ':'POST'},_0x5f3ff5=await _0x2df8d8['fyPPy'](getToken);if(!_0x5f3ff5)throw new Error(_0x1cee31(0x215));const _0x57df2e=_0x2df8d8['ZCUZl'](getApiBaseUrl),_0x182dfd=await _0x2df8d8[_0x1cee31(0x1f4)](fetch,_0x57df2e+_0x1cee31(0x21a)+_0x35f5c5+'/sessions/'+_0xd3292d+'/start',{'method':_0x2df8d8[_0x1cee31(0x226)],'headers':{'Authorization':_0x1cee31(0x227)+_0x5f3ff5}});if(!_0x182dfd['ok']){const _0x395743=await _0x182dfd[_0x1cee31(0x207)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x395743);}return _0x182dfd['json']();}export async function concludeSession(_0x28abd0,_0x589fc0){const _0xb70511=_0x10c3,_0x1dfb9d={'UuTNm':function(_0x13bec8){return _0x13bec8();},'FCXEx':function(_0x447770){return _0x447770();}},_0x5ca93c=await _0x1dfb9d['UuTNm'](getToken);if(!_0x5ca93c)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xa8606=_0x1dfb9d[_0xb70511(0x209)](getApiBaseUrl),_0x558708=await fetch(_0xa8606+_0xb70511(0x21a)+_0x28abd0+'/sessions/'+_0x589fc0+_0xb70511(0x1de),{'method':'POST','headers':{'Authorization':_0xb70511(0x227)+_0x5ca93c}});if(!_0x558708['ok']){const _0x2a0d10=await _0x558708[_0xb70511(0x207)]();throw new Error(_0xb70511(0x1fb)+_0x2a0d10);}return _0x558708[_0xb70511(0x20b)]();}export async function getActionItems(_0x2f6f79){const _0x5715e3=_0x10c3,_0xf0e5ac={'KgJNc':function(_0x7aeefb){return _0x7aeefb();},'dKkfA':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','AorGA':function(_0x11ce2e){return _0x11ce2e();},'lUKFj':function(_0x2e4def,_0x41ec50,_0x50b8d4){return _0x2e4def(_0x41ec50,_0x50b8d4);},'iiNkH':_0x5715e3(0x1f9)},_0xb8d9ce=await _0xf0e5ac['KgJNc'](getToken);if(!_0xb8d9ce)throw new Error(_0xf0e5ac['dKkfA']);const _0x1da633=_0xf0e5ac['AorGA'](getApiBaseUrl),_0x261fdd=await _0xf0e5ac['lUKFj'](fetch,_0x1da633+'/api/v1/mcp/features/'+_0x2f6f79+_0x5715e3(0x1fe),{'method':_0xf0e5ac['iiNkH'],'headers':{'Authorization':'Bearer\x20'+_0xb8d9ce}});if(!_0x261fdd['ok']){const _0x32af34=await _0x261fdd[_0x5715e3(0x207)]();throw new Error(_0x5715e3(0x211)+_0x32af34);}return _0x261fdd[_0x5715e3(0x20b)]();}export async function getItemFeedback(_0x11c08d,_0x5cce56){const _0x1f8a9c=_0x10c3,_0x37a995={'XYmaJ':function(_0x1f67cd){return _0x1f67cd();},'hYFYV':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','DlRoN':_0x1f8a9c(0x1f9)},_0x5f4d46=await _0x37a995[_0x1f8a9c(0x1f3)](getToken);if(!_0x5f4d46)throw new Error(_0x37a995[_0x1f8a9c(0x21e)]);const _0x3aedf1=getApiBaseUrl(),_0x481a2f=await fetch(_0x3aedf1+'/api/v1/mcp/features/'+_0x11c08d+'/checklist-items/'+_0x5cce56+_0x1f8a9c(0x1d8),{'method':_0x37a995['DlRoN'],'headers':{'Authorization':'Bearer\x20'+_0x5f4d46}});if(!_0x481a2f['ok']){const _0x4a6e75=await _0x481a2f['text']();throw new Error(_0x1f8a9c(0x21b)+_0x4a6e75);}return _0x481a2f[_0x1f8a9c(0x20b)]();}export async function markCommentsAddressed(_0x33172c,_0x4a6d77,_0x6eab3b){const _0x4f2613=_0x10c3,_0x278868={'NiDeT':_0x4f2613(0x215),'IAgtA':function(_0x10574f,_0x5b59de,_0x526382){return _0x10574f(_0x5b59de,_0x526382);}},_0x14f4ec=await getToken();if(!_0x14f4ec)throw new Error(_0x278868[_0x4f2613(0x20e)]);const _0x4f8da0=getApiBaseUrl(),_0x3b3077=await _0x278868[_0x4f2613(0x220)](fetch,_0x4f8da0+'/api/v1/mcp/features/'+_0x33172c+'/comments/address',{'method':_0x4f2613(0x213),'headers':{'Authorization':'Bearer\x20'+_0x14f4ec,'Content-Type':'application/json'},'body':JSON[_0x4f2613(0x1eb)]({'checklistItemId':_0x4a6d77,'commentIds':_0x6eab3b})});if(!_0x3b3077['ok']){const _0x2a0ef7=await _0x3b3077[_0x4f2613(0x207)]();throw new Error(_0x4f2613(0x21c)+_0x2a0ef7);}}export async function softDeleteFeature(_0x227806){const _0x370db5=_0x10c3,_0xdbc4b0={'EFRvD':_0x370db5(0x215),'WHSDY':function(_0x3d41ec,_0x52ddf2,_0x309bae){return _0x3d41ec(_0x52ddf2,_0x309bae);},'FvyDb':_0x370db5(0x1df)},_0x40a941=await getToken();if(!_0x40a941)throw new Error(_0xdbc4b0[_0x370db5(0x1e7)]);const _0x485f7e=getApiBaseUrl(),_0x537c9f=await _0xdbc4b0[_0x370db5(0x1ee)](fetch,_0x485f7e+_0x370db5(0x21a)+_0x227806,{'method':_0xdbc4b0[_0x370db5(0x1d5)],'headers':{'Authorization':'Bearer\x20'+_0x40a941}});if(!_0x537c9f['ok']){const _0x58c359=await _0x537c9f[_0x370db5(0x207)]();throw new Error(_0x370db5(0x222)+_0x58c359);}}export async function restoreFeature(_0x1f1dc3){const _0x2f3f4c=_0x10c3,_0x955252={'PbWXa':function(_0x316be6){return _0x316be6();},'SOUXO':_0x2f3f4c(0x215),'deJVl':function(_0xa424d2){return _0xa424d2();},'dsyey':function(_0x248ef8,_0x565dc7,_0x2daeb8){return _0x248ef8(_0x565dc7,_0x2daeb8);},'aEfDg':'POST'},_0x23f155=await _0x955252[_0x2f3f4c(0x212)](getToken);if(!_0x23f155)throw new Error(_0x955252['SOUXO']);const _0x2d55ee=_0x955252[_0x2f3f4c(0x228)](getApiBaseUrl),_0x58d686=await _0x955252['dsyey'](fetch,_0x2d55ee+_0x2f3f4c(0x21a)+_0x1f1dc3+_0x2f3f4c(0x216),{'method':_0x955252[_0x2f3f4c(0x1d7)],'headers':{'Authorization':'Bearer\x20'+_0x23f155}});if(!_0x58d686['ok']){const _0x4170fc=await _0x58d686[_0x2f3f4c(0x207)]();throw new Error(_0x2f3f4c(0x1f1)+_0x4170fc);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x43e622=_0x4f71;function _0x4f71(_0x447208,_0x1801e9){_0x447208=_0x447208-0x178;const _0x4c0d8a=_0x4c0d();let _0x4f716e=_0x4c0d8a[_0x447208];return _0x4f716e;}(function(_0x9ac6da,_0x1f2e27){const _0x10b340=_0x4f71,_0x1868b2=_0x9ac6da();while(!![]){try{const _0x3a6939=-parseInt(_0x10b340(0x183))/0x1+-parseInt(_0x10b340(0x17d))/0x2+-parseInt(_0x10b340(0x189))/0x3*(-parseInt(_0x10b340(0x18c))/0x4)+-parseInt(_0x10b340(0x1bc))/0x5*(parseInt(_0x10b340(0x18e))/0x6)+-parseInt(_0x10b340(0x1b5))/0x7+-parseInt(_0x10b340(0x19a))/0x8*(parseInt(_0x10b340(0x180))/0x9)+parseInt(_0x10b340(0x187))/0xa*(parseInt(_0x10b340(0x1bb))/0xb);if(_0x3a6939===_0x1f2e27)break;else _0x1868b2['push'](_0x1868b2['shift']());}catch(_0x344968){_0x1868b2['push'](_0x1868b2['shift']());}}}(_0x4c0d,0x709cf));import{readFileSync,writeFileSync}from'fs';const ID_SEGMENT=0x18538067,ID_INFO=0x1549a966,ID_TIMESTAMP_SCALE=0x2ad7b1,ID_DURATION=0x4489,ID_VOID=0xec,ID_CLUSTER=0x1f43b675,ID_TIMESTAMP=0xe7,ID_SIMPLE_BLOCK=0xa3;function readVint(_0x472b4b,_0x5ce5f9){const _0x1a8b73=_0x4f71,_0x4b1773={'MNtCv':function(_0x77f502,_0x782b5){return _0x77f502&_0x782b5;},'lrLsd':function(_0xd8c021,_0x1a2eab){return _0xd8c021-_0x1a2eab;},'bjGrf':function(_0x18728c,_0x1229d5){return _0x18728c*_0x1229d5;},'DkBfo':function(_0x32c800,_0x36fb58){return _0x32c800+_0x36fb58;}};if(_0x5ce5f9>=_0x472b4b['length'])return[0x0,0x0];const _0x22c1ce=_0x472b4b[_0x5ce5f9];let _0x4717f7=0x1,_0x26043e=0x80;while(_0x4717f7<=0x8&&!(_0x22c1ce&_0x26043e)){_0x4717f7++,_0x26043e>>=0x1;}if(_0x5ce5f9+_0x4717f7>_0x472b4b['length'])return[0x0,0x0];let _0x3f1cdb=_0x4b1773['MNtCv'](_0x22c1ce,_0x4b1773[_0x1a8b73(0x191)](_0x26043e,0x1));for(let _0x1357aa=0x1;_0x1357aa<_0x4717f7;_0x1357aa++){_0x3f1cdb=_0x4b1773['bjGrf'](_0x3f1cdb,0x100)+_0x472b4b[_0x4b1773['DkBfo'](_0x5ce5f9,_0x1357aa)];}return[_0x3f1cdb,_0x4717f7];}function readId(_0x3d6fe4,_0x397b1c){const _0x52a281=_0x4f71,_0x3f4a03={'DOLAP':function(_0xa7e2ba,_0x4aa4b1){return _0xa7e2ba>=_0x4aa4b1;},'mmMik':function(_0xdee29b,_0x1ab1ff){return _0xdee29b>_0x1ab1ff;},'bokKF':function(_0x38a66e,_0x5289d6){return _0x38a66e+_0x5289d6;},'JxcUg':function(_0x519ffd,_0x3478eb){return _0x519ffd<_0x3478eb;},'TyZMy':function(_0x42813f,_0x33938e){return _0x42813f*_0x33938e;}};if(_0x397b1c>=_0x3d6fe4['length'])return[0x0,0x0];const _0x532d27=_0x3d6fe4[_0x397b1c];let _0x173582;if(_0x3f4a03['DOLAP'](_0x532d27,0x80))_0x173582=0x1;else{if(_0x3f4a03[_0x52a281(0x18a)](_0x532d27,0x40))_0x173582=0x2;else{if(_0x3f4a03[_0x52a281(0x18a)](_0x532d27,0x20))_0x173582=0x3;else{if(_0x532d27>=0x10)_0x173582=0x4;else return[_0x532d27,0x1];}}}if(_0x3f4a03[_0x52a281(0x1ac)](_0x3f4a03[_0x52a281(0x1ba)](_0x397b1c,_0x173582),_0x3d6fe4[_0x52a281(0x19d)]))return[0x0,0x0];let _0x3f325a=0x0;for(let _0x5fd108=0x0;_0x3f4a03[_0x52a281(0x198)](_0x5fd108,_0x173582);_0x5fd108++){_0x3f325a=_0x3f4a03['TyZMy'](_0x3f325a,0x100)+_0x3d6fe4[_0x3f4a03['bokKF'](_0x397b1c,_0x5fd108)];}return[_0x3f325a,_0x173582];}function readUint(_0x445e79,_0x3edbff,_0x3d4e6a){const _0x242cd9={'GgKvG':function(_0xc7c112,_0x4e67d8){return _0xc7c112+_0x4e67d8;}};let _0x258a17=0x0;for(let _0x4f6018=0x0;_0x4f6018<_0x3d4e6a;_0x4f6018++){_0x258a17=_0x242cd9['GgKvG'](_0x258a17*0x100,_0x445e79[_0x3edbff+_0x4f6018]);}return _0x258a17;}function isUnknownSize(_0x4b0238,_0xfd9027){const _0x26fdaf=_0x4f71,_0x56770f={'SuypY':function(_0x3b0f5f,_0xdbe9ee){return _0x3b0f5f===_0xdbe9ee;},'tJrBz':function(_0x2f1849,_0x35db2e){return _0x2f1849-_0x35db2e;},'VxFDW':function(_0x52dcc4,_0x348339){return _0x52dcc4*_0x348339;}};return _0x56770f[_0x26fdaf(0x19e)](_0x4b0238,_0x56770f['tJrBz'](Math[_0x26fdaf(0x19c)](0x2,_0x56770f['VxFDW'](0x7,_0xfd9027)),0x1));}function writeId(_0x991ed5){const _0x4a33d7=_0x4f71,_0xdff259={'fsKpP':function(_0xfa15e,_0x4bf1ca){return _0xfa15e<=_0x4bf1ca;},'HVZqT':function(_0x16cc54,_0x14ebb6){return _0x16cc54&_0x14ebb6;},'BwYGt':function(_0x5a84a0,_0x72f540){return _0x5a84a0>>_0x72f540;},'ZrwlI':function(_0x298d16,_0xd772d4){return _0x298d16<=_0xd772d4;},'iscJg':function(_0x39d52b,_0x5f01b4){return _0x39d52b&_0x5f01b4;},'lqYJK':function(_0x3de98c,_0x1486dc){return _0x3de98c>>_0x1486dc;}};if(_0xdff259['fsKpP'](_0x991ed5,0xff))return Buffer['from']([_0x991ed5]);if(_0xdff259[_0x4a33d7(0x1b6)](_0x991ed5,0xffff))return Buffer[_0x4a33d7(0x1a2)]([_0xdff259[_0x4a33d7(0x1a8)](_0xdff259['BwYGt'](_0x991ed5,0x8),0xff),_0x991ed5&0xff]);if(_0xdff259['ZrwlI'](_0x991ed5,0xffffff))return Buffer[_0x4a33d7(0x1a2)]([_0xdff259[_0x4a33d7(0x178)](_0x991ed5,0x10)&0xff,_0xdff259[_0x4a33d7(0x1a4)](_0x991ed5>>0x8,0xff),_0x991ed5&0xff]);return Buffer['from']([_0xdff259[_0x4a33d7(0x1a8)](_0xdff259[_0x4a33d7(0x185)](_0x991ed5,0x18),0xff),_0xdff259['iscJg'](_0x991ed5>>0x10,0xff),_0xdff259[_0x4a33d7(0x1a8)](_0xdff259[_0x4a33d7(0x178)](_0x991ed5,0x8),0xff),_0xdff259[_0x4a33d7(0x1a4)](_0x991ed5,0xff)]);}function writeVint(_0x5b0a04,_0x5b97e5){const _0x40541c=_0x4f71,_0x1fee21={'NICHr':function(_0x34fdf0,_0x4f0fc2){return _0x34fdf0<_0x4f0fc2;},'nwMhi':function(_0x7f728a,_0x24833d){return _0x7f728a*_0x24833d;},'apEHC':function(_0xe82985,_0x280b47){return _0xe82985>=_0x280b47;},'QAnRk':function(_0x5d1b3b,_0x2cd75c){return _0x5d1b3b/_0x2cd75c;}};let _0x4ba9f4=_0x5b97e5||0x1;while(_0x1fee21[_0x40541c(0x1b9)](Math['pow'](0x2,_0x1fee21['nwMhi'](0x7,_0x4ba9f4))-0x2,_0x5b0a04))_0x4ba9f4++;const _0x460ffe=Buffer['alloc'](_0x4ba9f4);for(let _0xda4db0=_0x4ba9f4-0x1;_0x1fee21[_0x40541c(0x1af)](_0xda4db0,0x0);_0xda4db0--){_0x460ffe[_0xda4db0]=_0x5b0a04&0xff,_0x5b0a04=Math['floor'](_0x1fee21[_0x40541c(0x1a6)](_0x5b0a04,0x100));}return _0x460ffe[0x0]|=0x1<<0x8-_0x4ba9f4,_0x460ffe;}function writeFloat64(_0x4e94b9){const _0x159ba1=_0x4f71,_0x17321b=Buffer[_0x159ba1(0x196)](0x8);return _0x17321b['writeDoubleBE'](_0x4e94b9,0x0),_0x17321b;}function writeVoid(_0x26344d){const _0x541e4b=_0x4f71,_0x521c40={'FQocp':function(_0x217055,_0x175ab4){return _0x217055<=_0x175ab4;},'tFZEV':function(_0xb9f8f6,_0x1983ea){return _0xb9f8f6-_0x1983ea;},'BnwIb':function(_0x4ce951,_0x540ad5){return _0x4ce951>=_0x540ad5;},'lDKXt':function(_0x492d57,_0x274a6f,_0x318efa){return _0x492d57(_0x274a6f,_0x318efa);}};for(let _0x53de2d=0x1;_0x521c40[_0x541e4b(0x1b7)](_0x53de2d,0x8);_0x53de2d++){const _0x404174=_0x521c40['tFZEV'](_0x521c40['tFZEV'](_0x26344d,0x1),_0x53de2d);if(_0x521c40[_0x541e4b(0x184)](_0x404174,0x0)&&_0x521c40['FQocp'](_0x404174,Math['pow'](0x2,0x7*_0x53de2d)-0x2))return Buffer['concat']([Buffer['from']([ID_VOID]),_0x521c40[_0x541e4b(0x190)](writeVint,_0x404174,_0x53de2d),Buffer['alloc'](_0x404174)]);}return Buffer['alloc'](0x0);}function findElement(_0x49ad1c,_0x3e68ed,_0x889af1,_0x1fb838){const _0x535495=_0x4f71,_0x5a64f1={'QIebw':function(_0xb3c250,_0x528e51){return _0xb3c250<_0x528e51;},'mcfSE':function(_0xafd315,_0x56c983,_0x1c8f51){return _0xafd315(_0x56c983,_0x1c8f51);},'ydxNj':function(_0x404f0f,_0x42908b){return _0x404f0f+_0x42908b;}};let _0x53eeda=_0x3e68ed;while(_0x5a64f1['QIebw'](_0x53eeda,_0x889af1)){const [_0x293c83,_0x205c89]=_0x5a64f1['mcfSE'](readId,_0x49ad1c,_0x53eeda),[_0x491d49,_0x1a4245]=readVint(_0x49ad1c,_0x53eeda+_0x205c89);if(_0x293c83===_0x1fb838)return{'offset':_0x53eeda,'idLen':_0x205c89,'sizeLen':_0x1a4245,'dataSize':_0x491d49,'dataOffset':_0x5a64f1[_0x535495(0x193)](_0x53eeda,_0x205c89)+_0x1a4245};if(_0x5a64f1[_0x535495(0x17e)](isUnknownSize,_0x491d49,_0x1a4245))break;_0x53eeda+=_0x205c89+_0x1a4245+_0x491d49;}return null;}function computeDurationMs(_0x6cf58,_0x345ccd){const _0x4b8698=_0x4f71,_0x437225={'rYAvw':function(_0x272a8a,_0x221d3a){return _0x272a8a<_0x221d3a;},'JDWzs':function(_0x23b3c8,_0x44cdb6){return _0x23b3c8!==_0x44cdb6;},'WDflg':function(_0x33bcba,_0x440271,_0x3b518d){return _0x33bcba(_0x440271,_0x3b518d);},'vPnsj':function(_0x2b4010,_0x4949bb){return _0x2b4010+_0x4949bb;},'rzPiu':function(_0x1231f6,_0x47f54a){return _0x1231f6+_0x47f54a;},'QCEGT':function(_0x4b60c2,_0x1704d3){return _0x4b60c2+_0x1704d3;},'OEYPm':function(_0x1c7308,_0x36b327,_0x197f83){return _0x1c7308(_0x36b327,_0x197f83);},'jQXqM':function(_0x2ccbf3,_0x4d8ce1){return _0x2ccbf3<_0x4d8ce1;},'tyNxf':function(_0x58e9fe,_0x528b5a){return _0x58e9fe===_0x528b5a;},'DmbJU':function(_0x5cf08a,_0x3e265d){return _0x5cf08a+_0x3e265d;},'dIlSO':function(_0x1cb33d,_0x23d510){return _0x1cb33d<_0x23d510;},'iZLTJ':function(_0x22b5c1,_0x33b0bc,_0x10b4d9,_0x1e3b66){return _0x22b5c1(_0x33b0bc,_0x10b4d9,_0x1e3b66);},'SQwzG':function(_0x5ce1dc,_0x425141){return _0x5ce1dc>=_0x425141;},'rRwzg':function(_0x17c437,_0x584f43){return _0x17c437+_0x584f43;},'UhaEh':function(_0x49b204,_0x5bf1d1){return _0x49b204*_0x5bf1d1;},'yuCfN':function(_0x468ae3,_0x131fb9){return _0x468ae3>_0x131fb9;},'fLJpy':function(_0x5e96a6,_0x2886fc){return _0x5e96a6+_0x2886fc;}};let _0x5d5ce6=0x0;const _0x572d57=Buffer[_0x4b8698(0x1a2)]([0x1f,0x43,0xb6,0x75]);let _0x400a21=_0x6cf58['indexOf'](_0x572d57);if(_0x400a21===-0x1)return 0x0;while(_0x437225['rYAvw'](_0x400a21,_0x6cf58['length'])){const [_0x7874d1,_0xfab4fd]=readId(_0x6cf58,_0x400a21);if(_0x437225['JDWzs'](_0x7874d1,ID_CLUSTER))break;const [_0x297249,_0x344f29]=_0x437225['WDflg'](readVint,_0x6cf58,_0x437225['vPnsj'](_0x400a21,_0xfab4fd)),_0x480b99=_0x437225[_0x4b8698(0x1ae)](_0x437225[_0x4b8698(0x1a3)](_0x400a21,_0xfab4fd),_0x344f29),_0x217a82=_0x437225['OEYPm'](isUnknownSize,_0x297249,_0x344f29);let _0x158540;if(_0x217a82){let _0x5a2b16=_0x480b99;while(_0x437225['jQXqM'](_0x5a2b16,_0x6cf58[_0x4b8698(0x19d)]-0x4)){const [_0x19ead4,_0x3a960f]=readId(_0x6cf58,_0x5a2b16);if(_0x437225[_0x4b8698(0x192)](_0x19ead4,ID_CLUSTER)){_0x158540=_0x5a2b16;break;}const [_0x1fbef4,_0x14d296]=readVint(_0x6cf58,_0x437225['QCEGT'](_0x5a2b16,_0x3a960f));if(_0x437225['OEYPm'](isUnknownSize,_0x1fbef4,_0x14d296)){_0x158540=_0x6cf58['length'];break;}_0x5a2b16+=_0x437225[_0x4b8698(0x19b)](_0x3a960f,_0x14d296)+_0x1fbef4;}_0x158540??=_0x6cf58['length'];}else _0x158540=_0x437225[_0x4b8698(0x1a3)](_0x480b99,_0x297249);let _0x3f5e3e=0x0,_0x46baeb=_0x480b99;while(_0x437225['dIlSO'](_0x46baeb,_0x158540)){const [_0x20851e,_0x982206]=readId(_0x6cf58,_0x46baeb),[_0x230490,_0x33b6fd]=readVint(_0x6cf58,_0x437225[_0x4b8698(0x17f)](_0x46baeb,_0x982206));if(_0x20851e===ID_TIMESTAMP)_0x3f5e3e=_0x437225['iZLTJ'](readUint,_0x6cf58,_0x437225['QCEGT'](_0x46baeb+_0x982206,_0x33b6fd),_0x230490);else{if(_0x20851e===ID_SIMPLE_BLOCK&&_0x437225[_0x4b8698(0x195)](_0x230490,0x4)){const _0x4aef67=_0x437225[_0x4b8698(0x18f)](_0x437225[_0x4b8698(0x18f)](_0x46baeb,_0x982206),_0x33b6fd),[,_0x5e7c54]=readVint(_0x6cf58,_0x4aef67),_0x55f4e3=_0x6cf58['readInt16BE'](_0x4aef67+_0x5e7c54),_0x1b13bd=_0x437225[_0x4b8698(0x1b0)](_0x3f5e3e+_0x55f4e3,_0x345ccd)/0xf4240;_0x437225['yuCfN'](_0x1b13bd,_0x5d5ce6)&&(_0x5d5ce6=_0x1b13bd);}else{if(_0x20851e===ID_CLUSTER)break;}}if(_0x437225['OEYPm'](isUnknownSize,_0x230490,_0x33b6fd))break;_0x46baeb+=_0x437225[_0x4b8698(0x1a5)](_0x437225[_0x4b8698(0x1a5)](_0x982206,_0x33b6fd),_0x230490);}_0x400a21=_0x158540;}return _0x5d5ce6;}export function fixWebmDuration(_0x245bcd,_0x333326){const _0x595215=_0x4f71,_0x1278a1={'yBvzb':function(_0x4864da,_0x4f3df5,_0x49253e){return _0x4864da(_0x4f3df5,_0x49253e);},'dUcpg':function(_0x197bf2,_0x1db971){return _0x197bf2+_0x1db971;},'yAdxq':function(_0x5c8929,_0x3653b7){return _0x5c8929+_0x3653b7;},'dXXDX':_0x595215(0x1ab),'zuDtZ':function(_0x2f6fd2,_0x14e135){return _0x2f6fd2===_0x14e135;},'dxCgQ':function(_0x516bf8,_0x3e5071){return _0x516bf8+_0x3e5071;},'rQOEs':_0x595215(0x181),'EYvOQ':function(_0x57505e,_0x4db3d8,_0x31ab03,_0x1935e7,_0x5781c6){return _0x57505e(_0x4db3d8,_0x31ab03,_0x1935e7,_0x5781c6);},'NKiiE':function(_0x359aa4,_0x53640d,_0x16910a){return _0x359aa4(_0x53640d,_0x16910a);},'ZxgYZ':function(_0x19e79a,_0x2409cd){return _0x19e79a<=_0x2409cd;},'jgfQI':function(_0x5de5da,_0x806596){return _0x5de5da(_0x806596);},'jhrCd':function(_0xaf9e6a,_0x38fee6){return _0xaf9e6a<_0x38fee6;},'ImqXC':function(_0x572de5,_0x5b897a){return _0x572de5-_0x5b897a;},'GyFCI':function(_0x6ca027,_0x186584,_0xc26f55){return _0x6ca027(_0x186584,_0xc26f55);}},_0x5c5b57=readFileSync(_0x245bcd);let _0x3be48b=0x0;const [_0x573126,_0x434885]=_0x1278a1['yBvzb'](readId,_0x5c5b57,_0x3be48b),[_0x5b8811,_0x548626]=readVint(_0x5c5b57,_0x3be48b+_0x434885);_0x3be48b+=_0x1278a1['dUcpg'](_0x1278a1[_0x595215(0x17a)](_0x434885,_0x548626),_0x5b8811);const [_0x234a29,_0xf2c546]=_0x1278a1['yBvzb'](readId,_0x5c5b57,_0x3be48b);if(_0x234a29!==ID_SEGMENT)return console[_0x595215(0x188)](_0x1278a1['dXXDX']),![];const [,_0x3d7333]=_0x1278a1['yBvzb'](readVint,_0x5c5b57,_0x3be48b+_0xf2c546),_0x21b76e=_0x1278a1[_0x595215(0x17a)](_0x3be48b,_0xf2c546)+_0x3d7333;let _0x3f5f8c=_0x21b76e;const _0x3c8fb3=Math[_0x595215(0x1b4)](_0x5c5b57[_0x595215(0x19d)],_0x21b76e+0x2710);let _0x486775=null,_0x276e35=null;while(_0x3f5f8c<_0x3c8fb3){const [_0x2183a1,_0x35780e]=readId(_0x5c5b57,_0x3f5f8c),[_0x37ed7,_0x1d3a76]=readVint(_0x5c5b57,_0x1278a1['yAdxq'](_0x3f5f8c,_0x35780e));_0x1278a1['zuDtZ'](_0x2183a1,ID_VOID)&&!_0x486775&&(_0x486775={'offset':_0x3f5f8c,'idLen':_0x35780e,'sizeLen':_0x1d3a76,'dataSize':_0x37ed7,'dataOffset':_0x3f5f8c+_0x35780e+_0x1d3a76});if(_0x2183a1===ID_INFO){_0x276e35={'offset':_0x3f5f8c,'idLen':_0x35780e,'sizeLen':_0x1d3a76,'dataSize':_0x37ed7,'dataOffset':_0x1278a1['dxCgQ'](_0x1278a1[_0x595215(0x17a)](_0x3f5f8c,_0x35780e),_0x1d3a76)};break;}if(_0x2183a1===ID_CLUSTER)break;if(isUnknownSize(_0x37ed7,_0x1d3a76))break;_0x3f5f8c+=_0x1278a1['dxCgQ'](_0x35780e+_0x1d3a76,_0x37ed7);}if(!_0x276e35)return console[_0x595215(0x188)](_0x1278a1['rQOEs']),![];const _0x2f1b95=_0x1278a1[_0x595215(0x1b1)](findElement,_0x5c5b57,_0x276e35[_0x595215(0x194)],_0x1278a1[_0x595215(0x17a)](_0x276e35['dataOffset'],_0x276e35[_0x595215(0x1b3)]),ID_DURATION);if(_0x2f1b95)return![];const _0x82957b=findElement(_0x5c5b57,_0x276e35[_0x595215(0x194)],_0x1278a1['dxCgQ'](_0x276e35[_0x595215(0x194)],_0x276e35['dataSize']),ID_TIMESTAMP_SCALE);let _0x557a79=0xf4240;_0x82957b&&(_0x557a79=readUint(_0x5c5b57,_0x82957b['dataOffset'],_0x82957b['dataSize']));const _0x356677=_0x1278a1[_0x595215(0x17c)](computeDurationMs,_0x5c5b57,_0x557a79);if(_0x1278a1[_0x595215(0x199)](_0x356677,0x0))return console['error'](_0x595215(0x1b8)),![];const _0x2e2690=_0x356677*0xf4240/_0x557a79,_0x49a10e=Buffer['concat']([writeId(ID_DURATION),_0x1278a1[_0x595215(0x1a0)](writeVint,0x8),writeFloat64(_0x2e2690)]),_0x18143c=_0x49a10e['length'];if(!_0x486775||_0x1278a1['jhrCd'](_0x486775['offset'],_0x276e35['offset'])){if(_0x486775){const _0x27c691=_0x486775[_0x595215(0x1aa)]+_0x486775[_0x595215(0x197)]+_0x486775[_0x595215(0x1b3)],_0x59a4f2=_0x1278a1[_0x595215(0x1b2)](_0x27c691,_0x18143c);if(_0x59a4f2<0x2)return rewriteFile(_0x5c5b57,_0x276e35,_0x49a10e,_0x557a79,_0x356677,_0x333326);const _0x557dca=_0x276e35['dataSize']+_0x18143c,_0x320f2e=Buffer[_0x595215(0x186)]([writeId(ID_INFO),_0x1278a1[_0x595215(0x18b)](writeVint,_0x557dca,_0x276e35[_0x595215(0x197)])]),_0xe4273d=_0x5c5b57['slice'](_0x276e35['dataOffset'],_0x1278a1['dUcpg'](_0x276e35['dataOffset'],_0x276e35['dataSize'])),_0x413445=writeVoid(_0x59a4f2),_0x44a01e=_0x5c5b57[_0x595215(0x19f)](0x0,_0x486775['offset']),_0x557263=_0x5c5b57[_0x595215(0x19f)](_0x1278a1[_0x595215(0x17a)](_0x276e35['dataOffset'],_0x276e35['dataSize']));return writeFileSync(_0x333326,Buffer['concat']([_0x44a01e,_0x413445,_0x320f2e,_0xe4273d,_0x49a10e,_0x557263])),!![];}}return rewriteFile(_0x5c5b57,_0x276e35,_0x49a10e,_0x557a79,_0x356677,_0x333326);}function rewriteFile(_0x3019fb,_0x27432e,_0x327f83,_0x10a502,_0x169eb0,_0x5ec007){const _0x5585b3=_0x4f71,_0x27ca15={'vBWYA':function(_0x446f70,_0x312f50){return _0x446f70+_0x312f50;},'YMsyn':function(_0x281515,_0x53f83f){return _0x281515+_0x53f83f;},'aHurW':function(_0x2cb596,_0x3615f1){return _0x2cb596+_0x3615f1;},'mcqVM':function(_0x139512,_0x62a55e,_0x4d49e7){return _0x139512(_0x62a55e,_0x4d49e7);}},_0x2e67b8=_0x27ca15['vBWYA'](_0x27432e['dataSize'],_0x327f83['length']),_0x6e2678=Buffer['concat']([writeId(ID_INFO),writeVint(_0x2e67b8)]),_0x279fb7=_0x27ca15[_0x5585b3(0x17b)](_0x27432e[_0x5585b3(0x1aa)],_0x27432e[_0x5585b3(0x197)]),_0x3e990d=_0x3019fb['slice'](0x0,_0x27432e['offset']),_0x521ae3=_0x3019fb['slice'](_0x27432e[_0x5585b3(0x194)],_0x27432e[_0x5585b3(0x194)]+_0x27432e['dataSize']),_0x2b6c15=_0x3019fb[_0x5585b3(0x19f)](_0x27ca15[_0x5585b3(0x17b)](_0x27ca15['aHurW'](_0x27432e[_0x5585b3(0x182)],_0x279fb7),_0x27432e['dataSize']));return _0x27ca15['mcqVM'](writeFileSync,_0x5ec007,Buffer[_0x5585b3(0x186)]([_0x3e990d,_0x6e2678,_0x521ae3,_0x327f83,_0x2b6c15])),!![];}function _0x4c0d(){const _0x493050=['yAdxq','YMsyn','NKiiE','1653264SnrLKh','mcfSE','vPnsj','9yQMfSJ','Could\x20not\x20find\x20Info\x20element','offset','88176Zmzwbr','BnwIb','lqYJK','concat','24770vCkstq','error','46338eVWzQc','DOLAP','GyFCI','104gPkZwl','File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.','3732546YdtIPc','rRwzg','lDKXt','lrLsd','tyNxf','ydxNj','dataOffset','SQwzG','alloc','sizeLen','JxcUg','ZxgYZ','4929032UQSNXj','DmbJU','pow','length','SuypY','slice','jgfQI','argv','from','QCEGT','iscJg','fLJpy','QAnRk','Fixed:\x20','HVZqT','fixWebmDuration.ts','idLen','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','mmMik','Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>','rzPiu','apEHC','UhaEh','EYvOQ','ImqXC','dataSize','min','6271580zWVGye','fsKpP','FQocp','Could\x20not\x20compute\x20duration','NICHr','bokKF','13805IKorAE','5qWASnG','BwYGt','exit'];_0x4c0d=function(){return _0x493050;};return _0x4c0d();}if(process[_0x43e622(0x1a1)][0x1]?.['endsWith'](_0x43e622(0x1a9))||process[_0x43e622(0x1a1)][0x1]?.['endsWith']('fixWebmDuration.js')){const input=process[_0x43e622(0x1a1)][0x2],output=process[_0x43e622(0x1a1)][0x3];(!input||!output)&&(console[_0x43e622(0x188)](_0x43e622(0x1ad)),process[_0x43e622(0x179)](0x1));const fixed=fixWebmDuration(input,output);fixed?console['log'](_0x43e622(0x1a7)+output):console['log'](_0x43e622(0x18d));}
|
|
1
|
+
const _0x120740=_0x2672;(function(_0x5684c2,_0x3bf519){const _0x46eea4=_0x2672,_0x208ee6=_0x5684c2();while(!![]){try{const _0xc12b26=parseInt(_0x46eea4(0xa9))/0x1+parseInt(_0x46eea4(0xac))/0x2*(-parseInt(_0x46eea4(0xb5))/0x3)+-parseInt(_0x46eea4(0x75))/0x4*(-parseInt(_0x46eea4(0x85))/0x5)+parseInt(_0x46eea4(0x8b))/0x6+-parseInt(_0x46eea4(0xa2))/0x7*(-parseInt(_0x46eea4(0x79))/0x8)+parseInt(_0x46eea4(0x92))/0x9+-parseInt(_0x46eea4(0x8a))/0xa;if(_0xc12b26===_0x3bf519)break;else _0x208ee6['push'](_0x208ee6['shift']());}catch(_0x23b01a){_0x208ee6['push'](_0x208ee6['shift']());}}}(_0x52de,0xb6115));import{readFileSync,writeFileSync}from'fs';const ID_SEGMENT=0x18538067,ID_INFO=0x1549a966,ID_TIMESTAMP_SCALE=0x2ad7b1,ID_DURATION=0x4489,ID_VOID=0xec,ID_CLUSTER=0x1f43b675,ID_TIMESTAMP=0xe7,ID_SIMPLE_BLOCK=0xa3;function readVint(_0x3a3918,_0x258ccd){const _0x5c8478=_0x2672,_0x420c79={'hkqRo':function(_0x14ea63,_0x4c23cc){return _0x14ea63<=_0x4c23cc;},'JRYpy':function(_0x4cc263,_0xd4908b){return _0x4cc263>_0xd4908b;},'wBtDq':function(_0x2e28c0,_0xd0d2b6){return _0x2e28c0-_0xd0d2b6;},'YSThR':function(_0x6bc8b9,_0x2f7332){return _0x6bc8b9*_0x2f7332;}};if(_0x258ccd>=_0x3a3918[_0x5c8478(0x98)])return[0x0,0x0];const _0x5682cb=_0x3a3918[_0x258ccd];let _0x4a29fa=0x1,_0x13690f=0x80;while(_0x420c79['hkqRo'](_0x4a29fa,0x8)&&!(_0x5682cb&_0x13690f)){_0x4a29fa++,_0x13690f>>=0x1;}if(_0x420c79[_0x5c8478(0x91)](_0x258ccd+_0x4a29fa,_0x3a3918[_0x5c8478(0x98)]))return[0x0,0x0];let _0x1a4eb1=_0x5682cb&_0x420c79[_0x5c8478(0xa4)](_0x13690f,0x1);for(let _0x198c2d=0x1;_0x198c2d<_0x4a29fa;_0x198c2d++){_0x1a4eb1=_0x420c79[_0x5c8478(0xae)](_0x1a4eb1,0x100)+_0x3a3918[_0x258ccd+_0x198c2d];}return[_0x1a4eb1,_0x4a29fa];}function readId(_0x1d3345,_0x367b16){const _0x115a6e=_0x2672,_0x1c2943={'eufFl':function(_0x29889b,_0x5c7a0d){return _0x29889b>=_0x5c7a0d;},'yapjC':function(_0x4c30b1,_0x4c300c){return _0x4c30b1>=_0x4c300c;},'ECouz':function(_0x369675,_0x2830de){return _0x369675<_0x2830de;},'GJplv':function(_0x1fa8b0,_0x1607f3){return _0x1fa8b0+_0x1607f3;}};if(_0x367b16>=_0x1d3345[_0x115a6e(0x98)])return[0x0,0x0];const _0x30af72=_0x1d3345[_0x367b16];let _0xcdc5e1;if(_0x30af72>=0x80)_0xcdc5e1=0x1;else{if(_0x30af72>=0x40)_0xcdc5e1=0x2;else{if(_0x1c2943['eufFl'](_0x30af72,0x20))_0xcdc5e1=0x3;else{if(_0x1c2943['yapjC'](_0x30af72,0x10))_0xcdc5e1=0x4;else return[_0x30af72,0x1];}}}if(_0x367b16+_0xcdc5e1>_0x1d3345['length'])return[0x0,0x0];let _0x1ab936=0x0;for(let _0x3d5f16=0x0;_0x1c2943[_0x115a6e(0x9b)](_0x3d5f16,_0xcdc5e1);_0x3d5f16++){_0x1ab936=_0x1c2943['GJplv'](_0x1ab936*0x100,_0x1d3345[_0x367b16+_0x3d5f16]);}return[_0x1ab936,_0xcdc5e1];}function readUint(_0x66576e,_0x5435c2,_0x369de0){const _0x5d2a1e=_0x2672,_0x31f570={'rkMVe':function(_0x227fbf,_0x35a55f){return _0x227fbf<_0x35a55f;},'fKeeC':function(_0x29f12c,_0x3a0b3d){return _0x29f12c*_0x3a0b3d;},'aQypo':function(_0x39100b,_0x28f426){return _0x39100b+_0x28f426;}};let _0x4a91c3=0x0;for(let _0x3cec33=0x0;_0x31f570[_0x5d2a1e(0x83)](_0x3cec33,_0x369de0);_0x3cec33++){_0x4a91c3=_0x31f570['fKeeC'](_0x4a91c3,0x100)+_0x66576e[_0x31f570['aQypo'](_0x5435c2,_0x3cec33)];}return _0x4a91c3;}function isUnknownSize(_0x52af1c,_0x3682e9){return _0x52af1c===Math['pow'](0x2,0x7*_0x3682e9)-0x1;}function writeId(_0x3c432f){const _0x18073f=_0x2672,_0x36a007={'qQOGk':function(_0x150f44,_0x324c97){return _0x150f44>>_0x324c97;},'LfggC':function(_0x5cb0c4,_0x1221b6){return _0x5cb0c4<=_0x1221b6;},'PTlZR':function(_0x9b3d6a,_0xb0e560){return _0x9b3d6a&_0xb0e560;},'xqKCu':function(_0x3764e2,_0x153570){return _0x3764e2>>_0x153570;},'yPEKD':function(_0x4d5899,_0x3feb15){return _0x4d5899>>_0x3feb15;},'aAVcg':function(_0xfff540,_0x5f53f5){return _0xfff540&_0x5f53f5;},'lxgCP':function(_0x20455f,_0x35381a){return _0x20455f&_0x35381a;}};if(_0x3c432f<=0xff)return Buffer[_0x18073f(0x70)]([_0x3c432f]);if(_0x3c432f<=0xffff)return Buffer[_0x18073f(0x70)]([_0x36a007['qQOGk'](_0x3c432f,0x8)&0xff,_0x3c432f&0xff]);if(_0x36a007['LfggC'](_0x3c432f,0xffffff))return Buffer['from']([_0x3c432f>>0x10&0xff,_0x36a007[_0x18073f(0x88)](_0x3c432f>>0x8,0xff),_0x3c432f&0xff]);return Buffer['from']([_0x36a007['PTlZR'](_0x36a007[_0x18073f(0x89)](_0x3c432f,0x18),0xff),_0x36a007[_0x18073f(0x88)](_0x36a007['yPEKD'](_0x3c432f,0x10),0xff),_0x36a007['aAVcg'](_0x3c432f>>0x8,0xff),_0x36a007['lxgCP'](_0x3c432f,0xff)]);}function _0x2672(_0x243e48,_0x259022){_0x243e48=_0x243e48-0x70;const _0x52dea9=_0x52de();let _0x267294=_0x52dea9[_0x243e48];return _0x267294;}function writeVint(_0x489894,_0xe2f5d6){const _0x213a0d=_0x2672,_0x1f673a={'bFtCx':function(_0x1cac57,_0x3c1439){return _0x1cac57||_0x3c1439;},'tEiTk':function(_0x1e4e05,_0x46c5c0){return _0x1e4e05<_0x46c5c0;},'FibUj':function(_0x325f52,_0x576118){return _0x325f52-_0x576118;},'hwjQH':function(_0x5e0bfb,_0x577f41){return _0x5e0bfb*_0x577f41;},'TPeqo':function(_0x294537,_0x9dd3a8){return _0x294537-_0x9dd3a8;},'aJtcE':function(_0x31725f,_0x2c14c1){return _0x31725f&_0x2c14c1;},'ohzHk':function(_0x57b33b,_0x146c21){return _0x57b33b/_0x146c21;},'tJMaH':function(_0x1cb819,_0x5d938a){return _0x1cb819<<_0x5d938a;},'IXKKH':function(_0x4cadce,_0x398102){return _0x4cadce-_0x398102;}};let _0x5919fa=_0x1f673a['bFtCx'](_0xe2f5d6,0x1);while(_0x1f673a['tEiTk'](_0x1f673a[_0x213a0d(0x7a)](Math['pow'](0x2,_0x1f673a['hwjQH'](0x7,_0x5919fa)),0x2),_0x489894))_0x5919fa++;const _0x1b0822=Buffer['alloc'](_0x5919fa);for(let _0x3f4f0c=_0x1f673a[_0x213a0d(0x7d)](_0x5919fa,0x1);_0x3f4f0c>=0x0;_0x3f4f0c--){_0x1b0822[_0x3f4f0c]=_0x1f673a['aJtcE'](_0x489894,0xff),_0x489894=Math['floor'](_0x1f673a[_0x213a0d(0xa5)](_0x489894,0x100));}return _0x1b0822[0x0]|=_0x1f673a[_0x213a0d(0x9a)](0x1,_0x1f673a[_0x213a0d(0x8f)](0x8,_0x5919fa)),_0x1b0822;}function writeFloat64(_0x468b08){const _0x1b6fd6=_0x2672,_0x3bf955=Buffer[_0x1b6fd6(0x7f)](0x8);return _0x3bf955['writeDoubleBE'](_0x468b08,0x0),_0x3bf955;}function writeVoid(_0x4517e2){const _0x265a70=_0x2672,_0x2e13be={'aaIHZ':function(_0x3cd448,_0x1d975d){return _0x3cd448>=_0x1d975d;},'eFrNw':function(_0x14705d,_0x197b43){return _0x14705d<=_0x197b43;},'ypuWF':function(_0x11be8f,_0x53f3a9,_0x48cb0c){return _0x11be8f(_0x53f3a9,_0x48cb0c);}};for(let _0x4582de=0x1;_0x4582de<=0x8;_0x4582de++){const _0x37c40b=_0x4517e2-0x1-_0x4582de;if(_0x2e13be['aaIHZ'](_0x37c40b,0x0)&&_0x2e13be['eFrNw'](_0x37c40b,Math['pow'](0x2,0x7*_0x4582de)-0x2))return Buffer['concat']([Buffer['from']([ID_VOID]),_0x2e13be['ypuWF'](writeVint,_0x37c40b,_0x4582de),Buffer[_0x265a70(0x7f)](_0x37c40b)]);}return Buffer['alloc'](0x0);}function findElement(_0x29c764,_0x1d5a5e,_0xd914ec,_0x459918){const _0x16e484=_0x2672,_0x2ec93f={'BBoaM':function(_0x1204b1,_0x5f05a0,_0x3cc186){return _0x1204b1(_0x5f05a0,_0x3cc186);},'knpiB':function(_0x4ef52d,_0x72395a){return _0x4ef52d===_0x72395a;},'LhqCt':function(_0x495c0e,_0x2e12fb){return _0x495c0e+_0x2e12fb;}};let _0x2139b2=_0x1d5a5e;while(_0x2139b2<_0xd914ec){const [_0xa1bc5b,_0x44c41c]=_0x2ec93f['BBoaM'](readId,_0x29c764,_0x2139b2),[_0x310e0b,_0x2d1dff]=_0x2ec93f[_0x16e484(0x9d)](readVint,_0x29c764,_0x2139b2+_0x44c41c);if(_0x2ec93f['knpiB'](_0xa1bc5b,_0x459918))return{'offset':_0x2139b2,'idLen':_0x44c41c,'sizeLen':_0x2d1dff,'dataSize':_0x310e0b,'dataOffset':_0x2ec93f['LhqCt'](_0x2139b2+_0x44c41c,_0x2d1dff)};if(isUnknownSize(_0x310e0b,_0x2d1dff))break;_0x2139b2+=_0x2ec93f['LhqCt'](_0x44c41c,_0x2d1dff)+_0x310e0b;}return null;}function computeDurationMs(_0x90909,_0x4c5513){const _0x4d3c8c=_0x2672,_0x226d75={'oxQUn':function(_0x1ca27d,_0x66978b){return _0x1ca27d===_0x66978b;},'BSpTE':function(_0x4e61b6,_0x2df8de){return _0x4e61b6<_0x2df8de;},'RkMOO':function(_0x1fcb88,_0x450023,_0x31e160){return _0x1fcb88(_0x450023,_0x31e160);},'ZtcCh':function(_0x33a5a8,_0xc352f8){return _0x33a5a8!==_0xc352f8;},'IQrFn':function(_0x1af870,_0x17b95f){return _0x1af870+_0x17b95f;},'mLXdl':function(_0x46cd51,_0x114b0e){return _0x46cd51-_0x114b0e;},'byhet':function(_0xcdffa7,_0x22dbfe){return _0xcdffa7+_0x22dbfe;},'lPwIN':function(_0x1fd220,_0xa91665,_0x27d4fd){return _0x1fd220(_0xa91665,_0x27d4fd);},'GfLUE':function(_0x42af1d,_0x3741ab,_0x13c770){return _0x42af1d(_0x3741ab,_0x13c770);},'CsiSe':function(_0x510fdc,_0x5cc566){return _0x510fdc+_0x5cc566;},'FqcKI':function(_0x4836e5,_0x20ae2c){return _0x4836e5+_0x20ae2c;},'sfyOD':function(_0x1b49de,_0x2ab138){return _0x1b49de===_0x2ab138;},'exjGa':function(_0x322897,_0x4908fa){return _0x322897>=_0x4908fa;},'HHdOt':function(_0x4802cd,_0x5ab71e){return _0x4802cd/_0x5ab71e;},'sJcXv':function(_0x40d4c3,_0x4f4f2c){return _0x40d4c3>_0x4f4f2c;},'muqvN':function(_0x48fae2,_0x1ef3f3){return _0x48fae2+_0x1ef3f3;},'RubvJ':function(_0x3cddd8,_0x2e1cf2){return _0x3cddd8+_0x2e1cf2;}};let _0x5cd696=0x0;const _0x4e9cc3=Buffer['from']([0x1f,0x43,0xb6,0x75]);let _0x17f7cf=_0x90909[_0x4d3c8c(0xb2)](_0x4e9cc3);if(_0x226d75['oxQUn'](_0x17f7cf,-0x1))return 0x0;while(_0x226d75[_0x4d3c8c(0xa1)](_0x17f7cf,_0x90909['length'])){const [_0xf1b2db,_0x5e1cf7]=_0x226d75['RkMOO'](readId,_0x90909,_0x17f7cf);if(_0x226d75[_0x4d3c8c(0x94)](_0xf1b2db,ID_CLUSTER))break;const [_0x5ee77a,_0x412b74]=readVint(_0x90909,_0x226d75['IQrFn'](_0x17f7cf,_0x5e1cf7)),_0x22d164=_0x226d75['IQrFn'](_0x17f7cf,_0x5e1cf7)+_0x412b74,_0x29998b=isUnknownSize(_0x5ee77a,_0x412b74);let _0x4be5db;if(_0x29998b){let _0x22993a=_0x22d164;while(_0x22993a<_0x226d75['mLXdl'](_0x90909[_0x4d3c8c(0x98)],0x4)){const [_0x41c8ca,_0x4a6b75]=readId(_0x90909,_0x22993a);if(_0x41c8ca===ID_CLUSTER){_0x4be5db=_0x22993a;break;}const [_0xc9476a,_0xc367f9]=_0x226d75[_0x4d3c8c(0x9f)](readVint,_0x90909,_0x22993a+_0x4a6b75);if(_0x226d75['RkMOO'](isUnknownSize,_0xc9476a,_0xc367f9)){_0x4be5db=_0x90909[_0x4d3c8c(0x98)];break;}_0x22993a+=_0x226d75[_0x4d3c8c(0xa0)](_0x4a6b75,_0xc367f9)+_0xc9476a;}_0x4be5db??=_0x90909[_0x4d3c8c(0x98)];}else _0x4be5db=_0x226d75['IQrFn'](_0x22d164,_0x5ee77a);let _0x5a7ef8=0x0,_0x407412=_0x22d164;while(_0x407412<_0x4be5db){const [_0x1695a8,_0x2aec46]=_0x226d75['lPwIN'](readId,_0x90909,_0x407412),[_0x56b007,_0x5551ca]=_0x226d75['GfLUE'](readVint,_0x90909,_0x226d75['CsiSe'](_0x407412,_0x2aec46));if(_0x1695a8===ID_TIMESTAMP)_0x5a7ef8=readUint(_0x90909,_0x226d75['FqcKI'](_0x407412+_0x2aec46,_0x5551ca),_0x56b007);else{if(_0x226d75[_0x4d3c8c(0x9e)](_0x1695a8,ID_SIMPLE_BLOCK)&&_0x226d75['exjGa'](_0x56b007,0x4)){const _0xbe5cbf=_0x407412+_0x2aec46+_0x5551ca,[,_0x57d65e]=_0x226d75['RkMOO'](readVint,_0x90909,_0xbe5cbf),_0x17c81e=_0x90909['readInt16BE'](_0xbe5cbf+_0x57d65e),_0x2efdc4=_0x226d75['HHdOt']((_0x5a7ef8+_0x17c81e)*_0x4c5513,0xf4240);_0x226d75[_0x4d3c8c(0x7c)](_0x2efdc4,_0x5cd696)&&(_0x5cd696=_0x2efdc4);}else{if(_0x1695a8===ID_CLUSTER)break;}}if(_0x226d75[_0x4d3c8c(0xa7)](isUnknownSize,_0x56b007,_0x5551ca))break;_0x407412+=_0x226d75[_0x4d3c8c(0x74)](_0x226d75[_0x4d3c8c(0x73)](_0x2aec46,_0x5551ca),_0x56b007);}_0x17f7cf=_0x4be5db;}return _0x5cd696;}export function fixWebmDuration(_0x4e80ac,_0x2f94bd){const _0x202e90=_0x2672,_0x4b8a2f={'muHAi':function(_0x3f838f,_0x36711e,_0xda6ec7){return _0x3f838f(_0x36711e,_0xda6ec7);},'duoMx':function(_0x13f923,_0x10b484){return _0x13f923+_0x10b484;},'DbjJg':function(_0x552044,_0x16ce6e){return _0x552044+_0x16ce6e;},'EiccK':function(_0x2f0940,_0x21c7a7){return _0x2f0940!==_0x21c7a7;},'hJzxL':function(_0x184d50,_0x93a455){return _0x184d50<_0x93a455;},'UmPay':function(_0x7da710,_0x474d82,_0x3ac45f){return _0x7da710(_0x474d82,_0x3ac45f);},'PAcFD':function(_0x98ee3d,_0x59734c){return _0x98ee3d+_0x59734c;},'lXFRK':function(_0x144b6c,_0x15a472){return _0x144b6c===_0x15a472;},'ABHUF':function(_0x1b9f59,_0x349760){return _0x1b9f59+_0x349760;},'SrzXK':function(_0x19b9ae,_0x456475){return _0x19b9ae+_0x456475;},'veqmG':function(_0x1fa24e,_0x45c830){return _0x1fa24e+_0x45c830;},'nPjDJ':'Could\x20not\x20find\x20Info\x20element','shelD':function(_0x2bbfab,_0x356eb4,_0x1175c5,_0x2f9e1d,_0x20e354){return _0x2bbfab(_0x356eb4,_0x1175c5,_0x2f9e1d,_0x20e354);},'UkDFI':function(_0x37a088,_0x1e572e,_0x419008,_0x74b3e4,_0xce2e8d){return _0x37a088(_0x1e572e,_0x419008,_0x74b3e4,_0xce2e8d);},'SGxGG':function(_0x39aec3,_0x5c91ae,_0x2a274d,_0x6f5856){return _0x39aec3(_0x5c91ae,_0x2a274d,_0x6f5856);},'tLZAq':function(_0x165a29,_0x1f5542){return _0x165a29<=_0x1f5542;},'kiXYd':function(_0x3485ae,_0x27a8fb){return _0x3485ae*_0x27a8fb;},'SnDLD':function(_0x510354,_0x5c9ae2){return _0x510354(_0x5c9ae2);},'mRTiR':function(_0xba3bb,_0x22bda9,_0x5c393f,_0x171aa8,_0x5e155f,_0xa57763,_0x3f9ccc){return _0xba3bb(_0x22bda9,_0x5c393f,_0x171aa8,_0x5e155f,_0xa57763,_0x3f9ccc);},'UlKwe':function(_0x2b5c2a,_0x4e6828){return _0x2b5c2a(_0x4e6828);},'ipGcO':function(_0x1e350f,_0xbf0614){return _0x1e350f+_0xbf0614;},'kpMPA':function(_0xf5124f,_0x21796d,_0x59de11){return _0xf5124f(_0x21796d,_0x59de11);}},_0x8d97ff=readFileSync(_0x4e80ac);let _0xf80b6b=0x0;const [_0x361e5e,_0x19b241]=readId(_0x8d97ff,_0xf80b6b),[_0x533df0,_0x5ee822]=_0x4b8a2f[_0x202e90(0xa6)](readVint,_0x8d97ff,_0x4b8a2f[_0x202e90(0x7b)](_0xf80b6b,_0x19b241));_0xf80b6b+=_0x4b8a2f['DbjJg'](_0x19b241,_0x5ee822)+_0x533df0;const [_0x59ddeb,_0x1d0d99]=readId(_0x8d97ff,_0xf80b6b);if(_0x4b8a2f['EiccK'](_0x59ddeb,ID_SEGMENT))return console[_0x202e90(0x84)](_0x202e90(0x82)),![];const [,_0x317024]=readVint(_0x8d97ff,_0xf80b6b+_0x1d0d99),_0x57700b=_0xf80b6b+_0x1d0d99+_0x317024;let _0x210eba=_0x57700b;const _0x3e453a=Math[_0x202e90(0x81)](_0x8d97ff[_0x202e90(0x98)],_0x57700b+0x2710);let _0x56d6cb=null,_0x3f9c2c=null;while(_0x4b8a2f[_0x202e90(0x8c)](_0x210eba,_0x3e453a)){const [_0x40b5e3,_0x49e031]=readId(_0x8d97ff,_0x210eba),[_0x3f4d9b,_0x5e23a7]=_0x4b8a2f['UmPay'](readVint,_0x8d97ff,_0x4b8a2f['duoMx'](_0x210eba,_0x49e031));_0x40b5e3===ID_VOID&&!_0x56d6cb&&(_0x56d6cb={'offset':_0x210eba,'idLen':_0x49e031,'sizeLen':_0x5e23a7,'dataSize':_0x3f4d9b,'dataOffset':_0x4b8a2f[_0x202e90(0x76)](_0x210eba+_0x49e031,_0x5e23a7)});if(_0x4b8a2f[_0x202e90(0x97)](_0x40b5e3,ID_INFO)){_0x3f9c2c={'offset':_0x210eba,'idLen':_0x49e031,'sizeLen':_0x5e23a7,'dataSize':_0x3f4d9b,'dataOffset':_0x4b8a2f[_0x202e90(0xad)](_0x4b8a2f['SrzXK'](_0x210eba,_0x49e031),_0x5e23a7)};break;}if(_0x4b8a2f['lXFRK'](_0x40b5e3,ID_CLUSTER))break;if(isUnknownSize(_0x3f4d9b,_0x5e23a7))break;_0x210eba+=_0x4b8a2f[_0x202e90(0x71)](_0x49e031+_0x5e23a7,_0x3f4d9b);}if(!_0x3f9c2c)return console['error'](_0x4b8a2f[_0x202e90(0xab)]),![];const _0x4b652d=_0x4b8a2f[_0x202e90(0x9c)](findElement,_0x8d97ff,_0x3f9c2c['dataOffset'],_0x4b8a2f['SrzXK'](_0x3f9c2c['dataOffset'],_0x3f9c2c['dataSize']),ID_DURATION);if(_0x4b652d)return![];const _0x5d9be0=_0x4b8a2f['UkDFI'](findElement,_0x8d97ff,_0x3f9c2c['dataOffset'],_0x3f9c2c['dataOffset']+_0x3f9c2c[_0x202e90(0x96)],ID_TIMESTAMP_SCALE);let _0x24cb9a=0xf4240;_0x5d9be0&&(_0x24cb9a=_0x4b8a2f[_0x202e90(0x78)](readUint,_0x8d97ff,_0x5d9be0['dataOffset'],_0x5d9be0[_0x202e90(0x96)]));const _0x5b61f4=computeDurationMs(_0x8d97ff,_0x24cb9a);if(_0x4b8a2f[_0x202e90(0xaa)](_0x5b61f4,0x0))return console[_0x202e90(0x84)](_0x202e90(0x95)),![];const _0x7ecd0a=_0x4b8a2f[_0x202e90(0x86)](_0x5b61f4,0xf4240)/_0x24cb9a,_0x377b36=Buffer[_0x202e90(0xaf)]([_0x4b8a2f['SnDLD'](writeId,ID_DURATION),writeVint(0x8),writeFloat64(_0x7ecd0a)]),_0x477fae=_0x377b36[_0x202e90(0x98)];if(!_0x56d6cb||_0x56d6cb[_0x202e90(0xb4)]<_0x3f9c2c[_0x202e90(0xb4)]){if(_0x56d6cb){const _0x255c8d=_0x56d6cb[_0x202e90(0xb1)]+_0x56d6cb['sizeLen']+_0x56d6cb[_0x202e90(0x96)],_0x3916f3=_0x255c8d-_0x477fae;if(_0x3916f3<0x2)return _0x4b8a2f[_0x202e90(0x8e)](rewriteFile,_0x8d97ff,_0x3f9c2c,_0x377b36,_0x24cb9a,_0x5b61f4,_0x2f94bd);const _0x33bb8e=_0x3f9c2c['dataSize']+_0x477fae,_0x110073=Buffer['concat']([_0x4b8a2f['UlKwe'](writeId,ID_INFO),_0x4b8a2f['muHAi'](writeVint,_0x33bb8e,_0x3f9c2c[_0x202e90(0x99)])]),_0x431303=_0x8d97ff[_0x202e90(0x87)](_0x3f9c2c[_0x202e90(0xb3)],_0x4b8a2f[_0x202e90(0xa3)](_0x3f9c2c['dataOffset'],_0x3f9c2c['dataSize'])),_0x43d5d2=writeVoid(_0x3916f3),_0x13f17c=_0x8d97ff[_0x202e90(0x87)](0x0,_0x56d6cb[_0x202e90(0xb4)]),_0x1e9e12=_0x8d97ff[_0x202e90(0x87)](_0x3f9c2c[_0x202e90(0xb3)]+_0x3f9c2c[_0x202e90(0x96)]);return _0x4b8a2f[_0x202e90(0x80)](writeFileSync,_0x2f94bd,Buffer[_0x202e90(0xaf)]([_0x13f17c,_0x43d5d2,_0x110073,_0x431303,_0x377b36,_0x1e9e12])),!![];}}return _0x4b8a2f['mRTiR'](rewriteFile,_0x8d97ff,_0x3f9c2c,_0x377b36,_0x24cb9a,_0x5b61f4,_0x2f94bd);}function rewriteFile(_0x127824,_0x30bc0e,_0xe7e99c,_0x54eab8,_0x5a92e7,_0x3f81f9){const _0x2e1f17=_0x2672,_0x2dd60d={'gqWfD':function(_0x325fc,_0x73ce3e){return _0x325fc+_0x73ce3e;}},_0x46fde7=_0x2dd60d[_0x2e1f17(0x90)](_0x30bc0e[_0x2e1f17(0x96)],_0xe7e99c['length']),_0xd79f48=Buffer[_0x2e1f17(0xaf)]([writeId(ID_INFO),writeVint(_0x46fde7)]),_0x20848d=_0x30bc0e['idLen']+_0x30bc0e[_0x2e1f17(0x99)],_0x5cfcd3=_0x127824['slice'](0x0,_0x30bc0e['offset']),_0x1edc16=_0x127824['slice'](_0x30bc0e['dataOffset'],_0x30bc0e['dataOffset']+_0x30bc0e['dataSize']),_0x269af4=_0x127824[_0x2e1f17(0x87)](_0x2dd60d[_0x2e1f17(0x90)](_0x30bc0e['offset'],_0x20848d)+_0x30bc0e[_0x2e1f17(0x96)]);return writeFileSync(_0x3f81f9,Buffer[_0x2e1f17(0xaf)]([_0x5cfcd3,_0xd79f48,_0x1edc16,_0xe7e99c,_0x269af4])),!![];}function _0x52de(){const _0x5c510f=['idLen','indexOf','dataOffset','offset','3eTGcDf','from','veqmG','File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.','RubvJ','muqvN','4Nnuskc','PAcFD','Fixed:\x20','SGxGG','8NqleDC','FibUj','duoMx','sJcXv','TPeqo','Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>','alloc','kpMPA','min','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','rkMVe','error','2453485aYlUsQ','kiXYd','slice','PTlZR','xqKCu','14785520FnJfpK','6449310ntelAv','hJzxL','log','mRTiR','IXKKH','gqWfD','JRYpy','1309770gZrorf','fixWebmDuration.ts','ZtcCh','Could\x20not\x20compute\x20duration','dataSize','lXFRK','length','sizeLen','tJMaH','ECouz','shelD','BBoaM','sfyOD','RkMOO','byhet','BSpTE','8795066FnnobJ','ipGcO','wBtDq','ohzHk','muHAi','lPwIN','argv','392227ZaUDhp','tLZAq','nPjDJ','2270952FPemSz','ABHUF','YSThR','concat','fixWebmDuration.js'];_0x52de=function(){return _0x5c510f;};return _0x52de();}if(process['argv'][0x1]?.['endsWith'](_0x120740(0x93))||process[_0x120740(0xa8)][0x1]?.['endsWith'](_0x120740(0xb0))){const input=process['argv'][0x2],output=process[_0x120740(0xa8)][0x3];(!input||!output)&&(console['error'](_0x120740(0x7e)),process['exit'](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x120740(0x8d)](_0x120740(0x77)+output):console['log'](_0x120740(0x72));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x9160(){const _0x423989=['4255MTqpZQ','6304468PHsKna','3775222nVUTRX','30Ybsbun','312960PEJnxZ','4654371YuKOMG','875pAgToF','54472iMEAVN','2652llolAk','371511kJejbv','nHqAr','cwd'];_0x9160=function(){return _0x423989;};return _0x9160();}(function(_0x541d65,_0x16c14f){const _0x14a77e=_0x9299,_0x17f570=_0x541d65();while(!![]){try{const _0x35452b=parseInt(_0x14a77e(0x6f))/0x1+-parseInt(_0x14a77e(0x6d))/0x2+parseInt(_0x14a77e(0x70))/0x3+parseInt(_0x14a77e(0x6c))/0x4+-parseInt(_0x14a77e(0x6b))/0x5*(-parseInt(_0x14a77e(0x73))/0x6)+parseInt(_0x14a77e(0x71))/0x7*(-parseInt(_0x14a77e(0x72))/0x8)+-parseInt(_0x14a77e(0x74))/0x9*(parseInt(_0x14a77e(0x6e))/0xa);if(_0x35452b===_0x16c14f)break;else _0x17f570['push'](_0x17f570['shift']());}catch(_0x36f123){_0x17f570['push'](_0x17f570['shift']());}}}(_0x9160,0xe8ef7));import{execFile as _0xb71e99}from'child_process';import{promisify}from'util';const execFile=promisify(_0xb71e99);function _0x9299(_0x26b053,_0xce3498){_0x26b053=_0x26b053-0x69;const _0x9160be=_0x9160();let _0x92996f=_0x9160be[_0x26b053];return _0x92996f;}export async function isPathGitTracked(_0x3110d3){const _0x3ee4bd=_0x9299,_0xd82ff7={'nHqAr':function(_0x5c9f75,_0x403c4b,_0x177704,_0x270509){return _0x5c9f75(_0x403c4b,_0x177704,_0x270509);},'VhfMN':'ls-files','kqGAF':'--error-unmatch'};try{return await _0xd82ff7[_0x3ee4bd(0x69)](execFile,'git',[_0xd82ff7['VhfMN'],_0xd82ff7['kqGAF'],_0x3110d3],{'cwd':process[_0x3ee4bd(0x6a)]()}),!![];}catch{return![];}}
|