vercel 54.18.6 → 54.19.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 (72) hide show
  1. package/dist/chunks/{add-DFHK2LCD.js → add-P6CBTAGK.js} +4 -4
  2. package/dist/chunks/add-WB6SXGXX.js +134 -0
  3. package/dist/chunks/{chunk-LQALVXRD.js → chunk-3S2QGKYZ.js} +1 -1
  4. package/dist/chunks/chunk-4QVAYRYH.js +71 -0
  5. package/dist/chunks/{chunk-22CQWS5E.js → chunk-5MVXR7B7.js} +1 -1
  6. package/dist/chunks/{chunk-VKGCONIM.js → chunk-6ISLGUMI.js} +3 -3
  7. package/dist/chunks/chunk-AUECDTMX.js +128 -0
  8. package/dist/chunks/{chunk-3WENOEKR.js → chunk-FM24W7ET.js} +4 -4
  9. package/dist/chunks/{chunk-GXAVQSHO.js → chunk-FVI6UYNL.js} +1 -1
  10. package/dist/chunks/{chunk-DHLDURNP.js → chunk-FZZWTDNQ.js} +2 -2
  11. package/dist/chunks/chunk-I3HGCZ4E.js +72 -0
  12. package/dist/chunks/{chunk-CXGDCPH4.js → chunk-ITU4COOO.js} +12 -3
  13. package/dist/chunks/chunk-KXGWAWRV.js +148 -0
  14. package/dist/chunks/{chunk-NN7E6Y4F.js → chunk-L6QLQSJE.js} +2 -2
  15. package/dist/chunks/{chunk-XQQXV6ZZ.js → chunk-LFODAB54.js} +1 -0
  16. package/dist/chunks/{chunk-I43WUYKE.js → chunk-O2QNLUYX.js} +1 -1
  17. package/dist/chunks/{chunk-BI2IN6RX.js → chunk-P726GMBL.js} +1 -1
  18. package/dist/chunks/{chunk-7273TMGI.js → chunk-Q4A2Q46Z.js} +4 -4
  19. package/dist/chunks/{chunk-ODVBO56J.js → chunk-Q7GZMMHB.js} +2 -2
  20. package/dist/chunks/{chunk-F6YGVA2L.js → chunk-RB7WQKNC.js} +3 -2
  21. package/dist/chunks/{chunk-URFSONFS.js → chunk-RKLBPBRM.js} +1 -1
  22. package/dist/chunks/chunk-RY3AVR6E.js +111 -0
  23. package/dist/chunks/{chunk-QPBO2QDL.js → chunk-SQYJEUZD.js} +4 -4
  24. package/dist/chunks/{chunk-ZAJ4OMXG.js → chunk-TV7GKFSY.js} +1 -1
  25. package/dist/chunks/{chunk-PPW2JATF.js → chunk-U3FBUYRS.js} +1 -1
  26. package/dist/chunks/chunk-VGIMO3ZK.js +17 -0
  27. package/dist/chunks/{chunk-BSSEGYXP.js → chunk-WFXGLPSI.js} +7 -3
  28. package/dist/chunks/{chunk-V7IBBQ2D.js → chunk-YWLVPKNT.js} +1 -1
  29. package/dist/chunks/chunk-ZVDYGXRA.js +363 -0
  30. package/dist/chunks/{chunk-VTE7W5ZP.js → chunk-ZZIAWRCX.js} +0 -8
  31. package/dist/chunks/{compile-vercel-config-WRCB2TG2.js → compile-vercel-config-XEZ2TPQ4.js} +1 -1
  32. package/dist/chunks/{delete-DIFVXSQA.js → delete-O3F4EP2W.js} +2 -2
  33. package/dist/chunks/{disable-623SZAWT.js → disable-SJWGUQKZ.js} +2 -2
  34. package/dist/chunks/{discard-R7YAQI6C.js → discard-EQD6ENC3.js} +2 -2
  35. package/dist/chunks/{edit-CY2RYSKD.js → edit-NAIWNSXE.js} +3 -3
  36. package/dist/chunks/{enable-HHOQLDPW.js → enable-LXO62HU5.js} +2 -2
  37. package/dist/chunks/{export-TNFZHJKM.js → export-EHVTYAAP.js} +2 -2
  38. package/dist/chunks/image-R4JG4NX4.js +73 -0
  39. package/dist/chunks/inspect-57BITHYZ.js +136 -0
  40. package/dist/chunks/{inspect-7JLYYYAR.js → inspect-KYVZQL56.js} +3 -3
  41. package/dist/chunks/inspect-RTJALSXC.js +167 -0
  42. package/dist/chunks/inspect-VXODLWNM.js +163 -0
  43. package/dist/chunks/{list-5LKLQBXP.js → list-BYTNF7D7.js} +3 -3
  44. package/dist/chunks/{list-K4F7WGQR.js → list-MUFZTUZA.js} +2 -2
  45. package/dist/chunks/ls-D7NWJACX.js +165 -0
  46. package/dist/chunks/ls-JPWOOVMW.js +214 -0
  47. package/dist/chunks/{ls-DUHNXBAL.js → ls-PDILBRUL.js} +4 -4
  48. package/dist/chunks/ls-ZDMXBOJF.js +201 -0
  49. package/dist/chunks/{publish-O5UJJQKF.js → publish-27V2MMFS.js} +2 -2
  50. package/dist/chunks/{query-FE6G54EI.js → query-75PT24SH.js} +2 -2
  51. package/dist/chunks/{reorder-YH47SCZC.js → reorder-DCSIJX72.js} +2 -2
  52. package/dist/chunks/{restore-TSR6PO3H.js → restore-NRUBGNSK.js} +2 -2
  53. package/dist/chunks/{rm-PQSDPXP2.js → rm-BJSTNUIJ.js} +4 -4
  54. package/dist/chunks/rm-OSIDD4VR.js +137 -0
  55. package/dist/chunks/rm-ZJQ5DOAW.js +137 -0
  56. package/dist/chunks/{rule-inspect-TNP2HULT.js → rule-inspect-WTU3MGMH.js} +4 -4
  57. package/dist/chunks/{rules-IO4KI6U7.js → rules-6PXGKHFH.js} +6 -6
  58. package/dist/chunks/{schema-QFN4XSPZ.js → schema-Z6L3EN6F.js} +2 -2
  59. package/dist/chunks/tags-HHNNZLC6.js +67 -0
  60. package/dist/chunks/{update-PGYIRCOQ.js → update-TTPNV44H.js} +4 -4
  61. package/dist/commands/build/index.js +148 -50
  62. package/dist/commands/deploy/index.js +13 -10
  63. package/dist/commands/dev/index.js +8 -8
  64. package/dist/commands/dev/next-dev-websocket-shim-preload.cjs +20 -0
  65. package/dist/commands/env/index.js +11 -6
  66. package/dist/commands/link/index.js +10 -7
  67. package/dist/commands/list/index.js +3 -3
  68. package/dist/commands-bulk.js +957 -723
  69. package/dist/help.js +1 -1
  70. package/dist/index.js +22 -9
  71. package/dist/version.mjs +1 -1
  72. package/package.json +15 -15
