vercel 59.22.0 → 59.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-4XDHZES6.js → add-JVSHQKWC.js} +1 -1
- package/dist/chunks/{add-DTHT6FBK.js → add-UKFIETLE.js} +1 -1
- package/dist/chunks/{add-ZQXW2ONT.js → add-Z3CJT63N.js} +1 -1
- package/dist/chunks/{build-JORIG5OD.js → build-SMQYQX23.js} +1 -1
- package/dist/chunks/{chunk-JOH6CUOG.js → chunk-2HEC5TDU.js} +1 -1
- package/dist/chunks/{chunk-NZGOQUNN.js → chunk-2SLHYWMC.js} +1 -1
- package/dist/chunks/{chunk-77GUJ4JC.js → chunk-32QBGZ2Z.js} +1 -1
- package/dist/chunks/{chunk-3RLCABDN.js → chunk-4YVA7TSY.js} +2 -2
- package/dist/chunks/{chunk-T2ECF6MX.js → chunk-5YA32S6K.js} +1 -1
- package/dist/chunks/{chunk-UB37A37M.js → chunk-64NJHVA3.js} +3 -3
- package/dist/chunks/{chunk-GPX6W4GB.js → chunk-66RYR2GI.js} +1 -1
- package/dist/chunks/{chunk-TX4PCSTY.js → chunk-6C7LA5RA.js} +1 -1
- package/dist/chunks/{chunk-2U7K4KDF.js → chunk-6SA6SOHU.js} +1 -1
- package/dist/chunks/{chunk-CLKTBUI7.js → chunk-73G2MHUX.js} +1 -1
- package/dist/chunks/{chunk-2EY7NJ5E.js → chunk-ABSRS5KC.js} +1 -1
- package/dist/chunks/{chunk-GQQKAFGS.js → chunk-DL665Q3Z.js} +1 -1
- package/dist/chunks/{chunk-PQTP73R4.js → chunk-E4X2DH4K.js} +1 -1
- package/dist/chunks/{chunk-CGXXEPYI.js → chunk-EHTHHCNG.js} +1 -0
- package/dist/chunks/chunk-FB5TMOLQ.js +7 -0
- package/dist/chunks/{chunk-FYSA677K.js → chunk-FZH7RIRX.js} +2 -2
- package/dist/chunks/{chunk-7JMXZGXY.js → chunk-GGNZLN4R.js} +1 -1
- package/dist/chunks/{chunk-XRHDE2NT.js → chunk-GL2AUBAI.js} +1 -1
- package/dist/chunks/{chunk-CKX6OH4B.js → chunk-GR3DLKYP.js} +1 -1
- package/dist/chunks/{chunk-B7FOQCPU.js → chunk-HOYHUMBD.js} +1 -1
- package/dist/chunks/{chunk-W27LUVFI.js → chunk-JGPECEYY.js} +1 -1
- package/dist/chunks/{chunk-PQ7YG2JU.js → chunk-KXYR43H5.js} +1 -1
- package/dist/chunks/{chunk-RJOVMJZI.js → chunk-M6A7UH4U.js} +1 -1
- package/dist/chunks/{chunk-JXHVB5A7.js → chunk-NYOQMU3P.js} +1 -1
- package/dist/chunks/{chunk-JOV4G2LZ.js → chunk-NZKBBY2A.js} +1 -1
- package/dist/chunks/{chunk-UXTHEQVJ.js → chunk-OI263FBO.js} +1 -1
- package/dist/chunks/chunk-PS645CWM.js +32 -0
- package/dist/chunks/{chunk-JWC64GEW.js → chunk-QI3JSWD6.js} +1 -1
- package/dist/chunks/{chunk-WBE23KLI.js → chunk-RRQTVE2P.js} +1 -1
- package/dist/chunks/{chunk-UDOFIJ7K.js → chunk-SFTXBTMI.js} +1 -1
- package/dist/chunks/{chunk-BSOZ3UP2.js → chunk-TJKM3345.js} +1 -1
- package/dist/chunks/{chunk-VG2V4NHC.js → chunk-TOGR3HUB.js} +1 -1
- package/dist/chunks/{chunk-W65SRO53.js → chunk-UGXNE4YE.js} +1 -1
- package/dist/chunks/{chunk-WXT35K53.js → chunk-UUM2N6IG.js} +2 -2
- package/dist/chunks/{chunk-I5CXJNW4.js → chunk-UWZ5VIIQ.js} +1 -1
- package/dist/chunks/{chunk-NNP5NITU.js → chunk-V6MR45PD.js} +1 -1
- package/dist/chunks/{chunk-7XSHE5SA.js → chunk-WDVSYGZS.js} +1 -1
- package/dist/chunks/{chunk-Q3OG3SC4.js → chunk-X4X5RB2V.js} +1 -1
- package/dist/chunks/{chunk-5LCQGGTH.js → chunk-YGJO25LP.js} +1 -1
- package/dist/chunks/{chunk-3VRLKRIC.js → chunk-Z6LKARXP.js} +1 -1
- package/dist/chunks/{chunk-GJTA7DJO.js → chunk-Z7PBDQNR.js} +8 -5
- package/dist/chunks/{clear-74Z2GBIF.js → clear-6IXTTZO6.js} +1 -1
- package/dist/chunks/{compile-vercel-config-MRWI6INC.js → compile-vercel-config-ZFMPTU47.js} +1 -1
- package/dist/chunks/{config-7SVPPW7T.js → config-HLVJQKP7.js} +1 -1
- package/dist/chunks/{config-UYP3XEDY.js → config-XXHMPW46.js} +1 -1
- package/dist/chunks/{delete-E355MKDF.js → delete-52QKO73X.js} +1 -1
- package/dist/chunks/{delete-QFKW4O7R.js → delete-6VOUZDIR.js} +1 -1
- package/dist/chunks/{detect-projects-J3VAJIQD.js → detect-projects-WLAFT5HC.js} +1 -1
- package/dist/chunks/detect-services-YYT3LUUX.js +7 -0
- package/dist/chunks/{disable-K4MMQGSO.js → disable-7FGR2S56.js} +1 -1
- package/dist/chunks/{discard-ITZDMBFI.js → discard-XKPTY3DC.js} +1 -1
- package/dist/chunks/{edit-7IGZ4EH7.js → edit-A3HJCNPW.js} +1 -1
- package/dist/chunks/{edit-3V4C747E.js → edit-A7WGTO6K.js} +1 -1
- package/dist/chunks/{enable-4TJRZIE7.js → enable-NGKLGHJ2.js} +1 -1
- package/dist/chunks/{export-XJIKF2WX.js → export-QCBAQNTT.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-A4TZHE2Y.js → generate-cert-for-deploy-U7JF3HF3.js} +1 -1
- package/dist/chunks/{image-4UZ34VE5.js → image-DU7GJZR2.js} +1 -1
- package/dist/chunks/import-builders-IFZM44NL.js +7 -0
- package/dist/chunks/{inspect-FUJCRJTQ.js → inspect-CPOFKE4X.js} +1 -1
- package/dist/chunks/{inspect-YZP2TUXW.js → inspect-EMWJLBAW.js} +1 -1
- package/dist/chunks/{inspect-H3D3M4TY.js → inspect-IVJOEZC4.js} +1 -1
- package/dist/chunks/{inspect-2U47TXE3.js → inspect-PHUMEO4A.js} +1 -1
- package/dist/chunks/{inspect-QLPYWU6F.js → inspect-Q7OVSWFO.js} +1 -1
- package/dist/chunks/{list-AEKIXAC2.js → list-G4JM2TYX.js} +1 -1
- package/dist/chunks/{list-AO2NTDVE.js → list-KYZNCXBM.js} +1 -1
- package/dist/chunks/{list-UGFJDLK3.js → list-ZE2VPPXI.js} +1 -1
- package/dist/chunks/{login-GXL33UOO.js → login-AVVJFLSC.js} +1 -1
- package/dist/chunks/{logs-HXT43YFY.js → logs-3LTU2N25.js} +1 -1
- package/dist/chunks/{ls-RYBY45PV.js → ls-4M2OBNG6.js} +1 -1
- package/dist/chunks/{ls-DLX6OKJD.js → ls-7O63WIES.js} +1 -1
- package/dist/chunks/{ls-IFYHOVHI.js → ls-AKGRKWHM.js} +1 -1
- package/dist/chunks/{ls-LDTXN5NC.js → ls-DU5QTKKA.js} +1 -1
- package/dist/chunks/{ls-T6LDBBIZ.js → ls-HWUYP3XY.js} +1 -1
- package/dist/chunks/{ls-2GUHQ2QY.js → ls-P6LKMT33.js} +1 -1
- package/dist/chunks/{ls-MR4IEJXI.js → ls-Y4QR3I6O.js} +1 -1
- package/dist/chunks/{mutate-NMAFXSIS.js → mutate-KOAALPIL.js} +1 -1
- package/dist/chunks/{notifications-VDMQJUX4.js → notifications-3RDFNJSD.js} +1 -1
- package/dist/chunks/{open-OYT4SXL7.js → open-VD4F6MAO.js} +1 -1
- package/dist/chunks/{permissions-RVEIYB2B.js → permissions-AE5JO26V.js} +1 -1
- package/dist/chunks/{publish-I7FUMJAU.js → publish-YXVJXBQT.js} +1 -1
- package/dist/chunks/{pull-XCHJWKNY.js → pull-QLC2CV4J.js} +1 -1
- package/dist/chunks/{purchase-domain-if-available-5HP57BPC.js → purchase-domain-if-available-74ZYVVBE.js} +1 -1
- package/dist/chunks/{push-7H2NJAPB.js → push-TMPPU5NU.js} +1 -1
- package/dist/chunks/{query-TJ7WEORG.js → query-PHAGR43V.js} +1 -1
- package/dist/chunks/{reorder-JCS5LKA6.js → reorder-OAJ3NXQQ.js} +1 -1
- package/dist/chunks/{reply-SFRIWOPK.js → reply-Q3JFRFA3.js} +1 -1
- package/dist/chunks/{resolve-WTQUYVKI.js → resolve-XXJVOXNE.js} +1 -1
- package/dist/chunks/{restore-K442WYIM.js → restore-MO4B2EQV.js} +1 -1
- package/dist/chunks/{rm-576VOXTN.js → rm-63LFH6NA.js} +1 -1
- package/dist/chunks/{rm-OUXMNCHX.js → rm-F2XD2XKB.js} +1 -1
- package/dist/chunks/{rm-377WPSMT.js → rm-GMG2DZOV.js} +1 -1
- package/dist/chunks/{rm-XFZMZILG.js → rm-P6KA5RSP.js} +1 -1
- package/dist/chunks/{rm-K2SG5TT7.js → rm-SZ4HWA4R.js} +1 -1
- package/dist/chunks/{rule-inspect-MK7A5LPA.js → rule-inspect-JKAXOBII.js} +1 -1
- package/dist/chunks/{rules-4T3OHT34.js → rules-6TZ6GSKT.js} +1 -1
- package/dist/chunks/{schema-PUOL7JUI.js → schema-5CZLK6NI.js} +1 -1
- package/dist/chunks/{schema-RIUBZXVC.js → schema-S2ZAREKF.js} +1 -1
- package/dist/chunks/{set-HNSMZTBW.js → set-PIKLGKT6.js} +1 -1
- package/dist/chunks/setup-and-link-O5QSQ5K2.js +7 -0
- package/dist/chunks/{tags-7CY2YR27.js → tags-C3HWJLJ4.js} +1 -1
- package/dist/chunks/{update-QAGFDMEF.js → update-5HE4X45O.js} +1 -1
- package/dist/chunks/{utils-BG3TNJBX.js → utils-5BFO5HC4.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +5 -5
- package/dist/commands/dev/index.js +3 -3
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +2 -2
- package/dist/commands/list/index.js +1 -1
- package/dist/commands-bulk.js +660 -652
- package/dist/help.js +1 -1
- package/dist/index.js +3 -3
- package/dist/version.mjs +1 -1
- package/package.json +22 -22
- package/dist/chunks/chunk-EYXFDREA.js +0 -7
- package/dist/chunks/chunk-K2RAW5DI.js +0 -10
- package/dist/chunks/detect-services-JTGZ7NCQ.js +0 -7
- package/dist/chunks/import-builders-7BRUAJT2.js +0 -7
- package/dist/chunks/setup-and-link-X44IODXA.js +0 -7
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_dist as require_dist2}from"./chunk-TRTEXGVN.js";import{sleep}from"./chunk-T3GQAMBJ.js";import{highlight}from"./chunk-J3U3L45Y.js";import{getGlobalPathConfig}from"./chunk-KBKN7EI7.js";import{getLocalPathConfig}from"./chunk-
|
|
7
|
+
import{require_dist as require_dist2}from"./chunk-TRTEXGVN.js";import{sleep}from"./chunk-T3GQAMBJ.js";import{highlight}from"./chunk-J3U3L45Y.js";import{getGlobalPathConfig}from"./chunk-KBKN7EI7.js";import{getLocalPathConfig}from"./chunk-DL665Q3Z.js";import{PromptBackError,PromptCanceledError}from"./chunk-P2O5DOYE.js";import{require_types}from"./chunk-GHM7V3GG.js";import{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS}from"./chunk-QR7QPUFN.js";import{require_load_json_file}from"./chunk-RCTYVKM5.js";import{isOAuthError,processTokenResponse,refreshTokenRequest,ua_default}from"./chunk-5XJNPXQK.js";import{parseArguments}from"./chunk-T4AZ3U7O.js";import{fetch}from"./chunk-MY4MONOH.js";import{VERCEL_DIR}from"./chunk-64NJHVA3.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{APIError,NowError}from"./chunk-LKI6FRNM.js";import{emoji,link_default,output_manager_default,prependEmoji}from"./chunk-EWWFNMPZ.js";import{require_dist}from"./chunk-QGIQK47P.js";import{require_cli_config}from"./chunk-BRK4OB4B.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_load_json_file=__toESM(require_load_json_file(),1),config=__toESM(require_cli_config(),1),import_error_utils=__toESM(require_dist(),1),import_types=__toESM(require_types(),1);import{join,basename,dirname}from"path";import{accessSync,constants}from"fs";import{persistCliAuthConfig,readCliAuthConfig}from"@vercel/cli-auth/credentials-store.js";var VERCEL_DIR2=getGlobalPathConfig(),CONFIG_FILE_PATH=config.getConfigFilePath(VERCEL_DIR2),AUTH_CONFIG_FILE_PATH=config.getAuthConfigFilePath(VERCEL_DIR2),readConfigFile=()=>config.readGlobalConfigFile(CONFIG_FILE_PATH),writeToConfigFile=stuff=>{try{config.writeGlobalConfigFile(CONFIG_FILE_PATH,stuff)}catch(err){throw(0,import_error_utils.isErrnoException)(err)&&((0,import_error_utils.isErrnoException)(err)&&err.code==="EPERM"?(output_manager_default.error(`Not able to create ${highlight(CONFIG_FILE_PATH)} (operation not permitted).`),process.exit(1)):err.code==="EBADF"&&(output_manager_default.error(`Not able to create ${highlight(CONFIG_FILE_PATH)} (bad file descriptor).`),process.exit(1))),err}},readAuthConfigFile=_globalConfig=>({...config.getDefaultAuthConfig(),...readCliAuthConfig(VERCEL_DIR2)}),persistAuthConfig=(authConfig,_globalConfig)=>{try{return persistCliAuthConfig(VERCEL_DIR2,authConfig)}catch(err){let wrappedError=new Error(`Not able to create ${humanizePath(AUTH_CONFIG_FILE_PATH)} (${(0,import_error_utils.errorToStringFriendly)(err)}).`);throw wrappedError.cause=err,wrappedError}};function getConfigFilePath2(){return CONFIG_FILE_PATH}function getAuthConfigFilePath2(){return AUTH_CONFIG_FILE_PATH}function readLocalConfig(prefix=process.cwd()){let config2,target="";try{target=getLocalPathConfig(prefix)}catch(err){if(err instanceof NowError)output_manager_default.error(err.message),process.exit(1);else throw err}if(!target)return;try{accessSync(target,constants.F_OK),config2=import_load_json_file.default.sync(target)}catch(err){if(!((0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT"))if((0,import_error_utils.isError)(err)&&err.name==="JSONError")output_manager_default.error(err.message),process.exit(1);else if((0,import_error_utils.isErrnoException)(err)){let code=err.code?` (${err.code})`:"";output_manager_default.error(`Failed to read config file: ${target}${code}`),process.exit(1)}else output_manager_default.prettyError(err),process.exit(1)}if(!config2)return;if(basename(target)==="vercel.json"&&basename(dirname(target))===VERCEL_DIR){let workPath=dirname(dirname(target)),sourceFile=null;for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);try{accessSync(configPath,constants.F_OK),sourceFile=basename(configPath);break}catch{}}if(!sourceFile){let tomlPath=join(workPath,"vercel.toml");try{accessSync(tomlPath,constants.F_OK),sourceFile="vercel.toml"}catch{}}config2[import_types.fileNameSymbol]=sourceFile||DEFAULT_VERCEL_CONFIG_FILENAME}else config2[import_types.fileNameSymbol]=basename(target);return config2}var import_chalk2=__toESM(require_source(),1),import_cli_config=__toESM(require_cli_config(),1),import_async_retry=__toESM(require_dist2(),1);import{join as join2,resolve}from"node:path";import{EventEmitter}from"events";import{URL}from"url";async function responseError(res,fallbackMessage=null,parsedBody={}){let bodyError;if(!res.ok){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||body}let msg=bodyError?.message||fallbackMessage||"Response Error";return new APIError(msg,res,bodyError)}var import_chalk=__toESM(require_source(),1);function printIndications(res){let indications=new Set(["warning","notice","tip"]),regex=/^x-(?:vercel|now)-(warning|notice|tip)-(.*)$/;for(let[name,payload]of res.headers){let match=name.match(regex);if(match){let[,type,identifier]=match,action=res.headers.get(`x-vercel-action-${identifier}`),link=res.headers.get(`x-vercel-link-${identifier}`);if(indications.has(type)){let newline=`
|
|
8
8
|
`,message=prependEmoji(import_chalk.default.dim(payload),emoji(type))+newline,finalLink="";link&&(finalLink=import_chalk.default.dim(`${action||"Learn More"}: ${link_default(link)}`)+newline),output_manager_default.print(message+finalLink)}}}}function sharedPromise(fn){let promise=null;return function(...args){return promise||(promise=fn.apply(this,args),promise.finally(()=>{promise=null})),promise}}var import_error_utils2=__toESM(require_dist(),1);var DOMAINS_API_PATH=/^\/v\d+\/(?:domains|registrar)(?:\/|$)/,isSAMLError=v=>v&&v.saml,isJSONObject=v=>v&&typeof v=="object"&&v.constructor===Object;function isValidAccessToken(authConfig){if(!authConfig.token)return!1;if(typeof authConfig.expiresAt!="number")return!0;let nowInSeconds=Math.floor(Date.now()/1e3);return authConfig.expiresAt>=nowInSeconds}function hasRefreshToken(authConfig){return"refreshToken"in authConfig}var Client=class extends EventEmitter{constructor(opts){super();this._argv=[];this._loggedTokenSource=!1;this.escapePromptCancellationDepth=0;this.promptBackNavigationDepth=0;this.reauthenticate=sharedPromise(async function(error){let{default:reauthenticate}=await import("./reauthenticate-O6C2AW3J.js");if(typeof await reauthenticate(this,error)=="number")throw error instanceof APIError?output_manager_default.prettyError(error):output_manager_default.error(`Failed to re-authenticate for ${(0,import_chalk2.bold)(error.scope)} scope`),error});this._onRetry=error=>{output_manager_default.debug(`Retrying: ${error}
|
|
9
9
|
${error.stack}`)};this.setArgv(opts.argv),this.apiUrl=opts.apiUrl,this.authConfig=opts.authConfig,this.stdin=opts.stdin,this.stdout=opts.stdout,this.stderr=opts.stderr,this.config=opts.config,this.localConfig=opts.localConfig,this.localConfigPath=opts.localConfigPath,this.requestIdCounter=1,this.telemetryEventStore=opts.telemetryEventStore,this.isAgent=opts.isAgent??!1,this.agentName=opts.agentName,this.nonInteractive=opts.nonInteractive??this.isAgent,this.dangerouslySkipPermissions=opts.dangerouslySkipPermissions??!1;let theme={prefix:(0,import_chalk2.gray)("?"),style:{answer:import_chalk2.gray}};this.input={text:async opts2=>{let{default:input}=await import("./esm-7HVUFWMN.js");return this.runPrompt(input({theme,...opts2},{input:this.stdin,output:this.stderr}))},password:async opts2=>{let{default:password}=await import("./esm-BZBEM7YA.js");return this.runPrompt(password({theme,...opts2},{input:this.stdin,output:this.stderr}))},checkbox:async opts2=>{let{default:checkbox}=await import("./esm-CXICLFA3.js");return this.runPrompt(checkbox({theme,...opts2},{input:this.stdin,output:this.stderr}))},expand:async opts2=>{let{default:expand}=await import("./esm-HDEHVK7I.js");return this.runPrompt(expand({theme,...opts2},{input:this.stdin,output:this.stderr}))},confirm:async(message,default_value)=>{let{default:confirm}=await import("./esm-SZZI53W7.js");return this.runPrompt(confirm({theme,message,default:default_value},{input:this.stdin,output:this.stderr}))},select:async opts2=>{let{default:select}=await import("./esm-WGJFGCLK.js");return this.runPrompt(select({theme,...opts2},{input:this.stdin,output:this.stderr}))},search:async opts2=>{let{default:search}=await import("./esm-NQRLKALI.js");return this.runPrompt(search({theme,...opts2},{input:this.stdin,output:this.stderr}))}}}async withEscapePromptCancellation(run){this.escapePromptCancellationDepth++;try{return await run()}finally{this.escapePromptCancellationDepth--}}async withPromptBackNavigation(run){this.promptBackNavigationDepth++;try{return await run()}finally{this.promptBackNavigationDepth--}}runPrompt(prompt){let escapeCancellationEnabled=this.escapePromptCancellationDepth>0,backNavigationEnabled=this.promptBackNavigationDepth>0;if(!escapeCancellationEnabled&&!backNavigationEnabled||!this.stdin.isTTY||!prompt.cancel)return prompt;let cancellation,onKeypress=(_input,key)=>{key?.name==="escape"&&escapeCancellationEnabled&&!cancellation?(cancellation="escape",prompt.cancel?.()):key?.name==="up"&&backNavigationEnabled&&!cancellation&&(cancellation="back",prompt.cancel?.())};return this.stdin.on("keypress",onKeypress),prompt.catch(error=>{throw cancellation==="escape"?new PromptCanceledError:cancellation==="back"?new PromptBackError:error}).finally(()=>{this.stdin.off("keypress",onKeypress)})}get argv(){return this._argv}setArgv(argvOrFirst,...rest){let argv=Array.isArray(argvOrFirst)?argvOrFirst:[argvOrFirst,...rest];this._argv=argv,this._parsedArgsCache=void 0}getParsedArgs(){return this._parsedArgsCache||(this._parsedArgsCache=parseArguments(this.argv.slice(2),{},{permissive:!0})),this._parsedArgsCache}retry(fn,{retries=3,maxTimeout=1/0}={}){return(0,import_async_retry.default)(fn,{retries,maxTimeout,onRetry:this._onRetry})}async ensureAuthorized(){let{authConfig}=this;if(isValidAccessToken(authConfig)){this._loggedTokenSource||(authConfig.tokenSource==="flag"?output_manager_default.debug("Using token from `--token` argument, skipping token refresh."):authConfig.tokenSource==="env"?output_manager_default.debug("Using token from VERCEL_TOKEN environment variable, skipping token refresh."):output_manager_default.debug("Valid access token, skipping token refresh."),this._loggedTokenSource=!0);return}if(!hasRefreshToken(authConfig)){output_manager_default.debug("No refresh token found, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}let tokenResponse=await refreshTokenRequest({refresh_token:authConfig.refreshToken}),[tokensError,tokens]=await processTokenResponse(tokenResponse);if(isOAuthError(tokensError)&&tokensError.code==="invalid_grant"&&!authConfig.tokenSource&&this.stdin.isTTY&&!this.nonInteractive){output_manager_default.debug(`Stored session refresh failed: ${tokensError.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login.");let{performDeviceCodeFlow}=await import("./future-BB7OE645.js"),recoveredTokens=await performDeviceCodeFlow(this);if(recoveredTokens){this.updateAuthConfig({token:recoveredTokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+recoveredTokens.expires_in,refreshToken:recoveredTokens.refresh_token}),this.persistAuthConfig();return}}if(tokensError){output_manager_default.debug("Error refreshing token, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}this.updateAuthConfig({token:tokens.access_token,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in}),tokens.refresh_token&&this.updateAuthConfig({refreshToken:tokens.refresh_token}),this.persistAuthConfig(),this.writeToConfigFile(),output_manager_default.debug("Tokens refreshed successfully.")}getGlobalPathConfig(){let confFlag=this.getParsedArgs().flags["--global-config"];return typeof confFlag=="string"?resolve(this.cwd,confFlag):(0,import_cli_config.getGlobalPathConfig)()}async readConfig(fileName,schema){let filePath=join2(this.getGlobalPathConfig(),fileName);return(0,import_cli_config.readConfigFile)(filePath,schema)}async maybeReadConfig(fileName,schema){try{return await this.readConfig(fileName,schema)}catch{return null}}async writeConfig(fileName,schema,value){let filePath=join2(this.getGlobalPathConfig(),fileName);(0,import_cli_config.writeConfigFile)(filePath,schema,value)}updateConfig(config2){this.config={...this.config,...config2}}writeToConfigFile(){writeToConfigFile(this.config)}updateAuthConfig(authConfig){authConfig.token&&authConfig.token!==this.authConfig.token&&(this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0),this.authConfig={...this.authConfig,...authConfig}}emptyAuthConfig(){this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0,this.authConfig=this.authConfig.skipWrite?{skipWrite:!0}:{}}persistAuthConfig(){persistAuthConfig(this.authConfig,this.config)}async confirmMutatingOperation(url,method){if(!((method||"GET").toUpperCase()==="DELETE"))return!0;if(this.isAgent&&this.dangerouslySkipPermissions){let agentInfo=this.agentName?` (${this.agentName})`:"";output_manager_default.print(`
|
|
10
10
|
`),output_manager_default.print((0,import_chalk2.bgRed)((0,import_chalk2.white)((0,import_chalk2.bold)(" \u26A0 WARNING ")))+(0,import_chalk2.red)((0,import_chalk2.bold)(` AGENT MODE - DELETE CONFIRMATION BYPASSED
|