@vercel/cli-support 68.1.0 → 68.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-57EE2LQO.js → add-4BFJ2SAR.js} +1 -1
- package/dist/chunks/{add-DNRNPUU7.js → add-5BQ3RSZQ.js} +1 -1
- package/dist/chunks/{add-FLVE2M3L.js → add-S7U4ZFBS.js} +1 -1
- package/dist/chunks/{alerts-26PDHRBL.js → alerts-GIT77GJG.js} +1 -1
- package/dist/chunks/{build-6WTRWW2M.js → build-RQ4ABN6Z.js} +1 -1
- package/dist/chunks/{chunk-WKEDN5SX.js → chunk-3JYREVOI.js} +1 -1
- package/dist/chunks/{chunk-U3IPJYB6.js → chunk-4HHDAGMC.js} +1 -1
- package/dist/chunks/{chunk-PP7BNCIG.js → chunk-4KHVAEGO.js} +1 -1
- package/dist/chunks/{chunk-7ZCM4LWL.js → chunk-4U6Y6LWP.js} +1 -1
- package/dist/chunks/{chunk-4FPYV37P.js → chunk-6JY43KSR.js} +1 -1
- package/dist/chunks/{chunk-GNQ7KLCN.js → chunk-BCOUDSOR.js} +1 -1
- package/dist/chunks/{chunk-OICSITNU.js → chunk-DRNUHJ6I.js} +1 -1
- package/dist/chunks/{chunk-76AOTUM2.js → chunk-HJPZOKEB.js} +1 -1
- package/dist/chunks/chunk-IKVQLMEI.js +7 -0
- package/dist/chunks/{chunk-BCD4TRQF.js → chunk-J54A5356.js} +1 -1
- package/dist/chunks/chunk-JOOWSBNQ.js +7 -0
- package/dist/chunks/{chunk-FO7OSSLI.js → chunk-LA3VRJX7.js} +1 -1
- package/dist/chunks/chunk-LUQPAO6K.js +7 -0
- package/dist/chunks/{chunk-732HWE3P.js → chunk-R2LNF5VK.js} +2 -2
- package/dist/chunks/{chunk-ILUU3SGP.js → chunk-R6LM3MBK.js} +2 -2
- package/dist/chunks/{chunk-YVWIDLY4.js → chunk-RBM4KOQ2.js} +3 -3
- package/dist/chunks/{chunk-AASXSNBW.js → chunk-RBZOVE2W.js} +1 -1
- package/dist/chunks/chunk-RVQ26UHS.js +7 -0
- package/dist/chunks/{chunk-QMI7GTT2.js → chunk-RXHW3T4H.js} +1 -1
- package/dist/chunks/chunk-TTJWZ3ZW.js +7 -0
- package/dist/chunks/{chunk-CNGI6Z2G.js → chunk-TXROE436.js} +1 -1
- package/dist/chunks/chunk-USCJFJD4.js +7 -0
- package/dist/chunks/{chunk-PSMKLDLV.js → chunk-YXJXKKS5.js} +1 -1
- package/dist/chunks/{chunk-FSMZPHAA.js → chunk-Z2L36RO3.js} +1 -1
- package/dist/chunks/{chunk-DWA7B7TB.js → chunk-Z3Z5GBKO.js} +1 -1
- package/dist/chunks/{clear-4MDTHLLE.js → clear-PQBUHQMO.js} +1 -1
- package/dist/chunks/{commands-Bx-lrmie-W7FCFL4P.js → commands-Bx-lrmie-3SGNZMAL.js} +1 -1
- package/dist/chunks/{config-A7DCP25J.js → config-6CSTGEZQ.js} +1 -1
- package/dist/chunks/{config-HiWLfXRQ-D7JA4E3D.js → config-HiWLfXRQ-C5TMRFGS.js} +1 -1
- package/dist/chunks/{config-4R62ATWJ.js → config-QQY3G5PG.js} +1 -1
- package/dist/chunks/{connect-U3yG4EtI-XYHDJQT7.js → connect-U3yG4EtI-W4F53AYR.js} +1 -1
- package/dist/chunks/{cp-aFe-HVrK-UAGAR2BC.js → cp-aFe-HVrK-NIJ7LN5P.js} +1 -1
- package/dist/chunks/{create-ilHWvzSk-7KWZXBE2.js → create-ilHWvzSk-5CZ443XL.js} +1 -1
- package/dist/chunks/{delete-DN53BRH7.js → delete-CELW3NLN.js} +1 -1
- package/dist/chunks/{delete-G4MAUBXZ.js → delete-YRATGP5Y.js} +1 -1
- package/dist/chunks/{dist-4F3LAB5Z.js → dist-6OEIUX4D.js} +1 -1
- package/dist/chunks/{domain-DGvr_U55-PNXSOVDO.js → domain-DGvr_U55-DTHIJA2K.js} +1 -1
- package/dist/chunks/{drives-Bi-Mnt2z-Z4T2YY4P.js → drives-Bi-Mnt2z-NUZTZOCO.js} +1 -1
- package/dist/chunks/{edit-7AUE6GXE.js → edit-YAYZEQRX.js} +1 -1
- package/dist/chunks/{exec-Bwv4MDyN-7YUAVBB2.js → exec-Bwv4MDyN-H45MRS5Y.js} +1 -1
- package/dist/chunks/{extend-D9tq9Cot-QT72AXGH.js → extend-D9tq9Cot-VK6JMUOY.js} +1 -1
- package/dist/chunks/{fork-DQ6qfKqB-XXTHHUMZ.js → fork-DQ6qfKqB-F3SVDDUI.js} +1 -1
- package/dist/chunks/group-actions-UOMO2WB2.js +14 -0
- package/dist/chunks/{groups-B8JVEeKk-K57VTXSS.js → groups-B8JVEeKk-K3CAYKG3.js} +1 -1
- package/dist/chunks/{image-DX2IAUKJ.js → image-DXZ4FKTV.js} +1 -1
- package/dist/chunks/{inspect-IHVP2M4H.js → inspect-BZKFXH45.js} +1 -1
- package/dist/chunks/{inspect-PBSKPN4W.js → inspect-TAR6RBRU.js} +1 -1
- package/dist/chunks/{inspect-GJXLYJC7.js → inspect-TDDHNNQS.js} +1 -1
- package/dist/chunks/inspect-YBEV7TZS.js +13 -0
- package/dist/chunks/{inspect-BS5UPI6W.js → inspect-YPATSOEP.js} +1 -1
- package/dist/chunks/{list-2ZCNO6DY.js → list-6JXV7U6T.js} +1 -1
- package/dist/chunks/{list-TUST62E6.js → list-JB32VTAB.js} +2 -2
- package/dist/chunks/{list-ZSQVIQXC.js → list-KJGICUN5.js} +1 -1
- package/dist/chunks/{list-iqQFvOHx-PNAUIUQL.js → list-iqQFvOHx-X3FHHVJX.js} +1 -1
- package/dist/chunks/{login-DGxA9ez--ZRIJ24TS.js → login-DGxA9ez--34Z67E3O.js} +1 -1
- package/dist/chunks/{login-CUEQHDT5.js → login-NXBKDSGN.js} +1 -1
- package/dist/chunks/{logout-OEbPJLu2-7NPM6ALK.js → logout-OEbPJLu2-RYNBWYWW.js} +1 -1
- package/dist/chunks/{ls-EEJQIKNI.js → ls-5UEICZHX.js} +1 -1
- package/dist/chunks/{ls-XYEJ5MR6.js → ls-A576SCRN.js} +1 -1
- package/dist/chunks/ls-BPD6GAEF.js +8 -0
- package/dist/chunks/{ls-UMSUUQCG.js → ls-KSFP2X45.js} +1 -1
- package/dist/chunks/{ls-27K5BB7Z.js → ls-SSLCXR4A.js} +1 -1
- package/dist/chunks/{ls-W7C5I555.js → ls-TBZHWZVO.js} +1 -1
- package/dist/chunks/{mutate-IELSY6ED.js → mutate-IQQTYNNF.js} +1 -1
- package/dist/chunks/{notifications-GZH7CFZY.js → notifications-BC2UCLDC.js} +1 -1
- package/dist/chunks/{open-EVYPUPNZ.js → open-JS5WAG77.js} +1 -1
- package/dist/chunks/{permissions-EHF5MNZP.js → permissions-3CD6EL4U.js} +1 -1
- package/dist/chunks/{push-YWKZ6SOO.js → push-TO7G2R7N.js} +1 -1
- package/dist/chunks/{query-G62G25HV.js → query-EVW5T2PI.js} +1 -1
- package/dist/chunks/{raw-query-WTKAOYCP.js → raw-query-7GAKEK2P.js} +1 -1
- package/dist/chunks/{read-BTA5slYO-IJLWMNSS.js → read-BTA5slYO-BJWNLVXG.js} +1 -1
- package/dist/chunks/{remove-7PSNAEDY.js → remove-AAFJR4EN.js} +1 -1
- package/dist/chunks/{remove-CCa99nz9-LCSNBDLT.js → remove-CCa99nz9-GDMR52SN.js} +1 -1
- package/dist/chunks/{reorder-OLCKSATY.js → reorder-QVSTUVEQ.js} +1 -1
- package/dist/chunks/{reply-OVHQNEBO.js → reply-QSTMHPP5.js} +1 -1
- package/dist/chunks/{resolve-TUHO4FHT.js → resolve-MITWQMP7.js} +1 -1
- package/dist/chunks/{rm-5RGN33Y5.js → rm-6KTCXHBG.js} +1 -1
- package/dist/chunks/{rm-D7CWGBTV.js → rm-GXDLM3SA.js} +1 -1
- package/dist/chunks/{rm-FYU3GBLC.js → rm-HXJWSOE4.js} +1 -1
- package/dist/chunks/{rm-HA752TW6.js → rm-M7QVN2N6.js} +1 -1
- package/dist/chunks/{rule-inspect-Y2MX7LQN.js → rule-inspect-D3BVZZRN.js} +1 -1
- package/dist/chunks/{run-D8obqfKw-D2EGHTU2.js → run-D8obqfKw-OEX3KLVO.js} +1 -1
- package/dist/chunks/{schema-UVTYLX6L.js → schema-T5BO3RBL.js} +1 -1
- package/dist/chunks/{sessions-cvWvPgzc-FBOQQPU5.js → sessions-cvWvPgzc-TBJZH7TC.js} +1 -1
- package/dist/chunks/{sh-7olsIyJh-NFO2QYTK.js → sh-7olsIyJh-FVAQLHEW.js} +1 -1
- package/dist/chunks/{snapshot-D9MAspub-UAVA2YSK.js → snapshot-D9MAspub-3U6JKVET.js} +1 -1
- package/dist/chunks/{snapshots-DQjvm6St-DBG4H2HS.js → snapshots-DQjvm6St-OGXR5PCJ.js} +1 -1
- package/dist/chunks/{stop-SQX-uC-Q-CRDQOA5M.js → stop-SQX-uC-Q-JSVPVN5K.js} +1 -1
- package/dist/chunks/{tags-DEIOW5MM.js → tags-KBCTII3M.js} +1 -1
- package/dist/chunks/{update-VG2LHBRV.js → update-FZESOZEW.js} +1 -1
- package/dist/chunks/{users-CGEsQ4G8-POYTVZJV.js → users-CGEsQ4G8-R2N46HVG.js} +1 -1
- package/dist/chunks/views-YXAMSKLM.js +11 -0
- package/dist/chunks/{write-DixEhGqz-YYDLLSJE.js → write-DixEhGqz-GBORRSZU.js} +1 -1
- package/dist/commands/deploy/index.js +1 -1
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/project/index.js +1 -1
- package/dist/commands-account.js +2 -2
- package/dist/commands-ai.js +1 -1
- package/dist/commands-blob.js +1 -1
- package/dist/commands-core.js +78 -46
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +1 -1
- package/dist/commands-integrations.js +1 -1
- package/dist/commands-observability.js +2 -2
- package/dist/commands-routing.js +2 -2
- package/dist/index.js +1 -1
- package/dist/internal-build.js +1 -1
- package/dist/package.json +1 -1
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +11 -11
- package/dist/chunks/chunk-4OOHXEKI.js +0 -7
- package/dist/chunks/chunk-RACUGILV.js +0 -7
- package/dist/chunks/inspect-Y7VXJEI2.js +0 -13
- package/dist/chunks/ls-PAL6FQB6.js +0 -8
- /package/dist/chunks/{chunk-OTIERMC7.js → chunk-COOA33HY.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/cli-support",
|
|
3
|
-
"version": "68.
|
|
3
|
+
"version": "68.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "The JavaScript Vercel CLI, installed by vercel to run where its native binary can't",
|
|
@@ -35,28 +35,28 @@
|
|
|
35
35
|
"zod": "4.6.7",
|
|
36
36
|
"@vercel/backends": "29.0.0",
|
|
37
37
|
"@vercel/build-utils": "15.7.0",
|
|
38
|
-
"@vercel/cli-config": "0.4.0",
|
|
39
38
|
"@vercel/cli-auth": "0.4.3",
|
|
40
|
-
"@vercel/container": "29.1.0",
|
|
41
39
|
"@vercel/detect-agent": "1.2.7",
|
|
40
|
+
"@vercel/cli-config": "0.4.0",
|
|
42
41
|
"@vercel/elysia": "29.0.0",
|
|
42
|
+
"@vercel/container": "29.1.0",
|
|
43
43
|
"@vercel/express": "29.0.0",
|
|
44
44
|
"@vercel/fastify": "29.0.0",
|
|
45
45
|
"@vercel/h3": "29.0.0",
|
|
46
46
|
"@vercel/go": "32.0.0",
|
|
47
|
-
"@vercel/hono": "29.0.0",
|
|
48
|
-
"@vercel/koa": "29.0.0",
|
|
49
47
|
"@vercel/hydrogen": "30.0.0",
|
|
48
|
+
"@vercel/koa": "29.0.0",
|
|
49
|
+
"@vercel/nestjs": "29.0.0",
|
|
50
|
+
"@vercel/hono": "29.0.0",
|
|
50
51
|
"@vercel/next": "33.0.1",
|
|
51
52
|
"@vercel/python": "35.0.1",
|
|
52
|
-
"@vercel/nestjs": "29.0.0",
|
|
53
53
|
"@vercel/python-analysis": "0.16.0",
|
|
54
|
-
"@vercel/redwood": "31.0.0",
|
|
55
54
|
"@vercel/node": "34.0.0",
|
|
56
|
-
"@vercel/ruby": "31.0.0",
|
|
57
55
|
"@vercel/remix-builder": "34.0.0",
|
|
58
|
-
"@vercel/
|
|
59
|
-
"@vercel/
|
|
56
|
+
"@vercel/redwood": "31.0.0",
|
|
57
|
+
"@vercel/ruby": "31.0.0",
|
|
58
|
+
"@vercel/rust": "30.0.0",
|
|
59
|
+
"@vercel/static-build": "31.0.0"
|
|
60
60
|
},
|
|
61
61
|
"builders": {
|
|
62
62
|
"@vercel/backends": "29.0.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@vercel/static-build": "31.0.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@vercel-internals/cli-core": "68.
|
|
83
|
+
"@vercel-internals/cli-core": "68.2.0"
|
|
84
84
|
},
|
|
85
85
|
"os": [
|
|
86
86
|
"aix",
|
|
@@ -1,7 +0,0 @@
|
|
|
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{outputError}from"./chunk-4FPYV37P.js";import{getScope}from"./chunk-CRPZYLIL.js";import{getLinkedProject}from"./chunk-HDKEES7E.js";import{getProjectByNameOrId}from"./chunk-UGVOMXYR.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-E6VQXHBD.js";import{ProjectNotFound,isAPIError}from"./chunk-MTPHHAPR.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 scopeFromLinkedProject(linkedProject)}function scopeFromLinkedProject(linkedProject){return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}export{emitAlertsScopeError,resolveAlertsScope,scopeFromLinkedProject};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{packageName}from"./chunk-EFGZK6OY.js";import{formatOption,jsonOption,limitOption,projectOption,sinceOption,untilOption}from"./chunk-CUO3CYU3.js";var listSubcommand={name:"ls",aliases:["list"],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},inspectSubcommand={name:"inspect",aliases:[],description:"Show details for a single alert group",arguments:[{name:"groupId",required:!0}],options:[formatOption,jsonOption,{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Use team-wide scope (ignore linked project auto-scoping)."}],examples:[{name:"Inspect a group in the linked project",value:`${packageName} alerts inspect grp_abc123`},{name:"Inspect as JSON",value:`${packageName} alerts inspect grp_abc123 --json`}]},alertsCommand={name:"alerts",aliases:[],description:"List alert groups or inspect a group. To manage alert rules, see `vercel monitors`.",arguments:[],subcommands:[listSubcommand,inspectSubcommand],options:[{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by alert type. Repeatable and comma-separated (for example --type usage_anomaly,error_anomaly)."},{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Show team-wide alerts (ignore linked project auto-scoping)."},{name:"ai",shorthand:null,type:Boolean,deprecated:!1,description:"Print AI-focused sections (title, resolved time, summary, key findings) instead of table output."},{...sinceOption,description:`${sinceOption.description} (default: 24h ago)`},untilOption,limitOption,formatOption,jsonOption],examples:[{name:"List alerts for the linked project",value:`${packageName} alerts`},{name:"List team-wide alerts",value:`${packageName} alerts --all`},{name:"Filter by type",value:`${packageName} alerts --type usage_anomaly --type error_anomaly`},{name:"Output JSON",value:`${packageName} alerts --json`},{name:"Custom time range",value:`${packageName} alerts --since 2026-03-01T00:00:00.000Z --until 2026-03-02T00:00:00.000Z`}]};export{listSubcommand,inspectSubcommand,alertsCommand};
|
|
@@ -1,13 +0,0 @@
|
|
|
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{formatTriggerOperator,getGroupStartedAt,getGroupTitle,getGroupType,humanizeReference,normalizeTimestamp,renderAlertTable}from"./chunk-QOIG2FJP.js";import{resolveRulesTeam}from"./chunk-QMI7GTT2.js";import{resolveAlertsScope,scopeFromLinkedProject}from"./chunk-4OOHXEKI.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import"./chunk-GHAY4PSD.js";import{truncateEnd,truncateMiddle}from"./chunk-EL65DTVZ.js";import{outputError}from"./chunk-4FPYV37P.js";import"./chunk-FIICEEXO.js";import{formatDate}from"./chunk-46R47IE5.js";import"./chunk-GZNDA6SV.js";import"./chunk-OM6NML7C.js";import"./chunk-QCYCLWNG.js";import{inspectSubcommand}from"./chunk-RACUGILV.js";import"./chunk-CRPZYLIL.js";import{getLinkedProject}from"./chunk-HDKEES7E.js";import"./chunk-SUD5V67L.js";import"./chunk-7TRHPXCG.js";import"./chunk-UGVOMXYR.js";import"./chunk-QRPBDCDH.js";import"./chunk-2GXP676X.js";import"./chunk-K5GE24PG.js";import"./chunk-IFMPBA4K.js";import"./chunk-KHJWQ4WP.js";import"./chunk-MY4MONOH.js";import"./chunk-YATYCZQJ.js";import"./chunk-2ILZM77F.js";import{printError}from"./chunk-7EI554V5.js";import{parseArguments}from"./chunk-E7ICSU45.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-E6VQXHBD.js";import{validateJsonOutput}from"./chunk-BDLZ6WL2.js";import"./chunk-PH2MLBQO.js";import"./chunk-DCFCPAFQ.js";import"./chunk-GOXGA37R.js";import{isAPIError}from"./chunk-MTPHHAPR.js";import{packageName}from"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-RRX2AMWY.js";import"./chunk-GUFRGEM5.js";import"./chunk-SUT2PTL3.js";import"./chunk-AX6UCTOC.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-AUCQKYL2.js";import{getFlagsSpecification}from"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_chalk=__toESM(require_source(),1);var aggregationLabels={sum:"Sum",avg:"Average",min:"Min",max:"Max",p50:"P50",p75:"P75",p90:"P90",p95:"P95",p99:"P99",stddev:"Std Dev",unique:"Unique",persecond:"Per Second",percent:"Percent"},formatCustomAlertRatioBelowFivePercent=new Intl.NumberFormat("en-US",{maximumFractionDigits:2,minimumFractionDigits:2,style:"percent"}),formatCustomAlertRatioThresholdValue=new Intl.NumberFormat("en-US",{maximumFractionDigits:4,minimumFractionDigits:0,style:"percent"});function getGroupStatus(group){if(group.status)return group.status;let alerts=group.alerts??[];return alerts.some(alert=>alert.status==="active")?"active":alerts.length>0?"resolved":"-"}function humanizeLabel(value){return humanizeReference(value,{case:"title"})}function formatAlertFieldValue(value,maxLength=64){if(value==null)return;let displayValue=typeof value=="number"?formatNumber(value):String(value);if(displayValue)return truncateMiddle(displayValue,maxLength)}function formatNumber(value){let absValue=Math.abs(value),sign=value<0?"-":"";for(let[threshold,suffix]of[[1e9,"B"],[1e6,"M"],[1e3,"k"]])if(absValue>=threshold)return`${sign}${(absValue/threshold).toFixed(1).replace(/\.0$/,"")}${suffix}`;return Number.isInteger(value)?String(value):value.toFixed(2).replace(/\.?0+$/,"")}function parseFormattedNumber(value){let trimmed=value.trim();if(!trimmed)return;let number=Number(trimmed.replace(/,/g,""));return Number.isFinite(number)?number:void 0}function formatRatio(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);if(number===void 0)return value;let percent=number*100;return percent>=5?`${Math.floor(percent)}%`:formatCustomAlertRatioBelowFivePercent.format(number)}function formatRatioThreshold(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);return number===void 0?value:formatCustomAlertRatioThresholdValue.format(number)}function getAlertSonarQuery(alert){return alert.sonarQuery??alert.data?.sonarQuery}function getCustomAlertBaselineTitle(alert){let granularity=getAlertSonarQuery(alert)?.granularity;return(granularity&&("hours"in granularity||"days"in granularity)?"7-day baseline":"24-hour baseline").replace(/\b[a-z]/g,character=>character.toUpperCase())}function appendUnit(value,unit){return!unit||unit==="score"?value:unit==="ratio"?formatRatio(value):unit==="%"?value.endsWith("%")?value:`${value}%`:value.toLowerCase().includes(unit.toLowerCase())?value:`${value} ${unit}`}function formatThreshold(alert){let data=alert.data,formatted=alert.formattedValues?.formattedThreshold??(data?.triggerThreshold===void 0?void 0:formatNumber(data.triggerThreshold));if(!formatted)return;let operator=formatTriggerOperator(data?.triggerOperator),threshold=data?.triggerType==="anomaly"?`${formatAnomalyThreshold(formatted,data.triggerOperator)} z-score`:alert.unit==="ratio"?formatRatioThreshold(formatted):appendUnit(formatted,alert.unit);return[operator,threshold].filter(Boolean).join(" ")}function formatAnomalyThreshold(formatted,operator){return operator!=="lt"&&operator!=="lte"?formatted:`-${formatted.replace(/^-/,"")}`}function getRuleIds(alert){let ids=new Set,dataRuleId=alert.data?.ruleId;dataRuleId&&ids.add(dataRuleId);for(let ruleId of alert.rules??[])ruleId&&ids.add(ruleId);return[...ids]}function getAlertResolvedAt(alert){return normalizeTimestamp(alert.recordedResolvedAt??alert.resolvedAt)}function getSignalRows(alert){let rows=[],formattedValues=alert.formattedValues??{},observed=formattedValues.formattedCount,baseline=formattedValues.formattedAvg,change=[formattedValues.changeDirection,formattedValues.changeAmount].filter(Boolean).join(" "),zscore=alert.data?.zscore,threshold=formatThreshold(alert),minThreshold=alert.data?.minThreshold,isRatioFormulaAlert=!!getCustomAlertFormula(alert);return alert.eventLabel&&rows.push(["Event",alert.eventLabel]),alert.measureLabel&&rows.push(["Measure",alert.measureLabel]),observed&&rows.push(["Observed Value",appendUnit(observed,alert.unit)]),baseline&&rows.push([alert.type==="custom_alert"&&alert.data?.triggerType==="anomaly"?getCustomAlertBaselineTitle(alert):"Baseline",appendUnit(baseline,alert.unit)]),change&&rows.push(["Change",change]),zscore!==void 0&&rows.push(["Observed Deviation",`${formatNumber(zscore)} z-score`]),threshold&&rows.push(["Threshold",threshold]),minThreshold!==void 0&&!isRatioFormulaAlert&&rows.push(["Minimum",alert.unit==="ratio"?formatNumber(minThreshold):appendUnit(formatNumber(minThreshold),alert.unit)]),formattedValues.errorRate&&rows.push(["Error Rate",formattedValues.errorRate]),formattedValues.avgErrorRate&&rows.push(["Baseline Error Rate",formattedValues.avgErrorRate]),rows.push(...getFieldRows(alert)),rows}function getFieldRows(alert){let fields=alert.data?.fields;if(!fields)return[];let groupBy=getAlertSonarQuery(alert)?.groupBy??[];return[...groupBy,...Object.keys(fields).filter(key=>!groupBy.includes(key))].flatMap(key=>{let value=fields[key],displayValue=formatAlertFieldValue(value);return displayValue?[[humanizeLabel(key),displayValue]]:[]})}function formatAggregation(value){return value?aggregationLabels[value]??humanizeLabel(value):void 0}function formatQueryReference(value){return value?humanizeLabel(value):void 0}function formatRollupDetail(rollup,fallbackMeasure){if(!rollup)return;let aggregation=formatAggregation(rollup.aggregation),measure=fallbackMeasure??formatQueryReference(rollup.measure);return[aggregation,measure].filter(Boolean).join(" ")||void 0}function getPrimaryRollup(rollups){return Object.values(rollups??{})[0]}function getCustomAlertFormula(alert){let formula=alert.data?.formula;if(formula?.operator==="divide"&&formula.left&&formula.right)return{operator:formula.operator,left:formula.left,right:formula.right}}function getQueryRows(alert){if(alert.type!=="custom_alert")return[];let query=getAlertSonarQuery(alert);if(!query)return[];let formula=getCustomAlertFormula(alert),rows=[],addRow=(label,value)=>{value&&rows.push([label,truncateMiddle(value,120)])};if(addRow("Event",alert.eventLabel??formatQueryReference(query.event)),formula)addRow("Numerator",formatRollupDetail(query.rollups?.[formula.left])),addRow("Denominator",formatRollupDetail(query.rollups?.[formula.right]));else{let primaryRollup=getPrimaryRollup(query.rollups);addRow("Measure",alert.measureLabel??formatQueryReference(primaryRollup?.measure)),addRow("Aggregation",formatAggregation(primaryRollup?.aggregation))}addRow("Granularity",formatGranularity(query.granularity));let groupBy=query.groupBy?.filter(Boolean)??[];if(groupBy.length>0&&addRow("Group by",groupBy.map(humanizeLabel).join(", ")),formula&&typeof alert.data?.minThreshold=="number"&&addRow("Minimum Numerator",formatNumber(alert.data.minThreshold)),addRow("Filter by",query.filter?.trim()),formula)for(let[label,rollupName]of[["Numerator filter",formula.left],["Denominator filter",formula.right]])addRow(label,query.rollups?.[rollupName]?.filter?.trim());return rows}function getDetailRows(alert){let data=alert.data;if(!data)return[];let rows=[],addRow=(label,value)=>{let displayValue=formatAlertFieldValue(value);displayValue&&rows.push([label,displayValue])};return addRow("Route",data.route),addRow("Status Group",data.statusGroup),addRow("Deployment ID",data.deploymentId),rows}function renderAlertSections(alert){let lines=[],signalRows=getSignalRows(alert);signalRows.length>0&&(lines.push(import_chalk.default.cyan("Signals")),lines.push(renderAlertTable(signalRows,3)));let queryRows=getQueryRows(alert);return queryRows.length>0&&(lines.push(import_chalk.default.cyan("Query")),lines.push(renderAlertTable(queryRows,3))),lines.join(`
|
|
8
|
-
`)}function renderAlert(alert,index,totalAlerts){let title=alert.title||`Alert ${index+1}`,ruleIds=getRuleIds(alert),resolvedAt=getAlertResolvedAt(alert),sections=renderAlertSections(alert),summaryRows=[["Alert id",alert.id||"-"],["Type",alert.type||"-"],["Status",alert.status||"-"],["Started At",formatDate(normalizeTimestamp(alert.recordedStartedAt??alert.startedAt))],...resolvedAt!==void 0?[["Resolved At",formatDate(resolvedAt)]]:[],...ruleIds.length>0?[["Rule id",ruleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...getDetailRows(alert)];return[import_chalk.default.bold(totalAlerts>1?`Alert ${index+1}: ${title}`:title),renderAlertTable(summaryRows,3),...sections?[sections]:[]].join(`
|
|
9
|
-
`)}function printAlertGroup(group,groupId){let alerts=group.alerts??[],singleAlert=alerts.length===1?alerts[0]:void 0,singleAlertRuleIds=singleAlert?getRuleIds(singleAlert):[],singleAlertResolvedAt=singleAlert?getAlertResolvedAt(singleAlert):void 0,summaryRows=[["Title",truncateEnd(getGroupTitle(group),80)],["Group id",group.id||groupId],["Type",getGroupType(group)],["Status",getGroupStatus(group)],["Started At",formatDate(getGroupStartedAt(group))],...singleAlertResolvedAt!==void 0?[["Resolved At",formatDate(singleAlertResolvedAt)]]:[],["Alerts",String(alerts.length)],...singleAlert?.id?[["Alert id",singleAlert.id]]:[],...singleAlertRuleIds.length>0?[["Rule id",singleAlertRuleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...singleAlert?getDetailRows(singleAlert):[]],renderedAlerts=alerts.length>0?alerts.length===1?renderAlertSections(alerts[0]):alerts.map((alert,index)=>renderAlert(alert,index,alerts.length)).join(`
|
|
10
|
-
|
|
11
|
-
`):"No alerts in this group.";output_manager_default.print(["",`${import_chalk.default.bold("Alert group")} ${import_chalk.default.cyan(group.id||groupId)}`,renderAlertTable(summaryRows,3),"",renderedAlerts,""].join(`
|
|
12
|
-
`))}async function inspect(client,argv){let parsedArgs,spec=getFlagsSpecification(inspectSubcommand.options);try{parsedArgs=parseArguments(argv,spec)}catch(e){let msg=e instanceof Error?e.message:String(e),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:projectFlagMissingArg?[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId> --project <name-or-id>"),when:"Re-run with placeholders replaced"}]:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect --help"),when:"See valid `alerts inspect` usage"}]},2),printError(e),2}let groupId=parsedArgs.args[0],fr=validateJsonOutput(parsedArgs.flags);if(!fr.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},2),output_manager_default.error(fr.error),2;if(!groupId)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing group id. Example: ${packageName} alerts inspect <groupId>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId>"),when:"Replace <groupId> with a group id from `vercel alerts`"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel alerts inspect <groupId>`");let scope=await resolveInspectScope(client,{project:parsedArgs.flags["--project"],all:parsedArgs.flags["--all"],jsonOutput:fr.jsonOutput,command:`alerts inspect ${groupId}`});if(typeof scope=="number")return scope;let query=new URLSearchParams({teamId:scope.teamId});scope.projectId&&query.set("projectId",scope.projectId);let path=`/alerts/v3/groups/${encodeURIComponent(groupId)}?${query.toString()}`;output_manager_default.spinner("Fetching alert group...");try{let group=await client.fetch(path);return fr.jsonOutput?client.stdout.write(`${JSON.stringify({group},null,2)}
|
|
13
|
-
`):printAlertGroup(group,groupId),0}catch(err){if(isAPIError(err)){let msg=err.serverMessage||`API error (${err.status}).`,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;return outputAgentError(client,{status:"error",reason,message:msg,...err.status===401||err.status===403||err.status===404?{hint:scope.projectId?"The request was scoped to a project. Use --all, and --scope <team-slug> if the group belongs to another team.":"Confirm team scope; use --scope <team-slug> if the group belongs to another team.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,scope.projectId?`alerts inspect ${groupId} --all`:`alerts inspect ${groupId}`),when:"Retry after fixing scope or permissions"}]}:{}},1),outputError(client,fr.jsonOutput,err.code||"API_ERROR",msg)}throw err}finally{output_manager_default.stopSpinner()}}async function resolveInspectScope(client,opts){if(opts.project||opts.all)return resolveAlertsScope(client,opts);let linkedProject=await getLinkedProject(client);return linkedProject.status==="error"?linkedProject.exitCode:linkedProject.status==="linked"?scopeFromLinkedProject(linkedProject):resolveRulesTeam(client,opts.jsonOutput)}export{inspect as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
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{printRules}from"./chunk-Z62G57GC.js";import"./chunk-QOIG2FJP.js";import{parseRulesFlagsAndScope}from"./chunk-QMI7GTT2.js";import"./chunk-4OOHXEKI.js";import{emitRulesArgParseError,handleRulesApiError,outputRulesError,rulesCollectionPath}from"./chunk-WKEDN5SX.js";import"./chunk-DRDY2UZX.js";import"./chunk-GHAY4PSD.js";import"./chunk-EL65DTVZ.js";import{normalizeRepeatableStringFilters}from"./chunk-4FPYV37P.js";import"./chunk-FIICEEXO.js";import"./chunk-46R47IE5.js";import"./chunk-GZNDA6SV.js";import"./chunk-OM6NML7C.js";import"./chunk-R5KBPWWS.js";import"./chunk-QCYCLWNG.js";import{monitorsLsSubcommand}from"./chunk-X2UJGCIC.js";import"./chunk-CRPZYLIL.js";import"./chunk-HDKEES7E.js";import"./chunk-SUD5V67L.js";import"./chunk-7TRHPXCG.js";import"./chunk-UGVOMXYR.js";import"./chunk-QRPBDCDH.js";import"./chunk-2GXP676X.js";import"./chunk-K5GE24PG.js";import"./chunk-IFMPBA4K.js";import"./chunk-KHJWQ4WP.js";import"./chunk-MY4MONOH.js";import"./chunk-YATYCZQJ.js";import"./chunk-2ILZM77F.js";import{printError}from"./chunk-7EI554V5.js";import{parseArguments}from"./chunk-E7ICSU45.js";import"./chunk-E6VQXHBD.js";import{validateJsonOutput}from"./chunk-BDLZ6WL2.js";import"./chunk-PH2MLBQO.js";import"./chunk-DCFCPAFQ.js";import"./chunk-GOXGA37R.js";import{isAPIError}from"./chunk-MTPHHAPR.js";import"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-RRX2AMWY.js";import"./chunk-GUFRGEM5.js";import"./chunk-SUT2PTL3.js";import"./chunk-AX6UCTOC.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-AUCQKYL2.js";import{getFlagsSpecification}from"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import"./chunk-NBPLUP7C.js";var BUILT_IN_ALERT_TYPES=["usage_anomaly","error_anomaly","botId_anomaly","firewallSystemRule_anomaly","firewallCustomRule_anomaly","testAlert_anomaly","buildTime_anomaly"];var BUILT_IN_ALERT_TYPE_SET=new Set(BUILT_IN_ALERT_TYPES);function parseRuleTypeFilter(client,values,jsonOutput){let types=normalizeRepeatableStringFilters(values);if(types.length===0)return;let invalidType=types.find(type=>type!=="built-in"&&type!=="custom"&&type!=="custom_alert"&&!BUILT_IN_ALERT_TYPE_SET.has(type));if(invalidType)return outputRulesError(client,jsonOutput,"INVALID_RULE_TYPE",`Invalid monitor type "${invalidType}". Expected a supported monitor type or built-in trigger type.`);let includeCustom=types.includes("custom")||types.includes("custom_alert"),includeAllBuiltIn=types.includes("built-in"),builtInAlertTypes=new Set(types.filter(type=>BUILT_IN_ALERT_TYPE_SET.has(type))),includeBuiltIn=includeAllBuiltIn||builtInAlertTypes.size>0;return{apiType:includeCustom===includeBuiltIn?void 0:includeCustom?"custom":"built-in",matches(rule){return rule.type==="custom"?includeCustom:includeAllBuiltIn?!0:includeBuiltIn?rule.triggers.mode==="all"?!0:rule.triggers.items.some(trigger=>builtInAlertTypes.has(trigger.type)):!1}}}async function ls(client,argv,api,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(monitorsLsSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"monitors ls --project <name-or-id>"),printError(error),2}let flags=parsedArgs.flags;telemetry?.trackCliOptionType(flags["--type"]),telemetry?.trackCliFlagAll(flags["--all"]),telemetry?.trackCliFlagJson(flags["--json"]);let format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);let typeFilter=parseRuleTypeFilter(client,flags["--type"],format.jsonOutput);if(typeof typeFilter=="number")return typeFilter;let scope=await parseRulesFlagsAndScope(client,{"--project":flags["--project"],"--all":flags["--all"]},format.jsonOutput,"monitors ls");if(typeof scope=="number")return scope;output_manager_default.spinner("Fetching monitors\u2026");try{let rules=[],cursor;do{let page=await client.fetch(rulesCollectionPath(api,scope.teamId,{limit:100,cursor,projectId:scope.projectId,type:typeFilter?.apiType}));rules.push(...page[api.listKey]),cursor=page.pagination.next??void 0}while(cursor);let filteredRules=typeFilter?rules.filter(typeFilter.matches):rules;return format.jsonOutput?client.stdout.write(`${JSON.stringify({[api.listKey]:filteredRules},null,2)}
|
|
8
|
-
`):filteredRules.length===0?output_manager_default.log("No monitors found for this scope"):printRules(filteredRules),0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}export{ls as default};
|
|
File without changes
|