@@ -0,0 +1,214 @@
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
+ formatBytes,
9
+ formatDigest,
10
+ formatRelativeTime
11
+ } from "./chunk-I3HGCZ4E.js";
12
+ import {
13
+ repositoryTagsPath
14
+ } from "./chunk-4QVAYRYH.js";
15
+ import {
16
+ emitVcrArgParseError,
17
+ handleVcrApiError,
18
+ requireVcrRepository,
19
+ resolveVcrScope,
20
+ validateVcrChoice,
21
+ validateVcrJsonOutput
22
+ } from "./chunk-ZVDYGXRA.js";
23
+ import {
24
+ outputError,
25
+ validateOptionalIntegerRange
26
+ } from "./chunk-E2ENQE2W.js";
27
+ import "./chunk-XPKWKPWA.js";
28
+ import {
29
+ TAGS_SORT_BY_CHOICES,
30
+ TAGS_SORT_ORDER_CHOICES,
31
+ tagsLsSubcommand
32
+ } from "./chunk-RY3AVR6E.js";
33
+ import {
34
+ AGENT_REASON
35
+ } from "./chunk-QH7WYDEP.js";
36
+ import "./chunk-P726GMBL.js";
37
+ import {
38
+ table
39
+ } from "./chunk-VKBYAWTL.js";
40
+ import "./chunk-RB7WQKNC.js";
41
+ import {
42
+ outputAgentError
43
+ } from "./chunk-IZOHLD5D.js";
44
+ import "./chunk-ECCWJHC6.js";
45
+ import {
46
+ getFlagsSpecification,
47
+ parseArguments,
48
+ printError
49
+ } from "./chunk-EJ6GQI6F.js";
50
+ import {
51
+ isAPIError
52
+ } from "./chunk-P6AK7SVK.js";
53
+ import "./chunk-P4QNYOFB.js";
54
+ import "./chunk-2RVK3DDN.js";
55
+ import {
56
+ output_manager_default
57
+ } from "./chunk-OX7KI3LF.js";
58
+ import "./chunk-GGP5R3FU.js";
59
+ import {
60
+ require_source
61
+ } from "./chunk-S7KYDPEM.js";
62
+ import {
63
+ __toESM
64
+ } from "./chunk-TZ2YI2VH.js";
65
+
66
+ // src/commands/vcr/tags/ls.ts
67
+ var import_chalk = __toESM(require_source(), 1);
68
+ function printTags(list) {
69
+ if (list.tags.length === 0) {
70
+ output_manager_default.log("No tags found.");
71
+ return;
72
+ }
73
+ const headers = ["Tag", "Image ID", "Digest", "Arch", "Size", "Created"].map(
74
+ (h) => import_chalk.default.cyan(h)
75
+ );
76
+ const rows = [
77
+ headers,
78
+ ...list.tags.map((tag) => [
79
+ import_chalk.default.bold(tag.tag),
80
+ import_chalk.default.dim(tag.imageId),
81
+ import_chalk.default.dim(formatDigest(tag.manifestDigest)),
82
+ tag.arch ?? "-",
83
+ formatBytes(tag.sizeInBytes),
84
+ formatRelativeTime(tag.createdAt)
85
+ ])
86
+ ];
87
+ const tableOutput = table(rows, { hsep: 3 }).split("\n").map((line) => line.trimEnd()).join("\n").replace(/^/gm, " ");
88
+ output_manager_default.print(`
89
+ ${tableOutput}
90
+ `);
91
+ if (list.nextCursor) {
92
+ output_manager_default.log(
93
+ `More results available. Re-run with \`--cursor ${list.nextCursor}\`.`
94
+ );
95
+ }
96
+ }
97
+ async function ls(client, argv, telemetry) {
98
+ let parsedArgs;
99
+ try {
100
+ parsedArgs = parseArguments(
101
+ argv,
102
+ getFlagsSpecification(tagsLsSubcommand.options)
103
+ );
104
+ } catch (err) {
105
+ emitVcrArgParseError(
106
+ client,
107
+ err,
108
+ "vcr tag ls <repository> --project <name-or-id>"
109
+ );
110
+ printError(err);
111
+ return 1;
112
+ }
113
+ const fr = validateVcrJsonOutput(client, parsedArgs.flags);
114
+ if (typeof fr === "number") {
115
+ return fr;
116
+ }
117
+ const repository = parsedArgs.args[0];
118
+ const project = parsedArgs.flags["--project"];
119
+ const cursor = parsedArgs.flags["--cursor"];
120
+ const limitFlag = parsedArgs.flags["--limit"];
121
+ const sortBy = parsedArgs.flags["--sort-by"];
122
+ const sortOrder = parsedArgs.flags["--sort-order"];
123
+ telemetry.trackCliOptionProject(project);
124
+ telemetry.trackCliOptionLimit(limitFlag);
125
+ telemetry.trackCliOptionCursor(cursor);
126
+ telemetry.trackCliOptionSortBy(sortBy);
127
+ telemetry.trackCliOptionSortOrder(sortOrder);
128
+ telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
129
+ const missingRepository = requireVcrRepository(
130
+ client,
131
+ repository,
132
+ fr.jsonOutput,
133
+ "vcr tag ls <repository>"
134
+ );
135
+ if (typeof missingRepository === "number") {
136
+ return missingRepository;
137
+ }
138
+ const limitResult = validateOptionalIntegerRange(limitFlag, {
139
+ flag: "--limit",
140
+ min: 1,
141
+ max: 100
142
+ });
143
+ if (!limitResult.valid) {
144
+ outputAgentError(
145
+ client,
146
+ {
147
+ status: "error",
148
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
149
+ message: limitResult.message
150
+ },
151
+ 1
152
+ );
153
+ return outputError(
154
+ client,
155
+ fr.jsonOutput,
156
+ limitResult.code,
157
+ limitResult.message
158
+ );
159
+ }
160
+ const sortByError = validateVcrChoice(
161
+ client,
162
+ "--sort-by",
163
+ sortBy,
164
+ TAGS_SORT_BY_CHOICES,
165
+ fr.jsonOutput
166
+ );
167
+ if (typeof sortByError === "number") {
168
+ return sortByError;
169
+ }
170
+ const sortOrderError = validateVcrChoice(
171
+ client,
172
+ "--sort-order",
173
+ sortOrder,
174
+ TAGS_SORT_ORDER_CHOICES,
175
+ fr.jsonOutput
176
+ );
177
+ if (typeof sortOrderError === "number") {
178
+ return sortOrderError;
179
+ }
180
+ const scope = await resolveVcrScope(client, {
181
+ project,
182
+ jsonOutput: fr.jsonOutput
183
+ });
184
+ if (typeof scope === "number") {
185
+ return scope;
186
+ }
187
+ const path = repositoryTagsPath(scope, repository, {
188
+ limit: limitResult.value,
189
+ cursor,
190
+ sortBy,
191
+ sortOrder
192
+ });
193
+ output_manager_default.spinner("Fetching tags...");
194
+ try {
195
+ const list = await client.fetch(path);
196
+ if (fr.jsonOutput) {
197
+ client.stdout.write(`${JSON.stringify(list, null, 2)}
198
+ `);
199
+ } else {
200
+ printTags(list);
201
+ }
202
+ return 0;
203
+ } catch (err) {
204
+ if (isAPIError(err)) {
205
+ return handleVcrApiError(client, err, fr.jsonOutput);
206
+ }
207
+ throw err;
208
+ } finally {
209
+ output_manager_default.stopSpinner();
210
+ }
211
+ }
212
+ export {
213
+ ls as default
214
+ };
@@ -9,8 +9,8 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesCollectionPath
12
- } from "./chunk-URFSONFS.js";
13
- import "./chunk-NN7E6Y4F.js";
12
+ } from "./chunk-RKLBPBRM.js";
13
+ import "./chunk-L6QLQSJE.js";
14
14
  import "./chunk-E2ENQE2W.js";
