vercel 56.4.1 → 57.0.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 (94) hide show
  1. package/dist/chunks/{add-L3Z6PL54.js → add-7M577U56.js} +7 -6
  2. package/dist/chunks/{add-RFEJCIBM.js → add-YRZTDNXX.js} +3 -3
  3. package/dist/chunks/{chunk-V5P25P7F.js → chunk-2473DUBR.js} +4 -11
  4. package/dist/chunks/{chunk-5EXIJBLL.js → chunk-2EDWKVNP.js} +8 -8
  5. package/dist/chunks/{chunk-YS6EDZHB.js → chunk-2MJROFVC.js} +5 -1
  6. package/dist/chunks/{chunk-OOD67FAL.js → chunk-3242RXCN.js} +1 -1
  7. package/dist/chunks/chunk-3PGXYIKC.js +147 -0
  8. package/dist/chunks/{chunk-CHZBEMLF.js → chunk-4PGF367U.js} +47 -210
  9. package/dist/chunks/{chunk-GKVAAY2A.js → chunk-555WJSO5.js} +1 -1
  10. package/dist/chunks/chunk-5AJPMLDV.js +28 -0
  11. package/dist/chunks/{chunk-IHQ7DPQI.js → chunk-A2TYQBX2.js} +117 -3
  12. package/dist/chunks/chunk-A3NYPUKZ.js +17 -0
  13. package/dist/chunks/{chunk-W346YNDN.js → chunk-DWMH5M4Q.js} +4 -1
  14. package/dist/chunks/chunk-E336ZXPP.js +43 -0
  15. package/dist/chunks/chunk-F5PQWDOC.js +245 -0
  16. package/dist/chunks/{chunk-Y7TVKRRJ.js → chunk-F7X55TOY.js} +15 -839
  17. package/dist/chunks/chunk-FGDKMNEN.js +21 -0
  18. package/dist/chunks/chunk-FHEMFAHB.js +320 -0
  19. package/dist/chunks/{chunk-NLRIKNPX.js → chunk-GP5VCTEU.js} +1 -1
  20. package/dist/chunks/chunk-GZLPFESR.js +48 -0
  21. package/dist/chunks/{chunk-HZKJMZEQ.js → chunk-HD7B425F.js} +2 -2
  22. package/dist/chunks/{chunk-J6KTUJHV.js → chunk-IOAZNR6Z.js} +1 -1
  23. package/dist/chunks/{chunk-STJJ3DFO.js → chunk-KCF6S3XF.js} +16 -1
  24. package/dist/chunks/chunk-LMHT3QR3.js +247 -0
  25. package/dist/chunks/{chunk-A4XB42AB.js → chunk-MAHINYBW.js} +4 -3
  26. package/dist/chunks/{chunk-DXFSBJTA.js → chunk-MIFDRYTN.js} +1 -1
  27. package/dist/chunks/{chunk-VLTQJKP6.js → chunk-NH43BFJ3.js} +1 -1
  28. package/dist/chunks/{chunk-Z7NPYIZ6.js → chunk-NM43FFV6.js} +0 -8
  29. package/dist/chunks/{chunk-MQRHJEBS.js → chunk-NRNMT43R.js} +3 -3
  30. package/dist/chunks/chunk-OF2GNB42.js +53 -0
  31. package/dist/chunks/chunk-PRWJUY5U.js +848 -0
  32. package/dist/chunks/{chunk-F5OMERHI.js → chunk-QZD5DKUR.js} +10 -23
  33. package/dist/chunks/{chunk-4M3ZQCYN.js → chunk-RAFH25WW.js} +8 -1
  34. package/dist/chunks/{chunk-43B3LNUF.js → chunk-RYO6FJFB.js} +1 -1
  35. package/dist/chunks/{chunk-XFGY3JAX.js → chunk-T4NODP6Y.js} +11 -18
  36. package/dist/chunks/{chunk-GLAHGVBS.js → chunk-TBR2Q37Y.js} +2038 -1786
  37. package/dist/chunks/chunk-V4RMJKQP.js +36 -0
  38. package/dist/chunks/chunk-WR7JTCGL.js +104 -0
  39. package/dist/chunks/{chunk-6RTK6BWX.js → chunk-YA3WQFLY.js} +1 -1
  40. package/dist/chunks/{chunk-UHGAPG7O.js → chunk-YOZCJHLZ.js} +4 -4
  41. package/dist/chunks/{compile-vercel-config-J2X5OV6K.js → compile-vercel-config-3OHO3TJA.js} +2 -2
  42. package/dist/chunks/config-validator.mjs +1 -0
  43. package/dist/chunks/delete-3DZOCWCC.js +150 -0
  44. package/dist/chunks/{delete-57A44RN7.js → delete-VOSJLNEA.js} +3 -3
  45. package/dist/chunks/{disable-DNZ52MEO.js → disable-LQDEVRQF.js} +3 -3
  46. package/dist/chunks/{discard-HACSIZ74.js → discard-RGV4JKXQ.js} +3 -3
  47. package/dist/chunks/{edit-HJ47TQU3.js → edit-SFIEOQ24.js} +4 -4
  48. package/dist/chunks/edit-UPZPI54L.js +153 -0
  49. package/dist/chunks/{enable-BVLRVRYM.js → enable-6UVH35WC.js} +3 -3
  50. package/dist/chunks/{export-7MJFGMG7.js → export-6CEG3CK7.js} +3 -3
  51. package/dist/chunks/{image-4UMD7UZP.js → image-CQRCD2OE.js} +3 -3
  52. package/dist/chunks/inspect-4ZAH3RFT.js +205 -0
  53. package/dist/chunks/inspect-EXQBIAFF.js +587 -0
  54. package/dist/chunks/{inspect-WBHUZC3R.js → inspect-K5ZMQG7X.js} +3 -3
  55. package/dist/chunks/{inspect-4JD2QN67.js → inspect-UM3LDRPV.js} +3 -3
  56. package/dist/chunks/{inspect-XX3OXSHC.js → inspect-ZFRY3X3H.js} +3 -3
  57. package/dist/chunks/{list-AM6K2JCW.js → list-4DRVM7Q4.js} +42 -55
  58. package/dist/chunks/{list-5H57NTM4.js → list-FJCBOCCA.js} +2 -2
  59. package/dist/chunks/list-KCUHD4OA.js +360 -0
  60. package/dist/chunks/{login-YO34E4V5.js → login-DFGYNU3K.js} +3 -3
  61. package/dist/chunks/{ls-44NPIO2N.js → ls-34NCZKBE.js} +3 -3
  62. package/dist/chunks/{ls-P7ZLBWW2.js → ls-4QHHVXXD.js} +3 -3
  63. package/dist/chunks/{ls-YDUYTLXW.js → ls-CG6A7UXF.js} +3 -3
  64. package/dist/chunks/ls-RHEQ6YQB.js +188 -0
  65. package/dist/chunks/open-E3XADEMX.js +106 -0
  66. package/dist/chunks/{publish-RXFUYSW3.js → publish-Z3AQRUCS.js} +3 -3
  67. package/dist/chunks/{query-ILJJL3BZ.js → query-3EV66DO3.js} +9 -9
  68. package/dist/chunks/{reorder-GBCOPZT4.js → reorder-VA5E5ZJT.js} +3 -3
  69. package/dist/chunks/reply-SNSCNKAW.js +167 -0
  70. package/dist/chunks/resolve-6ZX4RTXX.js +228 -0
  71. package/dist/chunks/{restore-YK5DGGRX.js → restore-NEHI5B5P.js} +3 -3
  72. package/dist/chunks/{rm-O474MI5C.js → rm-22B22E47.js} +3 -3
  73. package/dist/chunks/{rm-LK6P7XTA.js → rm-E5ZVLAKO.js} +3 -3
  74. package/dist/chunks/{rm-FRZMXB2W.js → rm-FR6KE744.js} +7 -6
  75. package/dist/chunks/rule-inspect-DMP2CKJQ.js +283 -0
  76. package/dist/chunks/{rules-MZ2MP6KJ.js → rules-EYGXEI2Z.js} +7 -7
  77. package/dist/chunks/{schema-FR6CCQIZ.js → schema-2IIWOBSQ.js} +7 -5
  78. package/dist/chunks/{tags-AKRTKFRV.js → tags-ZDVYRHAY.js} +2 -2
  79. package/dist/chunks/{update-W3CWQB2F.js → update-QH4DQMZV.js} +7 -6
  80. package/dist/commands/build/index.js +45 -13
  81. package/dist/commands/deploy/index.js +38 -27
  82. package/dist/commands/dev/index.js +13 -16
  83. package/dist/commands/env/index.js +13 -11
  84. package/dist/commands/link/index.js +10 -9
  85. package/dist/commands/list/index.js +5 -5
  86. package/dist/commands-bulk.js +2981 -2179
  87. package/dist/index.js +31 -21
  88. package/dist/vc.js +54 -18
  89. package/dist/version.mjs +1 -1
  90. package/package.json +35 -35
  91. package/dist/chunks/chunk-F32B76CK.js +0 -86
  92. package/dist/chunks/inspect-5YZP7IWI.js +0 -351
  93. package/dist/chunks/ls-MB74DIQV.js +0 -113
  94. package/dist/chunks/rule-inspect-YEZGYINZ.js +0 -141
