vercel 64.1.0 → 64.3.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-JH6ALI3H.js → add-5RV75RPG.js} +1 -1
- package/dist/chunks/{add-XZJ4G2MM.js → add-RFCYPSPS.js} +1 -1
- package/dist/chunks/{add-GEAC4RAQ.js → add-UXOTAL3N.js} +1 -1
- package/dist/chunks/{build-3T6EUCCK.js → build-SE3QLNVF.js} +1 -1
- package/dist/chunks/{chunk-SD757OFS.js → chunk-26Z4U6G4.js} +2 -2
- package/dist/chunks/{chunk-XEQT373M.js → chunk-2B3A3MOX.js} +1 -1
- package/dist/chunks/{chunk-RZGWCQP7.js → chunk-2FHICLHJ.js} +1 -1
- package/dist/chunks/{chunk-AG5QQNJ3.js → chunk-2UMWTCY7.js} +1 -1
- package/dist/chunks/{chunk-Z6UFAIEX.js → chunk-444RE4Z5.js} +1 -1
- package/dist/chunks/{chunk-5VWJIYJE.js → chunk-6GIP2YPX.js} +1 -1
- package/dist/chunks/{chunk-PJMVU4JC.js → chunk-6HOVHRWJ.js} +3 -3
- package/dist/chunks/chunk-6ZRULOO3.js +7 -0
- package/dist/chunks/{chunk-JGPRCZC2.js → chunk-7GFRZWLE.js} +1 -1
- package/dist/chunks/{chunk-BAJDLMZS.js → chunk-A63VVXW2.js} +1 -1
- package/dist/chunks/{chunk-RFEREQPS.js → chunk-AA434KXY.js} +1 -1
- package/dist/chunks/{chunk-YNIW7DTL.js → chunk-AALI66ML.js} +1 -1
- package/dist/chunks/{chunk-DW3TSGVC.js → chunk-AQUDXMFH.js} +1 -1
- package/dist/chunks/chunk-BAT6SDBJ.js +10 -0
- package/dist/chunks/chunk-BTCKMXWW.js +7 -0
- package/dist/chunks/{chunk-VM6TZGLE.js → chunk-CMKLX4DC.js} +1 -1
- package/dist/chunks/{chunk-MYCQIZU6.js → chunk-CN3IVZJO.js} +1 -1
- package/dist/chunks/{chunk-JSBEAHKA.js → chunk-CYV3X62I.js} +1 -1
- package/dist/chunks/{chunk-EO7GUARB.js → chunk-DNDBPLLI.js} +1 -1
- package/dist/chunks/{chunk-WQIGKVBV.js → chunk-DNTQK2SW.js} +1 -1
- package/dist/chunks/{chunk-37QGCN6P.js → chunk-E6R2QOOR.js} +1 -1
- package/dist/chunks/{chunk-Z4OH72VZ.js → chunk-ELDHGU6N.js} +1 -1
- package/dist/chunks/{chunk-DYQXJCHO.js → chunk-EVQJ7SCV.js} +1 -1
- package/dist/chunks/{chunk-JAQM6UXY.js → chunk-EXPLBM7J.js} +1 -1
- package/dist/chunks/{chunk-VRWPRZJY.js → chunk-FLBI6DY2.js} +1 -1
- package/dist/chunks/{chunk-ASU72O2R.js → chunk-G2IJOQR3.js} +1 -1
- package/dist/chunks/{chunk-UBKETNGO.js → chunk-GCSAJUL6.js} +1 -1
- package/dist/chunks/{chunk-XXDVZWWM.js → chunk-GF7EG5IA.js} +1 -1
- package/dist/chunks/{chunk-ELI3L2UX.js → chunk-GJP22N6R.js} +1 -1
- package/dist/chunks/{chunk-JNPG7MVL.js → chunk-GLJH35MJ.js} +1 -1
- package/dist/chunks/{chunk-TBLIJ2PS.js → chunk-GNV6PG6W.js} +1 -1
- package/dist/chunks/{chunk-M7GT3ZPT.js → chunk-GVVIFYQE.js} +1 -1
- package/dist/chunks/{chunk-JESE5FPO.js → chunk-GWZ4VPU3.js} +2 -2
- package/dist/chunks/{chunk-NJINP2WU.js → chunk-H3KYG32S.js} +2 -2
- package/dist/chunks/chunk-H7CRPXOA.js +14 -0
- package/dist/chunks/{chunk-JEPRHNQU.js → chunk-HJRAWEA2.js} +1 -1
- package/dist/chunks/{chunk-NFJPCOTV.js → chunk-HTLGLTKD.js} +2 -2
- package/dist/chunks/{chunk-E6UKNYFF.js → chunk-HVUJNVPS.js} +1 -1
- package/dist/chunks/{chunk-J53D7SLS.js → chunk-IIC2A4YN.js} +1 -1
- package/dist/chunks/{chunk-N7Q2IESO.js → chunk-IJCCFLCQ.js} +1 -1
- package/dist/chunks/{chunk-QYDG63GL.js → chunk-IL7X6EKK.js} +1 -1
- package/dist/chunks/{chunk-XD2LZRBS.js → chunk-IQ7FPAI4.js} +1 -1
- package/dist/chunks/{chunk-QJKJBD2M.js → chunk-ITKS32PG.js} +1 -1
- package/dist/chunks/{chunk-J2LAZELI.js → chunk-IVIZLWZQ.js} +1 -1
- package/dist/chunks/{chunk-YCXZZSW6.js → chunk-IYCHAIFZ.js} +1 -1
- package/dist/chunks/{chunk-UFXKCETS.js → chunk-J6O6JW2K.js} +1 -1
- package/dist/chunks/{chunk-G6B6TVAE.js → chunk-JCTXRR4A.js} +1 -1
- package/dist/chunks/{chunk-IDGWQE4B.js → chunk-JV6IPUGX.js} +1 -1
- package/dist/chunks/{chunk-JJSDRKX4.js → chunk-KGXW36FQ.js} +2 -2
- package/dist/chunks/{chunk-GSOPJJO5.js → chunk-KKCBFBJK.js} +1 -1
- package/dist/chunks/{chunk-FWFTX2WE.js → chunk-KKQL4AKH.js} +1 -1
- package/dist/chunks/{chunk-JNJOUMGF.js → chunk-KUGXOLL7.js} +1 -1
- package/dist/chunks/{chunk-JLXG2XWW.js → chunk-LD5U73LA.js} +1 -1
- package/dist/chunks/{chunk-75IAMKGV.js → chunk-M774HRX5.js} +2 -2
- package/dist/chunks/{chunk-5IPBCD7K.js → chunk-MI7W4QMV.js} +1 -1
- package/dist/chunks/{chunk-THSHYFA6.js → chunk-MMPQC2N6.js} +1 -1
- package/dist/chunks/{chunk-FIIHB66A.js → chunk-MV4WHUIC.js} +1 -1
- package/dist/chunks/{chunk-SYEKOJHT.js → chunk-MZ3QGJH3.js} +1 -1
- package/dist/chunks/{chunk-ZKDWPKO2.js → chunk-MZLQY2EQ.js} +1 -1
- package/dist/chunks/{chunk-OGCVOINQ.js → chunk-OCOVCC5Q.js} +1 -1
- package/dist/chunks/{chunk-ZUCSA4IW.js → chunk-OJKZ7EV3.js} +1 -1
- package/dist/chunks/{chunk-67NNB6S6.js → chunk-OUTCLR64.js} +1 -1
- package/dist/chunks/chunk-Q5ZGA2RO.js +7 -0
- package/dist/chunks/{chunk-OZ47SVXA.js → chunk-QAETJRKX.js} +1 -1
- package/dist/chunks/{chunk-7YRPMVZK.js → chunk-QC3HEGFD.js} +1 -1
- package/dist/chunks/{chunk-YBOS65VB.js → chunk-QC5AMRWR.js} +1 -1
- package/dist/chunks/{chunk-MJD6WHG4.js → chunk-QCWV7FML.js} +1 -1
- package/dist/chunks/{chunk-FBJWLH2A.js → chunk-TCYAAWLB.js} +1 -1
- package/dist/chunks/{chunk-MFIVZXHH.js → chunk-TDDZGUU6.js} +1 -1
- package/dist/chunks/{chunk-S7XZC23O.js → chunk-TPVAPVQC.js} +1 -1
- package/dist/chunks/{chunk-KELSPU2J.js → chunk-U3NQZJQ4.js} +8 -8
- package/dist/chunks/{chunk-GRTIWUV2.js → chunk-UCAE5Z5L.js} +1 -1
- package/dist/chunks/{chunk-L5FUUGYX.js → chunk-UGMTKOTN.js} +1 -1
- package/dist/chunks/{chunk-OJZEOWK2.js → chunk-VRWLNWNE.js} +1 -1
- package/dist/chunks/{chunk-R5K37TXM.js → chunk-VVAZC5IO.js} +1 -1
- package/dist/chunks/chunk-W3TGCMRW.js +9 -0
- package/dist/chunks/{chunk-UDQYOGSQ.js → chunk-WGOQGKS5.js} +1 -1
- package/dist/chunks/{chunk-3EYOQC4R.js → chunk-WYI4VNXT.js} +1 -1
- package/dist/chunks/{chunk-YI5G2A3V.js → chunk-XJXX4QXA.js} +1 -1
- package/dist/chunks/{chunk-YIIPBH2D.js → chunk-XSDAUM4F.js} +1 -1
- package/dist/chunks/{chunk-ZMBDYOVN.js → chunk-XW4ZWX3I.js} +1 -1
- package/dist/chunks/{chunk-2JBVMF2Y.js → chunk-Y24OSBXP.js} +1 -1
- package/dist/chunks/{chunk-A5R2HHNK.js → chunk-YROIQRYI.js} +1 -1
- package/dist/chunks/{chunk-4ZICRXI5.js → chunk-YS542RHZ.js} +1 -1
- package/dist/chunks/{chunk-KAJM2NEI.js → chunk-YUYCSDCO.js} +1 -1
- package/dist/chunks/{chunk-3AVG55SO.js → chunk-ZBDLYNUF.js} +1 -1
- package/dist/chunks/{chunk-HAVEFTOO.js → chunk-ZE53XHAY.js} +1 -1
- package/dist/chunks/{chunk-WLK5BBNP.js → chunk-ZLWTPS5T.js} +1 -1
- package/dist/chunks/{chunk-5UEBA6N6.js → chunk-ZQKDO5PL.js} +1 -1
- package/dist/chunks/{chunk-WPQN5UKR.js → chunk-ZQME5XUJ.js} +1 -1
- package/dist/chunks/{chunk-WHVT7UXE.js → chunk-ZVLDGT4O.js} +1 -1
- package/dist/chunks/{chunk-N7L3XLWC.js → chunk-ZZ3LJ22B.js} +1 -1
- package/dist/chunks/{clear-XCZCETRU.js → clear-2VHJFFMM.js} +1 -1
- package/dist/chunks/{compile-vercel-config-NQKOGOPH.js → compile-vercel-config-ADKZDUAU.js} +1 -1
- package/dist/chunks/{config-CIM647OM.js → config-6YWGF4CO.js} +1 -1
- package/dist/chunks/{config-P42IQJDF.js → config-VAOXMKVX.js} +1 -1
- package/dist/chunks/{connect-git-provider-VJYXBRYG.js → connect-git-provider-2JIBL3ST.js} +1 -1
- package/dist/chunks/{delete-MVJ3NENU.js → delete-FEUSV3JO.js} +1 -1
- package/dist/chunks/{delete-KJMVCQ7C.js → delete-YW2NH7VG.js} +1 -1
- package/dist/chunks/{detect-services-UYQZT6MU.js → detect-services-A2B6KJO5.js} +1 -1
- package/dist/chunks/{disable-666GPFHE.js → disable-KA6PS2CZ.js} +1 -1
- package/dist/chunks/{discard-RUQPJMOG.js → discard-ZNUPAJTQ.js} +1 -1
- package/dist/chunks/{edit-IIM7GKC2.js → edit-D7VE55ZF.js} +1 -1
- package/dist/chunks/{edit-NRJCMP4B.js → edit-YTYYBVZN.js} +1 -1
- package/dist/chunks/{enable-FVXIP7NX.js → enable-Q4OCTJIJ.js} +1 -1
- package/dist/chunks/{exec-QZXH5RXR.js → exec-NMRO6DIZ.js} +2 -2
- package/dist/chunks/{export-VPGLK5KL.js → export-UX6JVWOD.js} +1 -1
- package/dist/chunks/{future-MDYFVS3M.js → future-6UTK4EFE.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-MWXVKKFQ.js → generate-cert-for-deploy-WDKFR34X.js} +1 -1
- package/dist/chunks/{image-URNV2ABR.js → image-IL7IN7MD.js} +1 -1
- package/dist/chunks/{import-builders-FC5ESQ34.js → import-builders-FX2XXVRT.js} +1 -1
- package/dist/chunks/{inspect-LYGYBYV3.js → inspect-E2HPGMNI.js} +1 -1
- package/dist/chunks/{inspect-P4XEVJW5.js → inspect-F6NLCWHN.js} +1 -1
- package/dist/chunks/{inspect-6KZERH2F.js → inspect-UNZR445S.js} +1 -1
- package/dist/chunks/{inspect-OBNVJRYC.js → inspect-UPXTGUJQ.js} +1 -1
- package/dist/chunks/{inspect-G5NDWTDB.js → inspect-YAMAGNIW.js} +1 -1
- package/dist/chunks/{list-5YBZG374.js → list-FDYB6GHF.js} +1 -1
- package/dist/chunks/{list-ICJMKLOR.js → list-G4E6RG3V.js} +1 -1
- package/dist/chunks/{list-AV5CMKBK.js → list-GDI5O246.js} +1 -1
- package/dist/chunks/{login-SUBW6IFU.js → login-HU5OFS7T.js} +1 -1
- package/dist/chunks/{login-5VKAY2R5.js → login-XYYNIAMM.js} +1 -1
- package/dist/chunks/{logs-BJL37R5U.js → logs-EWXTZN4W.js} +1 -1
- package/dist/chunks/{ls-QGJPVPLK.js → ls-3GNX6IPE.js} +1 -1
- package/dist/chunks/{ls-TXKT6RCY.js → ls-A3HIPTF5.js} +1 -1
- package/dist/chunks/{ls-3Y2X26EY.js → ls-A4NEYMKP.js} +1 -1
- package/dist/chunks/{ls-SOTQGCPD.js → ls-CGZ3NL5R.js} +1 -1
- package/dist/chunks/{ls-AKUJ4VUV.js → ls-MO3R46TQ.js} +1 -1
- package/dist/chunks/{ls-EJ4THXVR.js → ls-SZKDUJHV.js} +1 -1
- package/dist/chunks/{ls-VEWJPLJC.js → ls-TCB7UUPP.js} +1 -1
- package/dist/chunks/{mutate-Y4KO4NAJ.js → mutate-BQAP2S7A.js} +1 -1
- package/dist/chunks/{notifications-J3SMCQX5.js → notifications-TDSFYYNB.js} +1 -1
- package/dist/chunks/{open-COGMMSHS.js → open-YPOEUM3S.js} +1 -1
- package/dist/chunks/{openapi-TP6GEZGZ.js → openapi-BQSQNXQE.js} +1 -1
- package/dist/chunks/{permissions-43WFISAY.js → permissions-6LOJKL5W.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-5AQVXSFB.js → prompt-missing-credentials-IGTCFUA6.js} +1 -1
- package/dist/chunks/{publish-4NSLHSHF.js → publish-CATCXJZG.js} +1 -1
- package/dist/chunks/pull-CXUNHWAO.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-S43PVX5Y.js → purchase-domain-if-available-4YKWAHH5.js} +1 -1
- package/dist/chunks/{push-2NBXVOX2.js → push-KZZE3AQ3.js} +1 -1
- package/dist/chunks/{query-DI4FF2ZM.js → query-GHFOZV7K.js} +1 -1
- package/dist/chunks/{reauthenticate-Z62FFYZH.js → reauthenticate-W7QIXLZ3.js} +1 -1
- package/dist/chunks/{reorder-P4AXRPMF.js → reorder-XU55LOZ5.js} +1 -1
- package/dist/chunks/{reply-ULZRH7KA.js → reply-B2XOCSZD.js} +1 -1
- package/dist/chunks/{resolve-3IS44LUW.js → resolve-H4BZ2QI3.js} +1 -1
- package/dist/chunks/{resolve-agent-team-DDBPICVE.js → resolve-agent-team-43HZCPF3.js} +1 -1
- package/dist/chunks/{restore-WM4EZHD4.js → restore-AJLS2N6C.js} +1 -1
- package/dist/chunks/{rm-4XX3UUUF.js → rm-2TR2KBDP.js} +1 -1
- package/dist/chunks/{rm-7Z6GJ4O2.js → rm-IGY6LD6H.js} +1 -1
- package/dist/chunks/{rm-TRMBM6DD.js → rm-N6ZUA66Z.js} +1 -1
- package/dist/chunks/{rm-C455A2EH.js → rm-OI5VS7GG.js} +1 -1
- package/dist/chunks/{rm-53YK7N2N.js → rm-ZQUVOC3V.js} +1 -1
- package/dist/chunks/{routes-3RJGIZYJ.js → routes-TCMUHSJF.js} +1 -1
- package/dist/chunks/{rule-inspect-FMZTPH3S.js → rule-inspect-NLEABBTP.js} +1 -1
- package/dist/chunks/{rules-K7XMFMXG.js → rules-SVLVB6YB.js} +1 -1
- package/dist/chunks/{schema-5R44NJNE.js → schema-HWS2SOZS.js} +1 -1
- package/dist/chunks/{schema-PQZAACV2.js → schema-KG4RWQBC.js} +1 -1
- package/dist/chunks/{select-org-GGUGYGDL.js → select-org-AAB5RBSB.js} +1 -1
- package/dist/chunks/{set-SZPCOILW.js → set-AJEMEBZU.js} +1 -1
- package/dist/chunks/setup-and-link-6AIRWXXX.js +7 -0
- package/dist/chunks/{tags-YS7EQDJY.js → tags-O6R6VWPP.js} +1 -1
- package/dist/chunks/{types-FK3W7A2Y.js → types-Y3NJROKH.js} +1 -1
- package/dist/chunks/{update-QVYTOT35.js → update-C7XR7CHI.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 +776 -715
- 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 +58 -57
- package/dist/chunks/chunk-AR5T62PK.js +0 -7
- package/dist/chunks/chunk-AU42HSQ3.js +0 -7
- package/dist/chunks/chunk-CSIUJLB7.js +0 -9
- package/dist/chunks/chunk-FLQJAP2A.js +0 -14
- package/dist/chunks/chunk-FZIRYAXC.js +0 -10
- package/dist/chunks/chunk-QC47UKDR.js +0 -7
- package/dist/chunks/pull-MS2PVQUV.js +0 -7
- package/dist/chunks/setup-and-link-OAS7PYL6.js +0 -7
|
@@ -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{emitAlertsScopeError,resolveAlertsScope}from"./chunk-
|
|
7
|
+
import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-WGOQGKS5.js";import{getExitCodeForErrorCode,handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-ZQKDO5PL.js";import{isJSONObject}from"./chunk-6HOVHRWJ.js";import{getScope}from"./chunk-IIC2A4YN.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getExitCodeForReason,outputAgentError}from"./chunk-BAT6SDBJ.js";import{getProjectByNameOrId}from"./chunk-U3NQZJQ4.js";import{ProjectNotFound,isAPIError}from"./chunk-XSDAUM4F.js";import{output_manager_default}from"./chunk-M774HRX5.js";async function resolveRulesTeam(client,jsonOutput){let{team}=await getScope(client,{resolveLocalScope:!0});return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Alert rules belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="alerts rules ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts rules --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}import{readFileSync}from"fs";import{resolve}from"path";function rulesCollectionPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`/alerts/v3/alert-rules?${query.toString()}`}function rulesItemPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`/alerts/v3/alert-rules/notifications?${query.toString()}`}function rulesNotificationLinksPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`/alerts/v3/alert-rules/schema?${query.toString()}`}async function fetchRule(client,scope,ruleId){return(await client.fetch(rulesItemPath(scope.teamId,ruleId))).rule}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; "),exitCode=options.reason!==void 0?getExitCodeForReason(options.reason):getExitCodeForErrorCode(code);return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},exitCode),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
|
|
8
8
|
`):output_manager_default.fatal([message,...issues.map(issue=>` ${issue.path}: ${issue.message}`)].join(`
|
|
9
9
|
`)),exitCode}function handleRulesApiError(client,err,jsonOutput){let message=err.status===401?"You do not have access to alert rules in this team. Ensure your role can manage Alert Rules, or pass --token and --scope.":err.status===403?err.serverMessage||"You do not have permission to manage alert rules in this team.":err.status>=500?`The alert rules endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`:err.serverMessage||`API error (${err.status}).`;return outputRulesError(client,jsonOutput,err.code||"API_ERROR",message,{reason:err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR,issues:getIssues(err),hint:err.status===401||err.status===403?"Confirm the team with `vercel whoami`; use --scope <team-slug> if the rule belongs to another team.":void 0})}var LEGACY_BODY_FIELDS=["alertTypes","customAlert","queryJsonString"];function readRuleBody(client,bodyPath,jsonOutput){let raw;try{raw=readFileSync(resolve(client.cwd,bodyPath),"utf8")}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS",`Could not read --body file: ${bodyPath}`)}let parsed;try{parsed=JSON.parse(raw)}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","Invalid JSON in --body file.")}return isJSONObject(parsed)?LEGACY_BODY_FIELDS.some(field=>Object.hasOwn(parsed,field))?outputRulesError(client,jsonOutput,"LEGACY_ALERT_RULE_BODY","This body uses the previous alert-rules shape. Rewrite it using the current schema.",{hint:"Run `vercel alerts rules schema --type built-in` for examples."}):parsed:outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","The --body file must contain a JSON object.")}function getBodyType(body){return body.type==="built-in"||body.type==="custom"?body.type:void 0}function emitRulesArgParseError(client,err,recoverWithProjectFlag){let message=err instanceof Error?err.message:String(err),projectFlagMissingArg=message.includes("--project")&&message.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":message,next:[{command:buildCommandWithGlobalFlags(client.argv,projectFlagMissingArg?recoverWithProjectFlag:"alerts rules --help"),when:projectFlagMissingArg?"Retry with a project name or id":"See valid `alerts rules` subcommands"}]},2)}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope,rulesCollectionPath,rulesItemPath,ruleNotificationsPath,rulesNotificationsPath,rulesNotificationLinksPath,rulesSchemaPath,fetchRule,outputRulesError,handleRulesApiError,readRuleBody,getBodyType,emitRulesArgParseError};
|
|
@@ -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{require_dist}from"./chunk-O4FDRZ22.js";import{getDeployment}from"./chunk-
|
|
7
|
+
import{require_dist}from"./chunk-O4FDRZ22.js";import{getDeployment}from"./chunk-IVIZLWZQ.js";import{getScope}from"./chunk-IIC2A4YN.js";import{toNodeReadable}from"./chunk-MY4MONOH.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_ansi_escapes}from"./chunk-YHPPP3SF.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_parser=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/lib/parser.js"(exports,module){var Transform=__require("stream").Transform;function Parser(options){if(!(this instanceof Parser))throw new TypeError("Cannot call a class as a function");options=options||{},Transform.call(this,{objectMode:!0}),this._memory="",this._emitInvalidLines=options.emitInvalidLines||!1}Parser.prototype=Object.create(Transform.prototype);Parser.prototype._handleLines=function(lines,cb){for(var i=0;i<lines.length;i++)if(lines[i]!==""){var err=null,json=null;try{json=JSON.parse(lines[i])}catch(_err){_err.source=lines[i],err=_err}if(err)if(this._emitInvalidLines)this.emit("invalid-line",err);else return cb(err);else this.push(json)}cb(null)};Parser.prototype._transform=function(chunk,encoding,cb){var lines=(this._memory+chunk.toString()).split(`
|
|
8
8
|
`);this._memory=lines.pop(),this._handleLines(lines,cb)};Parser.prototype._flush=function(cb){if(!this._memory)return cb(null);var line=this._memory;this._memory="",this._handleLines([line],cb)};module.exports=Parser}});var require_stringifier=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/lib/stringifier.js"(exports,module){var Transform=__require("stream").Transform;function Stringifier(){if(!(this instanceof Stringifier))throw new TypeError("Cannot call a class as a function");Transform.call(this,{objectMode:!0})}Stringifier.prototype=Object.create(Transform.prototype);Stringifier.prototype._transform=function(data,_,cb){var value;try{value=JSON.stringify(data)}catch(err){return err.source=data,cb(err)}cb(null,value+`
|
|
9
9
|
`)};module.exports=Stringifier}});var require_jsonlines=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/index.js"(exports){var Parser=require_parser(),Stringifier=require_stringifier();exports.parse=function(options){return new Parser(options)};exports.stringify=function(){return new Stringifier}}});var import_async_retry=__toESM(require_dist(),1),import_jsonlines=__toESM(require_jsonlines(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1);import{URLSearchParams}from"url";async function printEvents(client,urlOrDeploymentId,{mode,onEvent,onAliasAssigned,quiet,findOpts},abortController){let{log,debug}=output_manager_default,scope=mode==="deploy"?await getScope(client):null,o=0;await(0,import_async_retry.default)(async(bail,attemptNumber)=>{if(abortController?.signal.aborted)return;attemptNumber>1&&debug("Retrying events");let query=new URLSearchParams({direction:findOpts.direction,follow:findOpts.follow?"1":"",format:"lines"});findOpts.limit&&query.set("limit",String(findOpts.limit)),findOpts.since&&query.set("since",String(findOpts.since)),findOpts.until&&query.set("until",String(findOpts.until));let eventsUrl=`/v3/now/deployments/${urlOrDeploymentId}/events?${query}`;try{let eventsRes=await client.fetch(eventsUrl,{json:!1,signal:abortController?.signal});if(eventsRes.ok){let readable=toNodeReadable(eventsRes.body);return new Promise((resolve,reject)=>{let stream=readable.pipe(import_jsonlines.default.parse()),poller;mode==="deploy"&&(poller=function startPoller(){return setTimeout(async()=>{try{if((await getDeployment(client,scope.contextName,urlOrDeploymentId)).readyState==="READY"){stream.end(),finish();return}poller=startPoller()}catch(err2){stream.end(),finish(err2)}},5e3)}());let finishCalled=!1;function finish(err2){finishCalled||(finishCalled=!0,clearTimeout(poller),err2?reject(err2):resolve())}let latestLogDate=0,onData=data=>{if(data.type==="alias-assigned"){data.deploymentId===urlOrDeploymentId&&onAliasAssigned?.(data);return}let{event,payload,date}=data;event==="state"&&payload.value==="READY"?mode==="deploy"&&(stream.end(),finish()):(latestLogDate=Math.max(latestLogDate,date),onEvent(data))},onErrorCalled=!1,onError=err2=>{if(finishCalled||onErrorCalled)return;if(err2.name==="AbortError"){finish();return}onErrorCalled=!0,o++;let errorMessage=`Deployment event stream error: ${err2.message}`;if(!findOpts.follow){log(errorMessage);return}debug(errorMessage),clearTimeout(poller),stream.destroy(err2);let retryFindOpts={...findOpts,since:latestLogDate},retryTimeout=setTimeout(()=>{abortController?.signal.removeEventListener("abort",onAbort),!abortController?.signal.aborted&&printEvents(client,urlOrDeploymentId,{mode,onEvent,onAliasAssigned,quiet,findOpts:retryFindOpts},abortController).then(resolve,reject)},2e3);onAliasAssigned&&retryTimeout.unref?.();let onAbort=()=>{clearTimeout(retryTimeout),finish()};abortController?.signal.addEventListener("abort",onAbort,{once:!0})};stream.on("end",finish),stream.on("data",onData),stream.on("error",onError),readable.on("error",onError)})}let err=new Error(`Deployment events status ${eventsRes.status}`);if(eventsRes.status<500)bail(err);else throw err}catch(err){if(err instanceof Error&&err.name==="AbortError")return;throw err}},{retries:4,unref:!!onAliasAssigned,onRetry:err=>{!quiet&&o&&(process.stdout.write((0,import_ansi_escapes.eraseLines)(o+1)),o=0),log(`Deployment events polling error: ${err.message}`)}})}var events_default=printEvents;export{events_default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getGlobalFlagsFromArgs,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-MI7W4QMV.js";import{teamCache}from"./chunk-2VBFQZ72.js";import{LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-XSDAUM4F.js";import{getCommandName,packageName}from"./chunk-JESNVRVR.js";import{recordCliError}from"./chunk-M774HRX5.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{pkg_default}from"./chunk-OO572JUC.js";import{__toESM}from"./chunk-BZENIQ7N.js";function quoteArg(value){return/^[A-Za-z0-9_./@:-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}var AGENT_STATUS={ERROR:"error",ACTION_REQUIRED:"action_required",OK:"ok"},AGENT_REASON={MISSING_ARGUMENTS:"missing_arguments",INVALID_ARGUMENTS:"invalid_arguments",CONFIRMATION_REQUIRED:"confirmation_required",INTERACTIVE_CONFIRMATION_REQUIRED:"interactive_confirmation_required",LOGIN_REQUIRED:"login_required",PROJECT_SETTINGS_REQUIRED:"project_settings_required",NOT_LINKED:"not_linked",NOT_FOUND:"not_found",PROJECT_NOT_FOUND:"project_not_found",MISSING_SCOPE:"missing_scope",SCOPE_NOT_ACCESSIBLE:"scope_not_accessible",AGENT_CANNOT_SWITCH:"agent_cannot_switch",API_ERROR:"api_error",RATE_LIMITED:"rate_limited",SEGMENT_IN_USE:"segment_in_use",ENTITY_IN_USE:"entity_in_use",MISSING_REQUIREMENTS:"missing_requirements",MISSING_NAME:"missing_name",MISSING_VALUE:"missing_value",MISSING_ENVIRONMENT:"missing_environment",ENV_NOT_FOUND:"env_not_found",MULTIPLE_ENVS:"multiple_envs",ENV_FILE_EXISTS:"env_file_exists",GIT_BRANCH_REQUIRED:"git_branch_required",ENV_KEY_SENSITIVE:"env_key_sensitive",AMBIGUOUS_ROUTE:"ambiguous_route",ROUTE_CREATE_FAILED:"route_create_failed",ROUTE_GENERATION_FAILED:"route_generation_failed",DOMAIN_NOT_FOUND:"domain_not_found",PRICE_CHANGED:"price_changed",CONFLICT:"conflict",DOMAIN_NOT_AVAILABLE:"domain_not_available",TLD_NOT_SUPPORTED:"tld_not_supported",PAYMENT_FAILED:"payment_failed",UNKNOWN_OUTCOME:"unknown_outcome",DNS_RECORD_NOT_FOUND:"dns_record_not_found",INCOMPLETE_RECORD:"incomplete_record",PERMISSION_DENIED:"permission_denied",INVALID_PORT:"invalid_port",INVALID_DNS_TYPE:"invalid_dns_type",DNS_ADD_FAILED:"dns_add_failed",INVALID_DOMAIN:"invalid_domain",CONFIGURED_CORRECTLY:"configured_correctly",VERIFICATION_NEEDED:"verification_needed",INVALID_CONFIGURATION:"invalid_configuration",DNS_CHANGE_REQUIRED:"dns_change_required",DNS_CHANGE_RECOMMENDED:"dns_change_recommended",DNSSEC_NEEDS_TO_BE_DISABLED:"dnssec_needs_to_be_disabled",PROJECT_ATTACHMENT_RECOMMENDED:"project_attachment_recommended",PROJECT_DOMAIN_MISSING:"project_domain_missing",INTEGRATION_TERMS_ACCEPTANCE_REQUIRED:"integration_terms_acceptance_required",INTEGRATION_SETUP_REQUIRED:"integration_setup_required",HAS_RESOURCES:"has_resources",INTEGRATION_SANDBOX_CLAIM_REQUIRED:"integration_sandbox_claim_required",CLASSIC_TOKEN_REQUIRED:"classic_token_required",TOKEN_USER_SCOPE_REQUIRED:"token_user_scope_required",MISSING_URL:"missing_url",MISSING_EVENTS:"missing_events",INVALID_URL:"invalid_url",INVALID_EVENT:"invalid_event",INVALID_BUDGET:"invalid_budget",INVALID_REFRESH_PERIOD:"invalid_refresh_period",INVALID_EXPIRATION:"invalid_expiration",INVALID_ALERT_THRESHOLDS:"invalid_alert_thresholds",REQUIRES_CONSENT:"requires_consent",MISSING_ISSUER_ID:"missing_issuer_id",MISSING_KEY:"missing_key",MISSING_KEY_ID:"missing_key_id",MISSING_PROJECT:"missing_project",ISSUER_NOT_FOUND:"issuer_not_found",ISSUER_MANAGED:"issuer_managed",ISSUER_REQUIRES_IMPORTED_KEY:"issuer_requires_imported_key",ISSUER_REQUIRES_GENERATED_KEY:"issuer_requires_generated_key",KEY_NOT_REVOKING:"key_not_revoking",NO_CHANGES_REQUESTED:"no_changes_requested",GIT_REPOSITORY_REQUIRED:"git_repository_required",CI_RUN_NOT_FOUND:"ci_run_not_found",CI_RUN_IN_PROGRESS:"ci_run_in_progress",CI_RUN_NOT_RETRYABLE:"ci_run_not_retryable",SCHEDULES_NOT_ENABLED:"schedules_not_enabled",SCHEDULE_ALREADY_EXISTS:"schedule_already_exists",SCHEDULE_COMPLETED:"schedule_completed",SCHEDULE_ALREADY_ACTIVE:"schedule_already_active",STATIC_SCHEDULE:"static_schedule",INVALID_CRON_EXPRESSION:"invalid_cron_expression",INVALID_JITTER:"invalid_jitter",JITTER_EXCEEDS_CADENCE:"jitter_exceeds_cadence",SINGLE_AT_TOO_SOON:"single_at_too_soon",SCHEDULE_PAYLOAD_TOO_LARGE:"payload_too_large",SCHEDULE_PAYLOAD_STORE_FAILED:"payload_store_failed",SCHEDULE_SERVICE_UNAVAILABLE:"service_unavailable",SCHEDULE_SERVICE_ERROR:"service_error",REDIRECT_NOT_FOUND:"redirect_not_found",VERSION_NOT_FOUND:"version_not_found",VERSION_ALREADY_LIVE:"version_already_live",VERSION_IS_STAGING:"version_is_staging",PLAN_UPGRADE_REQUIRED:"plan_upgrade_required",PLAN_LIMIT:"plan_limit",NOT_TEAM_MEMBER:"not_team_member",INVALID_ROLE_COMBINATION:"invalid_role_combination",TARGET_CONFLICT:"target_conflict",DEPRECATED:"deprecated",LIMIT_CLAMPED:"limit_clamped",METRICS_UNAVAILABLE:"metrics_unavailable",STREAM_GAP:"stream_gap"},USAGE_ERROR_REASONS=new Set(["invalid_arguments","missing_arguments","unknown_command","missing_command","invalid_environment","invalid_type","missing_id","missing_value","missing_name","missing_flags","missing_clients","invalid_clients","conflicting_type_flags","missing_environment","invalid_slug","invalid_name","invalid_alert_thresholds","invalid_budget","invalid_dns_type","invalid_event","invalid_expiration","invalid_port","invalid_refresh_period","invalid_role_combination","invalid_url","missing_events","missing_issuer_id","missing_key_id","missing_key","missing_url"]);function getExitCodeForReason(reason){return reason!==void 0&&USAGE_ERROR_REASONS.has(reason)?2:1}var AGENT_ACTION={MISSING_ARGUMENTS:"missing_arguments",CONFIRMATION_REQUIRED:"confirmation_required",LOGIN_REQUIRED:"login_required"};var import_error_utils=__toESM(require_dist(),1);var OBSERVABILITY_PLUS_PURCHASE_COMMAND="buy addon observability-plus",PRIORITY_PROJECT_ENABLE_COMMAND="project priority enable",BUY_PRO_COMMAND="buy pro",PROJECT_ENABLE_COMMAND="project observability enable";function mentionsObservabilityPlus(message){return/observability\s+plus/i.test(message)}function mentionsPriorityProject(message){return/priority\s+project/i.test(message)||/priority\s+tier/i.test(message)}function observabilityPlusDenialReason(error){if(!error||typeof error!="object"||!("meta"in error))return;let meta=error.meta;if(meta&&typeof meta=="object"&&"reason"in meta&&typeof meta.reason=="string")return meta.reason}function observabilityPlusPurchaseHint(){return`Subscribe with ${getCommandName(OBSERVABILITY_PLUS_PURCHASE_COMMAND)}.`}function isHobbyLikePlan(plan){return plan==="hobby"||plan==="oss"}function isProOrEnterprisePlan(plan){return plan==="pro"||plan==="enterprise"}function currentTeamPlan(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.billing?.plan}function planForTeam(idOrSlug){return teamCache.get(idOrSlug)?.billing?.plan}function buyProFix(hint){return{command:BUY_PRO_COMMAND,hint:hint??`Upgrade with ${getCommandName(BUY_PRO_COMMAND)}.`,when:"a person has approved upgrading the plan"}}function observabilityPlusPurchaseFix(){return{command:OBSERVABILITY_PLUS_PURCHASE_COMMAND,hint:observabilityPlusPurchaseHint(),when:"a person has approved buying the add-on"}}function inferDenialReason(message){if(/(?:disabled|switched off|re-enable)/i.test(message))return"subscription_disabled";if(/excluded from it|include the project/i.test(message))return"project_excluded";if(/upgrade your plan/i.test(message)&&/pro and enterprise/i.test(message))return"plan_upgrade_required";if(/(?:quota|usage limit|query limit)/i.test(message))return"quota"}function plusNeedsPlanUpgradeHint(){return`Observability Plus is available on Pro and Enterprise. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}. The add-on cannot be purchased on Hobby.`}function observabilityPlusRecovery(message,denialReason,plan){if(mentionsObservabilityPlus(message))switch(denialReason??inferDenialReason(message)){case"subscription_disabled":return{hint:"Observability Plus is disabled. Ask a team owner to enable it for the intended team or project, then retry. A new subscription may not be needed."};case"project_excluded":return{command:PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:`Observability Plus is on for the team, but this project is excluded. Enable it with ${getCommandName(PROJECT_ENABLE_COMMAND)}. A new subscription is not needed.`,preserveProject:!1,when:"a person has approved enabling Observability Plus for this project"};case"plan_upgrade_required":return buyProFix(plusNeedsPlanUpgradeHint());case"quota":return{hint:"The usage limit was reached. Ask a team owner to review the limit before retrying."};default:return isHobbyLikePlan(plan)?buyProFix(plusNeedsPlanUpgradeHint()):{...observabilityPlusPurchaseFix(),hint:`Check whether Observability Plus is disabled for this project or the team needs a subscription. Enable it if already subscribed. Otherwise, ${observabilityPlusPurchaseHint()}`,when:"the team has no subscription and a person has approved buying the add-on"}}}function priorityProjectRecovery(message,plan){if(mentionsPriorityProject(message))return isHobbyLikePlan(plan)?buyProFix(`Priority Projects are only available on Pro or Enterprise team plans. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}, then run ${getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND)}.`):{command:PRIORITY_PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND),preserveProject:!1,when:"user runs this command in an interactive terminal"}}function observabilityPlanRecovery(message,denialReason,plan){return priorityProjectRecovery(message,plan)??observabilityPlusRecovery(message,denialReason,plan)}var PROJECT_POSITIONAL_COMMANDS=new Set([PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND]);function currentTeamScope(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.slug??id}function targetRecovery(fix,target){if(!fix)return;let targeted=command=>{let out=command;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(command)&&(out+=` ${quoteArg(target.projectName)}`),target.scope&&(out+=` --scope ${quoteArg(target.scope)}`),out},hint=fix.hint;for(let command of[BUY_PRO_COMMAND,OBSERVABILITY_PLUS_PURCHASE_COMMAND,PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND])hint=hint.split(getCommandName(command)).join(getCommandName(targeted(command)));if(!fix.command)return{...fix,hint};let excludeFlags=new Set(fix.excludeFlags??[]),preserveProject=fix.preserveProject;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(fix.command)&&(excludeFlags.add("--project"),preserveProject=!1),fix.command===BUY_PRO_COMMAND&&excludeFlags.add("--project"),target.scope&&(excludeFlags.add("--scope"),excludeFlags.add("--team")),{...fix,command:targeted(fix.command),hint,...excludeFlags.size?{excludeFlags:Array.from(excludeFlags)}:{},...preserveProject!==void 0?{preserveProject}:{}}}function clientObservabilityPlanRecovery(client,error,message,projectName,scope){return targetRecovery(observabilityPlanRecovery(message,observabilityPlusDenialReason(error),scope?planForTeam(scope):currentTeamPlan(client)),{projectName,scope:scope??currentTeamScope(client)})}function errorContext(client){let teamId=client?.config?.currentTeam;return teamId?client?.teams?.find(team=>team.id===teamId||team.slug===teamId)?.slug??teamCache.get(teamId)?.slug:client?.user?.username||client?.user?.email}function getErrorRecovery(error,client){let reason=error.reason?.toLowerCase(),scope=errorContext(client);if(error.status===403||["forbidden","permission_denied","scope_not_accessible"].includes(reason??""))return{hint:`Check that the selected team is correct${scope?` (${scope})`:""}. If it is, ask a team owner to grant the required access. Retry only after the team or access changes.`,retryable:!1,userActionRequired:!0,...scope&&{scope},...error.action&&{action:error.action},...error.resource&&{resource:error.resource}};if(error.status===401||reason==="not_authorized")return{hint:"Provide valid credentials for the intended account and team, then retry.",retryable:!1,userActionRequired:!0};if(error.status===402||["payment_required","plan_upgrade_required"].includes(reason??"")){let message=error.serverMessage??error.message??"";return{hint:observabilityPlanRecovery(message,observabilityPlusDenialReason(error),currentTeamPlan(client))?.hint??(/(?:disabled|switched off|re-enable)/i.test(message)?"Enable the feature for the selected team or project, then retry.":/(?:overdue|payment method|unpaid|balance)/i.test(message)?"Ask a team owner to resolve the billing issue, then retry.":/(?:plan|subscription)/i.test(message)?"Ask a team owner to confirm the required plan or subscription before changing billing. Retry after access is enabled.":"Check the billing or feature requirement reported above with a team owner. Retry after that requirement is resolved."),retryable:!1,userActionRequired:!0,...scope&&{scope}}}if(error.status===429||reason==="rate_limited"){let wait=error.retryAfterMs;return{hint:typeof wait=="number"&&Number.isFinite(wait)&&wait>0?`Wait at least ${Math.ceil(wait/1e3)} seconds before trying again.`:wait==="never"?"This request cannot be retried with the current limit. Ask a team owner to review the limit.":"The request limit was reached. Wait before trying again; no retry time was provided.",retryable:wait!=="never",...typeof wait=="number"&&Number.isFinite(wait)&&wait>0&&{retryAfterMs:wait}}}return{}}import{randomUUID}from"node:crypto";function agentErrorMetadata(client){return client.isAgent?{cliVersion:pkg_default.version,invocationId:client.telemetryEventStore?.currentInvocationId}:{}}function agentErrorCategory(reason){return/^(forbidden|permission_denied|scope_not_accessible)$/i.test(reason)?"permission":/^(payment_required|plan_upgrade_required)$/i.test(reason)?"billing":/^(not_authorized|login_required)$/i.test(reason)?"authentication":/^(rate_limited|too_many_requests)$/i.test(reason)?"rate_limit":/^(invalid_arguments|unknown_command|ARG_UNKNOWN_OPTION)$/i.test(reason)?"usage":/^(link_required|project_not_found|not_found)$/i.test(reason)?"project_context":"other"}function trackAgentError(client,error){!client.isAgent||!client.telemetryEventStore||client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_error",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,category:agentErrorCategory(error.reason),hasRecovery:!!error.hint,retryable:error.retryable,userActionRequired:error.userActionRequired})})}function isHelpInvocation(argv){let args=argv.slice(2),separator=args.indexOf("--");return args.slice(0,separator<0?args.length:separator).some(arg=>arg==="--help"||arg==="-h")}function trackAgentCommandOutcome(client,exitCode){if(!client.isAgent||!client.telemetryEventStore)return;let help=isHelpInvocation(client.argv);client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_command_outcome",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,exitCode,outcome:help&&(exitCode===0||exitCode===2)?"help":exitCode===0?"success":"failure"})})}function buildCommandWithYes(argv,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=args.some(a=>a==="--yes"||a==="-y")?args:[...args,"--yes"];return`${pkgName} ${out.join(" ")}`.trim()}function redactEnvValueArgs(argv){let redacted=[...argv];for(let i=0;i<redacted.length;i++)redacted[i]==="--value"&&i+1<redacted.length?(redacted[i+1]='"<value>"',i++):redacted[i].startsWith("--value=")&&(redacted[i]='--value="<value>"');return redacted}var GLOBAL_FLAG_NAMES=new Set(["--cwd","--config","--yes","-y","--non-interactive","--scope","--team","-S","-T"]),GLOBAL_FLAG_SHORTHANDS={"-y":"--yes","-S":"--scope","-T":"--team"};function canonicalGlobalFlagName(name){return GLOBAL_FLAG_SHORTHANDS[name]??name}function getGlobalFlagsFromArgv(argv){let args=getGlobalFlagsFromArgs(argv.slice(2),{preserveConfig:!0,preserveYes:!0}),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;GLOBAL_FLAG_NAMES.has(name)&&(out.push(arg),suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-")&&(out.push(args[i+1]),i++))}return out}function omitGlobalFlagsFromArgs(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let arg=safeArgs[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(GLOBAL_FLAG_NAMES.has(name)){suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&i++;continue}out.push(arg)}return out}function buildIntegrationCommandTailFromArgv(argv){let args=argv.slice(2),idx=args.indexOf("integration");return idx===-1?"integration":omitGlobalFlagsFromArgs(args.slice(idx)).join(" ")}function buildCommandWithGlobalFlags(argv,commandTemplate,pkgName=packageName,options){let preserved=options?.globalFlags==="all"?getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:options.preserveProject}):getGlobalFlagsFromArgv(argv);if(options?.globalFlags!=="all"&&options?.preserveProject){let globalArgs=getGlobalFlagsFromArgs(argv.slice(2)),contextArgs=getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:!0});preserved.push(...contextArgs.slice(globalArgs.length))}let exclude=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0])));for(let flag of options?.excludeFlags??[])exclude.add(canonicalGlobalFlagName(flag));if(exclude.size){let out=[];for(let i=0;i<preserved.length;i++){let arg=preserved[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(exclude.has(canonicalGlobalFlagName(name))){!arg.includes("=")&&i+1<preserved.length&&!preserved[i+1].startsWith("-")&&i++;continue}out.push(arg)}preserved=out}let base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:options?.prependGlobalFlags?`${pkgName} ${preserved.join(" ")} ${commandTemplate}`:`${base} ${preserved.join(" ")}`}function withGlobalFlags(client,commandTemplate,options={}){return buildCommandWithGlobalFlags(client.argv,commandTemplate,packageName,{globalFlags:"all",preserveProject:options.preserveProject})}function getPreservedArgsAfterEnvSubcommand(argv,subcommands,positionalCount){let args=stripSensitiveAuthArgs(argv.slice(2)),envIdx=args.findIndex((arg,index)=>arg==="env"&&subcommands.includes(args[index+1])),subcommandIdx=envIdx+1;if(envIdx===-1)return args;let preserved=[],positionals=0,optionsEnded=!1;for(let i=subcommandIdx+1;i<args.length;i++){let arg=args[i];if(arg==="--"&&!optionsEnded){optionsEnded=!0;continue}if(!optionsEnded&&arg.startsWith("-")){preserved.push(arg),!arg.includes("=")&&suggestionFlagTakesSeparateValue(arg)&&i+1<args.length&&!args[i+1].startsWith("-")&&preserved.push(args[++i]);continue}if(positionals<positionalCount){positionals++;continue}optionsEnded&&!preserved.includes("--")&&preserved.push("--"),preserved.push(arg)}return preserved}function omitPreservedFlagsAlreadyInTemplate(args,commandTemplate){let templateFlags=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0]))),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("-")?arg.split("=")[0]:arg;if(!templateFlags.has(canonicalGlobalFlagName(name))){out.push(arg);continue}!arg.includes("=")&&suggestionFlagTakesSeparateValue(name)&&i+1<args.length&&!args[i+1].startsWith("-")&&i++}return out}function getPreservedArgsForEnvAdd(argv){return getPreservedArgsAfterEnvSubcommand(argv,["add"],3)}function buildEnvAddCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvAdd(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvPull(argv){return getPreservedArgsAfterEnvSubcommand(argv,["pull"],1)}function getPreservedArgsForEnvRm(argv){return getPreservedArgsAfterEnvSubcommand(argv,["rm","remove"],3)}function buildEnvRmCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvRm(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvUpdate(argv){return getPreservedArgsAfterEnvSubcommand(argv,["update"],3)}function buildEnvUpdateCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvUpdate(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function buildCommandWithScope(argv,scopeSlug,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=[];for(let i=0;i<args.length;i++){if(args[i]==="--scope"||args[i]==="--team"||args[i]==="-S"||args[i]==="-T"){i++;continue}args[i].startsWith("--scope=")||args[i].startsWith("--team=")||out.push(args[i])}return out.push("--scope",scopeSlug),`${pkgName} ${out.join(" ")}`}function enrichActionRequiredWithInvokingCommand(payload,argv){if(payload.reason!=="missing_scope"||!payload.choices?.length)return payload;let next=[],linkCommand=buildCommandWithGlobalFlags(argv,"link",packageName,{preserveProject:!0,excludeFlags:["--scope","--team"]});for(let choice of payload.choices){let slug=choice.name;next.push({command:`${linkCommand} --scope ${slug}`,when:"Link first (then run any command without --scope)"}),next.push({command:buildCommandWithScope(argv,slug),when:"Run this command with scope (no link)"})}return{...payload,next}}function outputActionRequired(client,payload,exitCode=getExitCodeForReason(payload.reason)){if(!shouldEmitNonInteractiveCommandError(client))return;let enriched=enrichActionRequiredWithInvokingCommand(payload,client.argv);!enriched.hint&&enriched.next?.length&&(enriched.hint="Run one of the commands in next[] to complete without prompting."),recordCliError({code:payload.reason}),client.stdout.write(`${JSON.stringify(enriched,null,2)}
|
|
8
|
+
`),process.exit(exitCode)}function argvHasNonInteractive(argv){if(!argv?.length)return!1;for(let i=0;i<argv.length;i++){let a=argv[i];if(a==="--non-interactive")return argv[i+1]!=="false";if(a.startsWith("--non-interactive="))return a.slice(18)!=="false"}return!1}function shouldEmitNonInteractiveCommandError(client){return client.nonInteractive||argvHasNonInteractive(client.argv??[])}function outputAgentError(client,payload,exitCode=getExitCodeForReason(payload.reason)){shouldEmitNonInteractiveCommandError(client)&&(writeAgentError(client,payload),process.exit(exitCode))}function writeAgentError(client,payload){let enriched={...getErrorRecovery(payload,client),...payload,...agentErrorMetadata(client)};recordCliError({code:payload.reason,reportOnSuccess:!0}),trackAgentError(client,enriched),client.stdout.write(`${JSON.stringify(enriched,null,2)}
|
|
9
|
+
`)}function outputAgentSuccess(client,payload,exitCode=0){shouldEmitNonInteractiveCommandError(client)&&(!payload.hint&&payload.next?.length&&(payload.hint="Follow up with one of the commands in next[]."),client.stdout.write(`${JSON.stringify(payload,null,2)}
|
|
10
|
+
`),process.exit(exitCode))}function buildNextStepsForGlobalConfig(client){return[{command:buildCommandWithGlobalFlags(client.argv,"global-config list"),when:"List Global Config stores in the current team scope"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to the team that owns the Global Config"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Verify the current team or user scope"}]}var GLOBAL_CONFIG_NON_INTERACTIVE_HINT="Global Config commands use your current team scope. Pass --scope or run `vercel teams switch` if the store is missing.",LIST_ERROR_HINT="Project names are team-scoped. Use --scope when the project belongs to another team, or `list --all` to list deployments across all projects.";function buildNextStepsForList(client,projectName){return[projectName?{command:buildCommandWithGlobalFlags(client.argv,`project ls --filter ${projectName}`),when:"Search projects matching the attempted name to find the right one"}:{command:buildCommandWithGlobalFlags(client.argv,"project ls --filter <name>"),when:"Search projects by name substring to find the right one (replace <name>)"},{command:buildCommandWithGlobalFlags(client.argv,"list --all"),when:"List deployments across all projects in the current scope"},{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"}]}function buildNextStepsForProjectSubcommands(client,variant){let byName=variant==="access-groups"?{template:"project access-groups <name>",when:"List access groups by project name (replace <name>)"}:variant==="access-summary"?{template:"project access-summary <name>",when:"Show role counts by project name (replace <name>)"}:variant==="protection"?{template:"project protection <name>",when:"Show deployment protection by project name (replace <name>)"}:variant==="update"?{template:"project update <name> --framework <slug>",when:"Update a framework preset by project name (replace <name> and <slug>)"}:variant==="speed-insights"?{template:"project speed-insights <name>",when:"Enable Speed Insights by project name (replace <name>)"}:variant==="web-analytics"?{template:"project web-analytics <name>",when:"Enable Web Analytics by project name (replace <name>)"}:variant==="observability"?{template:"project observability enable <name>",when:"Enable Observability Plus by project name (replace <name>)"}:variant==="checks"?{template:"project checks add <name>",when:"Create a deployment check by project name (replace <name>)"}:variant==="inspect"?{template:"project inspect <name>",when:"Inspect a project by name (replace <name>)"}:variant==="resume"?{template:"project resume <name>",when:"Resume production traffic by project name (replace <name>)"}:{template:"project members <name>",when:"List members by project name (replace <name>)"};return[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,byName.template),when:byName.when},{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]}var PROJECT_SUBCOMMAND_ERROR_HINT="If you use --cwd, ensure that folder is linked to the right project, or pass an explicit project name. Use --scope when the project belongs to another team.";function resolveNonInteractiveDefaults(client,variant){return variant==="global-config"?{next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT}:variant==="list"?{next:buildNextStepsForList(client),hint:LIST_ERROR_HINT}:{next:buildNextStepsForProjectSubcommands(client,variant),hint:PROJECT_SUBCOMMAND_ERROR_HINT}}function writeAgentErrorPayloadAndExit(client,payload,exitCode,variant){let defaults=["link_required","project_not_found","not_found"].includes(payload.reason)?resolveNonInteractiveDefaults(client,variant):{},out={...payload,next:payload.next??defaults.next,hint:payload.hint??defaults.hint};writeAgentError(client,out),process.exit(exitCode)}function isProjectNotFoundLike(err){return!!(err instanceof ProjectNotFound||(0,import_error_utils.isError)(err)&&"code"in err&&err.code==="PROJECT_NOT_FOUND")}function isLinkRequiredLike(err){return err instanceof LinkRequiredError}function normalizeApiErrorText(message){return message.replace(/\s*\(\d{3}\)\s*$/,"").trim()}function exitWithNonInteractiveError(client,err,exitCode=1,options={variant:"members"}){if(!shouldEmitNonInteractiveCommandError(client))return;let{variant}=options;if(isLinkRequiredLike(err)){if(variant==="global-config"){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err),next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT},exitCode,"global-config");return}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err)},exitCode,variant);return}if(isProjectNotFoundLike(err)){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"project_not_found",message:err instanceof Error?err.message:String(err),...variant==="list"&&options.projectName?{next:buildNextStepsForList(client,options.projectName)}:{}},exitCode,variant);return}if(isAPIError(err)){let rawMessage=err.serverMessage||err.message,message=normalizeApiErrorText(rawMessage),reason=err.status===403?"forbidden":err.status===402?"payment_required":err.status===401?"not_authorized":err.status===404?variant==="global-config"?"not_found":"project_not_found":err.status===429?"rate_limited":"api_error";writeAgentErrorPayloadAndExit(client,{status:"error",reason,message,...getErrorRecovery(err,client),...err.action&&{action:err.action},...err.resource&&{resource:err.resource}},exitCode,variant)}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"unexpected_error",message:err instanceof Error?err.message:String(err)},exitCode,variant)}function openUrlInBrowserCommand(url){return process.platform==="win32"?`start ${url}`:process.platform==="darwin"?`open '${url}'`:`xdg-open '${url}'`}export{quoteArg,AGENT_STATUS,AGENT_REASON,getExitCodeForReason,AGENT_ACTION,PRIORITY_PROJECT_ENABLE_COMMAND,BUY_PRO_COMMAND,isProOrEnterprisePlan,buyProFix,targetRecovery,clientObservabilityPlanRecovery,getErrorRecovery,agentErrorMetadata,trackAgentError,isHelpInvocation,trackAgentCommandOutcome,buildCommandWithYes,redactEnvValueArgs,getGlobalFlagsFromArgv,omitGlobalFlagsFromArgs,buildIntegrationCommandTailFromArgv,buildCommandWithGlobalFlags,withGlobalFlags,getPreservedArgsForEnvAdd,buildEnvAddCommandWithPreservedArgs,getPreservedArgsForEnvPull,getPreservedArgsForEnvRm,buildEnvRmCommandWithPreservedArgs,getPreservedArgsForEnvUpdate,buildEnvUpdateCommandWithPreservedArgs,outputActionRequired,argvHasNonInteractive,shouldEmitNonInteractiveCommandError,outputAgentError,writeAgentError,outputAgentSuccess,exitWithNonInteractiveError,openUrlInBrowserCommand};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{jsonOption,projectOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var listSubcommand={name:"list",aliases:["ls"],description:"List all routing rules for the current project. These routes apply to all deployments and environments.",arguments:[],options:[projectOption,jsonOption,{name:"search",description:"Search by name, description, source, or destination",shorthand:"s",type:String,argument:"QUERY",deprecated:!1},{name:"filter",description:"Filter by type: rewrite, redirect, set_status, transform",shorthand:"f",type:String,argument:"TYPE",deprecated:!1},{name:"production",description:"List routes from the live production version",shorthand:null,type:Boolean,deprecated:!1},{name:"version-id",description:"List routes from a specific version ID",shorthand:null,type:String,argument:"VERSION_ID",deprecated:!1},{name:"diff",description:"Compare staged changes against production. Use with --version-id to compare a specific version.",shorthand:null,type:Boolean,deprecated:!1},{name:"expand",description:"Show expanded details for each route",shorthand:"e",type:Boolean,deprecated:!1}],examples:[{name:"List all routes",value:`${packageName} routes list`},{name:"Search for routes",value:`${packageName} routes list --search "api"`},{name:"Filter by type",value:`${packageName} routes list --filter rewrite`},{name:"Show staged changes",value:`${packageName} routes list --diff`},{name:"Show live production routes",value:`${packageName} routes list --production`},{name:"Show expanded details",value:`${packageName} routes list --expand`}]},listVersionsSubcommand={name:"list-versions",aliases:["ls-versions"],description:"List all versions of routing rules",arguments:[],options:[projectOption,jsonOption,{name:"count",description:"Number of versions to fetch (default: 20, max: 100)",shorthand:null,type:Number,argument:"NUMBER",deprecated:!1}],examples:[{name:"List route versions",value:`${packageName} routes list-versions`},{name:"List more versions",value:`${packageName} routes list-versions --count 50`}]},inspectSubcommand={name:"inspect",aliases:[],description:"Show detailed information about a specific route",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,jsonOption,{name:"diff",description:"Compare staged changes against production for this route",shorthand:null,type:Boolean,deprecated:!1}],examples:[{name:"Inspect a route by name",value:`${packageName} routes inspect "API rewrite"`},{name:"Inspect a route by ID",value:`${packageName} routes inspect abc123`},{name:"Show staged changes for a route",value:`${packageName} routes inspect "My route" --diff`}]},addSubcommand={name:"add",aliases:[],description:"Add a new routing rule to the project",arguments:[{name:"name",required:!1}],options:[projectOption,{name:"src",description:"Path pattern (required in non-interactive mode)",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Path syntax: regex (default), path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Action type: rewrite, redirect, or set-status (required with --dest/--status)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Destination URL for rewrite or redirect",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Status code (301/302/307/308 for redirect, or any for set-status)",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Condition that must match: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'"Does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"description",description:"Route description (max 1024 chars)",shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"disabled",description:"Create route in disabled state",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Generate route from a natural language description (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{name:"position",description:"Position: start, end, after:<id>, before:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"yes",description:"Skip confirmation prompts",shorthand:"y",type:Boolean,deprecated:!1}],examples:[{name:"Interactive mode",value:`${packageName} routes add`},{name:"Create with AI",value:`${packageName} routes add --ai "Rewrite /api/* to https://backend.internal/*"`},{name:"Add a rewrite",value:`${packageName} routes add "API Proxy" --src "/api/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://api.example.com/:path*" --yes`},{name:"Add a redirect",value:`${packageName} routes add "Old Blog" --src "/blog" --src-syntax equals --action redirect --dest "/articles" --status 301 --yes`},{name:"Add CORS headers",value:`${packageName} routes add "CORS" --src "^/api/.*$" --set-response-header "Access-Control-Allow-Origin=*" --yes`},{name:"Block access (set status)",value:`${packageName} routes add "Block Admin" --src "^/admin/.*$" --action set-status --status 403 --yes`},{name:"Conditional redirect",value:`${packageName} routes add "Auth Required" --src "/protected/:path*" --src-syntax path-to-regexp --action redirect --dest "/login" --status 307 --missing "cookie:session" --yes`},{name:"Rewrite with request headers",value:`${packageName} routes add "Backend Proxy" --src "/backend/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://internal.example.com/:path*" --set-request-header "X-Forwarded-Host=myapp.com" --yes`},{name:"Add route at start",value:`${packageName} routes add "Priority Route" --src "/priority" --src-syntax equals --action rewrite --dest "/handler" --position start --yes`}]},publishSubcommand={name:"publish",aliases:[],description:"Publish all staged routing changes to production",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when publishing"}],examples:[{name:"Publish staged changes",value:`${packageName} routes publish`},{name:"Publish without confirmation",value:`${packageName} routes publish --yes`}]},restoreSubcommand={name:"restore",aliases:[],description:"Restore a previous routing version to production",arguments:[{name:"version-id",required:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when restoring"}],examples:[{name:"Restore a previous version",value:`${packageName} routes restore <version-id>`},{name:"Restore without confirmation",value:`${packageName} routes restore <version-id> --yes`}]},discardSubcommand={name:"discard-staging",aliases:[],description:"Discard staged routing changes",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when discarding"}],examples:[{name:"Discard staged changes",value:`${packageName} routes discard-staging`},{name:"Discard without confirmation",value:`${packageName} routes discard-staging --yes`}]},deleteSubcommand={name:"delete",aliases:["rm"],description:"Delete one or more routing rules",arguments:[{name:"name-or-id",required:!0,multiple:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when deleting"}],examples:[{name:"Delete a route by name",value:`${packageName} routes delete "Old Redirect"`},{name:"Delete a route by ID",value:`${packageName} routes delete abc123`},{name:"Delete multiple routes",value:`${packageName} routes delete "Route A" "Route B"`},{name:"Delete without confirmation",value:`${packageName} routes delete "Old Route" --yes`}]},enableSubcommand={name:"enable",aliases:[],description:"Enable a disabled routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Enable a route by name",value:`${packageName} routes enable "API Proxy"`},{name:"Enable a route by ID",value:`${packageName} routes enable abc123`}]},disableSubcommand={name:"disable",aliases:[],description:"Disable a routing rule without deleting it",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Disable a route by name",value:`${packageName} routes disable "API Proxy"`},{name:"Disable a route by ID",value:`${packageName} routes disable abc123`}]},reorderSubcommand={name:"reorder",aliases:["move"],description:"Move a routing rule to a different position",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"position",description:"Target position: start, end, a number (1-based), before:<id>, after:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"first",description:"Move to the first position (highest priority)",shorthand:null,type:Boolean,deprecated:!1},{name:"last",description:"Move to the last position (lowest priority)",shorthand:null,type:Boolean,deprecated:!1},{...yesOption,description:"Skip the confirmation prompt when reordering"}],examples:[{name:"Move to first position",value:`${packageName} routes reorder "Catch All" --first`},{name:"Move to last position",value:`${packageName} routes reorder "Catch All" --last`},{name:"Move to a specific position",value:`${packageName} routes reorder "API Proxy" --position 3`},{name:"Move after another route",value:`${packageName} routes reorder "API Proxy" --position after:route-id-123`},{name:"Interactive reorder (prompts for position)",value:`${packageName} routes reorder "API Proxy"`}]},editSubcommand={name:"edit",aliases:[],description:"Edit an existing routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"name",description:"Change route name",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"description",description:'Change description (use "" to clear)',shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"src",description:"Change source path pattern",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Change path syntax: regex, path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Set action type: rewrite, redirect, or set-status (required when switching types)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Set destination URL",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Set status code",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"no-dest",description:"Remove destination",shorthand:null,type:Boolean,deprecated:!1},{name:"no-status",description:"Remove status code",shorthand:null,type:Boolean,deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Add a has condition: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'Add a "does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"clear-conditions",description:"Remove all has/does-not-have conditions",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-headers",description:"Remove all response headers",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-transforms",description:"Remove all transforms (request headers, request query)",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Describe changes using natural language (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{...yesOption,description:"Skip confirmation prompts"}],examples:[{name:"Interactive mode",value:`${packageName} routes edit "API Proxy"`},{name:"Edit with AI",value:`${packageName} routes edit "API Proxy" --ai "Add CORS headers and change status to 308"`},{name:"Change destination",value:`${packageName} routes edit "API Proxy" --dest "https://new-api.example.com/:path*"`},{name:"Switch to redirect",value:`${packageName} routes edit "Old Route" --action redirect --dest "/new" --status 301`},{name:"Add a response header",value:`${packageName} routes edit "My Route" --set-response-header "Cache-Control=public, max-age=3600"`},{name:"Clear all conditions and add new ones",value:`${packageName} routes edit "My Route" --clear-conditions --has "header:Authorization"`}]},exportSubcommand={name:"export",aliases:[],description:"Export routes to a vercel.json or vercel.ts file",arguments:[{name:"name-or-id",required:!1}],options:[projectOption,{name:"output",description:"Output file format: .json (default) or .ts",shorthand:"o",type:String,argument:"json|ts",deprecated:!1}],examples:[{name:"Export as vercel.json format",value:`${packageName} routes export`},{name:"Export as vercel.ts format",value:`${packageName} routes export --output ts`},{name:"Export a specific route",value:`${packageName} routes export "API Proxy"`},{name:"Export to a file",value:`${packageName} routes export > routes.json`}]},routesCommand={name:"routes",aliases:[],description:"Manage routing rules for a project. Routes managed at the project level apply to all deployments and environments.",arguments:[],subcommands:[listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,editSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,exportSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand],options:[],examples:[]};export{listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,editSubcommand,exportSubcommand,routesCommand};
|
|
@@ -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-KUGXOLL7.js";import{forceOption,formatOption,jsonOption,projectOption,yesOption}from"./chunk-MI7W4QMV.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,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{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-
|
|
7
|
+
import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var commentsProjectOption={...projectOption,shorthand:"p",description:"Project ID or name (defaults to the linked project)"},messageContentOption={name:"message",shorthand:"m",type:String,argument:"TEXT",deprecated:!1,description:"Markdown message content"},fileOption={name:"file",shorthand:null,type:String,argument:"PATH",deprecated:!1,description:"Read Markdown content from a file; use `-` for stdin"},attachOption={name:"attach",shorthand:null,type:[String],argument:"URL",deprecated:!1,description:"Attach a file by https URL (repeatable, max 10)"},nextCursorOption={name:"next",shorthand:"N",type:String,argument:"CURSOR",deprecated:!1,description:"Show the next page using the cursor from the previous output"},listSubcommand={name:"list",aliases:["ls"],default:!0,description:"List comments for a project",arguments:[],options:[commentsProjectOption,{name:"branch",shorthand:null,type:[String],argument:"BRANCH",deprecated:!1,description:"Filter by Git branch (repeatable; defaults to the current branch when inferable)"},{name:"all-branches",shorthand:null,type:Boolean,deprecated:!1,description:"Show comments from every branch"},{name:"status",shorthand:null,type:String,argument:"STATUS",deprecated:!1,description:"unresolved (default), resolved, or all"},{name:"page-path",shorthand:null,type:[String],argument:"PATH",deprecated:!1,description:"Filter by recorded page path or glob (repeatable). Note: rewrites may record a different path than the browser URL"},{name:"page",shorthand:null,type:[String],argument:"PATH",deprecated:!0,description:"Filter by recorded page path or glob"},{name:"author",shorthand:null,type:[String],argument:"USER",deprecated:!1,description:"Filter by author user ID, or `me` (repeatable)"},{name:"content-id",shorthand:null,type:[String],argument:"ID",deprecated:!1,description:"Filter by CMS content ID (repeatable)"},{name:"search",shorthand:null,type:String,argument:"TEXT",deprecated:!1,description:"Search comment content"},limitOption,nextCursorOption,formatOption,jsonOption],examples:[{name:"List unresolved comments for the linked project",value:`${packageName} comments`},{name:"List comments on every branch",value:`${packageName} comments --all-branches --status all`},{name:"List comments as JSON",value:`${packageName} comments --json | jq '.threads[].id'`}]},inspectSubcommand={name:"inspect",aliases:["get"],description:"Show a comment thread with its full conversation",arguments:[{name:"thread",required:!1}],options:[commentsProjectOption,{name:"context",shorthand:null,type:Boolean,deprecated:!1,description:"Include framework and device context"},formatOption,jsonOption],examples:[{name:"Inspect a comment thread",value:`${packageName} comments inspect icZ9BnPPINuK`},{name:"Inspect a comment from its URL",value:`${packageName} comments inspect https://vercel.com/team/project/c/icZ9BnPPINuK`},{name:"Pick a comment interactively",value:`${packageName} comments inspect`},{name:"Inspect a thread whose ID starts with a dash",value:`${packageName} comments inspect -- -ULOL`}]},openSubcommand={name:"open",aliases:[],description:"Open a comment thread on vercel.com",arguments:[{name:"thread",required:!0}],options:[commentsProjectOption],examples:[{name:"Open a comment in the browser",value:`${packageName} comments open icZ9BnPPINuK`}]},replySubcommand={name:"reply",aliases:[],description:"Reply to a comment thread",arguments:[{name:"thread",required:!0}],options:[commentsProjectOption,messageContentOption,fileOption,attachOption,formatOption,jsonOption],examples:[{name:"Reply to a comment",value:`${packageName} comments reply icZ9BnPPINuK -m 'Fixed in **main**.'`},{name:"Reply from stdin",value:`git log -1 --format=%s | ${packageName} comments reply icZ9BnPPINuK`}]},resolveSubcommand={name:"resolve",aliases:[],description:"Resolve comment threads, optionally with a closing reply",arguments:[{name:"thread",required:!0,multiple:!0}],options:[commentsProjectOption,messageContentOption,yesOption,formatOption,jsonOption],examples:[{name:"Resolve a comment",value:`${packageName} comments resolve icZ9BnPPINuK`},{name:"Reply and resolve in one step",value:`${packageName} comments resolve icZ9BnPPINuK -m 'Fixed in the latest deployment'`}]},reopenSubcommand={name:"reopen",aliases:[],description:"Reopen resolved comment threads",arguments:[{name:"thread",required:!0,multiple:!0}],options:[commentsProjectOption,yesOption,formatOption,jsonOption],examples:[{name:"Reopen a comment",value:`${packageName} comments reopen icZ9BnPPINuK`}]},editSubcommand={name:"edit",aliases:[],description:"Edit a comment message while preserving its attachments",arguments:[{name:"thread",required:!0},{name:"message-id",required:!0}],options:[commentsProjectOption,messageContentOption,fileOption,formatOption,jsonOption],examples:[{name:"Edit a message",value:`${packageName} comments edit icZ9BnPPINuK VvkhYF6dTqbpm7K -m 'Updated wording'`}]},deleteSubcommand={name:"delete",aliases:[],description:"Delete a comment message",arguments:[{name:"thread",required:!0},{name:"message-id",required:!0}],options:[commentsProjectOption,yesOption,formatOption,jsonOption],examples:[{name:"Delete a message",value:`${packageName} comments delete icZ9BnPPINuK VvkhYF6dTqbpm7K`}]},commentsCommand={name:"comments",aliases:[],description:"Review and act on Vercel Toolbar comments from the command line",arguments:[],subcommands:[listSubcommand,inspectSubcommand,openSubcommand,replySubcommand,resolveSubcommand,reopenSubcommand,editSubcommand,deleteSubcommand],options:[],examples:[{name:"Review unresolved comments for the linked project",value:`${packageName} comments`},{name:"Inspect a comment and reply",value:`${packageName} comments inspect icZ9BnPPINuK`},{name:"Reply and resolve in one step",value:`${packageName} comments resolve icZ9BnPPINuK -m 'Fixed!'`}]};export{listSubcommand,inspectSubcommand,openSubcommand,replySubcommand,resolveSubcommand,reopenSubcommand,editSubcommand,deleteSubcommand,commentsCommand};
|
|
@@ -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{STANDARD_ENVIRONMENTS}from"./chunk-
|
|
7
|
+
import{STANDARD_ENVIRONMENTS}from"./chunk-WYI4VNXT.js";import{require_lib}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_title=__toESM(require_lib(),1);function formatEnvironment(orgSlug,projectSlug,environment){let projectUrl=`https://vercel.com/${orgSlug}/${projectSlug}`,boldName=import_chalk.default.bold(STANDARD_ENVIRONMENTS.includes(environment.slug)?(0,import_title.default)(environment.slug):environment.slug);return output_manager_default.link(boldName,`${projectUrl}/settings/environments/${environment.slug}`,{fallback:()=>boldName,color:!1})}export{formatEnvironment};
|
|
@@ -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{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-
|
|
7
|
+
import{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function validateLsArgs(options){let{commandName,args,maxArgs=0,exitCode=1,usageString}=options;if(args.length>maxArgs){let usage=usageString||getCommandName(commandName);return output_manager_default.error(`Invalid number of arguments. Usage: ${import_chalk.default.cyan(usage)}`),exitCode}return 0}export{validateLsArgs};
|