15
15
  import {
16
16
  validateJsonOutput
@@ -21,8 +21,8 @@ import {
21
21
  import {
22
22
  AGENT_REASON
23
23
  } from "./chunk-QH7WYDEP.js";
24
- import "./chunk-BI2IN6RX.js";
25
- import "./chunk-F6YGVA2L.js";
24
+ import "./chunk-P726GMBL.js";
25
+ import "./chunk-RB7WQKNC.js";
26
26
  import {
27
27
  outputAgentError
28
28
  } from "./chunk-IZOHLD5D.js";
@@ -0,0 +1,201 @@
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
+ formatBytes,
9
+ formatDigest,
10
+ formatImageStatus,
11
+ formatRelativeTime
12
+ } from "./chunk-I3HGCZ4E.js";
13
+ import {
14
+ repositoryImagesPath
15
+ } from "./chunk-4QVAYRYH.js";
16
+ import {
17
+ emitVcrArgParseError,
18
+ handleVcrApiError,
19
+ requireVcrRepository,
20
+ resolveVcrScope,
21
+ validateVcrJsonOutput
22
+ } from "./chunk-ZVDYGXRA.js";
23
+ import {
24
+ outputError,
25
+ validateOptionalIntegerRange
26
+ } from "./chunk-E2ENQE2W.js";
27
+ import "./chunk-XPKWKPWA.js";
28
+ import {
29
+ imageLsSubcommand
30
+ } from "./chunk-AUECDTMX.js";
31
+ import {
32
+ AGENT_REASON
33
+ } from "./chunk-QH7WYDEP.js";
34
+ import "./chunk-P726GMBL.js";
35
+ import {
36
+ table
37
+ } from "./chunk-VKBYAWTL.js";
38
+ import "./chunk-RB7WQKNC.js";
39
+ import {
40
+ outputAgentError
41
+ } from "./chunk-IZOHLD5D.js";
42
+ import "./chunk-ECCWJHC6.js";
43
+ import {
44
+ getFlagsSpecification,
45
+ parseArguments,
46
+ printError
47
+ } from "./chunk-EJ6GQI6F.js";
48
+ import {
49
+ isAPIError
50
+ } from "./chunk-P6AK7SVK.js";
51
+ import "./chunk-P4QNYOFB.js";
52
+ import "./chunk-2RVK3DDN.js";
53
+ import {
54
+ output_manager_default
55
+ } from "./chunk-OX7KI3LF.js";
56
+ import "./chunk-GGP5R3FU.js";
57
+ import {
58
+ require_source
59
+ } from "./chunk-S7KYDPEM.js";
60
+ import {
61
+ __toESM
62
+ } from "./chunk-TZ2YI2VH.js";
63
+
64
+ // src/commands/vcr/image/ls.ts
65
+ var import_chalk = __toESM(require_source(), 1);
66
+ function formatType(kind) {
67
+ return kind === "index" ? "Index" : "Image";
68
+ }
69
+ function printImages(list) {
70
+ if (list.images.length === 0) {
71
+ output_manager_default.log("No images found.");
72
+ return;
73
+ }
74
+ const headers = [
75
+ "Image ID",
76
+ "Digest",
77
+ "Tags",
78
+ "Type",
79
+ "Status",
80
+ "Arch",
81
+ "Size",
82
+ "Created"
83
+ ].map((h) => import_chalk.default.cyan(h));
84
+ const rows = [
85
+ headers,
86
+ ...list.images.map((image) => [
87
+ import_chalk.default.bold(image.id),
88
+ import_chalk.default.dim(formatDigest(image.manifestDigest)),
89
+ image.tags.length > 0 ? image.tags.join(", ") : import_chalk.default.dim("<none>"),
90
+ formatType(image.kind),
91
+ formatImageStatus(image.status),
92
+ image.arch ?? "-",
93
+ formatBytes(image.sizeInBytes),
94
+ formatRelativeTime(image.createdAt)
95
+ ])
96
+ ];
97
+ const tableOutput = table(rows, { hsep: 3 }).split("\n").map((line) => line.trimEnd()).join("\n").replace(/^/gm, " ");
98
+ output_manager_default.print(`
99
+ ${tableOutput}
100
+ `);
101
+ if (list.nextCursor) {
102
+ output_manager_default.log(
103
+ `More results available. Re-run with \`--cursor ${list.nextCursor}\`.`
104
+ );
105
+ }
106
+ }
107
+ async function ls(client, argv, telemetry) {
108
+ let parsedArgs;
109
+ try {
110
+ parsedArgs = parseArguments(
111
+ argv,
112
+ getFlagsSpecification(imageLsSubcommand.options)
113
+ );
114
+ } catch (err) {
115
+ emitVcrArgParseError(
116
+ client,
117
+ err,
118
+ "vcr image ls <repository> --project <name-or-id>"
119
+ );
120
+ printError(err);
121
+ return 1;
122
+ }
123
+ const fr = validateVcrJsonOutput(client, parsedArgs.flags);
124
+ if (typeof fr === "number") {
125
+ return fr;
126
+ }
127
+ const repository = parsedArgs.args[0];
128
+ const project = parsedArgs.flags["--project"];
129
+ const cursor = parsedArgs.flags["--cursor"];
130
+ const limitFlag = parsedArgs.flags["--limit"];
131
+ const untagged = parsedArgs.flags["--untagged"];
132
+ telemetry.trackCliOptionProject(project);
133
+ telemetry.trackCliOptionLimit(limitFlag);
134
+ telemetry.trackCliOptionCursor(cursor);
135
+ telemetry.trackCliFlagUntagged(untagged);
136
+ telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
137
+ const missingRepository = requireVcrRepository(
138
+ client,
139
+ repository,
140
+ fr.jsonOutput,
141
+ "vcr image ls <repository>"
142
+ );
143
+ if (typeof missingRepository === "number") {
144
+ return missingRepository;
145
+ }
146
+ const limitResult = validateOptionalIntegerRange(limitFlag, {
147
+ flag: "--limit",
148
+ min: 1,
149
+ max: 100
150
+ });
151
+ if (!limitResult.valid) {
152
+ outputAgentError(
153
+ client,
154
+ {
155
+ status: "error",
156
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
157
+ message: limitResult.message
158
+ },
159
+ 1
160
+ );
161
+ return outputError(
162
+ client,
163
+ fr.jsonOutput,
164
+ limitResult.code,
165
+ limitResult.message
166
+ );
167
+ }
168
+ const scope = await resolveVcrScope(client, {
169
+ project,
170
+ jsonOutput: fr.jsonOutput
171
+ });
172
+ if (typeof scope === "number") {
173
+ return scope;
174
+ }
175
+ const path = repositoryImagesPath(scope, repository, {
176
+ limit: limitResult.value,
177
+ cursor,
178
+ untagged
179
+ });
180
+ output_manager_default.spinner("Fetching images...");
181
+ try {
182
+ const list = await client.fetch(path);
183
+ if (fr.jsonOutput) {
184
+ client.stdout.write(`${JSON.stringify(list, null, 2)}
185
+ `);
186
+ } else {
187
+ printImages(list);
188
+ }
189
+ return 0;
190
+ } catch (err) {
191
+ if (isAPIError(err)) {
192
+ return handleVcrApiError(client, err, fr.jsonOutput);
193
+ }
194
+ throw err;
195
+ } finally {
196
+ output_manager_default.stopSpinner();
197
+ }
198
+ }
199
+ export {
200
+ ls as default
201
+ };
@@ -17,7 +17,7 @@ import {
17
17
  parseSubcommandArgs,
18
18
  printDiffSummary,
19
19
  withGlobalFlags
20
- } from "./chunk-ZAJ4OMXG.js";
20
+ } from "./chunk-TV7GKFSY.js";
21
21
  import {
22
22
  publishSubcommand
23
23
  } from "./chunk-EFUR47FZ.js";
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-64IF634X.js";
27
27
  import "./chunk-VXYGCOKL.js";
