vercel 58.4.4 → 58.7.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.
Files changed (92) hide show
  1. package/dist/chunks/{add-245XOFJO.js → add-I7X6NXYD.js} +4 -4
  2. package/dist/chunks/{add-P7WBQMBW.js → add-KMRFKOPJ.js} +44 -9
  3. package/dist/chunks/{add-XH24V5VU.js → add-USFLACJX.js} +4 -4
  4. package/dist/chunks/{build-M7NJYJPE.js → build-GNX3QE6Q.js} +4 -4
  5. package/dist/chunks/{chunk-WR7JTCGL.js → chunk-3BU2UCGV.js} +1 -1
  6. package/dist/chunks/{chunk-MAHXF73X.js → chunk-3L2YLLHC.js} +1 -1
  7. package/dist/chunks/{chunk-ZGBBPJ6B.js → chunk-4XKF7JOF.js} +92 -1377
  8. package/dist/chunks/{chunk-2LBVX2H3.js → chunk-5SZ6VX2H.js} +2 -2
  9. package/dist/chunks/{chunk-2MAPZXVV.js → chunk-62SBYAED.js} +5 -5
  10. package/dist/chunks/{chunk-UE3JUVUZ.js → chunk-74XVGG52.js} +2 -2
  11. package/dist/chunks/{chunk-2FMPLU44.js → chunk-7KUQ7BHI.js} +2 -2
  12. package/dist/chunks/{chunk-YDUINEII.js → chunk-7SXWLTXT.js} +6 -4
  13. package/dist/chunks/{chunk-M5NOLAJ4.js → chunk-BIGFTNW6.js} +1 -1
  14. package/dist/chunks/{chunk-YCPUAG77.js → chunk-CDYBV7YA.js} +1 -1
  15. package/dist/chunks/{chunk-4BUPRO5B.js → chunk-D6SC2UJH.js} +1 -1
  16. package/dist/chunks/{chunk-62MH5KPX.js → chunk-DHTB5D3E.js} +5 -5
  17. package/dist/chunks/{chunk-NJ6QXKQD.js → chunk-H3KETQAA.js} +1 -1
  18. package/dist/chunks/{chunk-NJUPUGOE.js → chunk-HT2XWSAJ.js} +1 -1
  19. package/dist/chunks/chunk-I2XE3GMB.js +21 -0
  20. package/dist/chunks/chunk-LC5BYUUP.js +1337 -0
  21. package/dist/chunks/{chunk-SJYAUEZR.js → chunk-MNZUPMZZ.js} +3 -15
  22. package/dist/chunks/chunk-MXLA3VQS.js +20 -0
  23. package/dist/chunks/{chunk-XE5VSQ25.js → chunk-NI4DNP3D.js} +1 -1
  24. package/dist/chunks/{chunk-Y5GTPWXB.js → chunk-NOMQUVGM.js} +2 -2
  25. package/dist/chunks/{chunk-AQDWMAPM.js → chunk-NYKWLQQM.js} +10 -8
  26. package/dist/chunks/{chunk-4CCY5OPH.js → chunk-NZ6GDMPB.js} +306 -217
  27. package/dist/chunks/chunk-TE5MIANG.js +96 -0
  28. package/dist/chunks/{chunk-EBLH23AQ.js → chunk-TEQKKTJQ.js} +4 -7
  29. package/dist/chunks/{chunk-2WILSD7J.js → chunk-TNTJXJSE.js} +1 -1
  30. package/dist/chunks/{chunk-IEDUCUDV.js → chunk-UAVZOOOL.js} +10 -8
  31. package/dist/chunks/{chunk-4UYKSYKQ.js → chunk-UMA66MKW.js} +66 -2
  32. package/dist/chunks/{chunk-CPFNFVCL.js → chunk-UME4MVFU.js} +1 -1
  33. package/dist/chunks/{chunk-HSYF5SI3.js → chunk-YR6M7ZIU.js} +1 -1
  34. package/dist/chunks/{chunk-3QAUXPIR.js → chunk-ZZZEJXHD.js} +172 -51
  35. package/dist/chunks/{clear-HWIKQ4NC.js → clear-ERVHWAHX.js} +4 -4
  36. package/dist/chunks/{compile-vercel-config-U5NRIMZ2.js → compile-vercel-config-PM5ID4CV.js} +2 -2
  37. package/dist/chunks/{constants-3FSSR6E7.js → constants-T6BULVX6.js} +1 -1
  38. package/dist/chunks/{delete-NVMGVD5Z.js → delete-GMVIUCQV.js} +3 -3
  39. package/dist/chunks/{delete-FZCOUFGN.js → delete-XB24AZGV.js} +4 -4
  40. package/dist/chunks/{disable-ERM2BWEQ.js → disable-JJZZQ4IZ.js} +3 -3
  41. package/dist/chunks/{discard-KM5OLEN4.js → discard-CGAS2MSK.js} +3 -3
  42. package/dist/chunks/{edit-HT3UTATZ.js → edit-RKUUUBQF.js} +4 -4
  43. package/dist/chunks/{edit-TOSB2EMI.js → edit-TFZDCJTL.js} +5 -5
  44. package/dist/chunks/{enable-BQL6AOQV.js → enable-UXRVQO6C.js} +3 -3
  45. package/dist/chunks/{export-UOWQHOG3.js → export-WQE3UU4V.js} +3 -3
  46. package/dist/chunks/{image-F5SC6Q7Y.js → image-HV7N6RTK.js} +3 -3
  47. package/dist/chunks/import-builders-IEVZ7KYP.js +28 -0
  48. package/dist/chunks/{inspect-PZJM2CWT.js → inspect-4BXZOMC2.js} +7 -7
  49. package/dist/chunks/{inspect-35FU5R62.js → inspect-DT2PX6LB.js} +4 -4
  50. package/dist/chunks/{inspect-5J5GSTOB.js → inspect-E3YSH5BV.js} +4 -4
  51. package/dist/chunks/{inspect-GKJ6T5H4.js → inspect-NADJYMSZ.js} +4 -4
  52. package/dist/chunks/{inspect-LGKOLH2O.js → inspect-VDQEM3E6.js} +5 -5
  53. package/dist/chunks/{list-KZETH3ZE.js → list-5PLKF2GL.js} +3 -3
  54. package/dist/chunks/{list-ITFJYYQ2.js → list-ARM4RM22.js} +9 -9
  55. package/dist/chunks/{list-2IIE7CAP.js → list-RVE2NAC5.js} +5 -5
  56. package/dist/chunks/{login-BQPJCJEZ.js → login-VHGNOKBB.js} +4 -4
  57. package/dist/chunks/{ls-7GHDK4MD.js → ls-4QRIPSBC.js} +13 -13
  58. package/dist/chunks/{ls-DL2LA35C.js → ls-IVVP4H24.js} +4 -4
  59. package/dist/chunks/{ls-UXUEP54B.js → ls-OTCUUI4L.js} +4 -4
  60. package/dist/chunks/{ls-YSFWSM6J.js → ls-QBKFZC52.js} +4 -4
  61. package/dist/chunks/{ls-ZZFLH7PK.js → ls-YME2AL47.js} +4 -4
  62. package/dist/chunks/{open-ADNJQN5E.js → open-KYVW2GTM.js} +4 -4
  63. package/dist/chunks/{permissions-72SZCBIY.js → permissions-BLHKOJDO.js} +4 -4
  64. package/dist/chunks/{publish-OOAGSEBM.js → publish-4BKTL25X.js} +3 -3
  65. package/dist/chunks/{push-B6TZDXNF.js → push-IJFWOWD7.js} +4 -4
  66. package/dist/chunks/{query-LZWS5TDH.js → query-VIV66DLZ.js} +3 -3
  67. package/dist/chunks/{reorder-MRHFKPMK.js → reorder-C44IJZNE.js} +3 -3
  68. package/dist/chunks/{reply-BKTJXO3B.js → reply-M6WBMKBN.js} +5 -5
  69. package/dist/chunks/{resolve-BKVGSGPN.js → resolve-44ICWDRT.js} +4 -4
  70. package/dist/chunks/{restore-USR7SKWV.js → restore-ACDVNSTC.js} +3 -3
  71. package/dist/chunks/{rm-2UO6BT3A.js → rm-K2FDC5CL.js} +6 -6
  72. package/dist/chunks/{rm-37MKKV3I.js → rm-P2ILGP4I.js} +4 -4
  73. package/dist/chunks/{rm-VY3OHKFH.js → rm-Q7VXI345.js} +4 -4
  74. package/dist/chunks/{rm-KUWPNZIS.js → rm-RO3R3MZT.js} +4 -4
  75. package/dist/chunks/{rule-inspect-JVDOOTWK.js → rule-inspect-JGKJXOUD.js} +13 -20
  76. package/dist/chunks/{rules-NTBFZBIF.js → rules-BRTF5HJP.js} +9 -6
  77. package/dist/chunks/schema-T7RNRNKT.js +426 -0
  78. package/dist/chunks/{schema-6EZ72OVH.js → schema-Z3L5ZOEE.js} +2 -2
  79. package/dist/chunks/{tags-HNPC63QA.js → tags-BPHVFK53.js} +2 -2
  80. package/dist/chunks/{update-LUYWNZP3.js → update-5KQU4HCK.js} +38 -6
  81. package/dist/commands/build/index.js +65 -24
  82. package/dist/commands/deploy/index.js +24 -17
  83. package/dist/commands/dev/index.js +41 -18
  84. package/dist/commands/env/index.js +89 -150
  85. package/dist/commands/link/index.js +9 -9
  86. package/dist/commands/list/index.js +5 -5
  87. package/dist/commands-bulk.js +3183 -2199
  88. package/dist/index.js +12 -11
  89. package/dist/vc.js +11 -14
  90. package/dist/version.mjs +1 -1
  91. package/package.json +54 -48
  92. package/dist/chunks/{chunk-BUZRVER7.js → chunk-P65EEFTR.js} +3 -3
