vercel 54.18.7 → 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 (32) hide show
  1. package/dist/chunks/add-WB6SXGXX.js +134 -0
  2. package/dist/chunks/chunk-4QVAYRYH.js +71 -0
  3. package/dist/chunks/chunk-AUECDTMX.js +128 -0
  4. package/dist/chunks/{chunk-JREEV2EL.js → chunk-FM24W7ET.js} +1 -1
  5. package/dist/chunks/chunk-I3HGCZ4E.js +72 -0
  6. package/dist/chunks/chunk-KXGWAWRV.js +148 -0
  7. package/dist/chunks/{chunk-XQQXV6ZZ.js → chunk-LFODAB54.js} +1 -0
  8. package/dist/chunks/chunk-RY3AVR6E.js +111 -0
  9. package/dist/chunks/{chunk-DXL7EPOQ.js → chunk-SQYJEUZD.js} +1 -1
  10. package/dist/chunks/chunk-VGIMO3ZK.js +17 -0
  11. package/dist/chunks/{chunk-AXFSALI3.js → chunk-WFXGLPSI.js} +5 -1
  12. package/dist/chunks/chunk-ZVDYGXRA.js +363 -0
  13. package/dist/chunks/{chunk-VTE7W5ZP.js → chunk-ZZIAWRCX.js} +0 -8
  14. package/dist/chunks/image-R4JG4NX4.js +73 -0
  15. package/dist/chunks/inspect-57BITHYZ.js +136 -0
  16. package/dist/chunks/inspect-RTJALSXC.js +167 -0
  17. package/dist/chunks/inspect-VXODLWNM.js +163 -0
  18. package/dist/chunks/ls-D7NWJACX.js +165 -0
  19. package/dist/chunks/ls-JPWOOVMW.js +214 -0
  20. package/dist/chunks/ls-ZDMXBOJF.js +201 -0
  21. package/dist/chunks/rm-OSIDD4VR.js +137 -0
  22. package/dist/chunks/rm-ZJQ5DOAW.js +137 -0
  23. package/dist/chunks/tags-HHNNZLC6.js +67 -0
  24. package/dist/commands/build/index.js +5 -1
  25. package/dist/commands/deploy/index.js +5 -2
  26. package/dist/commands/env/index.js +8 -3
  27. package/dist/commands/link/index.js +4 -1
  28. package/dist/commands-bulk.js +929 -695
  29. package/dist/help.js +1 -1
  30. package/dist/index.js +16 -3
  31. package/dist/version.mjs +1 -1
  32. package/package.json +13 -13