28
28
  import "./chunk-QH7WYDEP.js";
29
- import "./chunk-F6YGVA2L.js";
29
+ import "./chunk-RB7WQKNC.js";
30
30
  import {
31
31
  outputAgentError
32
32
  } from "./chunk-IZOHLD5D.js";
@@ -28,14 +28,14 @@ import {
28
28
  } from "./chunk-MAJWH2PD.js";
29
29
  import {
30
30
  getScope
31
- } from "./chunk-BI2IN6RX.js";
31
+ } from "./chunk-P726GMBL.js";
32
32
  import {
33
33
  table
34
34
  } from "./chunk-VKBYAWTL.js";
35
35
  import {
36
36
  getLinkedProject,
37
37
  getProjectByNameOrId
38
- } from "./chunk-F6YGVA2L.js";
38
+ } from "./chunk-RB7WQKNC.js";
39
39
  import "./chunk-IZOHLD5D.js";
40
40
  import "./chunk-ECCWJHC6.js";
41
41
  import {
@@ -16,7 +16,7 @@ import {
16
16
  resolveRoute,
17
17
  shellQuoteRouteIdentifierForSuggestion,
18
18
  withGlobalFlags
19
- } from "./chunk-ZAJ4OMXG.js";
19
+ } from "./chunk-TV7GKFSY.js";
20
20
  import {
21
21
  reorderSubcommand
22
22
  } from "./chunk-EFUR47FZ.js";