@@ -0,0 +1,21 @@
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/util/openapi/column-label.ts
9
+ function humanizeIdentifier(raw) {
10
+ const s = raw.trim();
11
+ if (!s) {
12
+ return raw;
13
+ }
14
+ const withSpaces = s.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
15
+ const words = withSpaces.split(/[\s_-]+/).filter(Boolean);
16
+ return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ");
17
+ }
18
+
19
+ export {
20
+ humanizeIdentifier
21
+ };
@@ -0,0 +1,320 @@
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
+ formatOption,
9
+ limitOption,
10
+ packageName,
11
+ projectOption,
12
+ yesOption
13
+ } from "./chunk-KSSNLCL4.js";
14
+
15
+ // src/commands/comments/command.ts
16
+ var commentsProjectOption = {
17
+ ...projectOption,
18
+ shorthand: "p",
19
+ description: "Project ID or name (defaults to the linked project)"
20
+ };
21
+ var messageContentOption = {
22
+ name: "message",
23
+ shorthand: "m",
24
+ type: String,
25
+ argument: "TEXT",
26
+ deprecated: false,
27
+ description: "Markdown message content"
28
+ };
29
+ var fileOption = {
30
+ name: "file",
31
+ shorthand: null,
32
+ type: String,
33
+ argument: "PATH",
34
+ deprecated: false,
35
+ description: "Read Markdown content from a file; use `-` for stdin"
36
+ };
37
+ var attachOption = {
38
+ name: "attach",
39
+ shorthand: null,
40
+ type: [String],
41
+ argument: "URL",
42
+ deprecated: false,
43
+ description: "Attach a file by https URL (repeatable, max 10)"
44
+ };
45
+ var nextCursorOption = {
46
+ name: "next",
47
+ shorthand: "N",
48
+ type: String,
49
+ argument: "CURSOR",
50
+ deprecated: false,
51
+ description: "Show the next page using the cursor from the previous output"
52
+ };
53
+ var listSubcommand = {
54
+ name: "list",
55
+ aliases: ["ls"],
56
+ default: true,
57
+ description: "List comments for a project",
58
+ arguments: [],
59
+ options: [
60
+ commentsProjectOption,
61
+ {
62
+ name: "branch",
63
+ shorthand: null,
64
+ type: [String],
65
+ argument: "BRANCH",
66
+ deprecated: false,
67
+ description: "Filter by Git branch (repeatable; defaults to the current branch when inferable)"
68
+ },
69
+ {
70
+ name: "all-branches",
71
+ shorthand: null,
72
+ type: Boolean,
73
+ deprecated: false,
74
+ description: "Show comments from every branch"
75
+ },
76
+ {
77
+ name: "status",
78
+ shorthand: null,
79
+ type: String,
80
+ argument: "STATUS",
81
+ deprecated: false,
82
+ description: "unresolved (default), resolved, or all"
83
+ },
84
+ {
85
+ name: "page",
86
+ shorthand: null,
87
+ type: [String],
88
+ argument: "PATH",
89
+ deprecated: false,
90
+ description: "Filter by recorded page path or glob (repeatable). Note: rewrites may record a different path than the browser URL"
91
+ },
92
+ {
93
+ name: "author",
94
+ shorthand: null,
95
+ type: [String],
96
+ argument: "USER",
97
+ deprecated: false,
98
+ description: "Filter by author user ID, or `me` (repeatable)"
99
+ },
100
+ {
101
+ name: "content-id",
102
+ shorthand: null,
103
+ type: [String],
104
+ argument: "ID",
105
+ deprecated: false,
106
+ description: "Filter by CMS content ID (repeatable)"
107
+ },
108
+ {
109
+ name: "search",
110
+ shorthand: null,
111
+ type: String,
112
+ argument: "TEXT",
113
+ deprecated: false,
114
+ description: "Search comment content"
115
+ },
116
+ limitOption,
117
+ nextCursorOption,
118
+ formatOption
119
+ ],
120
+ examples: [
121
+ {
122
+ name: "List unresolved comments for the linked project",
123
+ value: `${packageName} comments`
124
+ },
125
+ {
126
+ name: "List comments on every branch",
127
+ value: `${packageName} comments --all-branches --status all`
128
+ },
129
+ {
130
+ name: "List comments as JSON",
131
+ value: `${packageName} comments --format json | jq '.threads[].id'`
132
+ }
133
+ ]
134
+ };
135
+ var inspectSubcommand = {
136
+ name: "inspect",
137
+ aliases: ["get"],
138
+ description: "Show a comment thread with its full conversation",
139
+ arguments: [{ name: "thread", required: false }],
140
+ options: [
141
+ commentsProjectOption,
142
+ {
143
+ name: "context",
144
+ shorthand: null,
145
+ type: Boolean,
146
+ deprecated: false,
147
+ description: "Include framework and device context"
148
+ },
149
+ formatOption
150
+ ],
151
+ examples: [
152
+ {
153
+ name: "Inspect a comment thread",
154
+ value: `${packageName} comments inspect icZ9BnPPINuK`
155
+ },
156
+ {
157
+ name: "Inspect a comment from its URL",
158
+ value: `${packageName} comments inspect https://vercel.com/team/project/c/icZ9BnPPINuK`
159
+ },
160
+ {
161
+ name: "Pick a comment interactively",
162
+ value: `${packageName} comments inspect`
163
+ },
164
+ {
165
+ name: "Inspect a thread whose ID starts with a dash",
166
+ value: `${packageName} comments inspect -- -ULOL`
167
+ }
168
+ ]
169
+ };
170
+ var openSubcommand = {
171
+ name: "open",
172
+ aliases: [],
173
+ description: "Open a comment thread on vercel.com",
174
+ arguments: [{ name: "thread", required: true }],
175
+ options: [commentsProjectOption],
176
+ examples: [
177
+ {
178
+ name: "Open a comment in the browser",
179
+ value: `${packageName} comments open icZ9BnPPINuK`
180
+ }
181
+ ]
182
+ };
183
+ var replySubcommand = {
184
+ name: "reply",
185
+ aliases: [],
186
+ description: "Reply to a comment thread",
187
+ arguments: [{ name: "thread", required: true }],
188
+ options: [
189
+ commentsProjectOption,
190
+ messageContentOption,
191
+ fileOption,
192
+ attachOption,
193
+ formatOption
194
+ ],
195
+ examples: [
196
+ {
197
+ name: "Reply to a comment",
198
+ value: `${packageName} comments reply icZ9BnPPINuK -m 'Fixed in **main**.'`
199
+ },
200
+ {
201
+ name: "Reply from stdin",
202
+ value: `git log -1 --format=%s | ${packageName} comments reply icZ9BnPPINuK`
203
+ }
204
+ ]
205
+ };
206
+ var resolveSubcommand = {
207
+ name: "resolve",
208
+ aliases: [],
209
+ description: "Resolve comment threads, optionally with a closing reply",
210
+ arguments: [{ name: "thread", required: true, multiple: true }],
211
+ options: [
212
+ commentsProjectOption,
213
+ messageContentOption,
214
+ yesOption,
215
+ formatOption
216
+ ],
217
+ examples: [
218
+ {
219
+ name: "Resolve a comment",
220
+ value: `${packageName} comments resolve icZ9BnPPINuK`
221
+ },
222
+ {
223
+ name: "Reply and resolve in one step",
224
+ value: `${packageName} comments resolve icZ9BnPPINuK -m 'Fixed in the latest deployment'`
225
+ }
226
+ ]
227
+ };
228
+ var reopenSubcommand = {
229
+ name: "reopen",
230
+ aliases: [],
231
+ description: "Reopen resolved comment threads",
232
+ arguments: [{ name: "thread", required: true, multiple: true }],
233
+ options: [commentsProjectOption, yesOption, formatOption],
234
+ examples: [
235
+ {
236
+ name: "Reopen a comment",
237
+ value: `${packageName} comments reopen icZ9BnPPINuK`
238
+ }
239
+ ]
240
+ };
241
+ var editSubcommand = {
242
+ name: "edit",
243
+ aliases: [],
244
+ description: "Edit a comment message",
245
+ arguments: [
246
+ { name: "thread", required: true },
247
+ { name: "message-id", required: true }
248
+ ],
249
+ options: [
250
+ commentsProjectOption,
251
+ messageContentOption,
252
+ fileOption,
253
+ formatOption
254
+ ],
255
+ examples: [
256
+ {
257
+ name: "Edit a message",
258
+ value: `${packageName} comments edit icZ9BnPPINuK VvkhYF6dTqbpm7K -m 'Updated wording'`
259
+ }
260
+ ]
261
+ };
262
+ var deleteSubcommand = {
263
+ name: "delete",
264
+ aliases: [],
265
+ description: "Delete a comment message",
266
+ arguments: [
267
+ { name: "thread", required: true },
268
+ { name: "message-id", required: true }
269
+ ],
270
+ options: [commentsProjectOption, yesOption, formatOption],
271
+ examples: [
272
+ {
273
+ name: "Delete a message",
274
+ value: `${packageName} comments delete icZ9BnPPINuK VvkhYF6dTqbpm7K`
275
+ }
276
+ ]
277
+ };
278
+ var commentsCommand = {
279
+ name: "comments",
280
+ aliases: [],
281
+ description: "Review and act on Vercel Toolbar comments from the command line",
282
+ arguments: [],
283
+ subcommands: [
284
+ listSubcommand,
285
+ inspectSubcommand,
286
+ openSubcommand,
287
+ replySubcommand,
288
+ resolveSubcommand,
289
+ reopenSubcommand,
290
+ editSubcommand,
291
+ deleteSubcommand
292
+ ],
293
+ options: [],
294
+ examples: [
295
+ {
296
+ name: "Review unresolved comments for the linked project",
297
+ value: `${packageName} comments`
298
+ },
299
+ {
300
+ name: "Inspect a comment and reply",
301
+ value: `${packageName} comments inspect icZ9BnPPINuK`
302
+ },
303
+ {
304
+ name: "Reply and resolve in one step",
305
+ value: `${packageName} comments resolve icZ9BnPPINuK -m 'Fixed!'`
306
+ }
307
+ ]
308
+ };
309
+
310
+ export {
311
+ listSubcommand,
312
+ inspectSubcommand,
313
+ openSubcommand,
314
+ replySubcommand,
315
+ resolveSubcommand,
316
+ reopenSubcommand,
317
+ editSubcommand,
318
+ deleteSubcommand,
319
+ commentsCommand
320
+ };
@@ -14,7 +14,7 @@ import {
14
14
  getLinkedProject,
15
15
  getProjectByNameOrId,
16
16
  getScope
17
- } from "./chunk-GLAHGVBS.js";
17
+ } from "./chunk-TBR2Q37Y.js";
18
18
  import {
19
19
  AGENT_REASON,
20
20
  buildCommandWithGlobalFlags,
@@ -0,0 +1,48 @@
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_format
9
+ } from "./chunk-PRWJUY5U.js";
10
+ import {
11
+ require_ms
12
+ } from "./chunk-GGP5R3FU.js";
13
+ import {
14
+ require_source
15
+ } from "./chunk-S7KYDPEM.js";
16
+ import {
17
+ __toESM
18
+ } from "./chunk-TZ2YI2VH.js";
19
+
20
+ // src/util/format-date.ts
21
+ var import_ms = __toESM(require_ms(), 1);
22
+ var import_chalk = __toESM(require_source(), 1);
23
+ var import_format = __toESM(require_format(), 1);
24
+ function formatDate(dateStrOrNumber) {
25
+ if (!dateStrOrNumber) {
26
+ return import_chalk.default.gray("-");
27
+ }
28
+ const date = new Date(dateStrOrNumber);
29
+ const diff = date.getTime() - Date.now();
30
+ return diff < 0 ? `${(0, import_format.default)(date, "DD MMMM YYYY HH:mm:ss")} ${import_chalk.default.gray(
31
+ `[${(0, import_ms.default)(-diff)} ago]`
32
+ )}` : `${(0, import_format.default)(date, "DD MMMM YYYY HH:mm:ss")} ${import_chalk.default.gray(
33
+ `[in ${(0, import_ms.default)(diff)}]`
34
+ )}`;
35
+ }
36
+ function formatDateWithoutTime(dateStrOrNumber) {
37
+ if (!dateStrOrNumber) {
38
+ return import_chalk.default.gray("-");
39
+ }
40
+ const date = new Date(dateStrOrNumber);
41
+ const diff = date.getTime() - Date.now();
42
+ return diff < 0 ? `${(0, import_format.default)(date, "MMM DD YYYY")} ${import_chalk.default.gray(`[${(0, import_ms.default)(-diff)} ago]`)}` : `${(0, import_format.default)(date, "MMM DD YYYY")} ${import_chalk.default.gray(`[in ${(0, import_ms.default)(diff)}]`)}`;
43
+ }
44
+
45
+ export {
46
+ formatDate,
47
+ formatDateWithoutTime
48
+ };
@@ -6,14 +6,14 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  setupAndLink
9
- } from "./chunk-MQRHJEBS.js";
9
+ } from "./chunk-NRNMT43R.js";
10
10
  import {
11
11
  detectExplicitScope,
12
12
  getLinkedProject,
13
13
  param,
14
14
  printProjectNotFoundError,
15
15
  resolveProjectCwd
16
- } from "./chunk-GLAHGVBS.js";
16
+ } from "./chunk-TBR2Q37Y.js";
17
17
  import {
18
18
  buildCommandWithYes,
19
19
  outputActionRequired
@@ -8,7 +8,7 @@ import {
8
8
  formatCondition,
9
9
  formatTransform,
10
10
  isTargetTransform
11
- } from "./chunk-GKVAAY2A.js";
11
+ } from "./chunk-555WJSO5.js";
12
12
  import {
13
13
  output_manager_default
14
14
  } from "./chunk-OX7KI3LF.js";
