vercel 58.4.0 → 58.5.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.
Files changed (91) hide show
  1. package/dist/chunks/{add-IOYS5JE4.js → add-2KSAN7EK.js} +43 -8
  2. package/dist/chunks/{add-JTIGJQ75.js → add-HTKUQ3KF.js} +3 -3
  3. package/dist/chunks/{add-QKKUAXFL.js → add-Y3ACMZQ3.js} +3 -3
  4. package/dist/chunks/{build-ZHZDIIS5.js → build-SOTUMEPT.js} +3 -3
  5. package/dist/chunks/{chunk-MAHXF73X.js → chunk-3L2YLLHC.js} +1 -1
  6. package/dist/chunks/{chunk-G47QOVJ7.js → chunk-4PZ2IIZI.js} +1 -1
  7. package/dist/chunks/{chunk-JHIWAM64.js → chunk-4ZZI2JPE.js} +1 -1
  8. package/dist/chunks/{chunk-WUMURQKS.js → chunk-7RTO3VPE.js} +122 -44
  9. package/dist/chunks/{chunk-SWHPI3G7.js → chunk-CVZWB2MA.js} +1 -1
  10. package/dist/chunks/{chunk-56QCZ4RL.js → chunk-FQ4R66UG.js} +1 -1
  11. package/dist/chunks/chunk-GE5R7SYE.js +85 -0
  12. package/dist/chunks/{chunk-DI54DSTV.js → chunk-GKLT2ZGC.js} +210 -60
  13. package/dist/chunks/{chunk-NJUPUGOE.js → chunk-HT2XWSAJ.js} +1 -1
  14. package/dist/chunks/chunk-I2XE3GMB.js +21 -0
  15. package/dist/chunks/{chunk-2ILCTO6A.js → chunk-I5F5AE2Q.js} +2 -2
  16. package/dist/chunks/{chunk-GJ5DKYDQ.js → chunk-IKIPDMQT.js} +7 -5
  17. package/dist/chunks/{chunk-U7Y5DZXS.js → chunk-IRX26ZL5.js} +2 -2
  18. package/dist/chunks/{chunk-U5E5J56I.js → chunk-LTEFJ3VD.js} +3 -3
  19. package/dist/chunks/{chunk-PVWXPWLQ.js → chunk-LXRK7KPA.js} +1255 -1371
  20. package/dist/chunks/{chunk-27FZN5LR.js → chunk-MEOBIY2L.js} +3 -3
  21. package/dist/chunks/chunk-MXLA3VQS.js +20 -0
  22. package/dist/chunks/{chunk-QTXQOWOJ.js → chunk-NXLNRLL7.js} +2 -2
  23. package/dist/chunks/{chunk-IBSUQT6H.js → chunk-OQ6UFVGM.js} +1 -1
  24. package/dist/chunks/{chunk-OWY3MF3E.js → chunk-PGH6RJJF.js} +7 -3
  25. package/dist/chunks/{chunk-DXS2X7KK.js → chunk-QS5I33VI.js} +6 -4
  26. package/dist/chunks/{chunk-EBLH23AQ.js → chunk-TEQKKTJQ.js} +4 -7
  27. package/dist/chunks/{chunk-Z5ZQJ5VJ.js → chunk-TJJ562C5.js} +3 -0
  28. package/dist/chunks/{chunk-ZQR5RIAX.js → chunk-TQE7DRGH.js} +5 -5
  29. package/dist/chunks/{chunk-4UYKSYKQ.js → chunk-UMA66MKW.js} +66 -2
  30. package/dist/chunks/chunk-V5P25P7F.js +22 -0
  31. package/dist/chunks/{chunk-AZS5CLCN.js → chunk-YFQSZI5Q.js} +1 -1
  32. package/dist/chunks/{chunk-CAWBO7SQ.js → chunk-Z3VYQ7JP.js} +9 -7
  33. package/dist/chunks/chunk-ZHDQMUK4.js +96 -0
  34. package/dist/chunks/{chunk-KWOWGI7Z.js → chunk-ZYCVYZSR.js} +1 -1
  35. package/dist/chunks/{clear-R3DI3AA6.js → clear-GLMDDDUR.js} +3 -3
  36. package/dist/chunks/{compile-vercel-config-NEC63GCN.js → compile-vercel-config-7JTL7U5E.js} +2 -2
  37. package/dist/chunks/config-validator.mjs +1 -1
  38. package/dist/chunks/{constants-3FSSR6E7.js → constants-T6BULVX6.js} +1 -1
  39. package/dist/chunks/{delete-BYB66ET3.js → delete-HE6FCDYS.js} +3 -3
  40. package/dist/chunks/{delete-DIZK7FRU.js → delete-M3DCAYTX.js} +3 -3
  41. package/dist/chunks/{disable-HW6CHEVD.js → disable-LHOHFHGU.js} +3 -3
  42. package/dist/chunks/{discard-3UG4K6G2.js → discard-D2SI77HA.js} +3 -3
  43. package/dist/chunks/{edit-EY7LRITZ.js → edit-PSUYL34C.js} +3 -3
  44. package/dist/chunks/{edit-LD5G6GL3.js → edit-XCJDQOZR.js} +4 -4
  45. package/dist/chunks/{enable-MDNLCSAW.js → enable-QXXBU3QH.js} +3 -3
  46. package/dist/chunks/{export-25X6M77L.js → export-CRCAJ72L.js} +3 -3
  47. package/dist/chunks/{image-YQWZLM6Z.js → image-4YES44D3.js} +4 -4
  48. package/dist/chunks/{inspect-H7GEYNIF.js → inspect-CFJWOYWD.js} +4 -4
  49. package/dist/chunks/{inspect-KYAB4F3P.js → inspect-FEW47KAZ.js} +3 -3
  50. package/dist/chunks/{inspect-73FISCNZ.js → inspect-GYUTUSOP.js} +6 -6
  51. package/dist/chunks/{inspect-QVI6UVBJ.js → inspect-JIGB2JK7.js} +3 -3
  52. package/dist/chunks/{inspect-R6ADYTPB.js → inspect-WUT7EW6R.js} +3 -3
  53. package/dist/chunks/{list-SRKON4E4.js → list-4N6HI5LH.js} +6 -6
  54. package/dist/chunks/{list-FTNOS4FT.js → list-W4ZLROFI.js} +4 -4
  55. package/dist/chunks/{list-SDNYJJ4M.js → list-ZQOF2B2L.js} +2 -2
  56. package/dist/chunks/{login-7NR7N4ZF.js → login-FWYKZ642.js} +3 -3
  57. package/dist/chunks/{ls-T276Z2QR.js → ls-7YYHSZIR.js} +3 -3
  58. package/dist/chunks/{ls-BDLEGFY3.js → ls-AV2WYGNW.js} +3 -3
  59. package/dist/chunks/{ls-TWHG22W7.js → ls-DD7RQ7KH.js} +3 -3
  60. package/dist/chunks/{ls-PZHHHKZ7.js → ls-V7E37ERN.js} +7 -7
  61. package/dist/chunks/{ls-NIEZW5O3.js → ls-VOD4NK6A.js} +3 -3
  62. package/dist/chunks/{open-TNEPXGZK.js → open-YEJQVMYZ.js} +3 -3
  63. package/dist/chunks/{permissions-KI2JGJSN.js → permissions-OJCRKNGQ.js} +5 -5
  64. package/dist/chunks/{publish-NBGFOHLV.js → publish-XDKQYIKH.js} +3 -3
  65. package/dist/chunks/{push-SPPWXOAJ.js → push-Z2EQUVOV.js} +3 -3
  66. package/dist/chunks/{query-LS4PEYHG.js → query-KEICHLVN.js} +2 -2
  67. package/dist/chunks/{reorder-UTQ632H5.js → reorder-Z6YCND2X.js} +3 -3
  68. package/dist/chunks/{reply-QFGX5YBV.js → reply-CIWFPTEK.js} +3 -3
  69. package/dist/chunks/{resolve-ZDO5BCI7.js → resolve-BYDSKVYN.js} +3 -3
  70. package/dist/chunks/{restore-T77AKNZ2.js → restore-2KP5DLEC.js} +3 -3
  71. package/dist/chunks/{rm-3RTVWGWR.js → rm-5Z75EGOZ.js} +3 -3
  72. package/dist/chunks/{rm-D24FHFMF.js → rm-FRKS6Y2G.js} +5 -5
  73. package/dist/chunks/{rm-JTOFOKOZ.js → rm-RJOWQHQV.js} +3 -3
  74. package/dist/chunks/{rm-IQPLVKJR.js → rm-TNCPDKEX.js} +3 -3
  75. package/dist/chunks/{rule-inspect-VVHTVTRD.js → rule-inspect-NOSNKD63.js} +7 -14
  76. package/dist/chunks/{rules-EEWMLKRI.js → rules-THS42KX4.js} +10 -7
  77. package/dist/chunks/{schema-XLJLZ4OE.js → schema-MDLX6ZDL.js} +2 -2
  78. package/dist/chunks/schema-R54OXIXC.js +426 -0
  79. package/dist/chunks/{tags-5DZYPJDP.js → tags-NDPHPWME.js} +3 -3
  80. package/dist/chunks/{update-YFXZDNIV.js → update-YAN3MGMW.js} +37 -5
  81. package/dist/commands/build/index.js +61 -22
  82. package/dist/commands/deploy/index.js +27 -17
  83. package/dist/commands/dev/index.js +47 -12
  84. package/dist/commands/env/index.js +284 -20
  85. package/dist/commands/link/index.js +9 -9
  86. package/dist/commands/list/index.js +3 -3
  87. package/dist/commands-bulk.js +1966 -1264
  88. package/dist/index.js +23 -20
  89. package/dist/version.mjs +1 -1
  90. package/package.json +47 -54
  91. package/dist/chunks/chunk-V4RMJKQP.js +0 -36