@@ -25,7 +25,7 @@ import {
25
25
  } from "./chunk-64IF634X.js";
26
26
  import "./chunk-VXYGCOKL.js";
27
27
  import "./chunk-QH7WYDEP.js";
28
- import "./chunk-F6YGVA2L.js";
28
+ import "./chunk-RB7WQKNC.js";
29
29
  import {
30
30
  outputAgentError
31
31
  } from "./chunk-IZOHLD5D.js";
@@ -19,7 +19,7 @@ import {
19
19
  printDiffSummary,
20
20
  validateRequiredArgs,
21
21
  withGlobalFlags
22
- } from "./chunk-ZAJ4OMXG.js";
22
+ } from "./chunk-TV7GKFSY.js";
23
23
  import {
24
24
  restoreSubcommand
25
25
  } from "./chunk-EFUR47FZ.js";
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-64IF634X.js";
29
29
  import "./chunk-VXYGCOKL.js";
30
30
  import "./chunk-QH7WYDEP.js";
31
- import "./chunk-F6YGVA2L.js";
31
+ import "./chunk-RB7WQKNC.js";
32
32
  import {
33
33
  outputAgentError
34
34
  } from "./chunk-IZOHLD5D.js";
@@ -9,8 +9,8 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesItemPath
12
- } from "./chunk-URFSONFS.js";
13
- import "./chunk-NN7E6Y4F.js";
12
+ } from "./chunk-RKLBPBRM.js";
13
+ import "./chunk-L6QLQSJE.js";
14
14
  import "./chunk-E2ENQE2W.js";
