vercel 63.0.2 → 63.1.1
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-BODUK747.js → add-LFJBSEHE.js} +1 -1
- package/dist/chunks/{add-QKGWNVQS.js → add-WX7XBOMM.js} +1 -1
- package/dist/chunks/{add-QBGY56BR.js → add-YAWFEGID.js} +1 -1
- package/dist/chunks/{build-SD6SLRK7.js → build-FIPVJJWA.js} +1 -1
- package/dist/chunks/{chunk-BRUTDRAQ.js → chunk-26KRNEYD.js} +1 -1
- package/dist/chunks/{chunk-JTAAWOJS.js → chunk-2GTCIOCB.js} +1 -1
- package/dist/chunks/{chunk-VOB4W7DO.js → chunk-46XQIXL7.js} +1 -1
- package/dist/chunks/chunk-5DXCVG5U.js +10 -0
- package/dist/chunks/{chunk-7D2HVBVP.js → chunk-5O2CW3SX.js} +1 -1
- package/dist/chunks/{chunk-DZ6GORJ7.js → chunk-67N2NJCF.js} +1 -1
- package/dist/chunks/{chunk-HJ3NY4UA.js → chunk-6LXX5P3A.js} +1 -1
- package/dist/chunks/chunk-6LZ72MNE.js +9 -0
- package/dist/chunks/{chunk-V2BKSCXI.js → chunk-7I57HOA6.js} +1 -1
- package/dist/chunks/{chunk-MEJTHWZB.js → chunk-7Z4JCYS6.js} +1 -1
- package/dist/chunks/{chunk-YLTCVZOL.js → chunk-ACGKBCXE.js} +1 -1
- package/dist/chunks/{chunk-WJ4VNTE3.js → chunk-AVRYIQRF.js} +1 -1
- package/dist/chunks/{chunk-3AF3TTCR.js → chunk-BW64GZ3E.js} +1 -1
- package/dist/chunks/{chunk-VJEQAITW.js → chunk-DJDT2SUM.js} +1 -1
- package/dist/chunks/{chunk-X3JK3SQ2.js → chunk-DO4GPDKO.js} +1 -1
- package/dist/chunks/{chunk-6LRVRPYO.js → chunk-E6UKNYFF.js} +1 -1
- package/dist/chunks/{chunk-NZBUIMZG.js → chunk-EGZIRI5B.js} +1 -1
- package/dist/chunks/{chunk-MA4K5IWW.js → chunk-G2JKENQU.js} +1 -1
- package/dist/chunks/{chunk-VNSQCAVT.js → chunk-G64N3I5W.js} +1 -1
- package/dist/chunks/{chunk-YAPHSZJ7.js → chunk-GNY6U33Z.js} +2 -2
- package/dist/chunks/{chunk-3DMY3OJR.js → chunk-HVNIW32A.js} +1 -1
- package/dist/chunks/{chunk-UTW2FDSC.js → chunk-I3D36ZLJ.js} +1 -1
- package/dist/chunks/{chunk-H7LHZZKU.js → chunk-I4NK2P2D.js} +1 -1
- package/dist/chunks/{chunk-MZ6DNAVL.js → chunk-IADIPNJO.js} +1 -1
- package/dist/chunks/{chunk-MYMM34ZH.js → chunk-IOJYYPUF.js} +4 -4
- package/dist/chunks/{chunk-AUZEOUZU.js → chunk-IVUYULMP.js} +1 -1
- package/dist/chunks/{chunk-VIBUYIZ3.js → chunk-J2LAZELI.js} +1 -1
- package/dist/chunks/{chunk-4A5SGLIH.js → chunk-JV4URBEA.js} +1 -1
- package/dist/chunks/{chunk-TKA7PPGY.js → chunk-L3S26YTM.js} +1 -1
- package/dist/chunks/{chunk-BWY67LI6.js → chunk-LZAGJ3QI.js} +1 -1
- package/dist/chunks/chunk-ME6DBVQG.js +7 -0
- package/dist/chunks/{chunk-AZ76R3LW.js → chunk-ME75ZZW7.js} +1 -1
- package/dist/chunks/{chunk-SY4EANZH.js → chunk-MHQ2MW2B.js} +3 -3
- package/dist/chunks/{chunk-WF5YVWWY.js → chunk-MJR564B4.js} +1 -1
- package/dist/chunks/{chunk-SSEVYTJ7.js → chunk-MS576PZ7.js} +1 -1
- package/dist/chunks/{chunk-2H243SJV.js → chunk-MSH7V3FL.js} +1 -1
- package/dist/chunks/{chunk-64U5W6GU.js → chunk-MYY36NBW.js} +1 -1
- package/dist/chunks/{chunk-IYL5CKZ4.js → chunk-NUPLQVP3.js} +1 -1
- package/dist/chunks/{chunk-25S4PQNK.js → chunk-OBRNACWW.js} +1 -1
- package/dist/chunks/{chunk-KNBEUC4P.js → chunk-OKS442LQ.js} +1 -1
- package/dist/chunks/{chunk-7V2F5IUY.js → chunk-Q3SWLXLO.js} +1 -1
- package/dist/chunks/{chunk-CRO7VQWK.js → chunk-Q7ZF7MBI.js} +1 -1
- package/dist/chunks/{chunk-B3PZ3I4Z.js → chunk-QCG6Q33G.js} +1 -1
- package/dist/chunks/{chunk-XJOOPPSQ.js → chunk-R4TMZGV5.js} +1 -1
- package/dist/chunks/{chunk-PSBBSY46.js → chunk-RZTGPQFR.js} +1 -1
- package/dist/chunks/{chunk-BZYQ6RFV.js → chunk-SYEKOJHT.js} +1 -1
- package/dist/chunks/{chunk-ESMQCFCX.js → chunk-TAAV7L3T.js} +1 -1
- package/dist/chunks/{chunk-JUSQYKFF.js → chunk-TEHMKMPG.js} +1 -1
- package/dist/chunks/{chunk-HUJPGK7W.js → chunk-TNZMCRAP.js} +1 -1
- package/dist/chunks/{chunk-2WYDLP7X.js → chunk-UPXIQO57.js} +1 -1
- package/dist/chunks/{chunk-QZRZ6ECD.js → chunk-VUILLFZ6.js} +1 -1
- package/dist/chunks/{chunk-V336CYEI.js → chunk-WDJFZM7U.js} +1 -1
- package/dist/chunks/{chunk-IAUAFUO2.js → chunk-WJEAGH4K.js} +1 -1
- package/dist/chunks/{chunk-QW2UP4W4.js → chunk-WKTIAVGU.js} +1 -1
- package/dist/chunks/{chunk-VSE5BAPP.js → chunk-WPQN5UKR.js} +1 -1
- package/dist/chunks/{chunk-2LGNEOKV.js → chunk-WXWBB7LP.js} +1 -1
- package/dist/chunks/{chunk-KTNRWBHM.js → chunk-YCV465P5.js} +1 -1
- package/dist/chunks/{chunk-T76ITV65.js → chunk-YDRNDY2V.js} +2 -2
- package/dist/chunks/{chunk-AZULOP7M.js → chunk-YIIPBH2D.js} +2 -2
- package/dist/chunks/{chunk-T6SFC3IH.js → chunk-Z6HYEIYV.js} +1 -1
- package/dist/chunks/{clear-PYDGQBSS.js → clear-ZEWRQLJR.js} +1 -1
- package/dist/chunks/{compile-vercel-config-KWSIFONF.js → compile-vercel-config-66TMMPL5.js} +1 -1
- package/dist/chunks/{config-Y3JEZPVK.js → config-LDTDOVVC.js} +1 -1
- package/dist/chunks/{config-6TQFY5DN.js → config-V7SAJGMS.js} +1 -1
- package/dist/chunks/{connect-git-provider-HW23GK35.js → connect-git-provider-VJYXBRYG.js} +1 -1
- package/dist/chunks/{delete-HAOLSE35.js → delete-5WC3BAXY.js} +1 -1
- package/dist/chunks/{delete-ZISJ7HIW.js → delete-QVG74P23.js} +1 -1
- package/dist/chunks/{detect-projects-3CQ6ANGU.js → detect-projects-FTGWHOTA.js} +1 -1
- package/dist/chunks/{detect-services-22KZAGH2.js → detect-services-QPBLJZGR.js} +1 -1
- package/dist/chunks/{disable-ZCEEK2BD.js → disable-MJP72BUH.js} +1 -1
- package/dist/chunks/{discard-VHO5BXYN.js → discard-GHJO6HJ7.js} +1 -1
- package/dist/chunks/{edit-JRYFZ5N5.js → edit-ELV6KOAC.js} +1 -1
- package/dist/chunks/{edit-ZPNWEZWU.js → edit-MCMKL3PG.js} +1 -1
- package/dist/chunks/{enable-USQVAN4K.js → enable-NJV7TP3E.js} +1 -1
- package/dist/chunks/{export-H7YV6NVF.js → export-OFXKWFKJ.js} +1 -1
- package/dist/chunks/{future-PHRPWAVY.js → future-TTQX6P2J.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-WLYVWTBG.js → generate-cert-for-deploy-H5CIDNMW.js} +1 -1
- package/dist/chunks/{image-6KIQRC65.js → image-2V2VJOSJ.js} +1 -1
- package/dist/chunks/{import-builders-YAC6UE33.js → import-builders-K3AX56WJ.js} +1 -1
- package/dist/chunks/{inspect-BQELJ5EI.js → inspect-3YVNC464.js} +1 -1
- package/dist/chunks/{inspect-MRJ6JO7M.js → inspect-7YQ3GVZK.js} +1 -1
- package/dist/chunks/{inspect-HJQWRFHR.js → inspect-SEHUG246.js} +1 -1
- package/dist/chunks/{inspect-DWOQ6566.js → inspect-SLCLHRCE.js} +1 -1
- package/dist/chunks/{inspect-SEGNEPGI.js → inspect-ZNSHEHOX.js} +1 -1
- package/dist/chunks/{list-OCU47YHP.js → list-AKLXWJVE.js} +1 -1
- package/dist/chunks/{list-HS54LLJ5.js → list-QWTJ5GEV.js} +1 -1
- package/dist/chunks/{list-S2XKQMNX.js → list-TFJSUTGX.js} +1 -1
- package/dist/chunks/{login-SKAMFH7S.js → login-2RXKHHR7.js} +1 -1
- package/dist/chunks/{login-K6VYVJPS.js → login-DTYYE77N.js} +1 -1
- package/dist/chunks/{logs-KZSKOQUN.js → logs-RI5TPLZS.js} +1 -1
- package/dist/chunks/{ls-LCY7BHOP.js → ls-62IGNDVX.js} +1 -1
- package/dist/chunks/{ls-G5NTVYUB.js → ls-KPDMEX3M.js} +1 -1
- package/dist/chunks/{ls-DTEGGHQA.js → ls-O6RYA4QE.js} +1 -1
- package/dist/chunks/{ls-LBBI45ZT.js → ls-PDGT4IYT.js} +1 -1
- package/dist/chunks/{ls-NUM6IQL6.js → ls-RT2GW7GQ.js} +1 -1
- package/dist/chunks/{ls-TE7BAMHR.js → ls-SWSNZDIB.js} +1 -1
- package/dist/chunks/{ls-ZYM3DQXI.js → ls-XBWZZIZW.js} +1 -1
- package/dist/chunks/{mutate-BAFVNNRU.js → mutate-4QF5LX5H.js} +1 -1
- package/dist/chunks/{notifications-3EB3ZEU3.js → notifications-EZWNVZIY.js} +1 -1
- package/dist/chunks/{open-J4X5KJ6A.js → open-ZOCLC6EL.js} +1 -1
- package/dist/chunks/{openapi-C5BHMHWS.js → openapi-WDPDBK6G.js} +1 -1
- package/dist/chunks/{permissions-2WMWMXFP.js → permissions-WZ74DZVX.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-VS3ZJSCQ.js → prompt-missing-credentials-EU3KK3J4.js} +1 -1
- package/dist/chunks/{publish-WWI5HOAL.js → publish-M6VGADUV.js} +1 -1
- package/dist/chunks/{pull-MTQAMT4L.js → pull-HE4HZUJO.js} +1 -1
- package/dist/chunks/{purchase-domain-if-available-ZIIAF7CC.js → purchase-domain-if-available-YK7ZK4OQ.js} +1 -1
- package/dist/chunks/{push-PBKUSKXQ.js → push-AXG4E43Q.js} +1 -1
- package/dist/chunks/{query-5VGUVE2A.js → query-LSTTTOQM.js} +1 -1
- package/dist/chunks/{reauthenticate-UGBXSWZE.js → reauthenticate-S6DCF7RS.js} +1 -1
- package/dist/chunks/{reorder-S2ZJML5K.js → reorder-4G2JILHR.js} +1 -1
- package/dist/chunks/{reply-3GFULOMZ.js → reply-MDSF5FRG.js} +1 -1
- package/dist/chunks/{resolve-USEBSFUT.js → resolve-JFM5IA7H.js} +1 -1
- package/dist/chunks/{restore-JD7IGDTY.js → restore-DGXZYLLN.js} +1 -1
- package/dist/chunks/{rm-EQYVIFNX.js → rm-3CXFYPYT.js} +1 -1
- package/dist/chunks/{rm-RHRKS7XG.js → rm-56YVF7VJ.js} +1 -1
- package/dist/chunks/{rm-BYOBKSWY.js → rm-72VFNBSP.js} +1 -1
- package/dist/chunks/{rm-3V47KPK6.js → rm-OAN2XZOH.js} +1 -1
- package/dist/chunks/{rm-LL2AWOZT.js → rm-WFK724PU.js} +1 -1
- package/dist/chunks/{routes-NID5V7EJ.js → routes-PKCKZ5T6.js} +1 -1
- package/dist/chunks/{rule-inspect-5DZ7OXGE.js → rule-inspect-C6FZRTXY.js} +1 -1
- package/dist/chunks/{rules-CM2ARIWZ.js → rules-5EKUX5OX.js} +1 -1
- package/dist/chunks/{schema-V75RRXXF.js → schema-6LPADSVE.js} +1 -1
- package/dist/chunks/{schema-SZUKDSY2.js → schema-LM6XGKQS.js} +1 -1
- package/dist/chunks/{select-org-SH4JT6RI.js → select-org-MARKOFHY.js} +1 -1
- package/dist/chunks/{set-LY4YI5FZ.js → set-MTKMZ2YS.js} +1 -1
- package/dist/chunks/{setup-and-link-MWLALWAS.js → setup-and-link-KMD3ZLHN.js} +1 -1
- package/dist/chunks/{tags-P5GB7HTF.js → tags-SXRDMEPO.js} +1 -1
- package/dist/chunks/{types-OC7OTQNK.js → types-K73TDN7C.js} +1 -1
- package/dist/chunks/{update-SOD622HT.js → update-QSNT3MDG.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +4 -4
- package/dist/commands/dev/index.js +2 -2
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands-bulk.js +68 -56
- package/dist/index.js +2 -2
- package/dist/internal-build.js +1 -1
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +56 -56
- package/dist/chunks/chunk-5RR3435W.js +0 -10
- package/dist/chunks/chunk-U5C6XOLA.js +0 -9
- package/dist/chunks/chunk-W6LNIG5O.js +0 -7
|
@@ -4,4 +4,4 @@ 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{getGlobalPathConfig}from"./chunk-HMS3UIQ2.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_load_json_file}from"./chunk-VKXEOL4K.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{require_types}from"./chunk-ZS2WS4AM.js";import{inspectTokenRequest,processInspectTokenResponse}from"./chunk-AOWWC6WZ.js";import{parseArguments}from"./chunk-R4VVQRLX.js";import{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR,findProjectsFromPath,getLinkFromDir,getRepoLink,getVercelDirectory}from"./chunk-MYMM34ZH.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{getUser}from"./chunk-VSE5BAPP.js";import{getTeamByIdOrSlug}from"./chunk-VOZEB6PD.js";import{ConflictingConfigFiles,DeprecatedNowJson,InvalidLocalConfig,InvalidToken,NowError,TeamDeleted}from"./chunk-AZULOP7M.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function highlight(text){return import_chalk.default.bold.underline(text)}var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}var import_cli_config=__toESM(require_cli_config(),1),import_ms=__toESM(require_ms(),1);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";import path from"path";import{existsSync}from"fs";function getLocalPathConfig(prefix,useCompiledConfig=!0){let customPath=parseArguments(process.argv.slice(2),{},{permissive:!0}).flags["--local-config"];if(customPath){if(typeof customPath!="string")throw new InvalidLocalConfig(customPath);return path.resolve(process.cwd(),customPath)}let vercelConfigPath=path.join(prefix,"vercel.json"),vercelTomlPath=path.join(prefix,"vercel.toml"),nowConfigPath=path.join(prefix,"now.json"),vercelConfigExists=existsSync(vercelConfigPath),vercelTomlExists=existsSync(vercelTomlPath),nowConfigExists=existsSync(nowConfigPath),foundConfigs=[];if(vercelConfigExists&&foundConfigs.push(vercelConfigPath),vercelTomlExists&&foundConfigs.push(vercelTomlPath),nowConfigExists)throw new DeprecatedNowJson(nowConfigPath);if(foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs);let compiledConfigPath=path.join(prefix,VERCEL_DIR,"vercel.json"),compiledConfigExists=existsSync(compiledConfigPath);return useCompiledConfig&&compiledConfigExists?compiledConfigPath:vercelConfigPath}var globalDir,getVercelDir=()=>globalDir??=getGlobalPathConfig(),readConfigFile=()=>config.readGlobalConfigFile(getConfigFilePath2()),writeToConfigFile=stuff=>{try{config.writeGlobalConfigFile(getConfigFilePath2(),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(getConfigFilePath2())} (operation not permitted).`),process.exit(1)):err.code==="EBADF"&&(output_manager_default.error(`Not able to create ${highlight(getConfigFilePath2())} (bad file descriptor).`),process.exit(1))),err}},readAuthConfigFile=_globalConfig=>({...config.getDefaultAuthConfig(),...readCliAuthConfig(getVercelDir())}),persistAuthConfig=(authConfig,_globalConfig)=>{try{return persistCliAuthConfig(getVercelDir(),authConfig)}catch(err){let wrappedError=new Error(`Not able to create ${humanizePath(getAuthConfigFilePath2())} (${(0,import_error_utils.errorToStringFriendly)(err)}).`);throw wrappedError.cause=err,wrappedError}};function getConfigFilePath2(){return config.getConfigFilePath(getVercelDir())}function getAuthConfigFilePath2(){return config.getAuthConfigFilePath(getVercelDir())}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 TEAM_SLUG_TTL_MS=(0,import_ms.default)("1d");function getCachedTeamSlug(config2,teamId,now=Date.now()){let saved=config2.cachedTeamSlugs?.[teamId];if(!isSavedTeamSlug(saved))return;let age=now-saved.savedAt;return age>=0&&age<TEAM_SLUG_TTL_MS?saved.slug:void 0}function setCachedTeamSlug(client,teamId,slug){if(getCachedTeamSlug(client.config,teamId)===slug)return;let saved={slug,savedAt:Date.now()};updateCachedTeamSlugs(client,slugs=>({...slugs,[teamId]:saved}))}function forgetCachedTeamSlug(client,teamId){let slugs=client.config.cachedTeamSlugs;!slugs||!(teamId in slugs)||updateCachedTeamSlugs(client,saved=>{let rest={...saved};return delete rest[teamId],rest})}function isSavedTeamSlug(value){return typeof value=="object"&&value!==null&&typeof value.slug=="string"&&typeof value.savedAt=="number"}function updateCachedTeamSlugs(client,update){try{let configPath=getConfigFilePath2(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath),cachedTeamSlugs=update(savedConfig.cachedTeamSlugs??{}),config2={...savedConfig,cachedTeamSlugs};(0,import_cli_config.writeGlobalConfigFile)(configPath,config2),client.config.cachedTeamSlugs=cachedTeamSlugs}catch{output_manager_default.debug("Failed to persist cached team slugs.")}}import{relative}from"path";var import_cli_config2=__toESM(require_cli_config(),1);function isEligibleForNativeBinaryAutoOptIn(client){return client.teams?.some(team=>team.slug==="vercel")===!0}function autoOptInNativeBinary(client){let envOverride=process.env.VERCEL_CLI_USE_NATIVE_BINARY;if(!(envOverride==="false"||envOverride==="0"||typeof client.config.useNativeBinary=="boolean"||client.config.nativeBinaryAutoOptIn===!0||!isEligibleForNativeBinaryAutoOptIn(client)))try{let configPath=getConfigFilePath2(),savedConfig=(0,import_cli_config2.readGlobalConfigFile)(configPath);if(typeof savedConfig.useNativeBinary=="boolean"||savedConfig.nativeBinaryAutoOptIn===!0)return;let config2={...savedConfig,nativeBinaryAutoOptIn:!0};(0,import_cli_config2.writeGlobalConfigFile)(configPath,config2),client.config={...client.config,nativeBinaryAutoOptIn:!0}}catch{output_manager_default.debug("Failed to persist automatic native binary enrollment.")}}async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client);user&&autoOptInNativeBinary(client);let defaultTeamId=user?.version==="northstar"?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId);let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getContextName(client,opts={}){let teamId=client.config.currentTeam,cachedSlug=teamId&&!client.authConfig.tokenSource?getCachedTeamSlug(client.config,teamId):void 0;if(cachedSlug&&!(opts.resolveLocalScope&&await hasLocalScope(client)))return output_manager_default.debug(`Using saved name "${cachedSlug}" for team ${teamId}`),cachedSlug;let{contextName,team}=opts.resolveLocalScope?await getScope(client,{resolveLocalScope:!0}):await getScope(client);return team&&!client.authConfig.tokenSource&&setCachedTeamSlug(client,team.id,team.slug),contextName}async function hasLocalScope(client){if(detectExplicitScope(client))return!1;let{localOrgId,isCrossTeamRepo}=await findLocalLink(client);return!!localOrgId||isCrossTeamRepo}async function getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,localOrgId:effectiveLocalOrgId,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let matchedProjects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),projects=matchedProjects.length===0&&pathFromRepoRoot===""?repoConfig.projects:matchedProjects,orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function detectExplicitScope(client){let argv=client.argv;for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{highlight,introspectToken,isAppPrincipalEnabled,resolveAppFromToken,resolveAppTokenScope,forgetCachedTeamSlug,getScope,getContextName,detectExplicitScope,getLocalPathConfig,readConfigFile,writeToConfigFile,readAuthConfigFile,persistAuthConfig,getConfigFilePath2 as getConfigFilePath,getAuthConfigFilePath2 as getAuthConfigFilePath,readLocalConfig};
|
|
7
|
+
import{getGlobalPathConfig}from"./chunk-HMS3UIQ2.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_load_json_file}from"./chunk-VKXEOL4K.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{require_types}from"./chunk-ZS2WS4AM.js";import{inspectTokenRequest,processInspectTokenResponse}from"./chunk-AOWWC6WZ.js";import{parseArguments}from"./chunk-R4VVQRLX.js";import{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR,findProjectsFromPath,getLinkFromDir,getRepoLink,getVercelDirectory}from"./chunk-IOJYYPUF.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{getUser}from"./chunk-WPQN5UKR.js";import{getTeamByIdOrSlug}from"./chunk-VOZEB6PD.js";import{ConflictingConfigFiles,DeprecatedNowJson,InvalidLocalConfig,InvalidToken,NowError,TeamDeleted}from"./chunk-YIIPBH2D.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function highlight(text){return import_chalk.default.bold.underline(text)}var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}var import_cli_config=__toESM(require_cli_config(),1),import_ms=__toESM(require_ms(),1);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";import path from"path";import{existsSync}from"fs";function getLocalPathConfig(prefix,useCompiledConfig=!0){let customPath=parseArguments(process.argv.slice(2),{},{permissive:!0}).flags["--local-config"];if(customPath){if(typeof customPath!="string")throw new InvalidLocalConfig(customPath);return path.resolve(process.cwd(),customPath)}let vercelConfigPath=path.join(prefix,"vercel.json"),vercelTomlPath=path.join(prefix,"vercel.toml"),nowConfigPath=path.join(prefix,"now.json"),vercelConfigExists=existsSync(vercelConfigPath),vercelTomlExists=existsSync(vercelTomlPath),nowConfigExists=existsSync(nowConfigPath),foundConfigs=[];if(vercelConfigExists&&foundConfigs.push(vercelConfigPath),vercelTomlExists&&foundConfigs.push(vercelTomlPath),nowConfigExists)throw new DeprecatedNowJson(nowConfigPath);if(foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs);let compiledConfigPath=path.join(prefix,VERCEL_DIR,"vercel.json"),compiledConfigExists=existsSync(compiledConfigPath);return useCompiledConfig&&compiledConfigExists?compiledConfigPath:vercelConfigPath}var globalDir,getVercelDir=()=>globalDir??=getGlobalPathConfig(),readConfigFile=()=>config.readGlobalConfigFile(getConfigFilePath2()),writeToConfigFile=stuff=>{try{config.writeGlobalConfigFile(getConfigFilePath2(),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(getConfigFilePath2())} (operation not permitted).`),process.exit(1)):err.code==="EBADF"&&(output_manager_default.error(`Not able to create ${highlight(getConfigFilePath2())} (bad file descriptor).`),process.exit(1))),err}},readAuthConfigFile=_globalConfig=>({...config.getDefaultAuthConfig(),...readCliAuthConfig(getVercelDir())}),persistAuthConfig=(authConfig,_globalConfig)=>{try{return persistCliAuthConfig(getVercelDir(),authConfig)}catch(err){let wrappedError=new Error(`Not able to create ${humanizePath(getAuthConfigFilePath2())} (${(0,import_error_utils.errorToStringFriendly)(err)}).`);throw wrappedError.cause=err,wrappedError}};function getConfigFilePath2(){return config.getConfigFilePath(getVercelDir())}function getAuthConfigFilePath2(){return config.getAuthConfigFilePath(getVercelDir())}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 TEAM_SLUG_TTL_MS=(0,import_ms.default)("1d");function getCachedTeamSlug(config2,teamId,now=Date.now()){let saved=config2.cachedTeamSlugs?.[teamId];if(!isSavedTeamSlug(saved))return;let age=now-saved.savedAt;return age>=0&&age<TEAM_SLUG_TTL_MS?saved.slug:void 0}function setCachedTeamSlug(client,teamId,slug){if(getCachedTeamSlug(client.config,teamId)===slug)return;let saved={slug,savedAt:Date.now()};updateCachedTeamSlugs(client,slugs=>({...slugs,[teamId]:saved}))}function forgetCachedTeamSlug(client,teamId){let slugs=client.config.cachedTeamSlugs;!slugs||!(teamId in slugs)||updateCachedTeamSlugs(client,saved=>{let rest={...saved};return delete rest[teamId],rest})}function isSavedTeamSlug(value){return typeof value=="object"&&value!==null&&typeof value.slug=="string"&&typeof value.savedAt=="number"}function updateCachedTeamSlugs(client,update){try{let configPath=getConfigFilePath2(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath),cachedTeamSlugs=update(savedConfig.cachedTeamSlugs??{}),config2={...savedConfig,cachedTeamSlugs};(0,import_cli_config.writeGlobalConfigFile)(configPath,config2),client.config.cachedTeamSlugs=cachedTeamSlugs}catch{output_manager_default.debug("Failed to persist cached team slugs.")}}import{relative}from"path";var import_cli_config2=__toESM(require_cli_config(),1);function isEligibleForNativeBinaryAutoOptIn(client){return client.teams?.some(team=>team.slug==="vercel")===!0}function autoOptInNativeBinary(client){let envOverride=process.env.VERCEL_CLI_USE_NATIVE_BINARY;if(!(envOverride==="false"||envOverride==="0"||typeof client.config.useNativeBinary=="boolean"||client.config.nativeBinaryAutoOptIn===!0||!isEligibleForNativeBinaryAutoOptIn(client)))try{let configPath=getConfigFilePath2(),savedConfig=(0,import_cli_config2.readGlobalConfigFile)(configPath);if(typeof savedConfig.useNativeBinary=="boolean"||savedConfig.nativeBinaryAutoOptIn===!0)return;let config2={...savedConfig,nativeBinaryAutoOptIn:!0};(0,import_cli_config2.writeGlobalConfigFile)(configPath,config2),client.config={...client.config,nativeBinaryAutoOptIn:!0}}catch{output_manager_default.debug("Failed to persist automatic native binary enrollment.")}}async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client);user&&autoOptInNativeBinary(client);let defaultTeamId=user?.version==="northstar"?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId);let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getContextName(client,opts={}){let teamId=client.config.currentTeam,cachedSlug=teamId&&!client.authConfig.tokenSource?getCachedTeamSlug(client.config,teamId):void 0;if(cachedSlug&&!(opts.resolveLocalScope&&await hasLocalScope(client)))return output_manager_default.debug(`Using saved name "${cachedSlug}" for team ${teamId}`),cachedSlug;let{contextName,team}=opts.resolveLocalScope?await getScope(client,{resolveLocalScope:!0}):await getScope(client);return team&&!client.authConfig.tokenSource&&setCachedTeamSlug(client,team.id,team.slug),contextName}async function hasLocalScope(client){if(detectExplicitScope(client))return!1;let{localOrgId,isCrossTeamRepo}=await findLocalLink(client);return!!localOrgId||isCrossTeamRepo}async function getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,localOrgId:effectiveLocalOrgId,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let matchedProjects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),projects=matchedProjects.length===0&&pathFromRepoRoot===""?repoConfig.projects:matchedProjects,orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function scopeFlagPassed(argv){for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!1}function detectExplicitScope(client){return scopeFlagPassed(client.argv)||!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{highlight,introspectToken,isAppPrincipalEnabled,resolveAppFromToken,resolveAppTokenScope,forgetCachedTeamSlug,getScope,getContextName,scopeFlagPassed,detectExplicitScope,getLocalPathConfig,readConfigFile,writeToConfigFile,readAuthConfigFile,persistAuthConfig,getConfigFilePath2 as getConfigFilePath,getAuthConfigFilePath2 as getAuthConfigFilePath,readLocalConfig};
|
|
@@ -4,4 +4,4 @@ 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}from"./chunk-
|
|
7
|
+
import{require_dist}from"./chunk-TNZMCRAP.js";import{forceOption,formatOption,jsonOption,projectOption,yesOption}from"./chunk-5IPBCD7K.js";import{packageName,require_lib}from"./chunk-JESNVRVR.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_constants=__toESM(require_dist(),1),import_title=__toESM(require_lib(),1),envTargetChoices=import_constants.PROJECT_ENV_TARGET.map(t=>({name:(0,import_title.default)(t),value:t}));function isValidEnvTarget(target){return typeof target>"u"||envTargetChoices.map(c=>c.value).includes(target)}function getEnvTargetPlaceholder(){return`<${envTargetChoices.map(c=>c.value).join(" | ")}>`}function parseEnvTargetArg(arg){return Array.from(new Set(arg.split(",").map(t=>t.trim()).filter(Boolean)))}var targetPlaceholder=getEnvTargetPlaceholder(),listSubcommand={name:"list",aliases:["ls"],description:"List all Environment Variables for a Project",arguments:[{name:"environment",required:!1},{name:"git-branch",required:!1}],options:[{...formatOption,description:"Specify the output format (json, including readable Environment Variable values)"},{...jsonOption,description:"Output as JSON, including readable Environment Variable values"},projectOption,{name:"guidance",description:"Receive command suggestions once command is complete",shorthand:null,type:Boolean,deprecated:!1}],examples:[]},addSubcommand={name:"add",aliases:[],description:"Add an Environment Variable",arguments:[{name:"name",required:!0},{name:"environment",required:!1}],options:[projectOption,{name:"git-branch",description:"Set the Git branch for a Preview Environment Variable",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"sensitive",description:"Store the value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"no-sensitive",description:"Store the value as Config",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...forceOption,description:"Overwrite an existing variable for the same target",shorthand:null},{...yesOption,description:"Accept default choices when adding an Environment Variable"},{name:"guidance",description:"Show command suggestions after completion",shorthand:null,type:Boolean,deprecated:!1},{name:"value",description:"Set the variable value for non-interactive use; otherwise use stdin or the prompt",shorthand:null,type:String,argument:"VALUE",deprecated:!1}],examples:[{name:"Add a new variable (prompts for value and Environments)",value:[`${packageName} env add <name>`,`${packageName} env add API_TOKEN`]},{name:"Add a new Environment Variable to a specific Environment",value:[`${packageName} env add <name> ${targetPlaceholder}`,`${packageName} env add DB_PASS production`]},{name:"Add one variable to multiple Environments (comma-separated)",value:[`${packageName} env add <name> <environment>[,<environment>]`,`${packageName} env add API_URL production,preview,development`]},{name:"Override an existing Environment Variable of same target (production, preview, deployment)",value:`${packageName} env add API_TOKEN --force`},{name:"Add a Config Environment Variable that remains readable later",value:`${packageName} env add API_TOKEN --no-sensitive`},{name:"Add a new Environment Variable for a specific Environment and Git Branch",value:[`${packageName} env add <name> ${targetPlaceholder} --git-branch <name>`,`${packageName} env add DB_PASS preview --git-branch feat1`]},{name:"Add a new Environment Variable from stdin",value:[`cat <file> | ${packageName} env add <name> ${targetPlaceholder}`,`cat ~/.npmrc | ${packageName} env add NPM_RC preview`,`${packageName} env add API_URL production < url.txt`]},{name:"Add with --value for non-interactive use",value:`${packageName} env add API_TOKEN production --value "<value>" --yes`}]},removeSubcommand={name:"remove",aliases:["rm"],description:"Remove an Environment Variable (see examples below)",arguments:[{name:"name",required:!0},{name:"environment",required:!1}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when removing an Environment Variable"}],examples:[{name:"Remove a variable from multiple Environments",value:[`${packageName} env remove <name>`,`${packageName} env remove API_TOKEN`]},{name:"Remove a variable from a specific Environment",value:[`${packageName} env remove <name> ${targetPlaceholder}`,`${packageName} env remove NPM_RC preview`]},{name:"Remove a variable from a specific Environment and Git Branch",value:[`${packageName} env remove <name> ${targetPlaceholder} <gitbranch>`,`${packageName} env remove NPM_RC preview feat1`]}]},pullSubcommand={name:"pull",aliases:[],description:"Pull Environment Variables into a local file (default: .env.local)",arguments:[{name:"filename",required:!1}],options:[projectOption,{name:"environment",description:"Select the environment to pull (default: development)",shorthand:null,type:String,argument:"TARGET",deprecated:!1},{name:"git-branch",description:"Specify the Git branch to pull specific Environment Variables for",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"id",description:"Pull Environment Variables for a specific deployment (e.g. dpl_xxx)",shorthand:null,type:String,argument:"ID",deprecated:!1},{...yesOption,description:"Skip the confirmation prompt when overwriting an existing file"}],examples:[{name:"Pull Development Environment Variables into a custom file (check .gitignore)",value:[`${packageName} env pull <file>`,`${packageName} env pull .env.development.local`]},{name:"Pull Environment Variables for a specific deployment",value:`${packageName} env pull --id dpl_xxx`}]},runSubcommand={name:"run",aliases:[],description:"Run a command with environment variables from the linked Vercel project",arguments:[{name:"command",required:!0,multiple:!0}],options:[projectOption,{name:"environment",description:"Specify the environment to pull variables from (default: development)",shorthand:"e",type:String,argument:"TARGET",deprecated:!1},{name:"git-branch",description:"Specify the Git branch to pull specific Environment Variables for",shorthand:null,type:String,argument:"NAME",deprecated:!1}],examples:[{name:"Run Next.js dev server with development environment variables",value:`${packageName} env run -- next dev`},{name:"Run tests with preview environment variables for a specific branch",value:`${packageName} env run -e preview --git-branch feature-x -- npm test`}]},updateSubcommand={name:"update",aliases:[],description:"Update the value of an existing Environment Variable (see examples below)",arguments:[{name:"name",required:!0},{name:"environment",required:!1}],options:[projectOption,{name:"sensitive",description:"Store the updated value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...yesOption,description:"Skip the confirmation prompt when updating an Environment Variable"},{name:"value",description:"New value for the variable (non-interactive). Otherwise use stdin or you will be prompted.",shorthand:null,type:String,argument:"VALUE",deprecated:!1}],examples:[{name:"Update a variable in all Environments",value:[`${packageName} env update <name>`,`${packageName} env update API_TOKEN`]},{name:"Update a variable in a specific Environment",value:[`${packageName} env update <name> ${targetPlaceholder}`,`${packageName} env update DB_PASS production`]},{name:"Update a variable for a specific Environment and Git Branch",value:[`${packageName} env update <name> ${targetPlaceholder} <gitbranch>`,`${packageName} env update NPM_RC preview feat1`]},{name:"Update a variable from stdin",value:[`cat <file> | ${packageName} env update <name> ${targetPlaceholder}`,`cat ~/.npmrc | ${packageName} env update NPM_RC preview`,`${packageName} env update API_URL production < url.txt`]}]},envCommand={name:"env",aliases:[],description:"Interact with Environment Variables for a Project",arguments:[],subcommands:[addSubcommand,listSubcommand,pullSubcommand,removeSubcommand,runSubcommand,updateSubcommand],options:[],examples:[{name:"Run a command with Environment Variables from the linked Project",value:`${packageName} env run -- <command>`},{name:"Add one variable to multiple Environments",value:`${packageName} env add API_URL production,preview,development`}]};export{envTargetChoices,isValidEnvTarget,getEnvTargetPlaceholder,parseEnvTargetArg,listSubcommand,addSubcommand,removeSubcommand,pullSubcommand,runSubcommand,updateSubcommand,envCommand};
|