@@ -6,18 +6,18 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  setupAndLink
9
- } from "./chunk-U5E5J56I.js";
9
+ } from "./chunk-LTEFJ3VD.js";
10
10
  import {
11
11
  detectExplicitScope,
12
12
  getLinkedProject,
13
13
  param,
14
14
  printProjectNotFoundError,
15
15
  resolveProjectCwd
16
- } from "./chunk-PVWXPWLQ.js";
16
+ } from "./chunk-LXRK7KPA.js";
17
17
  import {
18
18
  buildCommandWithYes,
19
19
  outputActionRequired
20
- } from "./chunk-Z5ZQJ5VJ.js";
20
+ } from "./chunk-TJJ562C5.js";
21
21
  import {
22
22
  getCommandName,
23
23
  getCommandNamePlain
@@ -0,0 +1,20 @@
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
+
8
+ // src/commands/alerts/rules/schema-help.ts
9
+ var CUSTOM_ALERT_EVENT_HELP = [
10
+ "Run `vercel metrics schema <metric-or-prefix>` to discover available metrics, aggregations, and dimensions. Metric IDs use the `vercel.` namespace, for example `vercel.request.count`.",
11
+ "Custom alert queries use query-engine event and measure names instead of the public metric ID.",
12
+ '`vercel.request.count` maps to `event: "incomingRequest"` and `measure: "count"`.',
13
+ '`vercel.function_invocation.count` maps to `event: "serverlessFunctionInvocation"` and `measure: "count"`.',
14
+ '`vercel.external_api_request.count` maps to `event: "outgoingRequest"` and `measure: "count"`.',
15
+ '`vercel.sandbox.cpu_total_time_ms` maps to `event: "sandboxUsage"` and `measure: "cpuTotalTimeMs"`.'
16
+ ];
17
+
18
+ export {
19
+ CUSTOM_ALERT_EVENT_HELP
20
+ };
@@ -20,12 +20,12 @@ import {
20
20
  getLinkedProject,
21
21
  getProjectByNameOrId,
22
22
  getScope
23
- } from "./chunk-PVWXPWLQ.js";
23
+ } from "./chunk-LXRK7KPA.js";
24
24
  import {
25
25
  AGENT_REASON,
26
26
  buildCommandWithGlobalFlags,
27
27
  outputAgentError
28
- } from "./chunk-Z5ZQJ5VJ.js";
28
+ } from "./chunk-TJJ562C5.js";
29
29
  import {
30
30
  ProjectNotFound,
31
31
  isAPIError,
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  ALIGNED_LABEL_WIDTH
9
- } from "./chunk-PVWXPWLQ.js";
9
+ } from "./chunk-LXRK7KPA.js";
10
10
  import {
11
11
  require_ms
12
12
  } from "./chunk-GGP5R3FU.js";