15
15
  import {
16
16
  validateJsonOutput
@@ -21,8 +21,8 @@ import {
21
21
  import {
22
22
  AGENT_REASON
23
23
  } from "./chunk-QH7WYDEP.js";
24
- import "./chunk-BI2IN6RX.js";
25
- import "./chunk-F6YGVA2L.js";
24
+ import "./chunk-P726GMBL.js";
25
+ import "./chunk-RB7WQKNC.js";
26
26
  import {
27
27
  buildCommandWithGlobalFlags,
28
28
  buildCommandWithYes,
@@ -0,0 +1,137 @@
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
+ repositoryPath
9
+ } from "./chunk-4QVAYRYH.js";
10
+ import {
11
+ emitVcrArgParseError,
12
+ handleVcrApiError,
13
+ requireVcrRepository,
14
+ resolveVcrScope,
15
+ validateVcrJsonOutput
16
+ } from "./chunk-ZVDYGXRA.js";
17
+ import "./chunk-E2ENQE2W.js";
18
+ import "./chunk-XPKWKPWA.js";
19
+ import {
20
+ removeSubcommand
21
+ } from "./chunk-KXGWAWRV.js";
22
+ import "./chunk-RY3AVR6E.js";
23
+ import "./chunk-AUECDTMX.js";
24
+ import {
25
+ AGENT_REASON
26
+ } from "./chunk-QH7WYDEP.js";
27
+ import "./chunk-P726GMBL.js";
28
+ import "./chunk-RB7WQKNC.js";
29
+ import {
30
+ buildCommandWithYes,
31
+ outputAgentError
32
+ } from "./chunk-IZOHLD5D.js";
33
+ import "./chunk-ECCWJHC6.js";
34
+ import {
35
+ getFlagsSpecification,
36
+ parseArguments,
37
+ printError
38
+ } from "./chunk-EJ6GQI6F.js";
39
+ import {
40
+ isAPIError
41
+ } from "./chunk-P6AK7SVK.js";
42
+ import "./chunk-P4QNYOFB.js";
43
+ import "./chunk-2RVK3DDN.js";
44
+ import {
45
+ output_manager_default
46
+ } from "./chunk-OX7KI3LF.js";
47
+ import "./chunk-GGP5R3FU.js";
48
+ import "./chunk-S7KYDPEM.js";
49
+ import "./chunk-TZ2YI2VH.js";
50
+
51
+ // src/commands/vcr/rm.ts
52
+ async function rm(client, argv, telemetry) {
53
+ let parsedArgs;
54
+ try {
55
+ parsedArgs = parseArguments(
56
+ argv,
57
+ getFlagsSpecification(removeSubcommand.options)
58
+ );
59
+ } catch (err) {
60
+ emitVcrArgParseError(
61
+ client,
62
+ err,
63
+ "vcr rm <repository> --project <name-or-id>"
64
+ );
65
+ printError(err);
66
+ return 1;
67
+ }
68
+ const fr = validateVcrJsonOutput(client, parsedArgs.flags);
69
+ if (typeof fr === "number") {
70
+ return fr;
71
+ }
72
+ const repository = parsedArgs.args[0];
73
+ const project = parsedArgs.flags["--project"];
74
+ const skipConfirmation = Boolean(parsedArgs.flags["--yes"]);
75
+ telemetry.trackCliOptionProject(project);
76
+ telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]);
77
+ telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
78
+ const missingRepository = requireVcrRepository(
79
+ client,
80
+ repository,
81
+ fr.jsonOutput,
82
+ "vcr rm <repository>"
83
+ );
84
+ if (typeof missingRepository === "number") {
85
+ return missingRepository;
86
+ }
87
+ const scope = await resolveVcrScope(client, {
88
+ project,
89
+ jsonOutput: fr.jsonOutput
90
+ });
91
+ if (typeof scope === "number") {
92
+ return scope;
93
+ }
94
+ if (!skipConfirmation) {
95
+ outputAgentError(
96
+ client,
97
+ {
98
+ status: "error",
99
+ reason: AGENT_REASON.CONFIRMATION_REQUIRED,
100
+ message: "Deleting a repository deletes it and all of its images. Re-run with --yes.",
101
+ next: [{ command: buildCommandWithYes(client.argv) }]
102
+ },
103
+ 1
104
+ );
105
+ if (!await client.input.confirm(
106
+ `Delete repository ${repository} and all of its images? This cannot be undone.`,
107
+ false
108
+ )) {
109
+ output_manager_default.log("Canceled");
110
+ return 0;
111
+ }
112
+ }
113
+ const path = repositoryPath(scope, repository);
114
+ output_manager_default.spinner("Deleting repository...");
115
+ try {
116
+ await client.fetch(path, { method: "DELETE" });
117
+ if (fr.jsonOutput) {
118
+ client.stdout.write(
119
+ `${JSON.stringify({ repository, deleted: true }, null, 2)}
120
+ `
121
+ );
122
+ } else {
123
+ output_manager_default.success(`Repository ${repository} deleted`);
124
+ }
125
+ return 0;
126
+ } catch (err) {
127
+ if (isAPIError(err)) {
128
+ return handleVcrApiError(client, err, fr.jsonOutput);
129
+ }
130
+ throw err;
131
+ } finally {
132
+ output_manager_default.stopSpinner();
133
+ }
134
+ }
135
+ export {
136
+ rm as default
137
+ };