@@ -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-MNZUPMZZ.js";
10
+ import {
11
+ getProjectByNameOrId
12
+ } from "./chunk-NZ6GDMPB.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
+ };
@@ -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(
@@ -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-4CCY5OPH.js";
9
+ } from "./chunk-NZ6GDMPB.js";
10
10
  import {
11
11
  require_ms
12
12
  } from "./chunk-GGP5R3FU.js";
@@ -7,22 +7,24 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_format
9
9
  } from "./chunk-PRWJUY5U.js";
10
+ import {
11
+ progress
12
+ } from "./chunk-I2XE3GMB.js";
10
13
  import {
11
14
  isJSONObject,
12
15
  printIndications,
13
- progress,
14
16
  require_dist as require_dist2,
15
17
  sleep
16
- } from "./chunk-SJYAUEZR.js";
18
+ } from "./chunk-MNZUPMZZ.js";
17
19
  import {
18
20
  suggestNextCommands
19
21
  } from "./chunk-XBN2O34P.js";
20
22
  import {
21
23
  CommandTimeout
22
- } from "./chunk-3QAUXPIR.js";
24
+ } from "./chunk-ZZZEJXHD.js";
23
25
  import {
24
26
  showPluginTipIfNeeded
25
- } from "./chunk-NJUPUGOE.js";
27
+ } from "./chunk-HT2XWSAJ.js";
26
28
  import {
27
29
  stamp_default
28
30
  } from "./chunk-64IF634X.js";