@@ -19,7 +19,7 @@ import {
19
19
  require_lib,
20
20
  require_minimatch,
21
21
  require_pluralize
22
- } from "./chunk-PVWXPWLQ.js";
22
+ } from "./chunk-LXRK7KPA.js";
23
23
  import {
24
24
  CantParseJSONFile,
25
25
  cmd,
@@ -11534,8 +11534,8 @@ async function writeBuildResult(args) {
11534
11534
  function isEdgeFunction(v) {
11535
11535
  return v?.type === "EdgeFunction";
11536
11536
  }
11537
- function isContainerImage(v) {
11538
- return v?.runtime === "container";
11537
+ function isContainerImage(value) {
11538
+ return typeof value === "object" && value !== null && "runtime" in value && value.runtime === "container";
11539
11539
  }
11540
11540
  function isLambda(v) {
11541
11541
  return v?.type === "Lambda";
@@ -11902,6 +11902,7 @@ async function writeContainerImage(outputDir, containerImage, path2, functionCon
11902
11902
  const architecture = functionConfiguration?.architecture ?? containerImage.architecture;
11903
11903
  const memory = functionConfiguration?.memory ?? containerImage.memory;
11904
11904
  const maxDuration = functionConfiguration?.maxDuration ?? containerImage.maxDuration;
11905
+ const maxConcurrency = functionConfiguration?.maxConcurrency ?? containerImage.maxConcurrency;
11905
11906
  const regions = functionConfiguration?.regions ?? containerImage.regions;
11906
11907
  const functionFailoverRegions = functionConfiguration?.functionFailoverRegions ?? containerImage.functionFailoverRegions;
11907
11908
  const experimentalTriggers = functionConfiguration?.experimentalTriggers ?? containerImage.experimentalTriggers;
@@ -11917,6 +11918,7 @@ async function writeContainerImage(outputDir, containerImage, path2, functionCon
11917
11918
  ...architecture !== void 0 ? { architecture } : {},
11918
11919
  ...memory !== void 0 ? { memory } : {},
11919
11920
  ...maxDuration !== void 0 ? { maxDuration } : {},
11921
+ ...maxConcurrency !== void 0 ? { maxConcurrency } : {},
11920
11922
  ...regions !== void 0 ? { regions } : {},
11921
11923
  ...functionFailoverRegions !== void 0 ? { functionFailoverRegions } : {},
11922
11924
  ...experimentalTriggers !== void 0 ? { experimentalTriggers } : {},
@@ -11985,6 +11987,7 @@ async function writeLambda(repoRootPath, outputDir, lambda, path2, functionConfi
11985
11987
  const architecture = functionConfiguration?.architecture ?? lambda.architecture;
11986
11988
  const memory = functionConfiguration?.memory ?? lambda.memory;
11987
11989
  const maxDuration = functionConfiguration?.maxDuration ?? lambda.maxDuration;
11990
+ const maxConcurrency = functionConfiguration?.maxConcurrency ?? lambda.maxConcurrency;
11988
11991
  const regions = functionConfiguration?.regions ?? lambda.regions;
11989
11992
  const functionFailoverRegions = functionConfiguration?.functionFailoverRegions ?? lambda.functionFailoverRegions;
11990
11993
  const experimentalTriggers = functionConfiguration?.experimentalTriggers ?? lambda.experimentalTriggers;
@@ -11995,6 +11998,7 @@ async function writeLambda(repoRootPath, outputDir, lambda, path2, functionConfi
11995
11998
  architecture,
11996
11999
  memory,
11997
12000
  maxDuration,
12001
+ maxConcurrency,
11998
12002
  regions,
11999
12003
  functionFailoverRegions,
12000
12004
  experimentalTriggers,
@@ -11,12 +11,12 @@ import {
11
11
  getLinkedProject,
12
12
  getProjectByNameOrId,
13
13
  getScope
14
- } from "./chunk-PVWXPWLQ.js";
14
+ } from "./chunk-LXRK7KPA.js";
15
15
  import {
16
16
  AGENT_REASON,
17
17
  buildCommandWithGlobalFlags,
18
18
  outputAgentError
19
- } from "./chunk-Z5ZQJ5VJ.js";
19
+ } from "./chunk-TJJ562C5.js";
20
20
  import {
21
21
  ProjectNotFound,
22
22
  isAPIError
@@ -117,7 +117,8 @@ async function resolveAlertsScope(client, opts) {
117
117
  }
118
118
  return {
119
119
  teamId: team.id,
120
- projectId: projectResult.id
120
+ projectId: projectResult.id,
121
+ projectName: projectResult.name
121
122
  };
122
123
  }
123
124
  const linkedProject = await getLinkedProject(client);
@@ -147,7 +148,8 @@ async function resolveAlertsScope(client, opts) {
147
148
  }
148
149
  return {
149
150
  teamId: linkedProject.org.id,
150
- projectId: linkedProject.project.id
151
+ projectId: linkedProject.project.id,
152
+ projectName: linkedProject.project.name
151
153
  };
152
154
  }
153
155
 
@@ -65,21 +65,18 @@ function humanizeReference(value, opts = {}) {
65
65
  return opts.case === "title" ? label : label.toLowerCase();
66
66
  }).join(" / ");
67
67
  }
68
- function formatRuleScope(projectId, {
68
+ function formatRuleScope(rule, {
69
69
  projectIdMaxLength = 48,
70
70
  filterMaxLength = 80
71
71
  } = {}) {
72
+ const { projectId } = rule;
72
73
  if (!projectId) {
73
74
  return "team-wide";
74
75
  }
75
- const projectIdMatch = projectId.match(/^projectId eq '([^']+)'$/);
76
- if (projectIdMatch?.[1]) {
77
- return `project: ${truncateMiddle(projectIdMatch[1], projectIdMaxLength)}`;
78
- }
79
- if (!/\s/.test(projectId)) {
76
+ if (isCustomAlertRule(rule)) {
80
77
  return `project: ${truncateMiddle(projectId, projectIdMaxLength)}`;
81
78
  }
82
- return `project filter: ${truncateMiddle(projectId, filterMaxLength)}`;
79
+ return truncateMiddle(projectId, filterMaxLength);
83
80
  }
84
81
  function isCustomAlertRule(rule) {
85
82
  return Boolean(rule.customAlert) || Boolean(
@@ -393,6 +393,9 @@ function buildNextStepsForProjectSubcommands(client, variant) {
393
393
  } : variant === "checks" ? {
394
394
  template: "project checks add <name>",
395
395
  when: "Create a deployment check by project name (replace <name>)"
396
+ } : variant === "inspect" ? {
397
+ template: "project inspect <name>",
398
+ when: "Inspect a project by name (replace <name>)"
396
399
  } : {
397
400
  template: "project members <name>",
398
401
  when: "List members by project name (replace <name>)"
@@ -6,19 +6,19 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  writeProjectSettings
9
- } from "./chunk-G47QOVJ7.js";
9
+ } from "./chunk-4PZ2IIZI.js";
10
10
  import {
11
11
  autoInstallVercelPlugin
12
- } from "./chunk-NJUPUGOE.js";
12
+ } from "./chunk-HT2XWSAJ.js";
13
13
  import {
14
14
  stamp_default
15
15
  } from "./chunk-64IF634X.js";
16
16
  import {
17
17
  ensureLink
18
- } from "./chunk-27FZN5LR.js";
18
+ } from "./chunk-MEOBIY2L.js";
19
19
  import {
20
20
  pullCommand
21
- } from "./chunk-56QCZ4RL.js";
21
+ } from "./chunk-FQ4R66UG.js";
22
22
  import {
23
23
  help
24
24
  } from "./chunk-ZX2FSPWV.js";
@@ -28,7 +28,7 @@ import {
28
28
  envPullCommandLogic,
29
29
  humanizePath,
30
30
  parseTarget
31
- } from "./chunk-PVWXPWLQ.js";
31
+ } from "./chunk-LXRK7KPA.js";
32
32
  import {
33
33
  TelemetryClient
34
34
  } from "./chunk-ECCWJHC6.js";
@@ -27,6 +27,13 @@ var scopeOptions = [
27
27
  description: "Team-wide rules only (omit project filter; ignore linked project)."
28
28
  }
29
29
  ];
30
+ var addScopeOptions = [
31
+ {
32
+ ...scopeOptions[0],
33
+ description: "Target project when the body omits projectId; built-in rules otherwise remain team-wide."
34
+ },
35
+ scopeOptions[1]
36
+ ];
30
37
  var rulesLsSubcommand = {
31
38
  name: "ls",
32
39
  aliases: ["list"],
@@ -64,13 +71,48 @@ var rulesLsSubcommand = {
64
71
  }
65
72
  ]
66
73
  };