@@ -0,0 +1,167 @@
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
+ formatImageReference,
10
+ formatImageStatus,
11
+ formatRelativeTime
12
+ } from "./chunk-I3HGCZ4E.js";
13
+ import {
14
+ imagePath,
15
+ repositoryPath
16
+ } from "./chunk-4QVAYRYH.js";
17
+ import {
18
+ emitVcrArgParseError,
19
+ handleVcrApiError,
20
+ requireVcrRepositoryAndImageId,
21
+ resolveVcrScope,
22
+ validateVcrJsonOutput
23
+ } from "./chunk-ZVDYGXRA.js";
24
+ import "./chunk-E2ENQE2W.js";
25
+ import "./chunk-XPKWKPWA.js";
26
+ import {
27
+ imageInspectSubcommand
28
+ } from "./chunk-AUECDTMX.js";
29
+ import "./chunk-QH7WYDEP.js";
30
+ import "./chunk-P726GMBL.js";
31
+ import "./chunk-RB7WQKNC.js";
32
+ import "./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 {
49
+ require_source
50
+ } from "./chunk-S7KYDPEM.js";
51
+ import {
52
+ __toESM
53
+ } from "./chunk-TZ2YI2VH.js";
54
+
55
+ // src/commands/vcr/image/inspect.ts
56
+ var import_chalk = __toESM(require_source(), 1);
57
+ function printImage(image, scope, repository) {
58
+ output_manager_default.print("\n");
59
+ output_manager_default.print(` ${import_chalk.default.cyan("ID")} ${image.id}
60
+ `);
61
+ output_manager_default.print(` ${import_chalk.default.cyan("Digest")} ${image.manifestDigest}
62
+ `);
63
+ output_manager_default.print(
64
+ ` ${import_chalk.default.cyan("Image")} ${formatImageReference(
65
+ scope.teamSlug,
66
+ scope.projectName,
67
+ repository.name,
68
+ image.manifestDigest
69
+ )}
70
+ `
71
+ );
72
+ output_manager_default.print(` ${import_chalk.default.cyan("Type")} ${image.kind}
73
+ `);
74
+ output_manager_default.print(` ${import_chalk.default.cyan("Arch")} ${image.arch ?? "-"}
75
+ `);
76
+ output_manager_default.print(` ${import_chalk.default.cyan("Platform")} ${image.platform ?? "-"}
77
+ `);
78
+ output_manager_default.print(
79
+ ` ${import_chalk.default.cyan("Size")} ${formatBytes(image.sizeInBytes)}
80
+ `
81
+ );
82
+ output_manager_default.print(
83
+ ` ${import_chalk.default.cyan("Status")} ${formatImageStatus(image.status)}
84
+ `
85
+ );
86
+ output_manager_default.print(
87
+ ` ${import_chalk.default.cyan("Created")} ${formatRelativeTime(image.createdAt)}
88
+ `
89
+ );
90
+ output_manager_default.print(
91
+ ` ${import_chalk.default.cyan("Tags")} ${image.tags?.length ? image.tags.join(", ") : "-"}
92
+ `
93
+ );
94
+ output_manager_default.print("\n");
95
+ }
96
+ async function inspect(client, argv, telemetry) {
97
+ let parsedArgs;
98
+ try {
99
+ parsedArgs = parseArguments(
100
+ argv,
101
+ getFlagsSpecification(imageInspectSubcommand.options)
102
+ );
103
+ } catch (err) {
104
+ emitVcrArgParseError(
105
+ client,
106
+ err,
107
+ "vcr image inspect <repository> <imageId> --project <name-or-id>"
108
+ );
109
+ printError(err);
110
+ return 1;
111
+ }
112
+ const fr = validateVcrJsonOutput(client, parsedArgs.flags);
113
+ if (typeof fr === "number") {
114
+ return fr;
115
+ }
116
+ const repository = parsedArgs.args[0];
117
+ const imageId = parsedArgs.args[1];
118
+ const project = parsedArgs.flags["--project"];
119
+ telemetry.trackCliOptionProject(project);
120
+ telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
121
+ const missingArgs = requireVcrRepositoryAndImageId(
122
+ client,
123
+ repository,
124
+ imageId,
125
+ fr.jsonOutput,
126
+ "vcr image inspect <repository> <imageId>"
127
+ );
128
+ if (typeof missingArgs === "number") {
129
+ return missingArgs;
130
+ }
131
+ const scope = await resolveVcrScope(client, {
132
+ project,
133
+ jsonOutput: fr.jsonOutput
134
+ });
135
+ if (typeof scope === "number") {
136
+ return scope;
137
+ }
138
+ const path = imagePath(scope, repository, imageId);
139
+ output_manager_default.spinner("Fetching image...");
140
+ try {
141
+ if (fr.jsonOutput) {
142
+ const result = await client.fetch(path);
143
+ client.stdout.write(`${JSON.stringify(result.image, null, 2)}
144
+ `);
145
+ } else {
146
+ const [imageResult, repositoryResult] = await Promise.all([
147
+ client.fetch(path),
148
+ client.fetch(
149
+ repositoryPath(scope, repository)
150
+ )
151
+ ]);
152
+ output_manager_default.log(`${import_chalk.default.bold("Image")} ${import_chalk.default.cyan(imageId)}`);
153
+ printImage(imageResult.image, scope, repositoryResult.repository);
154
+ }
155
+ return 0;
156
+ } catch (err) {
157
+ if (isAPIError(err)) {
158
+ return handleVcrApiError(client, err, fr.jsonOutput);
159
+ }
160
+ throw err;
161
+ } finally {
162
+ output_manager_default.stopSpinner();
163
+ }
164
+ }
165
+ export {
166
+ inspect as default
167
+ };
@@ -0,0 +1,163 @@
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
+ formatImageStatus,
10
+ formatRelativeTime,
11
+ formatTagReference
12
+ } from "./chunk-I3HGCZ4E.js";
13
+ import {
14
+ repositoryPath,
15
+ repositoryTagPath
16
+ } from "./chunk-4QVAYRYH.js";
17
+ import {
18
+ emitVcrArgParseError,
19
+ handleVcrApiError,
20
+ requireVcrRepositoryAndTag,
21
+ resolveVcrScope,
22
+ validateVcrJsonOutput
23
+ } from "./chunk-ZVDYGXRA.js";
24
+ import "./chunk-E2ENQE2W.js";
25
+ import "./chunk-XPKWKPWA.js";
26
+ import {
27
+ tagsInspectSubcommand
28
+ } from "./chunk-RY3AVR6E.js";
29
+ import "./chunk-QH7WYDEP.js";
30
+ import "./chunk-P726GMBL.js";
31
+ import "./chunk-RB7WQKNC.js";
32
+ import "./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 {
49
+ require_source
50
+ } from "./chunk-S7KYDPEM.js";
51
+ import {
52
+ __toESM
53
+ } from "./chunk-TZ2YI2VH.js";
54
+
55
+ // src/commands/vcr/tags/inspect.ts
56
+ var import_chalk = __toESM(require_source(), 1);
57
+ function printTag(tag, scope, repository) {
58
+ output_manager_default.print("\n");
59
+ output_manager_default.print(` ${import_chalk.default.cyan("ID")} ${tag.imageId}
60
+ `);
61
+ output_manager_default.print(` ${import_chalk.default.cyan("Digest")} ${tag.manifestDigest}
62
+ `);
63
+ output_manager_default.print(
64
+ ` ${import_chalk.default.cyan("Image")} ${formatTagReference(
65
+ scope.teamSlug,
66
+ scope.projectName,
67
+ repository.name,
68
+ tag.tag
69
+ )}
70
+ `
71
+ );
72
+ output_manager_default.print(` ${import_chalk.default.cyan("Type")} ${tag.kind}
73
+ `);
74
+ output_manager_default.print(` ${import_chalk.default.cyan("Arch")} ${tag.arch ?? "-"}
75
+ `);
76
+ output_manager_default.print(` ${import_chalk.default.cyan("Platform")} ${tag.platform ?? "-"}
77
+ `);
78
+ output_manager_default.print(
79
+ ` ${import_chalk.default.cyan("Size")} ${formatBytes(tag.sizeInBytes)}
80
+ `
81
+ );
82
+ output_manager_default.print(
83
+ ` ${import_chalk.default.cyan("Status")} ${formatImageStatus(tag.status)}
84
+ `
85
+ );
86
+ output_manager_default.print(
87
+ ` ${import_chalk.default.cyan("Created")} ${formatRelativeTime(tag.createdAt)}
88
+ `
89
+ );
90
+ output_manager_default.print("\n");
91
+ }
92
+ async function inspect(client, argv, telemetry) {
93
+ let parsedArgs;
94
+ try {
95
+ parsedArgs = parseArguments(
96
+ argv,
97
+ getFlagsSpecification(tagsInspectSubcommand.options)
98
+ );
99
+ } catch (err) {
100
+ emitVcrArgParseError(
101
+ client,
102
+ err,
103
+ "vcr tag inspect <repository> <tag> --project <name-or-id>"
104
+ );
105
+ printError(err);
106
+ return 1;
107
+ }
108
+ const fr = validateVcrJsonOutput(client, parsedArgs.flags);
109
+ if (typeof fr === "number") {
110
+ return fr;
111
+ }
112
+ const repository = parsedArgs.args[0];
113
+ const tag = parsedArgs.args[1];
114
+ const project = parsedArgs.flags["--project"];
115
+ telemetry.trackCliOptionProject(project);
116
+ telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
117
+ const missingArgs = requireVcrRepositoryAndTag(
118
+ client,
119
+ repository,
120
+ tag,
121
+ fr.jsonOutput,
122
+ "vcr tag inspect <repository> <tag>"
123
+ );
124
+ if (typeof missingArgs === "number") {
125
+ return missingArgs;
126
+ }
127
+ const scope = await resolveVcrScope(client, {
128
+ project,
129
+ jsonOutput: fr.jsonOutput
130
+ });
131
+ if (typeof scope === "number") {
132
+ return scope;
133
+ }
134
+ const path = repositoryTagPath(scope, repository, tag);
135
+ output_manager_default.spinner("Fetching tag...");
136
+ try {
137
+ if (fr.jsonOutput) {
138
+ const result = await client.fetch(path);
139
+ client.stdout.write(`${JSON.stringify(result.tag, null, 2)}
140
+ `);
141
+ } else {
142
+ const [tagResult, repositoryResult] = await Promise.all([
143
+ client.fetch(path),
144
+ client.fetch(
145
+ repositoryPath(scope, repository)
146
+ )
147
+ ]);
148
+ output_manager_default.log(`${import_chalk.default.bold("Tag")} ${import_chalk.default.cyan(tag)}`);
149
+ printTag(tagResult.tag, scope, repositoryResult.repository);
150
+ }
151
+ return 0;
152
+ } catch (err) {
153
+ if (isAPIError(err)) {
154
+ return handleVcrApiError(client, err, fr.jsonOutput);
155
+ }
156
+ throw err;
157
+ } finally {
158
+ output_manager_default.stopSpinner();
159
+ }
160
+ }
161
+ export {
162
+ inspect as default
163
+ };
@@ -0,0 +1,165 @@
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
+ formatRelativeTime
9
+ } from "./chunk-I3HGCZ4E.js";
10
+ import {
11
+ repositoriesPath
12
+ } from "./chunk-4QVAYRYH.js";
13
+ import {
14
+ emitVcrArgParseError,
15
+ handleVcrApiError,
16
+ resolveVcrScope,
17
+ validateVcrJsonOutput
18
+ } from "./chunk-ZVDYGXRA.js";
19
+ import {
20
+ outputError,
21
+ validateOptionalIntegerRange
22
+ } from "./chunk-E2ENQE2W.js";
23
+ import "./chunk-XPKWKPWA.js";
24
+ import {
25
+ listSubcommand
26
+ } from "./chunk-KXGWAWRV.js";
27
+ import "./chunk-RY3AVR6E.js";
28
+ import "./chunk-AUECDTMX.js";
29
+ import {
30
+ AGENT_REASON
31
+ } from "./chunk-QH7WYDEP.js";
32
+ import "./chunk-P726GMBL.js";
33
+ import {
34
+ table
35
+ } from "./chunk-VKBYAWTL.js";
36
+ import "./chunk-RB7WQKNC.js";
37
+ import {
38
+ outputAgentError
39
+ } from "./chunk-IZOHLD5D.js";
40
+ import "./chunk-ECCWJHC6.js";
41
+ import {
42
+ getFlagsSpecification,
43
+ parseArguments,
44
+ printError
45
+ } from "./chunk-EJ6GQI6F.js";
46
+ import {
47
+ isAPIError
48
+ } from "./chunk-P6AK7SVK.js";
49
+ import "./chunk-P4QNYOFB.js";
50
+ import "./chunk-2RVK3DDN.js";
51
+ import {
52
+ output_manager_default
53
+ } from "./chunk-OX7KI3LF.js";
54
+ import "./chunk-GGP5R3FU.js";
55
+ import {
56
+ require_source
57
+ } from "./chunk-S7KYDPEM.js";
58
+ import {
59
+ __toESM
60
+ } from "./chunk-TZ2YI2VH.js";
61
+
62
+ // src/commands/vcr/ls.ts
63
+ var import_chalk = __toESM(require_source(), 1);
64
+ function printRepositories(list) {
65
+ if (list.repositories.length === 0) {
66
+ output_manager_default.log("No repositories found.");
67
+ return;
68
+ }
69
+ const headers = ["Name", "ID", "Created"].map((h) => import_chalk.default.cyan(h));
70
+ const rows = [
71
+ headers,
72
+ ...list.repositories.map((repo) => [
73
+ import_chalk.default.bold(repo.name),
74
+ import_chalk.default.dim(repo.id),
75
+ formatRelativeTime(repo.createdAt)
76
+ ])
77
+ ];
78
+ const tableOutput = table(rows, { hsep: 3 }).split("\n").map((line) => line.trimEnd()).join("\n").replace(/^/gm, " ");
79
+ output_manager_default.print(`
80
+ ${tableOutput}
81
+ `);
82
+ if (list.nextCursor) {
83
+ output_manager_default.log(
84
+ `More results available. Re-run with \`--cursor ${list.nextCursor}\`.`
85
+ );
86
+ }
87
+ }
88
+ async function ls(client, argv, telemetry) {
89
+ let parsedArgs;
90
+ try {
91
+ parsedArgs = parseArguments(
92
+ argv,
93
+ getFlagsSpecification(listSubcommand.options)
94
+ );
95
+ } catch (err) {
96
+ emitVcrArgParseError(client, err, "vcr ls --project <name-or-id>");
97
+ printError(err);
98
+ return 1;
99
+ }
100
+ const fr = validateVcrJsonOutput(client, parsedArgs.flags);
101
+ if (typeof fr === "number") {
102
+ return fr;
103
+ }
104
+ const project = parsedArgs.flags["--project"];
105
+ const cursor = parsedArgs.flags["--cursor"];
106
+ const limitFlag = parsedArgs.flags["--limit"];
107
+ telemetry.trackCliOptionProject(project);
108
+ telemetry.trackCliOptionLimit(limitFlag);
109
+ telemetry.trackCliOptionCursor(cursor);
110
+ telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
111
+ const limitResult = validateOptionalIntegerRange(limitFlag, {
112
+ flag: "--limit",
113
+ min: 1,
114
+ max: 100
115
+ });
116
+ if (!limitResult.valid) {
117
+ outputAgentError(
118
+ client,
119
+ {
120
+ status: "error",
121
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
122
+ message: limitResult.message
123
+ },
124
+ 1
125
+ );
126
+ return outputError(
127
+ client,
128
+ fr.jsonOutput,
129
+ limitResult.code,
130
+ limitResult.message
131
+ );
132
+ }
133
+ const scope = await resolveVcrScope(client, {
134
+ project,
135
+ jsonOutput: fr.jsonOutput
136
+ });
137
+ if (typeof scope === "number") {
138
+ return scope;
139
+ }
140
+ const path = repositoriesPath(scope, {
141
+ limit: limitResult.value,
142
+ cursor
143
+ });
144
+ output_manager_default.spinner("Fetching repositories...");
145
+ try {
146
+ const list = await client.fetch(path);
147
+ if (fr.jsonOutput) {
148
+ client.stdout.write(`${JSON.stringify(list, null, 2)}
149
+ `);
150
+ } else {
151
+ printRepositories(list);
152
+ }
153
+ return 0;
154
+ } catch (err) {
155
+ if (isAPIError(err)) {
156
+ return handleVcrApiError(client, err, fr.jsonOutput);
157
+ }
158
+ throw err;
159
+ } finally {
160
+ output_manager_default.stopSpinner();
161
+ }
162
+ }
163
+ export {
164
+ ls as default
165
+ };
@@ -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
+ };