@@ -36,7 +38,10 @@ import {
36
38
  require_dist as require_dist3,
37
39
  require_pluralize,
38
40
  ua_default
39
- } from "./chunk-4CCY5OPH.js";
41
+ } from "./chunk-NZ6GDMPB.js";
42
+ import {
43
+ require_ms
44
+ } from "./chunk-GGP5R3FU.js";
40
45
  import {
41
46
  require_strip_ansi,
42
47
  responseError
@@ -74,9 +79,6 @@ import {
74
79
  require_ansi_escapes,
75
80
  require_dist
76
81
  } from "./chunk-OX7KI3LF.js";
77
- import {
78
- require_ms
79
- } from "./chunk-GGP5R3FU.js";
80
82
  import {
81
83
  require_source
82
84
  } from "./chunk-S7KYDPEM.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,
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  VERCEL_DIR
9
- } from "./chunk-4CCY5OPH.js";
9
+ } from "./chunk-NZ6GDMPB.js";
10
10
  import {
11
11
  parseArguments
12
12
  } from "./chunk-XLKFJPMT.js";
@@ -8,7 +8,7 @@ import {
8
8
  formatCondition,
9
9
  formatTransform,
10
10
  isTargetTransform
11
- } from "./chunk-4BUPRO5B.js";
11
+ } from "./chunk-D6SC2UJH.js";
12
12
  import {
13
13
  output_manager_default
14
14
  } from "./chunk-OX7KI3LF.js";