@@ -31,7 +31,18 @@ var rulesLsSubcommand = {
31
31
  aliases: ["list"],
32
32
  description: "List alert rules for the current scope",
33
33
  arguments: [],
34
- options: [...scopeOptions, formatOption],
34
+ options: [
35
+ ...scopeOptions,
36
+ {
37
+ name: "type",
38
+ shorthand: null,
39
+ type: [String],
40
+ argument: "TYPE",
41
+ deprecated: false,
42
+ description: "Filter by alert type. Repeatable and comma-separated (for example --type custom_alert)."
43
+ },
44
+ formatOption
45
+ ],
35
46
  examples: [
36
47
  {
37
48
  name: "List rules for the linked project",
@@ -41,6 +52,10 @@ var rulesLsSubcommand = {
41
52
  name: "List team-wide rules",
42
53
  value: `${packageName} alerts rules ls --all`
43
54
  },
55
+ {
56
+ name: "List custom alert rules",
57
+ value: `${packageName} alerts rules ls --type custom_alert`
58
+ },
44
59
  {
45
60
  name: "JSON output",
46
61
  value: `${packageName} alerts rules ls --format json`
@@ -0,0 +1,247 @@
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
+ outputError
9
+ } from "./chunk-BUZRVER7.js";
10
+ import {
11
+ getLinkedProject,
12
+ getProjectByNameOrId,
13
+ getScope
14
+ } from "./chunk-TBR2Q37Y.js";
15
+ import {
16
+ printError
17
+ } from "./chunk-SZXT3PDQ.js";
18
+ import {
19
+ ProjectNotFound,
20
+ getCommandName,
21
+ isAPIError
22
+ } from "./chunk-KSSNLCL4.js";
23
+ import {
24
+ output_manager_default
25
+ } from "./chunk-OX7KI3LF.js";
26
+
27
+ // src/commands/comments/errors.ts
28
+ function handleCommentsParseError(err, subcommandName) {
29
+ printError(err);
30
+ if (err instanceof Error && /unknown or unexpected option: -[^-]/.test(err.message)) {
31
+ output_manager_default.log(
32
+ `An argument starting with "-"? Put it after \`--\`: ${getCommandName(`comments ${subcommandName} -- <arg>`)}`
33
+ );
34
+ }
35
+ output_manager_default.log(
36
+ `Run ${getCommandName(`comments ${subcommandName} --help`)} for usage.`
37
+ );
38
+ return 1;
39
+ }
40
+ function threadNotFoundMessage(threadId, scope) {
41
+ return `Comment not found: ${threadId} in team ${scope.teamSlug ?? scope.teamId}. If it belongs to another team, pass --scope <team>.`;
42
+ }
43
+
44
+ // src/commands/comments/api.ts
45
+ function query(teamId, params = {}) {
46
+ const search = new URLSearchParams({ teamId });
47
+ for (const [key, value] of Object.entries(params)) {
48
+ if (value === void 0) {
49
+ continue;
50
+ }
51
+ if (Array.isArray(value)) {
52
+ for (const entry of value) {
53
+ search.append(key, entry);
54
+ }
55
+ } else {
56
+ search.set(key, String(value));
57
+ }
58
+ }
59
+ return search.toString();
60
+ }
61
+ var fetchOpts = { useCurrentTeam: false };
62
+ function listThreads(client, teamId, params) {
63
+ return client.fetch(
64
+ `/toolbar/threads?${query(teamId, { ...params })}`,
65
+ fetchOpts
66
+ );
67
+ }
68
+ function getThread(client, teamId, threadId) {
69
+ return client.fetch(
70
+ `/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,
71
+ fetchOpts
72
+ );
73
+ }
74
+ function updateThread(client, teamId, threadId, resolved) {
75
+ return client.fetch(
76
+ `/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,
77
+ { ...fetchOpts, method: "PATCH", body: { resolved } }
78
+ );
79
+ }
80
+ function listMessages(client, teamId, threadId, opts = {}) {
81
+ return client.fetch(
82
+ `/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId, { ...opts })}`,
83
+ fetchOpts
84
+ );
85
+ }
86
+ function addMessage(client, teamId, threadId, body) {
87
+ return client.fetch(
88
+ `/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId)}`,
89
+ { ...fetchOpts, method: "POST", body }
90
+ );
91
+ }
92
+ function updateMessage(client, teamId, threadId, messageId, body) {
93
+ return client.fetch(
94
+ `/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,
95
+ { ...fetchOpts, method: "PATCH", body }
96
+ );
97
+ }
98
+ function deleteMessage(client, teamId, threadId, messageId) {
99
+ return client.fetch(
100
+ `/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,
101
+ { ...fetchOpts, method: "DELETE" }
102
+ );
103
+ }
104
+ function toApiErrorParts(err) {
105
+ const apiErr = err;
106
+ return {
107
+ code: apiErr.code || "API_ERROR",
108
+ message: apiErr.serverMessage || `API error (${apiErr.status ?? "unknown"}).`
109
+ };
110
+ }
111
+
112
+ // src/commands/comments/scope.ts
113
+ import { spawnSync } from "child_process";
114
+ function scopeIsExplicit(client) {
115
+ return client.argv.some(
116
+ (arg) => arg === "--scope" || arg === "-S" || arg.startsWith("--scope=") || arg === "--team" || arg.startsWith("--team=") || arg === "-T"
117
+ );
118
+ }
119
+ async function resolveCommentsScope(client, opts) {
120
+ if (opts.urlTeamSlug && !opts.project && !scopeIsExplicit(client)) {
121
+ return { teamId: opts.urlTeamSlug, teamSlug: opts.urlTeamSlug };
122
+ }
123
+ if (opts.project) {
124
+ const { team: team2 } = await getScope(client);
125
+ if (!team2) {
126
+ return outputError(
127
+ client,
128
+ opts.jsonOutput,
129
+ "NO_TEAM",
130
+ "No team context found. Run `vercel switch` to select a team, or run `vercel link` in a project directory."
131
+ );
132
+ }
133
+ let project;
134
+ try {
135
+ project = await getProjectByNameOrId(client, opts.project, team2.id);
136
+ } catch (err) {
137
+ if (isAPIError(err)) {
138
+ return outputError(
139
+ client,
140
+ opts.jsonOutput,
141
+ err.code || "API_ERROR",
142
+ err.serverMessage || `API error (${err.status}).`
143
+ );
144
+ }
145
+ throw err;
146
+ }
147
+ if (project instanceof ProjectNotFound) {
148
+ return outputError(
149
+ client,
150
+ opts.jsonOutput,
151
+ "PROJECT_NOT_FOUND",
152
+ `Project "${opts.project}" was not found in team "${team2.slug}".`
153
+ );
154
+ }
155
+ return {
156
+ teamId: team2.id,
157
+ teamSlug: team2.slug,
158
+ projectId: project.id,
159
+ projectName: project.name
160
+ };
161
+ }
162
+ const linked = await getLinkedProject(client);
163
+ if (linked.status === "error") {
164
+ return linked.exitCode;
165
+ }
166
+ if (linked.status === "linked") {
167
+ if (scopeIsExplicit(client)) {
168
+ const { team: team2 } = await getScope(client);
169
+ if (!team2) {
170
+ return outputError(
171
+ client,
172
+ opts.jsonOutput,
173
+ "NO_TEAM",
174
+ "No team context found for --scope."
175
+ );
176
+ }
177
+ if (team2.id !== linked.org.id) {
178
+ if (opts.requireProject) {
179
+ return outputError(
180
+ client,
181
+ opts.jsonOutput,
182
+ "SCOPE_PROJECT_MISMATCH",
183
+ `--scope ${team2.slug} does not match the linked project's team (${linked.org.slug}). Pass --project <name-or-id> for a project in ${team2.slug}.`
184
+ );
185
+ }
186
+ return { teamId: team2.id, teamSlug: team2.slug };
187
+ }
188
+ }
189
+ return {
190
+ teamId: linked.org.id,
191
+ teamSlug: linked.org.slug,
192
+ projectId: linked.project.id,
193
+ projectName: linked.project.name,
194
+ linked: true
195
+ };
196
+ }
197
+ if (opts.requireProject) {
198
+ return outputError(
199
+ client,
200
+ opts.jsonOutput,
201
+ "NOT_LINKED",
202
+ "No linked project found. Run `vercel link` to link a project, or pass --project <name-or-id>."
203
+ );
204
+ }
205
+ const { team } = await getScope(client);
206
+ if (!team) {
207
+ return outputError(
208
+ client,
209
+ opts.jsonOutput,
210
+ "NO_TEAM",
211
+ "No team context found. Run `vercel switch` to select a team, or run `vercel link` in a project directory."
212
+ );
213
+ }
214
+ return { teamId: team.id, teamSlug: team.slug };
215
+ }
216
+ function inferBranch(cwd) {
217
+ const result = spawnSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
218
+ cwd,
219
+ encoding: "utf8"
220
+ });
221
+ if (result.status === 0) {
222
+ const branch = result.stdout.trim();
223
+ if (branch && branch !== "HEAD") {
224
+ return { value: branch, source: "git" };
225
+ }
226
+ }
227
+ const ciRef = process.env.VERCEL_GIT_COMMIT_REF || process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME;
228
+ if (ciRef) {
229
+ return { value: ciRef, source: "ci" };
230
+ }
231
+ return void 0;
232
+ }
233
+
234
+ export {
235
+ handleCommentsParseError,
236
+ threadNotFoundMessage,
237
+ listThreads,
238
+ getThread,
239
+ updateThread,
240
+ listMessages,
241
+ addMessage,
242
+ updateMessage,
243
+ deleteMessage,
244
+ toApiErrorParts,
245
+ resolveCommentsScope,
246
+ inferBranch
247
+ };