vercel 64.0.1 → 64.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/chunks/add-GEAC4RAQ.js +8 -0
- package/dist/chunks/add-JH6ALI3H.js +8 -0
- package/dist/chunks/add-XZJ4G2MM.js +8 -0
- package/dist/chunks/build-3T6EUCCK.js +7 -0
- package/dist/chunks/{chunk-VOZEB6PD.js → chunk-2VBFQZ72.js} +1 -1
- package/dist/chunks/{chunk-N7DY367Z.js → chunk-37QGCN6P.js} +2 -2
- package/dist/chunks/{chunk-MMIOAN6V.js → chunk-4ZICRXI5.js} +1 -1
- package/dist/chunks/{chunk-A6WTFAZT.js → chunk-5VWJIYJE.js} +1 -1
- package/dist/chunks/{chunk-CUGDEOWG.js → chunk-67NNB6S6.js} +1 -1
- package/dist/chunks/{chunk-74OAJW3T.js → chunk-7YRPMVZK.js} +1 -1
- package/dist/chunks/{chunk-UC4YUQBN.js → chunk-AR5T62PK.js} +1 -1
- package/dist/chunks/{chunk-ZMIRVO5A.js → chunk-ASU72O2R.js} +1 -1
- package/dist/chunks/{chunk-YBSW4AZH.js → chunk-BAJDLMZS.js} +1 -1
- package/dist/chunks/chunk-CSIUJLB7.js +9 -0
- package/dist/chunks/{chunk-JFASDCSW.js → chunk-DW3TSGVC.js} +1 -1
- package/dist/chunks/{chunk-MSH7V3FL.js → chunk-DYQXJCHO.js} +1 -1
- package/dist/chunks/{chunk-TC65E2YX.js → chunk-ELI3L2UX.js} +1 -1
- package/dist/chunks/chunk-FBJWLH2A.js +8 -0
- package/dist/chunks/{chunk-HMS3UIQ2.js → chunk-FIIHB66A.js} +1 -1
- package/dist/chunks/chunk-FLQJAP2A.js +14 -0
- package/dist/chunks/{chunk-SFW6MBQN.js → chunk-FWFTX2WE.js} +1 -1
- package/dist/chunks/chunk-FZIRYAXC.js +10 -0
- package/dist/chunks/{chunk-BNJQIVC2.js → chunk-G6B6TVAE.js} +1 -1
- package/dist/chunks/{chunk-Z6HYEIYV.js → chunk-HAVEFTOO.js} +1 -1
- package/dist/chunks/{chunk-YH6CNXAT.js → chunk-IDGWQE4B.js} +1 -1
- package/dist/chunks/chunk-J53D7SLS.js +7 -0
- package/dist/chunks/{chunk-BM2K5MMH.js → chunk-JAQM6UXY.js} +1 -1
- package/dist/chunks/chunk-JEPRHNQU.js +7 -0
- package/dist/chunks/{chunk-S2JJZDW6.js → chunk-JESE5FPO.js} +1 -1
- package/dist/chunks/{chunk-V3UOKOM5.js → chunk-JGPRCZC2.js} +1 -1
- package/dist/chunks/{chunk-R7FDTIAQ.js → chunk-JJSDRKX4.js} +2 -2
- package/dist/chunks/{chunk-TNZMCRAP.js → chunk-JNJOUMGF.js} +1 -1
- package/dist/chunks/{chunk-B3K6GM2W.js → chunk-JNPG7MVL.js} +1 -1
- package/dist/chunks/{chunk-DVQDWCWS.js → chunk-KAJM2NEI.js} +1 -1
- package/dist/chunks/{chunk-LG5FP6PL.js → chunk-KELSPU2J.js} +5 -5
- package/dist/chunks/{chunk-CNU4T7FO.js → chunk-M7GT3ZPT.js} +1 -1
- package/dist/chunks/{chunk-QUE7MWER.js → chunk-MFIVZXHH.js} +1 -1
- package/dist/chunks/{chunk-PZK6CKRM.js → chunk-MJD6WHG4.js} +1 -1
- package/dist/chunks/{chunk-WJ3UIEZ5.js → chunk-NFJPCOTV.js} +1 -1
- package/dist/chunks/{chunk-FO7MV3VE.js → chunk-NJINP2WU.js} +1 -1
- package/dist/chunks/{chunk-YYPNUQDI.js → chunk-NWGBDBZI.js} +1 -1
- package/dist/chunks/{chunk-ZF6QZY35.js → chunk-OGCVOINQ.js} +1 -1
- package/dist/chunks/{chunk-I3D36ZLJ.js → chunk-OJZEOWK2.js} +1 -1
- package/dist/chunks/{chunk-HYFA2W4U.js → chunk-OZ47SVXA.js} +1 -1
- package/dist/chunks/chunk-PJMVU4JC.js +20 -0
- package/dist/chunks/{chunk-YWLJSVTR.js → chunk-QYDG63GL.js} +1 -1
- package/dist/chunks/{chunk-YLTOFGIJ.js → chunk-R5K37TXM.js} +1 -1
- package/dist/chunks/{chunk-PFM3URPJ.js → chunk-RFEREQPS.js} +1 -1
- package/dist/chunks/chunk-SD757OFS.js +30 -0
- package/dist/chunks/{chunk-FRXP4IEJ.js → chunk-THSHYFA6.js} +1 -1
- package/dist/chunks/{chunk-CX2GKBWT.js → chunk-UBKETNGO.js} +1 -1
- package/dist/chunks/{chunk-CDGQ3T52.js → chunk-UDQYOGSQ.js} +1 -1
- package/dist/chunks/{chunk-6LXX5P3A.js → chunk-VM6TZGLE.js} +1 -1
- package/dist/chunks/{chunk-A7LJYJTR.js → chunk-VRWPRZJY.js} +1 -1
- package/dist/chunks/{chunk-MTSJMQCE.js → chunk-WHVT7UXE.js} +1 -1
- package/dist/chunks/{chunk-2EZVL7H3.js → chunk-WLK5BBNP.js} +1 -1
- package/dist/chunks/{chunk-NVSVMH3S.js → chunk-WQIGKVBV.js} +1 -1
- package/dist/chunks/{chunk-AZAGTZTH.js → chunk-XXDVZWWM.js} +1 -1
- package/dist/chunks/{chunk-JJXNBWZY.js → chunk-YCXZZSW6.js} +1 -1
- package/dist/chunks/{chunk-D4B463CV.js → chunk-YI5G2A3V.js} +1 -1
- package/dist/chunks/{chunk-AKY6JG2X.js → chunk-YNIW7DTL.js} +1 -1
- package/dist/chunks/{chunk-R4VVQRLX.js → chunk-Z4OH72VZ.js} +1 -1
- package/dist/chunks/chunk-Z6UFAIEX.js +8 -0
- package/dist/chunks/{chunk-COGMOZTL.js → chunk-ZKDWPKO2.js} +1 -1
- package/dist/chunks/{chunk-6EOSJGQQ.js → chunk-ZMBDYOVN.js} +1 -1
- package/dist/chunks/clear-XCZCETRU.js +8 -0
- package/dist/chunks/{compile-vercel-config-MOEJ6RRY.js → compile-vercel-config-NQKOGOPH.js} +1 -1
- package/dist/chunks/{config-ESRDSIAF.js → config-CIM647OM.js} +1 -1
- package/dist/chunks/config-P42IQJDF.js +8 -0
- package/dist/chunks/delete-KJMVCQ7C.js +10 -0
- package/dist/chunks/delete-MVJ3NENU.js +9 -0
- package/dist/chunks/{detect-services-KGIGKZFX.js → detect-services-UYQZT6MU.js} +1 -1
- package/dist/chunks/disable-666GPFHE.js +7 -0
- package/dist/chunks/discard-RUQPJMOG.js +14 -0
- package/dist/chunks/edit-IIM7GKC2.js +9 -0
- package/dist/chunks/edit-NRJCMP4B.js +8 -0
- package/dist/chunks/enable-FVXIP7NX.js +7 -0
- package/dist/chunks/{export-BPHKR42P.js → export-VPGLK5KL.js} +1 -1
- package/dist/chunks/future-MDYFVS3M.js +7 -0
- package/dist/chunks/{generate-cert-for-deploy-JRFEERJY.js → generate-cert-for-deploy-MWXVKKFQ.js} +1 -1
- package/dist/chunks/image-URNV2ABR.js +7 -0
- package/dist/chunks/{import-builders-LAISJVC4.js → import-builders-FC5ESQ34.js} +1 -1
- package/dist/chunks/{inspect-WYE74TOO.js → inspect-6KZERH2F.js} +1 -1
- package/dist/chunks/inspect-G5NDWTDB.js +9 -0
- package/dist/chunks/inspect-LYGYBYV3.js +13 -0
- package/dist/chunks/{inspect-NZIX5PW5.js → inspect-OBNVJRYC.js} +1 -1
- package/dist/chunks/{inspect-Y7MAI6NN.js → inspect-P4XEVJW5.js} +1 -1
- package/dist/chunks/list-5YBZG374.js +11 -0
- package/dist/chunks/{list-U7ZZ5HN6.js → list-AV5CMKBK.js} +1 -1
- package/dist/chunks/{list-IUAECVSK.js → list-ICJMKLOR.js} +1 -1
- package/dist/chunks/login-5VKAY2R5.js +9 -0
- package/dist/chunks/login-SUBW6IFU.js +7 -0
- package/dist/chunks/{logs-YHQ6C7QH.js → logs-BJL37R5U.js} +1 -1
- package/dist/chunks/ls-3Y2X26EY.js +11 -0
- package/dist/chunks/{ls-CLAXRPIK.js → ls-AKUJ4VUV.js} +1 -1
- package/dist/chunks/{ls-XO7ZHACJ.js → ls-EJ4THXVR.js} +1 -1
- package/dist/chunks/ls-QGJPVPLK.js +8 -0
- package/dist/chunks/{ls-V5G5SIGL.js → ls-SOTQGCPD.js} +1 -1
- package/dist/chunks/{ls-BAUM7ICU.js → ls-TXKT6RCY.js} +1 -1
- package/dist/chunks/{ls-3HMQEZEV.js → ls-VEWJPLJC.js} +1 -1
- package/dist/chunks/mutate-Y4KO4NAJ.js +9 -0
- package/dist/chunks/notifications-J3SMCQX5.js +7 -0
- package/dist/chunks/open-COGMMSHS.js +7 -0
- package/dist/chunks/openapi-TP6GEZGZ.js +7 -0
- package/dist/chunks/permissions-43WFISAY.js +7 -0
- package/dist/chunks/prompt-missing-credentials-5AQVXSFB.js +7 -0
- package/dist/chunks/publish-4NSLHSHF.js +15 -0
- package/dist/chunks/pull-MS2PVQUV.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-O2SEHZQG.js → purchase-domain-if-available-S43PVX5Y.js} +1 -1
- package/dist/chunks/push-2NBXVOX2.js +7 -0
- package/dist/chunks/{query-GDAAENV5.js → query-DI4FF2ZM.js} +1 -1
- package/dist/chunks/reauthenticate-Z62FFYZH.js +7 -0
- package/dist/chunks/reorder-P4AXRPMF.js +10 -0
- package/dist/chunks/reply-ULZRH7KA.js +9 -0
- package/dist/chunks/resolve-3IS44LUW.js +12 -0
- package/dist/chunks/resolve-agent-team-DDBPICVE.js +7 -0
- package/dist/chunks/restore-WM4EZHD4.js +16 -0
- package/dist/chunks/rm-4XX3UUUF.js +8 -0
- package/dist/chunks/rm-53YK7N2N.js +8 -0
- package/dist/chunks/rm-7Z6GJ4O2.js +8 -0
- package/dist/chunks/rm-C455A2EH.js +8 -0
- package/dist/chunks/rm-TRMBM6DD.js +8 -0
- package/dist/chunks/{routes-PKCKZ5T6.js → routes-3RJGIZYJ.js} +1 -1
- package/dist/chunks/rule-inspect-FMZTPH3S.js +8 -0
- package/dist/chunks/rules-K7XMFMXG.js +7 -0
- package/dist/chunks/{schema-3VHLYZBA.js → schema-5R44NJNE.js} +2 -2
- package/dist/chunks/schema-PQZAACV2.js +14 -0
- package/dist/chunks/select-org-GGUGYGDL.js +7 -0
- package/dist/chunks/set-SZPCOILW.js +7 -0
- package/dist/chunks/setup-and-link-OAS7PYL6.js +7 -0
- package/dist/chunks/tags-YS7EQDJY.js +7 -0
- package/dist/chunks/{types-HLISMAF6.js → types-FK3W7A2Y.js} +1 -1
- package/dist/chunks/{update-GH56IPQR.js → update-QVYTOT35.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 +691 -684
- package/dist/index.js +2 -5
- 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/add-BMUUEEVH.js +0 -8
- package/dist/chunks/add-HVM5P72U.js +0 -8
- package/dist/chunks/add-UGPZ3CCF.js +0 -8
- package/dist/chunks/build-TNTAXGN2.js +0 -7
- package/dist/chunks/chunk-42GFIWDH.js +0 -12
- package/dist/chunks/chunk-BKV35LVB.js +0 -7
- package/dist/chunks/chunk-BO2A5V7C.js +0 -8
- package/dist/chunks/chunk-JWO4AFKT.js +0 -27
- package/dist/chunks/chunk-LU5O3NH7.js +0 -9
- package/dist/chunks/chunk-QHKVAGWC.js +0 -20
- package/dist/chunks/chunk-R5FJNGWK.js +0 -10
- package/dist/chunks/chunk-TWRV6QGX.js +0 -7
- package/dist/chunks/chunk-WDNNB4RL.js +0 -8
- package/dist/chunks/clear-MRFK6SNK.js +0 -8
- package/dist/chunks/config-H7EMH632.js +0 -8
- package/dist/chunks/delete-TIWKKRQQ.js +0 -10
- package/dist/chunks/delete-TYLF74HP.js +0 -9
- package/dist/chunks/disable-SRIMYL73.js +0 -7
- package/dist/chunks/discard-F4Y2NOHU.js +0 -14
- package/dist/chunks/edit-3D6L76R3.js +0 -9
- package/dist/chunks/edit-5VW3WYFP.js +0 -8
- package/dist/chunks/enable-IPPUYI4D.js +0 -7
- package/dist/chunks/future-PZPJ3LBY.js +0 -7
- package/dist/chunks/image-2GMCXYKH.js +0 -7
- package/dist/chunks/inspect-PMOUB7TZ.js +0 -13
- package/dist/chunks/inspect-ZRNPBDR7.js +0 -9
- package/dist/chunks/list-5M4CTEGG.js +0 -11
- package/dist/chunks/login-JNMM2LCA.js +0 -9
- package/dist/chunks/login-ZRY2YGZM.js +0 -7
- package/dist/chunks/ls-53GH55RA.js +0 -8
- package/dist/chunks/ls-IUULJ6WA.js +0 -11
- package/dist/chunks/mutate-NEVQYFUV.js +0 -9
- package/dist/chunks/notifications-6AZQNEOE.js +0 -7
- package/dist/chunks/open-23Y6VJR4.js +0 -7
- package/dist/chunks/openapi-KBLEYOJR.js +0 -7
- package/dist/chunks/permissions-R6MSKYOZ.js +0 -7
- package/dist/chunks/prompt-missing-credentials-UML2SHRT.js +0 -7
- package/dist/chunks/publish-TBU3WUSE.js +0 -15
- package/dist/chunks/pull-M7CBRERS.js +0 -7
- package/dist/chunks/push-7LXD5RDV.js +0 -7
- package/dist/chunks/reauthenticate-6PGYUP3P.js +0 -7
- package/dist/chunks/reorder-S5CX2UNT.js +0 -10
- package/dist/chunks/reply-4G2J5O6V.js +0 -9
- package/dist/chunks/resolve-724ULLUY.js +0 -12
- package/dist/chunks/restore-EPBSJFSA.js +0 -16
- package/dist/chunks/rm-F3LLL6MZ.js +0 -8
- package/dist/chunks/rm-IDDLGKRZ.js +0 -8
- package/dist/chunks/rm-MI7NPJ4F.js +0 -8
- package/dist/chunks/rm-PWUJF6CB.js +0 -8
- package/dist/chunks/rm-WWPCSM3O.js +0 -8
- package/dist/chunks/rule-inspect-FFUYLBZG.js +0 -8
- package/dist/chunks/rules-YFLGPQRW.js +0 -7
- package/dist/chunks/schema-QRHP4WMY.js +0 -14
- package/dist/chunks/select-org-6BWIH3S3.js +0 -7
- package/dist/chunks/set-FPPF7W47.js +0 -7
- package/dist/chunks/setup-and-link-ENQEJG6L.js +0 -7
- package/dist/chunks/tags-JDL3PPLS.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{isNativeBinaryInstall}from"./chunk-
|
|
7
|
+
import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-KELSPU2J.js";import{packageName}from"./chunk-JESNVRVR.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile}from"child_process";import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var UnsupportedUpgradeInstallError=class extends Error{},globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args;return(await new Promise((resolve2,reject)=>{execFile(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{encoding:"utf8",windowsHide:!0,cwd:trustedUpgradeDirectory,timeout:15e3,env:{...env},signal},(error,stdout2)=>{error?reject(error):resolve2(stdout2)})})).trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){throwIfAborted(signal);let nativeExecutable=isNativeBinaryInstall()&&env.VERCEL_CLI_PACKAGE_EXECUTABLE,resolvedNativeExecutable=nativeExecutable&&await(0,import_fs_extra.realpath)(nativeExecutable).catch(()=>null),entrypoint=resolvedNativeExecutable&&resolvedNativeExecutable===await(0,import_fs_extra.realpath)(process.execPath).catch(()=>null)?env.VERCEL_CLI_PACKAGE_ENTRYPOINT:process.argv[1],installPath=entrypoint&&await(0,import_fs_extra.realpath)(entrypoint).catch(()=>null);if(!installPath)throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.");let packageManager=await detectGlobalPackageManager(installPath,packageName,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${packageName}@latest`),allowBuild=pnpmAllowBuildFlag(packageManager,"esbuild");return{command:`${packageManager} ${args.join(" ")}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return(await getUpdateCommandInfo()).command}export{trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,isGlobal,getUpdateCommandInfo,getUpdateCommand};
|
|
@@ -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{
|
|
7
|
+
import{getScope}from"./chunk-J53D7SLS.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-FZIRYAXC.js";import{getOrgById}from"./chunk-KELSPU2J.js";import{output_manager_default}from"./chunk-75IAMKGV.js";async function printProjectNotFoundError(client,projectNameOrId,commandName,orgId){let contextName;try{orgId?contextName=(await getOrgById(client,orgId))?.slug??orgId:contextName=(await getScope(client)).contextName}catch(err){contextName=orgId,output_manager_default.debug(`Scope lookup failed during error reporting: ${err}`)}let scopeClause=contextName?` (${contextName})`:"",headline=`Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`;if(output_manager_default.error(`${headline}
|
|
8
8
|
|
|
9
9
|
If it lives in a different team or account:
|
|
10
10
|
\u2022 Retry with \`--scope <team-slug|your-username>\`, or
|
|
@@ -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{outputError}from"./chunk-5UEBA6N6.js";import{
|
|
7
|
+
import{outputError}from"./chunk-5UEBA6N6.js";import{getScope}from"./chunk-J53D7SLS.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-FZIRYAXC.js";import{getLinkedProject,getProjectByNameOrId}from"./chunk-KELSPU2J.js";import{ProjectNotFound,isAPIError}from"./chunk-YIIPBH2D.js";function emitAlertsScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveAlertsScope(client,opts){let command=opts.command??"alerts",projectCommand=`${command} --project <name_or_id>`,allCommand=`${command} --all`;if(opts.all||opts.project){let{team}=await getScope(client);if(!team){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitAlertsScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project or --all with alerts.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}if(opts.all)return{teamId:team.id};let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,team.id)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${team.slug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitAlertsScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${team.slug}".`;return emitAlertsScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a valid project (replace <name_or_id>)"}]})}return{teamId:team.id,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or use --project <name> or --all.";return emitAlertsScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project or --all when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with an explicit project (replace <name_or_id>)"},{command:buildCommandWithGlobalFlags(client.argv,allCommand),when:"Use team-wide scope without a linked project"}]})}return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}export{emitAlertsScopeError,resolveAlertsScope};
|
|
@@ -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-JNJOUMGF.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};
|
|
@@ -4,6 +4,6 @@ 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{readJSONFile}from"./chunk-
|
|
7
|
+
import{readJSONFile}from"./chunk-ZKDWPKO2.js";import{getScope,writeToConfigFile}from"./chunk-J53D7SLS.js";import{require_types}from"./chunk-ZS2WS4AM.js";import{getArgs}from"./chunk-Z4OH72VZ.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{CantFindConfig,CantParseJSONFile,DeprecatedNowJson,WorkingDirectoryDoesNotExist}from"./chunk-YIIPBH2D.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-75IAMKGV.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_epipebomb=__commonJS({"../../node_modules/.pnpm/epipebomb@1.0.0/node_modules/epipebomb/epipebomb.js"(exports,module){module.exports=epipeBomb;function epipeBomb(stream,callback){stream==null&&(stream=process.stdout),callback==null&&(callback=process.exit);function epipeFilter(err){if(err.code==="EPIPE")return callback();stream.listeners("error").length<=1&&(stream.removeAllListeners(),stream.emit("error",err),stream.on("error",epipeFilter))}stream.on("error",epipeFilter)}}});var sentry;async function getSentry(){if(!sentry){let[SentryModule,{SENTRY_DSN},{default:pkg}]=await Promise.all([import("./cjs-2SMN43VH.js"),import("./constants-JAB7MRSK.js"),import("./pkg-EDJQLCNP.js")]),Sentry="init"in SentryModule?SentryModule:SentryModule.default;Sentry.init({dsn:SENTRY_DSN,release:`vercel-cli@${pkg.version}`,environment:"stable",autoSessionTracking:!1}),sentry=Sentry}return sentry}function isOutputDebugEnabled(debugFlag){return debugFlag===!0||process.env.VERCEL_CLI_DEBUG==="1"}var import_epipebomb=__toESM(require_epipebomb(),1),SILENCED_ERRORS=["DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead."],installed=!1;function installProcessGuards(){if(installed)return;installed=!0;let originalError=console.error;console.error=msg=>{SILENCED_ERRORS.some(error=>typeof msg=="string"&&msg.includes(error))||originalError(msg)},(0,import_epipebomb.default)()}var import_error_utils=__toESM(require_dist(),1);async function reportError(sentry2,client,error){if(ignoreError(error))return;let user,team,scopeError;try{({user,team}=await getScope(client))}catch(err){(0,import_error_utils.isError)(err)&&(scopeError=err)}sentry2.withScope(scope=>{if(user){let spec={email:user.email,id:user.id,username:user.username,name:user.name};scope.setUser(spec)}team&&scope.setTag("currentTeam",team.id),scopeError&&scope.setExtra("scopeError",{name:scopeError.name,message:scopeError.message,stack:scopeError.stack});let args,argsError;try{args=getArgs(process.argv.slice(2),{})}catch(err){(0,import_error_utils.isError)(err)&&(argsError=err)}if(args){let flags=["--env","--build-env","--token"];for(let flag of flags)args[flag]&&(args[flag]="REDACTED");args._.length>=4&&args._[0].startsWith("secret")&&args._[1]==="add"&&(args._[3]="REDACTED"),scope.setExtra("args",args)}else{let msg="Unable to parse args";argsError&&(msg+=`: ${argsError}`),scope.setExtra("args",msg)}scope.setExtra("node",{execPath:process.execPath,version:process.version,platform:process.platform}),sentry2.captureException(error)});let sentryClient=sentry2.getCurrentHub().getClient();sentryClient&&await sentryClient.close()}function ignoreError(error){return(0,import_error_utils.isError)(error)&&error.message.includes("uv_cwd")}var fatalErrorHandlerSymbol=Symbol.for("vercel.cli.fatal-error-handler");async function exitWithUnexpectedError(error){let handler=globalThis[fatalErrorHandlerSymbol];if(typeof handler=="function")try{await handler(error)}catch{}process.exit(1)}async function handleUnexpectedError(client,err){let{message}=err;return message.includes("sentry")&&message.includes("ENOTFOUND")?(output_manager_default.debug(`Sentry is not reachable: ${err}`),!1):(output_manager_default.error(`An unexpected error occurred!
|
|
8
8
|
${err.stack}`),await reportError(await getSentry(),client,err),!0)}function registerUnexpectedErrorHandlers(getClient){process.on("unhandledRejection",async err=>{recordCliError(cliErrorFromUnknown(err)),err?err instanceof Error?await handleUnexpectedError(getClient(),err):(output_manager_default.error(`An unexpected rejection occurred
|
|
9
9
|
${err}`),await reportError(await getSentry(),getClient(),err)):output_manager_default.error("An unexpected empty rejection occurred"),await exitWithUnexpectedError(err)}),process.on("uncaughtException",async error=>{await handleUnexpectedError(getClient(),error)&&await exitWithUnexpectedError(error)})}var import_types=__toESM(require_types(),1);import path from"path";var import_error_utils2=__toESM(require_dist(),1);var config;async function earlyGetConfig(configFile){if(config)return config;let localPath;try{localPath=process.cwd()}catch(err){if((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT")return new WorkingDirectoryDoesNotExist;throw err}if(configFile){let localFilePath=path.resolve(localPath,configFile);output_manager_default.debug(`Found config in provided --local-config path ${localFilePath}`);let localConfig=await readJSONFile(localFilePath);return localConfig instanceof CantParseJSONFile?localConfig:localConfig===null?new CantFindConfig([humanizePath(localFilePath)]):(config=localConfig,config[import_types.fileNameSymbol]=configFile,config)}let vercelFilePath=path.resolve(localPath,"vercel.json"),nowFilePath=path.resolve(localPath,"now.json"),[vercelConfig,nowConfig]=await Promise.all([readJSONFile(vercelFilePath),readJSONFile(nowFilePath)]);return vercelConfig instanceof CantParseJSONFile?vercelConfig:nowConfig instanceof CantParseJSONFile?nowConfig:vercelConfig!==null?(output_manager_default.debug(`Found config in file "${vercelFilePath}"`),config=vercelConfig,config[import_types.fileNameSymbol]="vercel.json",config):nowConfig!==null?new DeprecatedNowJson(nowFilePath):new CantFindConfig([vercelFilePath].map(humanizePath))}var fallbackReason;function recordDirectBuildFallback(reason){fallbackReason=reason}function getDirectBuildFallbackAttributes(){return fallbackReason===void 0?void 0:{directBuild:"false",fallbackReason}}function checkTelemetryStatus({config:config2}){config2.telemetry||process.env.VERCEL_TELEMETRY_DISABLED||(output_manager_default.note("The Vercel CLI now collects telemetry regarding usage of the CLI."),output_manager_default.log("This information is used to shape the CLI roadmap and prioritize features."),output_manager_default.log("You can learn more, including how to opt-out if you'd not like to participate in this program, by visiting the following URL:"),output_manager_default.log("https://vercel.com/docs/cli/about-telemetry"),config2.telemetry={enabled:!0},writeToConfigFile(config2))}export{getSentry,isOutputDebugEnabled,installProcessGuards,reportError,exitWithUnexpectedError,handleUnexpectedError,registerUnexpectedErrorHandlers,earlyGetConfig,recordDirectBuildFallback,getDirectBuildFallbackAttributes,checkTelemetryStatus};
|
|
@@ -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{
|
|
7
|
+
import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{agentErrorMetadata,buildCommandWithGlobalFlags,clientObservabilityPlanRecovery,getErrorRecovery,trackAgentError}from"./chunk-FZIRYAXC.js";import{isAPIError}from"./chunk-YIIPBH2D.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function getRollupColumnName(metric,aggregation){return`${metric}_${aggregation}`.replace(/[./]/g,"_")}function getResolvedOrderMetadata(query,response){let orderBy=query.orderBy??(response.orderBy?"count":void 0),orderDirection=response.orderDirection??query.orderDirection;return{...orderBy?{orderBy}:{},...orderDirection?{orderDirection}:{}}}function formatQueryJson(query,response){let orderMetadata=getResolvedOrderMetadata(query,response),queryWithResponseMetadata={...query,...orderMetadata};return JSON.stringify({query:queryWithResponseMetadata,summary:response.summary??[],data:response.data??[],...orderMetadata},null,2)}function formatErrorJson(code,message,allowedValues,recovery={}){let error={code,message};return allowedValues&&allowedValues.length>0&&(error.allowedValues=allowedValues),JSON.stringify({error:{...error,...recovery}},null,2)}function projectSelectorFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg.startsWith("--project="))return arg.slice(10);if(arg==="--project"&&i+1<args.length)return args[i+1]}}function hintRestatesCommand(hint,steps){if(!steps?.length)return!1;let plain=(0,import_strip_ansi.default)(hint).replace(/`/g,"").trim();return steps.some(step=>{let command=step.command.trim();return command===plain||command.startsWith(`${plain} `)})}function handleApiError(err,jsonOutput,client,overrides={},target={}){let code,message,override=overrides[err.status];if(override)code=override.code||err.code||"BAD_REQUEST",message=override.message;else switch(err.status){case 402:code=err.code||"PAYMENT_REQUIRED",message=err.serverMessage||"This feature requires an Observability Plus subscription.";break;case 429:code=err.code||"RATE_LIMITED",message=err.serverMessage||"You have reached the metrics query rate limit. Please wait and try again. If you need a higher limit, request one from your Vercel account team.";break;case 403:code="FORBIDDEN",message=err.serverMessage&&err.serverMessage!=="Response Error"?err.serverMessage:"You do not have permission to query metrics for this project/team.";break;case 500:code="INTERNAL_ERROR",message="An internal error occurred. Please try again later.";break;case 504:code="TIMEOUT",message="The query timed out. Try a shorter time range or fewer groups.";break;case 400:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`;break;default:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`}let billing=err.status===402?clientObservabilityPlanRecovery(client,err,message,target.projectName??projectSelectorFromArgv(client.argv),target.scope):void 0,recovery={...getErrorRecovery({...err,serverMessage:message},client),...billing&&{hint:billing.hint}},next=billing?.command?[{command:buildCommandWithGlobalFlags(client.argv.filter(arg=>!/^(?:--yes|--force|-y)(?:=|$)/.test(arg)),billing.command,void 0,{excludeFlags:billing.excludeFlags,preserveProject:billing.preserveProject}),when:billing.when}]:void 0;recovery.hint&&hintRestatesCommand(recovery.hint,next)&&delete recovery.hint;let details={...recovery,...next&&{next},...agentErrorMetadata(client)};if(trackAgentError(client,{reason:err.status===403?"forbidden":err.status===402?"payment_required":err.status===429?"rate_limited":code,...recovery}),jsonOutput||client.nonInteractive)client.stdout.write(formatErrorJson(code,message,err.allowedValues,details));else{output_manager_default.fatal(message),recovery.hint&&output_manager_default.print(` ${recovery.hint}
|
|
8
8
|
`);for(let step of next??[])output_manager_default.print(` ${step.command}
|
|
9
9
|
`);err.allowedValues&&err.allowedValues.length>0&&output_manager_default.print(`
|
|
10
10
|
Available values: ${err.allowedValues.join(", ")}
|
|
@@ -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{outputError,writeJsonError}from"./chunk-5UEBA6N6.js";import{resolveProjectContext}from"./chunk-
|
|
7
|
+
import{outputError,writeJsonError}from"./chunk-5UEBA6N6.js";import{resolveProjectContext}from"./chunk-AR5T62PK.js";import{printError}from"./chunk-OZ47SVXA.js";import{detectExplicitScope,getScope}from"./chunk-J53D7SLS.js";import{getLinkedProject}from"./chunk-KELSPU2J.js";import{isAPIError}from"./chunk-YIIPBH2D.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-75IAMKGV.js";function handleCommentsParseError(err,subcommandName){return printError(err),err instanceof Error&&/unknown or unexpected option: -[^-]/.test(err.message)&&output_manager_default.log(`An argument starting with "-"? Put it after \`--\`: ${getCommandName(`comments ${subcommandName} -- <arg>`)}`),output_manager_default.log(`Run ${getCommandName(`comments ${subcommandName} --help`)} for usage.`),2}function threadNotFoundMessage(threadId,scope){return`Comment not found: ${threadId} in team ${scope.teamSlug??scope.teamId}. If it belongs to another team, pass --scope <team>.`}function query(teamId,params={}){let search=new URLSearchParams({teamId});for(let[key,value]of Object.entries(params))if(value!==void 0)if(Array.isArray(value))for(let entry of value)search.append(key,entry);else search.set(key,String(value));return search.toString()}var fetchOpts={useCurrentTeam:!1};function listThreads(client,teamId,params){return client.fetch(`/toolbar/threads?${query(teamId,{...params})}`,fetchOpts)}function getThread(client,teamId,threadId){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,fetchOpts)}function updateThread(client,teamId,threadId,resolved){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,{...fetchOpts,method:"PATCH",body:{resolved}})}function listMessages(client,teamId,threadId,opts={}){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId,{...opts})}`,fetchOpts)}function addMessage(client,teamId,threadId,body){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId)}`,{...fetchOpts,method:"POST",body})}function updateMessage(client,teamId,threadId,messageId,body){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,{...fetchOpts,method:"PATCH",body})}function deleteMessage(client,teamId,threadId,messageId){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,{...fetchOpts,method:"DELETE"})}function toApiErrorParts(err){let apiErr=err;return{code:apiErr.code||"API_ERROR",message:apiErr.serverMessage||`API error (${apiErr.status??"unknown"}).`}}import{spawnSync}from"node:child_process";async function resolveCommentsScope(client,opts){if(opts.urlTeamSlug&&!opts.project&&!detectExplicitScope(client))return{teamId:opts.urlTeamSlug,teamSlug:opts.urlTeamSlug};if(opts.project){let context;try{context=await resolveProjectContext({client,projectNameOrId:opts.project,projectNotFoundHandling:opts.jsonOutput?"return":"report"})}catch(err){if(isAPIError(err))return outputError(client,opts.jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`);throw err}return context.status==="error"?(opts.jsonOutput&&writeJsonError(client,"PROJECT_CONTEXT_ERROR","Could not resolve the project context."),context.exitCode):context.status==="not_linked"?outputError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",`Project "${opts.project}" was not found in the current scope.`):{teamId:context.org.id,teamSlug:context.org.slug,projectId:context.project.id,projectName:context.project.name,linked:!!context.repoRoot}}let linked=await getLinkedProject(client);if(linked.status==="error")return linked.exitCode;if(linked.status==="linked"){if(detectExplicitScope(client)){let{team:team2}=await getScope(client);if(!team2)return outputError(client,opts.jsonOutput,"NO_TEAM","No team context found for --scope.");if(team2.id!==linked.org.id)return opts.requireProject?outputError(client,opts.jsonOutput,"SCOPE_PROJECT_MISMATCH",`--scope ${team2.slug} does not match the linked project's team (${linked.org.slug}). Pass --project <name-or-id> for a project in ${team2.slug}.`):{teamId:team2.id,teamSlug:team2.slug}}return{teamId:linked.org.id,teamSlug:linked.org.slug,projectId:linked.project.id,projectName:linked.project.name,linked:!0}}if(opts.requireProject)return outputError(client,opts.jsonOutput,"NOT_LINKED","No linked project found. Run `vercel link` to link a project, or pass --project <name-or-id>.");let{team}=await getScope(client);return team?{teamId:team.id,teamSlug:team.slug}:outputError(client,opts.jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, or run `vercel link` in a project directory.")}function inferBranch(cwd){let result=spawnSync("git",["rev-parse","--abbrev-ref","HEAD"],{cwd,encoding:"utf8"});if(result.status===0){let branch=result.stdout.trim();if(branch&&branch!=="HEAD")return{value:branch,source:"git"}}let ciRef=process.env.VERCEL_GIT_COMMIT_REF||process.env.GITHUB_HEAD_REF||process.env.GITHUB_REF_NAME;if(ciRef)return{value:ciRef,source:"ci"}}export{handleCommentsParseError,threadNotFoundMessage,listThreads,getThread,updateThread,listMessages,addMessage,updateMessage,deleteMessage,toApiErrorParts,resolveCommentsScope,inferBranch};
|