74
+ var rulesSchemaSubcommand = {
75
+ name: "schema",
76
+ aliases: [],
77
+ description: "Show alert rule body schema and examples by alert type",
78
+ arguments: [],
79
+ options: [
80
+ {
81
+ name: "type",
82
+ shorthand: null,
83
+ type: String,
84
+ argument: "TYPE",
85
+ deprecated: false,
86
+ description: "Alert rule type to describe: usage_anomaly, error_anomaly, or custom_alert."
87
+ },
88
+ formatOption
89
+ ],
90
+ examples: [
91
+ {
92
+ name: "List supported rule types",
93
+ value: `${packageName} alerts rules schema`
94
+ },
95
+ {
96
+ name: "Show error anomaly rule schema",
97
+ value: `${packageName} alerts rules schema --type error_anomaly`
98
+ },
99
+ {
100
+ name: "Show custom alert rule schema",
101
+ value: `${packageName} alerts rules schema --type custom_alert`
102
+ },
103
+ {
104
+ name: "Schema as JSON",
105
+ value: `${packageName} alerts rules schema --type custom_alert --format json`
106
+ }
107
+ ]
108
+ };
67
109
  var rulesAddSubcommand = {
68
110
  name: "add",
69
111
  aliases: ["create"],
70
112
  description: "Create an alert rule from a JSON body file",
71
113
  arguments: [],
72
114
  options: [
73
- ...scopeOptions,
115
+ ...addScopeOptions,
74
116
  formatOption,
75
117
  jsonOption,
76
118
  {
@@ -153,7 +195,7 @@ var rulesUpdateSubcommand = {
153
195
  type: String,
154
196
  argument: "PATH",
155
197
  deprecated: false,
156
- description: "Path to JSON with fields to update (partial document)."
198
+ description: "Path to partial JSON. Omitted fields remain unchanged; null clears supported optional fields."
157
199
  }
158
200
  ],
159
201
  examples: [
@@ -170,6 +212,7 @@ var rulesAggregateCommand = {
170
212
  arguments: [],
171
213
  subcommands: [
172
214
  rulesLsSubcommand,
215
+ rulesSchemaSubcommand,
173
216
  rulesAddSubcommand,
174
217
  rulesInspectSubcommand,
175
218
  rulesRmSubcommand,
@@ -181,15 +224,36 @@ var rulesAggregateCommand = {
181
224
  name: "List rules",
182
225
  value: `${packageName} alerts rules ls`
183
226
  },
227
+ {
228
+ name: "List custom alert rules",
229
+ value: `${packageName} alerts rules ls --type custom_alert`
230
+ },
231
+ {
232
+ name: "Show schema for a rule type",
233
+ value: `${packageName} alerts rules schema --type custom_alert`
234
+ },
184
235
  {
185
236
  name: "Add a rule",
186
237
  value: `${packageName} alerts rules add --body ./rule.json`
238
+ },
239
+ {
240
+ name: "Inspect a rule",
241
+ value: `${packageName} alerts rules inspect ar_abc123`
242
+ },
243
+ {
244
+ name: "Update a rule",
245
+ value: `${packageName} alerts rules update ar_abc123 --body ./patch.json`
246
+ },
247
+ {
248
+ name: "Delete a rule",
249
+ value: `${packageName} alerts rules rm ar_abc123`
187
250
  }
188
251
  ]
189
252
  };
190
253
 
191
254
  export {
192
255
  rulesLsSubcommand,
256
+ rulesSchemaSubcommand,
193
257
  rulesAddSubcommand,
194
258
  rulesInspectSubcommand,
195
259
  rulesRmSubcommand,
@@ -0,0 +1,22 @@
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 {
8
+ require_source
9
+ } from "./chunk-S7KYDPEM.js";
10
+ import {
11
+ __toESM
12
+ } from "./chunk-TZ2YI2VH.js";
13
+
14
+ // src/util/output/highlight.ts
15
+ var import_chalk = __toESM(require_source(), 1);
16
+ function highlight(text) {
17
+ return import_chalk.default.bold.underline(text);
18
+ }
19
+
20
+ export {
21
+ highlight
22
+ };
@@ -8,7 +8,7 @@ import {
8
8
  formatCondition,
9
9
  formatTransform,
10
10
  isTargetTransform
11
- } from "./chunk-2ILCTO6A.js";
11
+ } from "./chunk-I5F5AE2Q.js";
12
12
  import {
13
13
  output_manager_default
14
14
  } from "./chunk-OX7KI3LF.js";
@@ -7,10 +7,14 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getUpdateCommandInfo,
9
9
  isGlobal
10
- } from "./chunk-KWOWGI7Z.js";
10
+ } from "./chunk-ZYCVYZSR.js";
11
11
  import {
12
12
  progress
13
- } from "./chunk-DI54DSTV.js";
13
+ } from "./chunk-I2XE3GMB.js";
14
+ import {
15
+ getGlobalPathConfig,
16
+ writeToConfigFile
17
+ } from "./chunk-GKLT2ZGC.js";
14
18
  import {
15
19
  validateJsonOutput
16
20
  } from "./chunk-XPKWKPWA.js";
