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.
- package/dist/chunks/{add-L3Z6PL54.js → add-7M577U56.js} +7 -6
- package/dist/chunks/{add-RFEJCIBM.js → add-YRZTDNXX.js} +3 -3
- package/dist/chunks/{chunk-V5P25P7F.js → chunk-2473DUBR.js} +4 -11
- package/dist/chunks/{chunk-5EXIJBLL.js → chunk-2EDWKVNP.js} +8 -8
- package/dist/chunks/{chunk-YS6EDZHB.js → chunk-2MJROFVC.js} +5 -1
- package/dist/chunks/{chunk-OOD67FAL.js → chunk-3242RXCN.js} +1 -1
- package/dist/chunks/chunk-3PGXYIKC.js +147 -0
- package/dist/chunks/{chunk-CHZBEMLF.js → chunk-4PGF367U.js} +47 -210
- package/dist/chunks/{chunk-GKVAAY2A.js → chunk-555WJSO5.js} +1 -1
- package/dist/chunks/chunk-5AJPMLDV.js +28 -0
- package/dist/chunks/{chunk-IHQ7DPQI.js → chunk-A2TYQBX2.js} +117 -3
- package/dist/chunks/chunk-A3NYPUKZ.js +17 -0
- package/dist/chunks/{chunk-W346YNDN.js → chunk-DWMH5M4Q.js} +4 -1
- package/dist/chunks/chunk-E336ZXPP.js +43 -0
- package/dist/chunks/chunk-F5PQWDOC.js +245 -0
- package/dist/chunks/{chunk-Y7TVKRRJ.js → chunk-F7X55TOY.js} +15 -839
- package/dist/chunks/chunk-FGDKMNEN.js +21 -0
- package/dist/chunks/chunk-FHEMFAHB.js +320 -0
- package/dist/chunks/{chunk-NLRIKNPX.js → chunk-GP5VCTEU.js} +1 -1
- package/dist/chunks/chunk-GZLPFESR.js +48 -0
- package/dist/chunks/{chunk-HZKJMZEQ.js → chunk-HD7B425F.js} +2 -2
- package/dist/chunks/{chunk-J6KTUJHV.js → chunk-IOAZNR6Z.js} +1 -1
- package/dist/chunks/{chunk-STJJ3DFO.js → chunk-KCF6S3XF.js} +16 -1
- package/dist/chunks/chunk-LMHT3QR3.js +247 -0
- package/dist/chunks/{chunk-A4XB42AB.js → chunk-MAHINYBW.js} +4 -3
- package/dist/chunks/{chunk-DXFSBJTA.js → chunk-MIFDRYTN.js} +1 -1
- package/dist/chunks/{chunk-VLTQJKP6.js → chunk-NH43BFJ3.js} +1 -1
- package/dist/chunks/{chunk-Z7NPYIZ6.js → chunk-NM43FFV6.js} +0 -8
- package/dist/chunks/{chunk-MQRHJEBS.js → chunk-NRNMT43R.js} +3 -3
- package/dist/chunks/chunk-OF2GNB42.js +53 -0
- package/dist/chunks/chunk-PRWJUY5U.js +848 -0
- package/dist/chunks/{chunk-F5OMERHI.js → chunk-QZD5DKUR.js} +10 -23
- package/dist/chunks/{chunk-4M3ZQCYN.js → chunk-RAFH25WW.js} +8 -1
- package/dist/chunks/{chunk-43B3LNUF.js → chunk-RYO6FJFB.js} +1 -1
- package/dist/chunks/{chunk-XFGY3JAX.js → chunk-T4NODP6Y.js} +11 -18
- package/dist/chunks/{chunk-GLAHGVBS.js → chunk-TBR2Q37Y.js} +2038 -1786
- package/dist/chunks/chunk-V4RMJKQP.js +36 -0
- package/dist/chunks/chunk-WR7JTCGL.js +104 -0
- package/dist/chunks/{chunk-6RTK6BWX.js → chunk-YA3WQFLY.js} +1 -1
- package/dist/chunks/{chunk-UHGAPG7O.js → chunk-YOZCJHLZ.js} +4 -4
- package/dist/chunks/{compile-vercel-config-J2X5OV6K.js → compile-vercel-config-3OHO3TJA.js} +2 -2
- package/dist/chunks/config-validator.mjs +1 -0
- package/dist/chunks/delete-3DZOCWCC.js +150 -0
- package/dist/chunks/{delete-57A44RN7.js → delete-VOSJLNEA.js} +3 -3
- package/dist/chunks/{disable-DNZ52MEO.js → disable-LQDEVRQF.js} +3 -3
- package/dist/chunks/{discard-HACSIZ74.js → discard-RGV4JKXQ.js} +3 -3
- package/dist/chunks/{edit-HJ47TQU3.js → edit-SFIEOQ24.js} +4 -4
- package/dist/chunks/edit-UPZPI54L.js +153 -0
- package/dist/chunks/{enable-BVLRVRYM.js → enable-6UVH35WC.js} +3 -3
- package/dist/chunks/{export-7MJFGMG7.js → export-6CEG3CK7.js} +3 -3
- package/dist/chunks/{image-4UMD7UZP.js → image-CQRCD2OE.js} +3 -3
- package/dist/chunks/inspect-4ZAH3RFT.js +205 -0
- package/dist/chunks/inspect-EXQBIAFF.js +587 -0
- package/dist/chunks/{inspect-WBHUZC3R.js → inspect-K5ZMQG7X.js} +3 -3
- package/dist/chunks/{inspect-4JD2QN67.js → inspect-UM3LDRPV.js} +3 -3
- package/dist/chunks/{inspect-XX3OXSHC.js → inspect-ZFRY3X3H.js} +3 -3
- package/dist/chunks/{list-AM6K2JCW.js → list-4DRVM7Q4.js} +42 -55
- package/dist/chunks/{list-5H57NTM4.js → list-FJCBOCCA.js} +2 -2
- package/dist/chunks/list-KCUHD4OA.js +360 -0
- package/dist/chunks/{login-YO34E4V5.js → login-DFGYNU3K.js} +3 -3
- package/dist/chunks/{ls-44NPIO2N.js → ls-34NCZKBE.js} +3 -3
- package/dist/chunks/{ls-P7ZLBWW2.js → ls-4QHHVXXD.js} +3 -3
- package/dist/chunks/{ls-YDUYTLXW.js → ls-CG6A7UXF.js} +3 -3
- package/dist/chunks/ls-RHEQ6YQB.js +188 -0
- package/dist/chunks/open-E3XADEMX.js +106 -0
- package/dist/chunks/{publish-RXFUYSW3.js → publish-Z3AQRUCS.js} +3 -3
- package/dist/chunks/{query-ILJJL3BZ.js → query-3EV66DO3.js} +9 -9
- package/dist/chunks/{reorder-GBCOPZT4.js → reorder-VA5E5ZJT.js} +3 -3
- package/dist/chunks/reply-SNSCNKAW.js +167 -0
- package/dist/chunks/resolve-6ZX4RTXX.js +228 -0
- package/dist/chunks/{restore-YK5DGGRX.js → restore-NEHI5B5P.js} +3 -3
- package/dist/chunks/{rm-O474MI5C.js → rm-22B22E47.js} +3 -3
- package/dist/chunks/{rm-LK6P7XTA.js → rm-E5ZVLAKO.js} +3 -3
- package/dist/chunks/{rm-FRZMXB2W.js → rm-FR6KE744.js} +7 -6
- package/dist/chunks/rule-inspect-DMP2CKJQ.js +283 -0
- package/dist/chunks/{rules-MZ2MP6KJ.js → rules-EYGXEI2Z.js} +7 -7
- package/dist/chunks/{schema-FR6CCQIZ.js → schema-2IIWOBSQ.js} +7 -5
- package/dist/chunks/{tags-AKRTKFRV.js → tags-ZDVYRHAY.js} +2 -2
- package/dist/chunks/{update-W3CWQB2F.js → update-QH4DQMZV.js} +7 -6
- package/dist/commands/build/index.js +45 -13
- package/dist/commands/deploy/index.js +38 -27
- package/dist/commands/dev/index.js +13 -16
- package/dist/commands/env/index.js +13 -11
- package/dist/commands/link/index.js +10 -9
- package/dist/commands/list/index.js +5 -5
- package/dist/commands-bulk.js +2981 -2179
- package/dist/index.js +31 -21
- package/dist/vc.js +54 -18
- package/dist/version.mjs +1 -1
- package/package.json +35 -35
- package/dist/chunks/chunk-F32B76CK.js +0 -86
- package/dist/chunks/inspect-5YZP7IWI.js +0 -351
- package/dist/chunks/ls-MB74DIQV.js +0 -113
- package/dist/chunks/rule-inspect-YEZGYINZ.js +0 -141
|
@@ -0,0 +1,150 @@
|
|
|
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
|
+
parseThreadArg
|
|
9
|
+
} from "./chunk-E336ZXPP.js";
|
|
10
|
+
import {
|
|
11
|
+
deleteMessage,
|
|
12
|
+
handleCommentsParseError,
|
|
13
|
+
resolveCommentsScope,
|
|
14
|
+
threadNotFoundMessage,
|
|
15
|
+
toApiErrorParts
|
|
16
|
+
} from "./chunk-LMHT3QR3.js";
|
|
17
|
+
import {
|
|
18
|
+
canPrompt
|
|
19
|
+
} from "./chunk-2473DUBR.js";
|
|
20
|
+
import {
|
|
21
|
+
outputError
|
|
22
|
+
} from "./chunk-BUZRVER7.js";
|
|
23
|
+
import {
|
|
24
|
+
validateJsonOutput
|
|
25
|
+
} from "./chunk-XPKWKPWA.js";
|
|
26
|
+
import {
|
|
27
|
+
deleteSubcommand
|
|
28
|
+
} from "./chunk-FHEMFAHB.js";
|
|
29
|
+
import "./chunk-TBR2Q37Y.js";
|
|
30
|
+
import "./chunk-ECCWJHC6.js";
|
|
31
|
+
import "./chunk-UDWRZXIT.js";
|
|
32
|
+
import {
|
|
33
|
+
parseArguments
|
|
34
|
+
} from "./chunk-SZXT3PDQ.js";
|
|
35
|
+
import {
|
|
36
|
+
getFlagsSpecification,
|
|
37
|
+
isAPIError
|
|
38
|
+
} from "./chunk-KSSNLCL4.js";
|
|
39
|
+
import "./chunk-P4QNYOFB.js";
|
|
40
|
+
import "./chunk-52QYYTM5.js";
|
|
41
|
+
import {
|
|
42
|
+
output_manager_default
|
|
43
|
+
} from "./chunk-OX7KI3LF.js";
|
|
44
|
+
import "./chunk-GGP5R3FU.js";
|
|
45
|
+
import {
|
|
46
|
+
require_source
|
|
47
|
+
} from "./chunk-S7KYDPEM.js";
|
|
48
|
+
import {
|
|
49
|
+
__toESM
|
|
50
|
+
} from "./chunk-TZ2YI2VH.js";
|
|
51
|
+
|
|
52
|
+
// src/commands/comments/delete.ts
|
|
53
|
+
var import_chalk = __toESM(require_source(), 1);
|
|
54
|
+
async function deleteCommentMessage(client, telemetry) {
|
|
55
|
+
let parsedArgs;
|
|
56
|
+
const flagsSpecification = getFlagsSpecification(deleteSubcommand.options);
|
|
57
|
+
try {
|
|
58
|
+
parsedArgs = parseArguments(client.argv.slice(2), flagsSpecification);
|
|
59
|
+
} catch (err) {
|
|
60
|
+
return handleCommentsParseError(err, "delete");
|
|
61
|
+
}
|
|
62
|
+
const formatResult = validateJsonOutput(parsedArgs.flags);
|
|
63
|
+
if (!formatResult.valid) {
|
|
64
|
+
output_manager_default.error(formatResult.error);
|
|
65
|
+
return 1;
|
|
66
|
+
}
|
|
67
|
+
const jsonOutput = formatResult.jsonOutput;
|
|
68
|
+
const yes = Boolean(parsedArgs.flags["--yes"]);
|
|
69
|
+
telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
|
|
70
|
+
telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]);
|
|
71
|
+
const [threadInput, messageId] = parsedArgs.args.slice(2);
|
|
72
|
+
telemetry.trackCliArgumentThread(threadInput);
|
|
73
|
+
telemetry.trackCliArgumentMessageId(messageId);
|
|
74
|
+
if (!threadInput || !messageId) {
|
|
75
|
+
return outputError(
|
|
76
|
+
client,
|
|
77
|
+
jsonOutput,
|
|
78
|
+
"MISSING_ARGUMENT",
|
|
79
|
+
"Usage: `vercel comments delete <thread> <message-id>` \u2014 message IDs are shown in `vercel comments inspect`."
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
const threadRef = parseThreadArg(threadInput);
|
|
83
|
+
if (!threadRef) {
|
|
84
|
+
return outputError(
|
|
85
|
+
client,
|
|
86
|
+
jsonOutput,
|
|
87
|
+
"INVALID_THREAD",
|
|
88
|
+
`Could not extract a thread ID from "${threadInput}".`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
const threadId = threadRef.id;
|
|
92
|
+
const scope = await resolveCommentsScope(client, {
|
|
93
|
+
project: parsedArgs.flags["--project"],
|
|
94
|
+
requireProject: false,
|
|
95
|
+
jsonOutput,
|
|
96
|
+
urlTeamSlug: threadRef.teamSlug
|
|
97
|
+
});
|
|
98
|
+
if (typeof scope === "number") {
|
|
99
|
+
return scope;
|
|
100
|
+
}
|
|
101
|
+
if (!yes) {
|
|
102
|
+
if (!canPrompt(client) || jsonOutput) {
|
|
103
|
+
return outputError(
|
|
104
|
+
client,
|
|
105
|
+
jsonOutput,
|
|
106
|
+
"CONFIRMATION_REQUIRED",
|
|
107
|
+
"Pass --yes to delete the message non-interactively."
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
const confirmed = await client.input.confirm(
|
|
111
|
+
`${import_chalk.default.red("Delete")} message ${messageId} from ${threadId} in team ${scope.teamSlug ?? scope.teamId}? This cannot be undone.`,
|
|
112
|
+
false
|
|
113
|
+
);
|
|
114
|
+
if (!confirmed) {
|
|
115
|
+
output_manager_default.log("Canceled.");
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);
|
|
120
|
+
try {
|
|
121
|
+
const result = await deleteMessage(
|
|
122
|
+
client,
|
|
123
|
+
scope.teamId,
|
|
124
|
+
threadId,
|
|
125
|
+
messageId
|
|
126
|
+
);
|
|
127
|
+
if (jsonOutput) {
|
|
128
|
+
client.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
129
|
+
`);
|
|
130
|
+
return 0;
|
|
131
|
+
}
|
|
132
|
+
output_manager_default.print(`${import_chalk.default.green("\u2713")} Deleted message ${messageId}
|
|
133
|
+
`);
|
|
134
|
+
return 0;
|
|
135
|
+
} catch (err) {
|
|
136
|
+
if (isAPIError(err)) {
|
|
137
|
+
const { code, message } = toApiErrorParts(err);
|
|
138
|
+
return outputError(
|
|
139
|
+
client,
|
|
140
|
+
jsonOutput,
|
|
141
|
+
code,
|
|
142
|
+
err.status === 404 ? threadNotFoundMessage(threadId, scope) : message
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
throw err;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
deleteCommentMessage as default
|
|
150
|
+
};
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
requireProjectContext,
|
|
16
16
|
resolveRoutes,
|
|
17
17
|
withGlobalFlags
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-555WJSO5.js";
|
|
19
19
|
import {
|
|
20
20
|
deleteSubcommand
|
|
21
21
|
} from "./chunk-VZSZBD4V.js";
|
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
stamp_default
|
|
24
24
|
} from "./chunk-64IF634X.js";
|
|
25
25
|
import "./chunk-VXYGCOKL.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-TBR2Q37Y.js";
|
|
27
|
+
import "./chunk-ECCWJHC6.js";
|
|
27
28
|
import {
|
|
28
29
|
AGENT_REASON,
|
|
29
30
|
AGENT_STATUS,
|
|
30
31
|
outputAgentError
|
|
31
32
|
} from "./chunk-UDWRZXIT.js";
|
|
32
|
-
import "./chunk-ECCWJHC6.js";
|
|
33
33
|
import "./chunk-SZXT3PDQ.js";
|
|
34
34
|
import "./chunk-KSSNLCL4.js";
|
|
35
35
|
import "./chunk-P4QNYOFB.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
requireProjectContext,
|
|
18
18
|
resolveRoute,
|
|
19
19
|
withGlobalFlags
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-555WJSO5.js";
|
|
21
21
|
import {
|
|
22
22
|
disableSubcommand
|
|
23
23
|
} from "./chunk-VZSZBD4V.js";
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
stamp_default
|
|
26
26
|
} from "./chunk-64IF634X.js";
|
|
27
27
|
import "./chunk-VXYGCOKL.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-TBR2Q37Y.js";
|
|
29
|
+
import "./chunk-ECCWJHC6.js";
|
|
29
30
|
import {
|
|
30
31
|
outputAgentError
|
|
31
32
|
} from "./chunk-UDWRZXIT.js";
|
|
32
|
-
import "./chunk-ECCWJHC6.js";
|
|
33
33
|
import "./chunk-SZXT3PDQ.js";
|
|
34
34
|
import "./chunk-KSSNLCL4.js";
|
|
35
35
|
import "./chunk-P4QNYOFB.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
printDiffSummary,
|
|
18
18
|
requireProjectContext,
|
|
19
19
|
withGlobalFlags
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-555WJSO5.js";
|
|
21
21
|
import {
|
|
22
22
|
discardSubcommand
|
|
23
23
|
} from "./chunk-VZSZBD4V.js";
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
stamp_default
|
|
26
26
|
} from "./chunk-64IF634X.js";
|
|
27
27
|
import "./chunk-VXYGCOKL.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-TBR2Q37Y.js";
|
|
29
|
+
import "./chunk-ECCWJHC6.js";
|
|
29
30
|
import {
|
|
30
31
|
outputAgentError
|
|
31
32
|
} from "./chunk-UDWRZXIT.js";
|
|
32
|
-
import "./chunk-ECCWJHC6.js";
|
|
33
33
|
import "./chunk-SZXT3PDQ.js";
|
|
34
34
|
import "./chunk-KSSNLCL4.js";
|
|
35
35
|
import "./chunk-P4QNYOFB.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
printRouteConfig,
|
|
20
20
|
routingRuleToCurrentRoute,
|
|
21
21
|
runInteractiveEditLoop
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-IOAZNR6Z.js";
|
|
23
23
|
import {
|
|
24
24
|
getRouteVersions
|
|
25
25
|
} from "./chunk-AHU7WNL2.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
resolveRoute,
|
|
32
32
|
shellQuoteRouteIdentifierForSuggestion,
|
|
33
33
|
withGlobalFlags
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-555WJSO5.js";
|
|
35
35
|
import {
|
|
36
36
|
editSubcommand
|
|
37
37
|
} from "./chunk-VZSZBD4V.js";
|
|
@@ -39,11 +39,11 @@ import {
|
|
|
39
39
|
stamp_default
|
|
40
40
|
} from "./chunk-64IF634X.js";
|
|
41
41
|
import "./chunk-VXYGCOKL.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-TBR2Q37Y.js";
|
|
43
|
+
import "./chunk-ECCWJHC6.js";
|
|
43
44
|
import {
|
|
44
45
|
outputAgentError
|
|
45
46
|
} from "./chunk-UDWRZXIT.js";
|
|
46
|
-
import "./chunk-ECCWJHC6.js";
|
|
47
47
|
import "./chunk-SZXT3PDQ.js";
|
|
48
48
|
import "./chunk-KSSNLCL4.js";
|
|
49
49
|
import "./chunk-P4QNYOFB.js";
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
resolveMessageContent
|
|
9
|
+
} from "./chunk-WR7JTCGL.js";
|
|
10
|
+
import {
|
|
11
|
+
parseThreadArg
|
|
12
|
+
} from "./chunk-E336ZXPP.js";
|
|
13
|
+
import {
|
|
14
|
+
handleCommentsParseError,
|
|
15
|
+
resolveCommentsScope,
|
|
16
|
+
threadNotFoundMessage,
|
|
17
|
+
toApiErrorParts,
|
|
18
|
+
updateMessage
|
|
19
|
+
} from "./chunk-LMHT3QR3.js";
|
|
20
|
+
import "./chunk-2473DUBR.js";
|
|
21
|
+
import {
|
|
22
|
+
outputError
|
|
23
|
+
} from "./chunk-BUZRVER7.js";
|
|
24
|
+
import {
|
|
25
|
+
validateJsonOutput
|
|
26
|
+
} from "./chunk-XPKWKPWA.js";
|
|
27
|
+
import {
|
|
28
|
+
editSubcommand
|
|
29
|
+
} from "./chunk-FHEMFAHB.js";
|
|
30
|
+
import "./chunk-TBR2Q37Y.js";
|
|
31
|
+
import "./chunk-ECCWJHC6.js";
|
|
32
|
+
import "./chunk-UDWRZXIT.js";
|
|
33
|
+
import {
|
|
34
|
+
parseArguments
|
|
35
|
+
} from "./chunk-SZXT3PDQ.js";
|
|
36
|
+
import {
|
|
37
|
+
getFlagsSpecification,
|
|
38
|
+
isAPIError
|
|
39
|
+
} from "./chunk-KSSNLCL4.js";
|
|
40
|
+
import "./chunk-P4QNYOFB.js";
|
|
41
|
+
import "./chunk-52QYYTM5.js";
|
|
42
|
+
import {
|
|
43
|
+
output_manager_default
|
|
44
|
+
} from "./chunk-OX7KI3LF.js";
|
|
45
|
+
import "./chunk-GGP5R3FU.js";
|
|
46
|
+
import {
|
|
47
|
+
require_source
|
|
48
|
+
} from "./chunk-S7KYDPEM.js";
|
|
49
|
+
import {
|
|
50
|
+
__toESM
|
|
51
|
+
} from "./chunk-TZ2YI2VH.js";
|
|
52
|
+
|
|
53
|
+
// src/commands/comments/edit.ts
|
|
54
|
+
var import_chalk = __toESM(require_source(), 1);
|
|
55
|
+
async function edit(client, telemetry) {
|
|
56
|
+
let parsedArgs;
|
|
57
|
+
const flagsSpecification = getFlagsSpecification(editSubcommand.options);
|
|
58
|
+
try {
|
|
59
|
+
parsedArgs = parseArguments(client.argv.slice(2), flagsSpecification);
|
|
60
|
+
} catch (err) {
|
|
61
|
+
return handleCommentsParseError(err, "edit");
|
|
62
|
+
}
|
|
63
|
+
const formatResult = validateJsonOutput(parsedArgs.flags);
|
|
64
|
+
if (!formatResult.valid) {
|
|
65
|
+
output_manager_default.error(formatResult.error);
|
|
66
|
+
return 1;
|
|
67
|
+
}
|
|
68
|
+
const jsonOutput = formatResult.jsonOutput;
|
|
69
|
+
telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
|
|
70
|
+
telemetry.trackCliOptionMessage(parsedArgs.flags["--message"]);
|
|
71
|
+
telemetry.trackCliOptionFile(parsedArgs.flags["--file"]);
|
|
72
|
+
const [threadInput, messageId] = parsedArgs.args.slice(2);
|
|
73
|
+
telemetry.trackCliArgumentThread(threadInput);
|
|
74
|
+
telemetry.trackCliArgumentMessageId(messageId);
|
|
75
|
+
if (!threadInput || !messageId) {
|
|
76
|
+
return outputError(
|
|
77
|
+
client,
|
|
78
|
+
jsonOutput,
|
|
79
|
+
"MISSING_ARGUMENT",
|
|
80
|
+
"Usage: `vercel comments edit <thread> <message-id> -m <text>` \u2014 message IDs are shown in `vercel comments inspect`."
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
const threadRef = parseThreadArg(threadInput);
|
|
84
|
+
if (!threadRef) {
|
|
85
|
+
return outputError(
|
|
86
|
+
client,
|
|
87
|
+
jsonOutput,
|
|
88
|
+
"INVALID_THREAD",
|
|
89
|
+
`Could not extract a thread ID from "${threadInput}".`
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
const threadId = threadRef.id;
|
|
93
|
+
const content = await resolveMessageContent(
|
|
94
|
+
client,
|
|
95
|
+
{
|
|
96
|
+
message: parsedArgs.flags["--message"],
|
|
97
|
+
file: parsedArgs.flags["--file"]
|
|
98
|
+
},
|
|
99
|
+
jsonOutput
|
|
100
|
+
);
|
|
101
|
+
if (typeof content === "number") {
|
|
102
|
+
return content;
|
|
103
|
+
}
|
|
104
|
+
if (content === void 0) {
|
|
105
|
+
return outputError(
|
|
106
|
+
client,
|
|
107
|
+
jsonOutput,
|
|
108
|
+
"MISSING_CONTENT",
|
|
109
|
+
"Pass the new content with -m <text> or --file <path>."
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);
|
|
113
|
+
const scope = await resolveCommentsScope(client, {
|
|
114
|
+
project: parsedArgs.flags["--project"],
|
|
115
|
+
requireProject: false,
|
|
116
|
+
jsonOutput,
|
|
117
|
+
urlTeamSlug: threadRef.teamSlug
|
|
118
|
+
});
|
|
119
|
+
if (typeof scope === "number") {
|
|
120
|
+
return scope;
|
|
121
|
+
}
|
|
122
|
+
try {
|
|
123
|
+
const message = await updateMessage(
|
|
124
|
+
client,
|
|
125
|
+
scope.teamId,
|
|
126
|
+
threadId,
|
|
127
|
+
messageId,
|
|
128
|
+
{ markdown: content }
|
|
129
|
+
);
|
|
130
|
+
if (jsonOutput) {
|
|
131
|
+
client.stdout.write(`${JSON.stringify(message, null, 2)}
|
|
132
|
+
`);
|
|
133
|
+
return 0;
|
|
134
|
+
}
|
|
135
|
+
output_manager_default.print(`${import_chalk.default.green("\u2713")} Edited message ${messageId}
|
|
136
|
+
`);
|
|
137
|
+
return 0;
|
|
138
|
+
} catch (err) {
|
|
139
|
+
if (isAPIError(err)) {
|
|
140
|
+
const { code, message } = toApiErrorParts(err);
|
|
141
|
+
return outputError(
|
|
142
|
+
client,
|
|
143
|
+
jsonOutput,
|
|
144
|
+
code,
|
|
145
|
+
err.status === 404 ? threadNotFoundMessage(threadId, scope) : message
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
throw err;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
edit as default
|
|
153
|
+
};
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
requireProjectContext,
|
|
18
18
|
resolveRoute,
|
|
19
19
|
withGlobalFlags
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-555WJSO5.js";
|
|
21
21
|
import {
|
|
22
22
|
enableSubcommand
|
|
23
23
|
} from "./chunk-VZSZBD4V.js";
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
stamp_default
|
|
26
26
|
} from "./chunk-64IF634X.js";
|
|
27
27
|
import "./chunk-VXYGCOKL.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-TBR2Q37Y.js";
|
|
29
|
+
import "./chunk-ECCWJHC6.js";
|
|
29
30
|
import {
|
|
30
31
|
outputAgentError
|
|
31
32
|
} from "./chunk-UDWRZXIT.js";
|
|
32
|
-
import "./chunk-ECCWJHC6.js";
|
|
33
33
|
import "./chunk-SZXT3PDQ.js";
|
|
34
34
|
import "./chunk-KSSNLCL4.js";
|
|
35
35
|
import "./chunk-P4QNYOFB.js";
|
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
parseSubcommandArgs,
|
|
10
10
|
requireProjectContext,
|
|
11
11
|
withGlobalFlags
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-555WJSO5.js";
|
|
13
13
|
import {
|
|
14
14
|
exportSubcommand
|
|
15
15
|
} from "./chunk-VZSZBD4V.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-TBR2Q37Y.js";
|
|
17
|
+
import "./chunk-ECCWJHC6.js";
|
|
17
18
|
import {
|
|
18
19
|
outputAgentError
|
|
19
20
|
} from "./chunk-UDWRZXIT.js";
|
|
20
|
-
import "./chunk-ECCWJHC6.js";
|
|
21
21
|
import "./chunk-SZXT3PDQ.js";
|
|
22
22
|
import "./chunk-KSSNLCL4.js";
|
|
23
23
|
import "./chunk-P4QNYOFB.js";
|
|
@@ -56,11 +56,11 @@ async function image(client, argv, telemetry) {
|
|
|
56
56
|
}
|
|
57
57
|
switch (subcommand) {
|
|
58
58
|
case "ls":
|
|
59
|
-
return (await import("./ls-
|
|
59
|
+
return (await import("./ls-34NCZKBE.js")).default(client, args, telemetry);
|
|
60
60
|
case "inspect":
|
|
61
|
-
return (await import("./inspect-
|
|
61
|
+
return (await import("./inspect-K5ZMQG7X.js")).default(client, args, telemetry);
|
|
62
62
|
case "rm":
|
|
63
|
-
return (await import("./rm-
|
|
63
|
+
return (await import("./rm-22B22E47.js")).default(client, args, telemetry);
|
|
64
64
|
default:
|
|
65
65
|
output_manager_default.error(`Unhandled image subcommand: ${subcommand}`);
|
|
66
66
|
return 1;
|
|
@@ -0,0 +1,205 @@
|
|
|
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
|
+
actorLabel,
|
|
9
|
+
displayPath,
|
|
10
|
+
renderThreadDetail,
|
|
11
|
+
threadAge,
|
|
12
|
+
truncate
|
|
13
|
+
} from "./chunk-F5PQWDOC.js";
|
|
14
|
+
import {
|
|
15
|
+
parseThreadArg
|
|
16
|
+
} from "./chunk-E336ZXPP.js";
|
|
17
|
+
import {
|
|
18
|
+
getThread,
|
|
19
|
+
handleCommentsParseError,
|
|
20
|
+
inferBranch,
|
|
21
|
+
listMessages,
|
|
22
|
+
listThreads,
|
|
23
|
+
resolveCommentsScope,
|
|
24
|
+
threadNotFoundMessage,
|
|
25
|
+
toApiErrorParts
|
|
26
|
+
} from "./chunk-LMHT3QR3.js";
|
|
27
|
+
import {
|
|
28
|
+
canPrompt
|
|
29
|
+
} from "./chunk-2473DUBR.js";
|
|
30
|
+
import {
|
|
31
|
+
outputError
|
|
32
|
+
} from "./chunk-BUZRVER7.js";
|
|
33
|
+
import {
|
|
34
|
+
validateJsonOutput
|
|
35
|
+
} from "./chunk-XPKWKPWA.js";
|
|
36
|
+
import {
|
|
37
|
+
inspectSubcommand
|
|
38
|
+
} from "./chunk-FHEMFAHB.js";
|
|
39
|
+
import "./chunk-TBR2Q37Y.js";
|
|
40
|
+
import "./chunk-ECCWJHC6.js";
|
|
41
|
+
import "./chunk-UDWRZXIT.js";
|
|
42
|
+
import {
|
|
43
|
+
parseArguments
|
|
44
|
+
} from "./chunk-SZXT3PDQ.js";
|
|
45
|
+
import {
|
|
46
|
+
getFlagsSpecification,
|
|
47
|
+
isAPIError
|
|
48
|
+
} from "./chunk-KSSNLCL4.js";
|
|
49
|
+
import "./chunk-P4QNYOFB.js";
|
|
50
|
+
import "./chunk-52QYYTM5.js";
|
|
51
|
+
import {
|
|
52
|
+
output_manager_default
|
|
53
|
+
} from "./chunk-OX7KI3LF.js";
|
|
54
|
+
import "./chunk-GGP5R3FU.js";
|
|
55
|
+
import "./chunk-S7KYDPEM.js";
|
|
56
|
+
import "./chunk-TZ2YI2VH.js";
|
|
57
|
+
|
|
58
|
+
// src/commands/comments/inspect.ts
|
|
59
|
+
async function pickThread(client, jsonOutput) {
|
|
60
|
+
if (!canPrompt(client) || jsonOutput) {
|
|
61
|
+
return outputError(
|
|
62
|
+
client,
|
|
63
|
+
jsonOutput,
|
|
64
|
+
"MISSING_THREAD",
|
|
65
|
+
"Pass a thread ID or URL: `vercel comments inspect <thread>`."
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
const scope = await resolveCommentsScope(client, {
|
|
69
|
+
requireProject: true,
|
|
70
|
+
jsonOutput
|
|
71
|
+
});
|
|
72
|
+
if (typeof scope === "number") {
|
|
73
|
+
return scope;
|
|
74
|
+
}
|
|
75
|
+
const focus = scope.linked ? inferBranch(client.cwd) : void 0;
|
|
76
|
+
output_manager_default.spinner("Fetching comments\u2026");
|
|
77
|
+
let response;
|
|
78
|
+
try {
|
|
79
|
+
response = await listThreads(client, scope.teamId, {
|
|
80
|
+
projectId: scope.projectId,
|
|
81
|
+
status: "unresolved",
|
|
82
|
+
branch: focus ? [focus.value] : void 0,
|
|
83
|
+
limit: 20
|
|
84
|
+
});
|
|
85
|
+
} finally {
|
|
86
|
+
output_manager_default.stopSpinner();
|
|
87
|
+
}
|
|
88
|
+
if (response.threads.length === 0) {
|
|
89
|
+
return outputError(
|
|
90
|
+
client,
|
|
91
|
+
jsonOutput,
|
|
92
|
+
"NO_COMMENTS",
|
|
93
|
+
`No unresolved comments${focus ? ` on ${focus.value}` : ""} to pick from.`
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
return client.input.select({
|
|
97
|
+
message: "Select a comment",
|
|
98
|
+
choices: response.threads.map((thread) => ({
|
|
99
|
+
name: `${threadAge(thread)} ${actorLabel(thread.messages[0]?.author)} ${displayPath(thread)} \u201C${truncate(thread.messages[0]?.text ?? "", 48)}\u201D`,
|
|
100
|
+
value: thread.id
|
|
101
|
+
}))
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async function fetchAllMessages(client, teamId, thread) {
|
|
105
|
+
if (thread.messageCount <= thread.messages.length) {
|
|
106
|
+
return thread.messages;
|
|
107
|
+
}
|
|
108
|
+
const all = [];
|
|
109
|
+
let cursor;
|
|
110
|
+
do {
|
|
111
|
+
const page = await listMessages(client, teamId, thread.id, {
|
|
112
|
+
limit: 100,
|
|
113
|
+
cursor
|
|
114
|
+
});
|
|
115
|
+
all.push(...page.messages);
|
|
116
|
+
cursor = page.pagination?.nextCursor;
|
|
117
|
+
} while (cursor && all.length < thread.messageCount);
|
|
118
|
+
return all;
|
|
119
|
+
}
|
|
120
|
+
async function inspect(client, telemetry) {
|
|
121
|
+
let parsedArgs;
|
|
122
|
+
const flagsSpecification = getFlagsSpecification(inspectSubcommand.options);
|
|
123
|
+
try {
|
|
124
|
+
parsedArgs = parseArguments(client.argv.slice(2), flagsSpecification);
|
|
125
|
+
} catch (err) {
|
|
126
|
+
return handleCommentsParseError(err, "inspect");
|
|
127
|
+
}
|
|
128
|
+
const formatResult = validateJsonOutput(parsedArgs.flags);
|
|
129
|
+
if (!formatResult.valid) {
|
|
130
|
+
output_manager_default.error(formatResult.error);
|
|
131
|
+
return 1;
|
|
132
|
+
}
|
|
133
|
+
const jsonOutput = formatResult.jsonOutput;
|
|
134
|
+
const showContext = Boolean(parsedArgs.flags["--context"]);
|
|
135
|
+
telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
|
|
136
|
+
telemetry.trackCliFlagContext(parsedArgs.flags["--context"]);
|
|
137
|
+
telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);
|
|
138
|
+
const threadInput = parsedArgs.args[2];
|
|
139
|
+
telemetry.trackCliArgumentThread(threadInput);
|
|
140
|
+
let threadId;
|
|
141
|
+
let urlTeamSlug;
|
|
142
|
+
if (threadInput) {
|
|
143
|
+
const parsed = parseThreadArg(threadInput);
|
|
144
|
+
if (!parsed) {
|
|
145
|
+
return outputError(
|
|
146
|
+
client,
|
|
147
|
+
jsonOutput,
|
|
148
|
+
"INVALID_THREAD",
|
|
149
|
+
`Could not extract a thread ID from "${threadInput}". Pass the thread ID or its vercel.com URL.`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
threadId = parsed.id;
|
|
153
|
+
urlTeamSlug = parsed.teamSlug;
|
|
154
|
+
} else {
|
|
155
|
+
const picked = await pickThread(client, jsonOutput);
|
|
156
|
+
if (typeof picked === "number") {
|
|
157
|
+
return picked;
|
|
158
|
+
}
|
|
159
|
+
threadId = picked;
|
|
160
|
+
}
|
|
161
|
+
const scope = await resolveCommentsScope(client, {
|
|
162
|
+
project: parsedArgs.flags["--project"],
|
|
163
|
+
requireProject: false,
|
|
164
|
+
jsonOutput,
|
|
165
|
+
urlTeamSlug
|
|
166
|
+
});
|
|
167
|
+
if (typeof scope === "number") {
|
|
168
|
+
return scope;
|
|
169
|
+
}
|
|
170
|
+
if (!jsonOutput) {
|
|
171
|
+
output_manager_default.spinner("Fetching comment\u2026");
|
|
172
|
+
}
|
|
173
|
+
let thread;
|
|
174
|
+
let messages;
|
|
175
|
+
try {
|
|
176
|
+
thread = await getThread(client, scope.teamId, threadId);
|
|
177
|
+
messages = await fetchAllMessages(client, scope.teamId, thread);
|
|
178
|
+
} catch (err) {
|
|
179
|
+
if (isAPIError(err)) {
|
|
180
|
+
const { code, message } = toApiErrorParts(err);
|
|
181
|
+
return outputError(
|
|
182
|
+
client,
|
|
183
|
+
jsonOutput,
|
|
184
|
+
code,
|
|
185
|
+
err.status === 404 ? threadNotFoundMessage(threadId, scope) : message
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
throw err;
|
|
189
|
+
} finally {
|
|
190
|
+
output_manager_default.stopSpinner();
|
|
191
|
+
}
|
|
192
|
+
if (jsonOutput) {
|
|
193
|
+
client.stdout.write(
|
|
194
|
+
`${JSON.stringify({ ...thread, messages }, null, 2)}
|
|
195
|
+
`
|
|
196
|
+
);
|
|
197
|
+
return 0;
|
|
198
|
+
}
|
|
199
|
+
output_manager_default.print(`${renderThreadDetail(thread, messages, { showContext })}
|
|
200
|
+
`);
|
|
201
|
+
return 0;
|
|
202
|
+
}
|
|
203
|
+
export {
|
|
204
|
+
inspect as default
|
|
205
|
+
};
|