@@ -18,7 +22,7 @@ import {
18
22
  apiCommand,
19
23
  listSubcommand4 as listSubcommand,
20
24
  loginCommand
21
- } from "./chunk-WUMURQKS.js";
25
+ } from "./chunk-7RTO3VPE.js";
22
26
  import {
23
27
  require_semver
24
28
  } from "./chunk-IB5L4LKZ.js";
@@ -26,10 +30,8 @@ import {
26
30
  help
27
31
  } from "./chunk-ZX2FSPWV.js";
28
32
  import {
29
- getGlobalPathConfig,
30
- login,
31
- writeToConfigFile
32
- } from "./chunk-PVWXPWLQ.js";
33
+ login
34
+ } from "./chunk-LXRK7KPA.js";
33
35
  import {
34
36
  TelemetryClient,
35
37
  isNativeBinaryInstall
@@ -0,0 +1,96 @@
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 {
8
+ isJSONObject
9
+ } from "./chunk-GKLT2ZGC.js";
10
+ import {
11
+ getProjectByNameOrId
12
+ } from "./chunk-LXRK7KPA.js";
13
+ import {
14
+ AGENT_REASON,
15
+ outputAgentError
16
+ } from "./chunk-TJJ562C5.js";
17
+ import {
18
+ ProjectNotFound,
19
+ isAPIError
20
+ } from "./chunk-SOFC4MLS.js";
21
+ import {
22
+ output_manager_default
23
+ } from "./chunk-OX7KI3LF.js";
24
+
25
+ // src/commands/alerts/rules/custom-alert-query.ts
26
+ async function resolveCustomAlertProjectName(client, scope, projectId) {
27
+ if (scope.projectId === projectId && scope.projectName) {
28
+ return scope.projectName;
29
+ }
30
+ try {
31
+ const project = await getProjectByNameOrId(client, projectId, scope.teamId);
32
+ return project instanceof ProjectNotFound ? void 0 : project.name;
33
+ } catch (error) {
34
+ if (isAPIError(error)) {
35
+ return void 0;
36
+ }
37
+ throw error;
38
+ }
39
+ }
40
+ function parseCustomAlertQueryBody(client, body) {
41
+ const customAlert = body.customAlert;
42
+ if (!isJSONObject(customAlert)) {
43
+ return void 0;
44
+ }
45
+ const queryJsonString = customAlert.queryJsonString;
46
+ if (typeof queryJsonString !== "string") {
47
+ return void 0;
48
+ }
49
+ let query;
50
+ try {
51
+ query = JSON.parse(queryJsonString);
52
+ } catch {
53
+ const message = "Invalid JSON in customAlert.queryJsonString.";
54
+ outputAgentError(
55
+ client,
56
+ {
57
+ status: "error",
58
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
59
+ message,
60
+ hint: "Provide queryJsonString as an escaped JSON string. Run `vercel alerts rules schema --type custom_alert` for examples."
61
+ },
62
+ 1
63
+ );
64
+ output_manager_default.error(message);
65
+ return 1;
66
+ }
67
+ if (!isJSONObject(query)) {
68
+ return void 0;
69
+ }
70
+ return { customAlert, query };
71
+ }
72
+ function setMissingCustomAlertProjectScope(parsedQuery, teamId, projectId, projectName) {
73
+ const existingScope = parsedQuery.query.scope;
74
+ if (existingScope !== void 0 && !isJSONObject(existingScope)) {
75
+ return;
76
+ }
77
+ const projectScope = existingScope ?? {
78
+ type: "project",
79
+ ownerId: teamId,
80
+ projectIds: [projectId]
81
+ };
82
+ if (!Object.hasOwn(projectScope, "projectId")) {
83
+ projectScope.projectId = projectId;
84
+ }
85
+ if (projectName && !Object.hasOwn(projectScope, "projectName")) {
86
+ projectScope.projectName = projectName;
87
+ }
88
+ parsedQuery.query.scope = projectScope;
89
+ parsedQuery.customAlert.queryJsonString = JSON.stringify(parsedQuery.query);
90
+ }
91
+
92
+ export {
93
+ resolveCustomAlertProjectName,
94
+ parseCustomAlertQueryBody,
95
+ setMissingCustomAlertProjectScope
96
+ };
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_lib
9
- } from "./chunk-PVWXPWLQ.js";
9
+ } from "./chunk-LXRK7KPA.js";
10
10
  import {
11
11
  isNativeBinaryInstall
12
12
  } from "./chunk-ECCWJHC6.js";
@@ -13,7 +13,7 @@ import {
13
13
  requireVcrRepository,
14
14
  resolveVcrScope,
15
15
  validateVcrJsonOutput
16
- } from "./chunk-QTXQOWOJ.js";
16
+ } from "./chunk-NXLNRLL7.js";
17
17
  import "./chunk-G75NFPIT.js";
18
18
  import "./chunk-BUZRVER7.js";
19
19
  import "./chunk-XPKWKPWA.js";
@@ -21,13 +21,13 @@ import {
21
21
  permissionsClearSubcommand
22
22
  } from "./chunk-J6LK45HT.js";
23
23
  import "./chunk-R6IGDGX3.js";
24
- import "./chunk-PVWXPWLQ.js";
24
+ import "./chunk-LXRK7KPA.js";
25
25
  import "./chunk-ECCWJHC6.js";
26
26
  import {
27
27
  AGENT_REASON,
28
28
  buildCommandWithYes,
29
29
  outputAgentError
30
- } from "./chunk-Z5ZQJ5VJ.js";
30
+ } from "./chunk-TJJ562C5.js";
31
31
  import {
32
32
  printError
33
33
  } from "./chunk-KBEX5MYS.js";
@@ -11,9 +11,9 @@ import {
11
11
  findSourceVercelConfigFile,
12
12
  getVercelConfigPath,
13
13
  normalizeConfig
14
- } from "./chunk-PVWXPWLQ.js";
14
+ } from "./chunk-LXRK7KPA.js";
15
15
  import "./chunk-ECCWJHC6.js";
16
- import "./chunk-Z5ZQJ5VJ.js";
16
+ import "./chunk-TJJ562C5.js";
17
17
  import "./chunk-KBEX5MYS.js";
18
18
  import "./chunk-XLKFJPMT.js";
19
19
  import "./chunk-SOFC4MLS.js";