@argos-ci/cli 5.1.3 → 6.1.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 (2) hide show
  1. package/dist/index.mjs +733 -232
  2. package/package.json +8 -7
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { resolve } from "node:path";
4
4
  import { Option, program } from "commander";
5
5
  import { deploy, finalize, skip, upload } from "@argos-ci/core";
6
6
  import ora from "ora";
7
- import { createClient, formatAPIError, throwAPIError } from "@argos-ci/api-client";
7
+ import { APIError, createClient, throwAPIError } from "@argos-ci/api-client";
8
8
  import { homedir } from "node:os";
9
9
  import { createServer } from "node:http";
10
10
  import { createHash, randomBytes } from "node:crypto";
@@ -14,6 +14,8 @@ const parallelNonceOption = new Option("--parallel-nonce <string>", "A unique ID
14
14
  const tokenOption = new Option("--token <token>", "Repository token").env("ARGOS_TOKEN");
15
15
  const projectOption = new Option("--project <slug>", "Argos project slug (account/project), used to disambiguate tokenless authentication when multiple projects are linked to the same repository").env("ARGOS_PROJECT");
16
16
  const buildNameOption = new Option("--build-name <string>", "Name of the build, in case you want to run multiple Argos builds in a single CI job").env("ARGOS_BUILD_NAME");
17
+ const jsonOption = new Option("--json", "Output machine-readable JSON instead of human-readable text");
18
+ const projectPathOption = new Option("--project <owner/project>", "Project path in owner/project format. Required for build-number references on review and comment commands").env("ARGOS_PROJECT");
17
19
  //#endregion
18
20
  //#region src/commands/upload.ts
19
21
  function uploadCommand(program) {
@@ -98,6 +100,194 @@ function skipCommand(program) {
98
100
  });
99
101
  }
100
102
  //#endregion
103
+ //#region src/lib/api.ts
104
+ /** Optional override for the API base URL (used in tests and dev). */
105
+ function getApiBaseUrl() {
106
+ return process.env["ARGOS_API_BASE_URL"];
107
+ }
108
+ /** Create an Argos API client authenticated with the given token. */
109
+ function createApiClient(authToken) {
110
+ return createClient({
111
+ authToken,
112
+ baseUrl: getApiBaseUrl()
113
+ });
114
+ }
115
+ /**
116
+ * Unwrap an `openapi-fetch` result, returning its data or throwing a formatted
117
+ * {@link APIError} when the request failed or returned an empty body.
118
+ */
119
+ function unwrap(result) {
120
+ if (!result.response.ok) throwAPIError(result.error, result.response);
121
+ if (result.data === void 0 || result.data === null) throw new APIError("Unexpected empty response from API.", { status: result.response.status });
122
+ return result.data;
123
+ }
124
+ //#endregion
125
+ //#region src/lib/format.ts
126
+ /** Render a scalar, using `-` for empty values. */
127
+ function formatValue(value) {
128
+ if (value === null || value === void 0 || value === "") return "-";
129
+ return String(value);
130
+ }
131
+ function formatUser(user) {
132
+ if (!user) return "-";
133
+ return user.name ? `${user.name} (@${user.slug})` : `@${user.slug}`;
134
+ }
135
+ function formatMe(user) {
136
+ return [
137
+ `Logged in to Argos as ${formatUser(user)}.`,
138
+ `Slug: ${user.slug}`,
139
+ `Name: ${formatValue(user.name)}`
140
+ ].join("\n");
141
+ }
142
+ function formatStats(stats) {
143
+ if (!stats) return "-";
144
+ return [
145
+ `total ${stats.total}`,
146
+ `changed ${stats.changed}`,
147
+ `added ${stats.added}`,
148
+ `removed ${stats.removed}`,
149
+ `unchanged ${stats.unchanged}`
150
+ ].join(", ");
151
+ }
152
+ const SNAPSHOT_STATUS_ORDER = [
153
+ "changed",
154
+ "added",
155
+ "removed",
156
+ "unchanged",
157
+ "ignored",
158
+ "pending",
159
+ "failure",
160
+ "retryFailure"
161
+ ];
162
+ function formatSnapshotSummary(diffs) {
163
+ const counts = /* @__PURE__ */ new Map();
164
+ for (const diff of diffs) counts.set(diff.status, (counts.get(diff.status) ?? 0) + 1);
165
+ return SNAPSHOT_STATUS_ORDER.map((status) => {
166
+ const count = counts.get(status);
167
+ return count ? `${status} ${count}` : null;
168
+ }).filter((part) => Boolean(part)).join(", ");
169
+ }
170
+ function formatBuild(build) {
171
+ return [
172
+ `Build #${build.number}`,
173
+ `Status: ${build.status}`,
174
+ `Snapshots: ${formatStats(build.stats)}`,
175
+ `Conclusion: ${formatValue(build.conclusion)}`,
176
+ `Branch: ${formatValue(build.head?.branch)}`,
177
+ `Commit: ${formatValue(build.head?.sha)}`,
178
+ `Base branch: ${formatValue(build.base?.branch)}`,
179
+ `Base commit: ${formatValue(build.base?.sha)}`,
180
+ `URL: ${build.url}`
181
+ ].join("\n");
182
+ }
183
+ function formatSnapshots(diffs, build) {
184
+ if (diffs.length === 0) return "No snapshots found.";
185
+ return [
186
+ `Snapshots for build #${build.number}`,
187
+ `Count: ${diffs.length}`,
188
+ `Summary: ${formatSnapshotSummary(diffs)}`,
189
+ "",
190
+ ...diffs.flatMap((diff) => [
191
+ `${diff.name} [${diff.status}]`,
192
+ ` Review: ${build.url}/${diff.id}`,
193
+ ` Mask: ${formatValue(diff.url)}`,
194
+ ` Base file: ${formatValue(diff.base?.url)}`,
195
+ ` Head file: ${formatValue(diff.head?.url)}`,
196
+ ` Score: ${formatValue(diff.score)}`,
197
+ ` Group: ${formatValue(diff.group)}`,
198
+ ""
199
+ ])
200
+ ].slice(0, -1).join("\n");
201
+ }
202
+ function formatReview(review) {
203
+ const lines = [
204
+ `Review #${review.id}`,
205
+ `State: ${review.state}`,
206
+ `Author: ${formatUser(review.user)}`,
207
+ `Date: ${review.date}`
208
+ ];
209
+ if (review.dismissedAt) lines.push(`Dismissed: ${review.dismissedAt} by ${formatUser(review.dismissedBy)}`);
210
+ return lines.join("\n");
211
+ }
212
+ function formatReviews(reviews) {
213
+ if (reviews.length === 0) return "No reviews found.";
214
+ return [
215
+ `Reviews (${reviews.length})`,
216
+ "",
217
+ ...reviews.flatMap((review) => [
218
+ `#${review.id} [${review.state}${review.dismissedAt ? ", dismissed" : ""}]`,
219
+ ` Author: ${formatUser(review.user)}`,
220
+ ` Date: ${review.date}`,
221
+ ""
222
+ ])
223
+ ].slice(0, -1).join("\n");
224
+ }
225
+ function indent(text) {
226
+ return text.split("\n").map((line) => ` ${line}`).join("\n");
227
+ }
228
+ function formatAnchor(anchor) {
229
+ if (!anchor) return null;
230
+ return anchor.type === "point" ? `point ${anchor.x},${anchor.y}` : `lines ${anchor.from}-${anchor.to}`;
231
+ }
232
+ function formatReactions(reactions) {
233
+ if (reactions.length === 0) return null;
234
+ return reactions.map((r) => `${r.emoji} ${r.count}`).join(" ");
235
+ }
236
+ function formatComment(comment) {
237
+ const lines = [`Comment #${comment.id}`, `Author: ${formatUser(comment.author)}`];
238
+ if (comment.threadId) lines.push(`Reply to: ${comment.threadId}`);
239
+ if (comment.screenshotDiffId) {
240
+ const anchor = formatAnchor(comment.anchor);
241
+ lines.push(`Diff: ${comment.screenshotDiffId}${anchor ? ` (${anchor})` : ""}`);
242
+ }
243
+ if (comment.pending) lines.push("Pending: draft (only visible to you)");
244
+ if (comment.resolvedAt) lines.push(`Resolved: ${comment.resolvedAt}`);
245
+ const reactions = formatReactions(comment.reactions);
246
+ if (reactions) lines.push(`Reactions: ${reactions}`);
247
+ lines.push(`Date: ${comment.createdAt}${comment.editedAt ? " (edited)" : ""}`);
248
+ lines.push("", indent(comment.text));
249
+ return lines.join("\n");
250
+ }
251
+ function formatComments(comments) {
252
+ if (comments.length === 0) return "No comments found.";
253
+ return [
254
+ `Comments (${comments.length})`,
255
+ "",
256
+ ...comments.flatMap((comment) => {
257
+ const tags = [
258
+ comment.threadId ? "reply" : "thread",
259
+ comment.pending ? "draft" : null,
260
+ comment.resolvedAt ? "resolved" : null
261
+ ].filter(Boolean);
262
+ return [
263
+ `#${comment.id} [${tags.join(", ")}] ${formatUser(comment.author)}`,
264
+ indent(comment.text),
265
+ ""
266
+ ];
267
+ })
268
+ ].slice(0, -1).join("\n");
269
+ }
270
+ //#endregion
271
+ //#region src/lib/cli-error.ts
272
+ /**
273
+ * Error whose message is meant to be shown to the user verbatim (prefixed with
274
+ * `Error: `) before the CLI exits with a non-zero code. Throw it — via
275
+ * {@link fail} — instead of calling `process.exit` directly so the failure can
276
+ * be unit-tested and handled in a single place ({@link handleCliError}).
277
+ */
278
+ var CliError = class extends Error {
279
+ constructor(message) {
280
+ super(message);
281
+ this.name = "CliError";
282
+ }
283
+ };
284
+ /**
285
+ * Abort the current command with a user-facing message.
286
+ */
287
+ function fail(message) {
288
+ throw new CliError(message);
289
+ }
290
+ //#endregion
101
291
  //#region src/auth.ts
102
292
  function getConfigPaths() {
103
293
  const configDir = resolve(homedir(), ".config", "argos-ci");
@@ -160,266 +350,558 @@ async function removeToken() {
160
350
  await writeConfig({});
161
351
  }
162
352
  //#endregion
163
- //#region src/commands/build.ts
164
- const reviewConclusions = {
165
- approve: "APPROVE",
166
- "request-changes": "REQUEST_CHANGES"
167
- };
168
- async function getTokenOrExit(options) {
169
- const token = options.token || process.env["ARGOS_TOKEN"] || await getStoredToken();
170
- if (!token) {
171
- console.error("Error: No Argos token found. Use --token, set ARGOS_TOKEN, or run `argos login`.");
172
- process.exit(1);
173
- }
174
- return token;
353
+ //#region src/lib/build-reference.ts
354
+ const BUILD_URL_REGEXP = /^https:\/\/app\.argos-ci\.(?:com|dev(?::\d+)?)\/(?<owner>[^/?#]+)\/(?<project>[^/?#]+)\/builds\/(?<buildNumber>\d+)(?:[/?#]|$)/;
355
+ /**
356
+ * Parse a build reference, accepting either a bare build number (`"1234"`) or a
357
+ * full Argos build URL. Returns `null` when the input is neither.
358
+ */
359
+ function parseBuildReference(reference) {
360
+ const asNumber = Number(reference);
361
+ if (Number.isInteger(asNumber) && asNumber > 0) return { buildNumber: asNumber };
362
+ const match = reference.match(BUILD_URL_REGEXP);
363
+ if (match?.groups) return {
364
+ owner: match.groups.owner,
365
+ project: match.groups.project,
366
+ buildNumber: Number(match.groups.buildNumber)
367
+ };
368
+ return null;
175
369
  }
176
- function getAPIBaseURL() {
177
- return process.env["ARGOS_API_BASE_URL"];
370
+ /**
371
+ * Like {@link parseBuildReference} but aborts the command with a clear message
372
+ * when the reference is invalid.
373
+ */
374
+ function parseBuildReferenceOrFail(reference) {
375
+ const parsed = parseBuildReference(reference);
376
+ if (!parsed) fail(`Build reference must be a valid build number or Argos build URL (https://app.argos-ci.com/.../builds/<number>), got "${reference}".`);
377
+ return parsed;
178
378
  }
179
- function getProjectTokenOrExit(options) {
180
- const projectToken = options.token || process.env["ARGOS_TOKEN"];
181
- if (!projectToken) {
182
- console.error("Error: No Argos project token found. Use --token or set ARGOS_TOKEN.");
183
- process.exit(1);
184
- }
185
- return projectToken;
379
+ //#endregion
380
+ //#region src/lib/project.ts
381
+ /**
382
+ * Parse a `owner/project` slug. Returns `null` when it is not exactly two
383
+ * non-empty segments.
384
+ */
385
+ function parseProjectPath(slug) {
386
+ const parts = slug.split("/");
387
+ if (parts.length !== 2 || !parts[0] || !parts[1]) return null;
388
+ return {
389
+ owner: parts[0],
390
+ project: parts[1]
391
+ };
186
392
  }
187
- function isBuildPending(build) {
188
- return build.status === "pending" || build.status === "progress";
393
+ /**
394
+ * Like {@link parseProjectPath} but aborts the command on an invalid slug.
395
+ */
396
+ function parseProjectPathOrFail(slug) {
397
+ const parsed = parseProjectPath(slug);
398
+ if (!parsed) fail("--project must be in the format 'owner/project'.");
399
+ return parsed;
189
400
  }
190
- function parseBuildReferenceDetailsOrExit(buildReference) {
191
- const parsedBuildNumber = Number(buildReference);
192
- if (Number.isFinite(parsedBuildNumber) && Number.isInteger(parsedBuildNumber)) return { buildNumber: parsedBuildNumber };
193
- const urlMatch = buildReference.match(/^https:\/\/app\.argos-ci\.(?:com|dev(?::\d+)?)\/(?<owner>[^/?#]+)\/(?<project>[^/?#]+)\/builds\/(?<buildNumber>\d+)(?:\/?$|[?#])/);
194
- if (urlMatch?.groups) return {
195
- owner: urlMatch.groups.owner,
196
- project: urlMatch.groups.project,
197
- buildNumber: Number(urlMatch.groups.buildNumber)
198
- };
199
- console.error(`Error: Build reference must be a valid build number or Argos build URL (https://app.argos-ci.com/.../builds/<number>), got "${buildReference}".`);
200
- process.exit(1);
401
+ //#endregion
402
+ //#region src/lib/target.ts
403
+ /**
404
+ * Resolve the API token, preferring an explicit token (`--token` /
405
+ * `ARGOS_TOKEN`) over the one stored by `argos login`.
406
+ */
407
+ async function resolveToken(options) {
408
+ const token = options.token || process.env["ARGOS_TOKEN"] || await getStoredToken();
409
+ if (!token) fail("No Argos token found. Use --token, set ARGOS_TOKEN, or run `argos login`.");
410
+ return token;
201
411
  }
202
- function formatValue(value) {
203
- if (value === null || value === void 0 || value === "") return "-";
204
- return String(value);
412
+ function explicitProjectPath(reference, options) {
413
+ if (reference.owner && reference.project) return {
414
+ owner: reference.owner,
415
+ project: reference.project
416
+ };
417
+ if (options.project) return parseProjectPathOrFail(options.project);
418
+ return null;
205
419
  }
206
- function formatStats(stats) {
207
- if (!stats) return "-";
208
- return [
209
- `total ${stats.total}`,
210
- `changed ${stats.changed}`,
211
- `added ${stats.added}`,
212
- `removed ${stats.removed}`,
213
- `unchanged ${stats.unchanged}`
214
- ].join(", ");
420
+ /**
421
+ * Resolve a build reference into a ready-to-use {@link BuildTarget}: an
422
+ * authenticated client and the `owner`, `project` and `buildNumber` needed by
423
+ * every build-scoped endpoint.
424
+ */
425
+ async function resolveBuildTarget(reference, options, { auth }) {
426
+ const parsed = parseBuildReferenceOrFail(reference);
427
+ const buildNumber = String(parsed.buildNumber);
428
+ const client = createApiClient(await resolveToken(options));
429
+ if (auth === "user") {
430
+ const projectPath = explicitProjectPath(parsed, options);
431
+ if (!projectPath) fail("--project <owner/project> is required for build-number references.");
432
+ return {
433
+ client,
434
+ ...projectPath,
435
+ buildNumber
436
+ };
437
+ }
438
+ const projectPath = explicitProjectPath(parsed, options);
439
+ if (projectPath) return {
440
+ client,
441
+ ...projectPath,
442
+ buildNumber
443
+ };
444
+ const project = unwrap(await client.GET("/project"));
445
+ return {
446
+ client,
447
+ owner: project.account.slug,
448
+ project: project.name,
449
+ buildNumber
450
+ };
215
451
  }
216
- function formatSnapshotSummary(diffs) {
217
- const counts = /* @__PURE__ */ new Map();
218
- for (const diff of diffs) counts.set(diff.status, (counts.get(diff.status) ?? 0) + 1);
219
- return [
220
- "changed",
221
- "added",
222
- "removed",
223
- "unchanged",
224
- "ignored",
225
- "pending",
226
- "failure",
227
- "retryFailure"
228
- ].map((status) => {
229
- const count = counts.get(status);
230
- return count ? `${status} ${count}` : null;
231
- }).filter((part) => Boolean(part)).join(", ");
452
+ //#endregion
453
+ //#region src/lib/run.ts
454
+ const USER_AUTH_HINT = "Ensure your token is a personal access token with access to this project. Project tokens (ARGOS_TOKEN in CI) can read build data but cannot perform review or comment actions.";
455
+ /**
456
+ * Print an error and exit. {@link CliError} and {@link APIError} messages are
457
+ * shown as-is; permission failures on user-authenticated commands get an extra
458
+ * hint about token types.
459
+ */
460
+ function handleCliError(error, auth) {
461
+ let message;
462
+ if (error instanceof CliError || error instanceof APIError) {
463
+ message = error.message;
464
+ if (auth === "user" && error instanceof APIError && (error.status === 401 || error.status === 403)) message += `\n${USER_AUTH_HINT}`;
465
+ } else if (error instanceof Error) message = error.message;
466
+ else message = String(error);
467
+ console.error(`Error: ${message}`);
468
+ process.exit(1);
232
469
  }
233
- function printBuild(build) {
234
- const lines = [
235
- `Build #${build.number}`,
236
- `Status: ${build.status}`,
237
- `Snapshots: ${formatStats(build.stats)}`,
238
- `Conclusion: ${formatValue(build.conclusion)}`,
239
- `Branch: ${formatValue(build.head?.branch)}`,
240
- `Commit: ${formatValue(build.head?.sha)}`,
241
- `Base branch: ${formatValue(build.base?.branch)}`,
242
- `Base commit: ${formatValue(build.base?.sha)}`,
243
- `URL: ${build.url}`
244
- ];
245
- console.log(lines.join("\n"));
470
+ /** Print a command result as pretty JSON or human-readable text. */
471
+ function output(data, options, format) {
472
+ console.log(options.json ? JSON.stringify(data, null, 2) : format(data));
246
473
  }
247
- function printSnapshots(diffs, build) {
248
- if (diffs.length === 0) {
249
- console.log("No snapshots found.");
250
- return;
474
+ /**
475
+ * Run a build-scoped command end to end: resolve the build target, run the
476
+ * handler, print the result, and turn any failure into a clean CLI error.
477
+ */
478
+ async function runBuildAction(opts) {
479
+ try {
480
+ const target = await resolveBuildTarget(opts.reference, opts.options, { auth: opts.auth });
481
+ output(await opts.handler(target), opts.options, opts.format);
482
+ } catch (error) {
483
+ handleCliError(error, opts.auth);
251
484
  }
252
- const lines = [
253
- `Snapshots for build #${build.number}`,
254
- `Count: ${diffs.length}`,
255
- `Summary: ${formatSnapshotSummary(diffs)}`,
256
- "",
257
- ...diffs.flatMap((diff) => {
258
- return [
259
- `${diff.name} [${diff.status}]`,
260
- ` Review: ${build.url}/${diff.id}`,
261
- ` Mask: ${formatValue(diff.url)}`,
262
- ` Base file: ${formatValue(diff.base?.url)}`,
263
- ` Head file: ${formatValue(diff.head?.url)}`,
264
- ` Score: ${formatValue(diff.score)}`,
265
- ` Group: ${formatValue(diff.group)}`,
266
- ""
267
- ];
268
- })
269
- ];
270
- console.log(lines.slice(0, -1).join("\n"));
271
485
  }
272
- function printReview(review, buildNumber) {
273
- const lines = [
274
- `Review #${review.id}`,
275
- `State: ${review.state}`,
276
- `Build: #${buildNumber}`
277
- ];
278
- console.log(lines.join("\n"));
486
+ //#endregion
487
+ //#region src/commands/build/get.ts
488
+ function registerBuildGet(build) {
489
+ build.command("get").description("Fetch build metadata").argument("<buildReference>", "Build number or Argos build URL").addOption(tokenOption).addOption(jsonOption).action((reference, options) => runBuildAction({
490
+ reference,
491
+ options,
492
+ auth: "project",
493
+ handler: async ({ client, owner, project, buildNumber }) => unwrap(await client.GET("/projects/{owner}/{project}/builds/{buildNumber}", { params: { path: {
494
+ owner,
495
+ project,
496
+ buildNumber
497
+ } } })),
498
+ format: formatBuild
499
+ }));
279
500
  }
280
- function createProjectClient(options) {
281
- return createClient({
282
- authToken: getProjectTokenOrExit(options),
283
- baseUrl: getAPIBaseURL()
284
- });
501
+ //#endregion
502
+ //#region src/commands/build/snapshots.ts
503
+ const PER_PAGE = 100;
504
+ function isBuildPending(build) {
505
+ return build.status === "pending" || build.status === "progress";
506
+ }
507
+ async function fetchBuild(target) {
508
+ const { client, owner, project, buildNumber } = target;
509
+ return unwrap(await client.GET("/projects/{owner}/{project}/builds/{buildNumber}", { params: { path: {
510
+ owner,
511
+ project,
512
+ buildNumber
513
+ } } }));
285
514
  }
286
- async function fetchAllDiffs(client, project, buildNumber, options) {
515
+ /** Fetch every diff of a build, following pagination. */
516
+ async function fetchAllDiffs(target, options) {
517
+ const { client, owner, project, buildNumber } = target;
287
518
  const results = [];
288
- let page = 1;
289
- const perPage = 100;
290
- while (true) {
291
- const query = {
292
- page: String(page),
293
- perPage: String(perPage),
294
- ...options?.needsReview ? { needsReview: true } : {}
295
- };
296
- const { data, error, response } = await client.GET("/projects/{owner}/{project}/builds/{buildNumber}/diffs", { params: {
519
+ for (let page = 1;; page++) {
520
+ const data = unwrap(await client.GET("/projects/{owner}/{project}/builds/{buildNumber}/diffs", { params: {
297
521
  path: {
298
- owner: project.account.slug,
299
- project: project.name,
300
- buildNumber: String(buildNumber)
522
+ owner,
523
+ project,
524
+ buildNumber
301
525
  },
302
- query
303
- } });
304
- if (error || !data) {
305
- if (error) throwAPIError(error, response);
306
- throw new Error("Unexpected empty response from API.");
307
- }
526
+ query: {
527
+ page: String(page),
528
+ perPage: String(PER_PAGE),
529
+ ...options.needsReview ? { needsReview: "true" } : {}
530
+ }
531
+ } }));
308
532
  results.push(...data.results);
309
- if (results.length >= data.pageInfo.total) break;
310
- page++;
533
+ if (results.length >= data.pageInfo.total || data.results.length === 0) break;
311
534
  }
312
535
  return results;
313
536
  }
314
- async function fetchProject(client) {
315
- const { data, error, response } = await client.GET("/project");
316
- if (error) throwAPIError(error, response);
317
- if (!data) {
318
- console.error("Error: Unexpected empty response from API.");
319
- process.exit(1);
537
+ function registerBuildSnapshots(build) {
538
+ build.command("snapshots").description("Fetch snapshot diffs for a build").argument("<buildReference>", "Build number or Argos build URL").addOption(new Option("--needs-review", "Only include snapshot diffs that require review")).addOption(tokenOption).addOption(jsonOption).action(async (reference, options) => {
539
+ try {
540
+ const target = await resolveBuildTarget(reference, options, { auth: "project" });
541
+ const build = await fetchBuild(target);
542
+ if (isBuildPending(build)) {
543
+ const message = `Build #${build.number} is still processing (${build.status}). Try again in a moment.`;
544
+ if (options.json) {
545
+ console.error(`Error: ${message}`);
546
+ process.exit(1);
547
+ }
548
+ console.log(message);
549
+ return;
550
+ }
551
+ output(await fetchAllDiffs(target, { needsReview: Boolean(options.needsReview) }), options, (data) => formatSnapshots(data, build));
552
+ } catch (error) {
553
+ handleCliError(error, "project");
554
+ }
555
+ });
556
+ }
557
+ //#endregion
558
+ //#region src/commands/build/index.ts
559
+ function buildCommand(program) {
560
+ const build = program.command("build").description("Inspect Argos builds");
561
+ registerBuildGet(build);
562
+ registerBuildSnapshots(build);
563
+ }
564
+ //#endregion
565
+ //#region src/lib/body.ts
566
+ /**
567
+ * Resolve the Markdown body of a comment or review from the mutually-exclusive
568
+ * `--body` (inline) and `--body-file` (path) options.
569
+ *
570
+ * The Argos API also accepts a rich-text JSON document, but that form is only
571
+ * needed for `@mentions` (which require user ids); the CLI exposes Markdown
572
+ * only, which the API converts server-side.
573
+ */
574
+ async function resolveBody(options, { required = false } = {}) {
575
+ const { body, bodyFile } = options;
576
+ if (body !== void 0 && bodyFile !== void 0) fail("Use either --body or --body-file, not both.");
577
+ if (body !== void 0) return body;
578
+ if (bodyFile !== void 0) try {
579
+ return await readFile(bodyFile, "utf8");
580
+ } catch (error) {
581
+ fail(`Failed to read --body-file "${bodyFile}": ${error instanceof Error ? error.message : String(error)}`);
320
582
  }
321
- return data;
583
+ if (required) fail("A comment body is required. Use --body <markdown> or --body-file <path>.");
322
584
  }
323
- async function fetchBuildByNumber(client, project, buildNumber, errorLabel) {
324
- const { data, error, response } = await client.GET("/projects/{owner}/{project}/builds/{buildNumber}", { params: { path: {
325
- owner: project.account.slug,
326
- project: project.name,
327
- buildNumber: String(buildNumber)
328
- } } });
329
- if (error) {
330
- if (response.status === 404) {
331
- console.error(`Error: Build number ${errorLabel} not found.`);
332
- process.exit(1);
333
- }
334
- throwAPIError(error, response);
585
+ //#endregion
586
+ //#region src/commands/review/create.ts
587
+ const events = {
588
+ approve: "APPROVE",
589
+ reject: "REJECT",
590
+ comment: "COMMENT"
591
+ };
592
+ function registerReviewCreate(review) {
593
+ review.command("create").description("Submit a review on a build").argument("<buildReference>", "Build number or Argos build URL").addOption(new Option("--event <event>", "Review event to apply to the build").choices(Object.keys(events)).makeOptionMandatory()).option("--body <markdown>", "Markdown comment to attach to the review").option("--body-file <path>", "Read the review comment from a Markdown file").addOption(tokenOption).addOption(projectPathOption).addOption(jsonOption).action((reference, options) => runBuildAction({
594
+ reference,
595
+ options,
596
+ auth: "user",
597
+ handler: async ({ client, owner, project, buildNumber }) => {
598
+ const body = await resolveBody(options);
599
+ return unwrap(await client.POST("/projects/{owner}/{project}/builds/{buildNumber}/reviews", {
600
+ params: { path: {
601
+ owner,
602
+ project,
603
+ buildNumber
604
+ } },
605
+ body: {
606
+ event: events[options.event],
607
+ body
608
+ }
609
+ }));
610
+ },
611
+ format: formatReview
612
+ }));
613
+ }
614
+ //#endregion
615
+ //#region src/commands/review/dismiss.ts
616
+ function registerReviewDismiss(review) {
617
+ review.command("dismiss").description("Dismiss a submitted review on a build").argument("<buildReference>", "Build number or Argos build URL").argument("<reviewId>", "ID of the review to dismiss").addOption(tokenOption).addOption(projectPathOption).addOption(jsonOption).action((reference, reviewId, options) => runBuildAction({
618
+ reference,
619
+ options,
620
+ auth: "user",
621
+ handler: async ({ client, owner, project, buildNumber }) => unwrap(await client.POST("/projects/{owner}/{project}/builds/{buildNumber}/reviews/{reviewId}/dismiss", { params: { path: {
622
+ owner,
623
+ project,
624
+ buildNumber,
625
+ reviewId
626
+ } } })),
627
+ format: formatReview
628
+ }));
629
+ }
630
+ //#endregion
631
+ //#region src/commands/review/list.ts
632
+ function registerReviewList(review) {
633
+ review.command("list").description("List the reviews submitted on a build").argument("<buildReference>", "Build number or Argos build URL").addOption(tokenOption).addOption(projectPathOption).addOption(jsonOption).action((reference, options) => runBuildAction({
634
+ reference,
635
+ options,
636
+ auth: "user",
637
+ handler: async ({ client, owner, project, buildNumber }) => unwrap(await client.GET("/projects/{owner}/{project}/builds/{buildNumber}/reviews", { params: { path: {
638
+ owner,
639
+ project,
640
+ buildNumber
641
+ } } })),
642
+ format: formatReviews
643
+ }));
644
+ }
645
+ //#endregion
646
+ //#region src/commands/review/index.ts
647
+ function reviewCommand(program) {
648
+ const review = program.command("review").description("List, submit, and dismiss build reviews");
649
+ registerReviewList(review);
650
+ registerReviewCreate(review);
651
+ registerReviewDismiss(review);
652
+ }
653
+ //#endregion
654
+ //#region src/lib/anchor.ts
655
+ function parsePair(value) {
656
+ const parts = value.split(",").map((part) => Number(part.trim()));
657
+ if (parts.length !== 2 || parts.some((part) => Number.isNaN(part))) return null;
658
+ return [parts[0], parts[1]];
659
+ }
660
+ /**
661
+ * Build a comment anchor from the mutually-exclusive `--anchor-point` and
662
+ * `--anchor-lines` options. Returns `undefined` when neither is provided.
663
+ */
664
+ function parseAnchor(options) {
665
+ const { anchorPoint, anchorLines } = options;
666
+ if (anchorPoint && anchorLines) fail("Use either --anchor-point or --anchor-lines, not both.");
667
+ if (anchorPoint) {
668
+ const pair = parsePair(anchorPoint);
669
+ if (!pair) fail("--anchor-point must be two numbers, e.g. --anchor-point 0.5,0.5.");
670
+ const [x, y] = pair;
671
+ if (x < 0 || x > 1 || y < 0 || y > 1) fail("--anchor-point coordinates must be normalized between 0 and 1.");
672
+ return {
673
+ type: "point",
674
+ x,
675
+ y
676
+ };
335
677
  }
336
- if (!data) {
337
- console.error("Error: Unexpected empty response from API.");
338
- process.exit(1);
678
+ if (anchorLines) {
679
+ const pair = parsePair(anchorLines);
680
+ if (!pair) fail("--anchor-lines must be two numbers, e.g. --anchor-lines 10,20.");
681
+ const [from, to] = pair;
682
+ if (!Number.isInteger(from) || !Number.isInteger(to) || from < 1 || to < from) fail("--anchor-lines must be a 1-based range where from <= to.");
683
+ return {
684
+ type: "lines",
685
+ from,
686
+ to
687
+ };
339
688
  }
340
- return data;
341
689
  }
342
- function buildCommand(program) {
343
- const build = program.command("build").description("Manage Argos builds");
344
- const createJsonOption = () => new Option("--json", "Output machine-readable JSON instead of human-readable text");
345
- build.command("get").description("Fetch build metadata").argument("<buildReference>", "Build number or Argos build URL").addOption(tokenOption).addOption(createJsonOption()).action(async (buildReference, options) => {
346
- const { buildNumber } = parseBuildReferenceDetailsOrExit(buildReference);
347
- const client = createProjectClient(options);
348
- const build = await fetchBuildByNumber(client, await fetchProject(client), buildNumber, buildReference);
349
- if (options.json) {
350
- console.log(JSON.stringify(build, null, 2));
351
- return;
352
- }
353
- printBuild(build);
354
- });
355
- build.command("snapshots").description("Fetch snapshot diffs for a build").argument("<buildReference>", "Build number or Argos build URL").option("--needs-review", "Only include snapshot diffs that require review").addOption(tokenOption).addOption(createJsonOption()).action(async (buildReference, options) => {
356
- const { buildNumber } = parseBuildReferenceDetailsOrExit(buildReference);
357
- const client = createProjectClient(options);
358
- const project = await fetchProject(client);
359
- const build = await fetchBuildByNumber(client, project, buildNumber, buildReference);
360
- if (isBuildPending(build)) {
361
- if (options.json) {
362
- console.error(`Error: Build #${build.number} is still processing (${build.status}). Try again in a moment.`);
363
- process.exit(1);
364
- }
365
- console.log(`Build #${build.number} is still processing (${build.status}). Try again in a moment.`);
366
- return;
367
- }
368
- const diffs = await fetchAllDiffs(client, project, buildNumber, { needsReview: Boolean(options.needsReview) });
369
- if (options.json) {
370
- console.log(JSON.stringify(diffs, null, 2));
371
- return;
372
- }
373
- printSnapshots(diffs, build);
374
- });
375
- build.command("review").description("Create a review on a build").argument("<buildReference>", "Build number or Argos build URL").addOption(new Option("--conclusion <conclusion>", "Overall review conclusion for the build: \"approve\" or \"request-changes\"").choices(Object.keys(reviewConclusions)).makeOptionMandatory()).option("--project <project>", "Project path in owner/project format").addOption(tokenOption).addOption(createJsonOption()).action(async (buildReference, options) => {
376
- const conclusion = reviewConclusions[options.conclusion];
377
- const buildReferenceDetails = parseBuildReferenceDetailsOrExit(buildReference);
378
- let owner;
379
- let project;
380
- if (buildReferenceDetails.owner && buildReferenceDetails.project) {
381
- owner = buildReferenceDetails.owner;
382
- project = buildReferenceDetails.project;
383
- } else if (options.project) {
384
- const parts = options.project.split("/");
385
- if (parts.length !== 2 || !parts[0] || !parts[1]) {
386
- console.error("Error: --project must be in the format 'owner/project'.");
387
- process.exit(1);
388
- }
389
- [owner, project] = parts;
390
- } else {
391
- console.error("Error: --project <owner/project> is required for build-number references.");
392
- process.exit(1);
393
- }
394
- const { data, error, response } = await createClient({
395
- authToken: await getTokenOrExit(options),
396
- baseUrl: getAPIBaseURL()
397
- }).POST("/projects/{owner}/{project}/builds/{buildNumber}/reviews", {
690
+ //#endregion
691
+ //#region src/commands/comment/create.ts
692
+ function registerCommentCreate(comment) {
693
+ comment.command("create").description("Post a comment (or reply) on a build").argument("<buildReference>", "Build number or Argos build URL").option("--body <markdown>", "Markdown body of the comment").option("--body-file <path>", "Read the comment body from a Markdown file").option("--reply-to <threadId>", "Reply to an existing thread (its root comment ID)").option("--diff <screenshotDiffId>", "Anchor the comment to a screenshot diff").option("--anchor-point <x,y>", "Point on the diff in normalized 0-1 coordinates (requires --diff)").option("--anchor-lines <from,to>", "1-based inclusive line range on the diff (requires --diff)").option("--draft", "Attach to your pending review instead of posting immediately").addOption(tokenOption).addOption(projectPathOption).addOption(jsonOption).action((reference, options) => runBuildAction({
694
+ reference,
695
+ options,
696
+ auth: "user",
697
+ handler: async ({ client, owner, project, buildNumber }) => {
698
+ const body = await resolveBody(options, { required: true });
699
+ const anchor = parseAnchor(options);
700
+ if (anchor && !options.diff) fail("--anchor-point and --anchor-lines require --diff <screenshotDiffId>.");
701
+ return unwrap(await client.POST("/projects/{owner}/{project}/builds/{buildNumber}/comments", {
702
+ params: { path: {
703
+ owner,
704
+ project,
705
+ buildNumber
706
+ } },
707
+ body: {
708
+ body,
709
+ threadId: options.replyTo,
710
+ screenshotDiffId: options.diff,
711
+ anchor,
712
+ addToReview: options.draft
713
+ }
714
+ }));
715
+ },
716
+ format: formatComment
717
+ }));
718
+ }
719
+ //#endregion
720
+ //#region src/commands/comment/_action.ts
721
+ /**
722
+ * Register a `comment <name> <buildReference> <commentId>` command that runs
723
+ * `perform` and prints the returned comment. Used for the single-comment
724
+ * actions that share the same shape (get, delete, resolve, subscribe, …).
725
+ */
726
+ function defineCommentAction(opts) {
727
+ return (comment) => {
728
+ comment.command(opts.name).description(opts.description).argument("<buildReference>", "Build number or Argos build URL").argument("<commentId>", "ID of the comment").addOption(tokenOption).addOption(projectPathOption).addOption(jsonOption).action((reference, commentId, options) => runBuildAction({
729
+ reference,
730
+ options,
731
+ auth: "user",
732
+ handler: ({ client, owner, project, buildNumber }) => opts.perform({
733
+ client,
734
+ owner,
735
+ project,
736
+ buildNumber,
737
+ commentId
738
+ }),
739
+ format: formatComment
740
+ }));
741
+ };
742
+ }
743
+ //#endregion
744
+ //#region src/commands/comment/delete.ts
745
+ const registerCommentDelete = defineCommentAction({
746
+ name: "delete",
747
+ description: "Delete a comment on a build (author only)",
748
+ perform: async ({ client, owner, project, buildNumber, commentId }) => unwrap(await client.DELETE("/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}", { params: { path: {
749
+ owner,
750
+ project,
751
+ buildNumber,
752
+ commentId
753
+ } } }))
754
+ });
755
+ //#endregion
756
+ //#region src/commands/comment/edit.ts
757
+ function registerCommentEdit(comment) {
758
+ comment.command("edit").description("Update the body of a comment (author only)").argument("<buildReference>", "Build number or Argos build URL").argument("<commentId>", "ID of the comment").option("--body <markdown>", "New Markdown body of the comment").option("--body-file <path>", "Read the new body from a Markdown file").addOption(tokenOption).addOption(projectPathOption).addOption(jsonOption).action((reference, commentId, options) => runBuildAction({
759
+ reference,
760
+ options,
761
+ auth: "user",
762
+ handler: async ({ client, owner, project, buildNumber }) => {
763
+ const body = await resolveBody(options, { required: true });
764
+ return unwrap(await client.PATCH("/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}", {
765
+ params: { path: {
766
+ owner,
767
+ project,
768
+ buildNumber,
769
+ commentId
770
+ } },
771
+ body: { body }
772
+ }));
773
+ },
774
+ format: formatComment
775
+ }));
776
+ }
777
+ //#endregion
778
+ //#region src/commands/comment/get.ts
779
+ const registerCommentGet = defineCommentAction({
780
+ name: "get",
781
+ description: "Fetch a single comment on a build",
782
+ perform: async ({ client, owner, project, buildNumber, commentId }) => unwrap(await client.GET("/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}", { params: { path: {
783
+ owner,
784
+ project,
785
+ buildNumber,
786
+ commentId
787
+ } } }))
788
+ });
789
+ //#endregion
790
+ //#region src/commands/comment/list.ts
791
+ function registerCommentList(comment) {
792
+ comment.command("list").description("List the comments on a build").argument("<buildReference>", "Build number or Argos build URL").addOption(tokenOption).addOption(projectPathOption).addOption(jsonOption).action((reference, options) => runBuildAction({
793
+ reference,
794
+ options,
795
+ auth: "user",
796
+ handler: async ({ client, owner, project, buildNumber }) => unwrap(await client.GET("/projects/{owner}/{project}/builds/{buildNumber}/comments", { params: { path: {
797
+ owner,
798
+ project,
799
+ buildNumber
800
+ } } })),
801
+ format: formatComments
802
+ }));
803
+ }
804
+ //#endregion
805
+ //#region src/commands/comment/react.ts
806
+ function registerCommentReact(comment) {
807
+ comment.command("react").description("Add an emoji reaction to a comment").argument("<buildReference>", "Build number or Argos build URL").argument("<commentId>", "ID of the comment").argument("<emoji>", "Emoji to react with").addOption(tokenOption).addOption(projectPathOption).addOption(jsonOption).action((reference, commentId, emoji, options) => runBuildAction({
808
+ reference,
809
+ options,
810
+ auth: "user",
811
+ handler: async ({ client, owner, project, buildNumber }) => unwrap(await client.POST("/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/reactions", {
398
812
  params: { path: {
399
813
  owner,
400
814
  project,
401
- buildNumber: String(buildReferenceDetails.buildNumber)
815
+ buildNumber,
816
+ commentId
402
817
  } },
403
- body: { conclusion }
404
- });
405
- if (error) {
406
- const message = formatAPIError(error, response);
407
- throw new Error([
408
- `Failed to create review for ${owner}/${project} build #${buildReferenceDetails.buildNumber}: ${message}`,
409
- "Make sure the token passed with --token is a user access token with access to this project.",
410
- "Project tokens from ARGOS_TOKEN can read build data, but they cannot create reviews."
411
- ].join("\n"));
412
- }
413
- if (!data) {
414
- console.error("Error: Unexpected empty response from API.");
415
- process.exit(1);
416
- }
417
- if (options.json) {
418
- console.log(JSON.stringify(data, null, 2));
419
- return;
420
- }
421
- printReview(data, buildReferenceDetails.buildNumber);
422
- });
818
+ body: { emoji }
819
+ })),
820
+ format: formatComment
821
+ }));
822
+ }
823
+ //#endregion
824
+ //#region src/commands/comment/resolve.ts
825
+ const registerCommentResolve = defineCommentAction({
826
+ name: "resolve",
827
+ description: "Mark a comment thread as resolved",
828
+ perform: async ({ client, owner, project, buildNumber, commentId }) => unwrap(await client.POST("/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/resolve", { params: { path: {
829
+ owner,
830
+ project,
831
+ buildNumber,
832
+ commentId
833
+ } } }))
834
+ });
835
+ //#endregion
836
+ //#region src/commands/comment/subscribe.ts
837
+ const registerCommentSubscribe = defineCommentAction({
838
+ name: "subscribe",
839
+ description: "Subscribe to a comment thread's notifications",
840
+ perform: async ({ client, owner, project, buildNumber, commentId }) => unwrap(await client.POST("/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/subscription", { params: { path: {
841
+ owner,
842
+ project,
843
+ buildNumber,
844
+ commentId
845
+ } } }))
846
+ });
847
+ //#endregion
848
+ //#region src/commands/comment/unreact.ts
849
+ function registerCommentUnreact(comment) {
850
+ comment.command("unreact").description("Remove one of your emoji reactions from a comment").argument("<buildReference>", "Build number or Argos build URL").argument("<commentId>", "ID of the comment").argument("<emoji>", "Emoji reaction to remove").addOption(tokenOption).addOption(projectPathOption).addOption(jsonOption).action((reference, commentId, emoji, options) => runBuildAction({
851
+ reference,
852
+ options,
853
+ auth: "user",
854
+ handler: async ({ client, owner, project, buildNumber }) => unwrap(await client.DELETE("/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/reactions", { params: {
855
+ path: {
856
+ owner,
857
+ project,
858
+ buildNumber,
859
+ commentId
860
+ },
861
+ query: { emoji }
862
+ } })),
863
+ format: formatComment
864
+ }));
865
+ }
866
+ //#endregion
867
+ //#region src/commands/comment/unresolve.ts
868
+ const registerCommentUnresolve = defineCommentAction({
869
+ name: "unresolve",
870
+ description: "Reopen a resolved comment thread",
871
+ perform: async ({ client, owner, project, buildNumber, commentId }) => unwrap(await client.POST("/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/unresolve", { params: { path: {
872
+ owner,
873
+ project,
874
+ buildNumber,
875
+ commentId
876
+ } } }))
877
+ });
878
+ //#endregion
879
+ //#region src/commands/comment/unsubscribe.ts
880
+ const registerCommentUnsubscribe = defineCommentAction({
881
+ name: "unsubscribe",
882
+ description: "Unsubscribe from a comment thread's notifications",
883
+ perform: async ({ client, owner, project, buildNumber, commentId }) => unwrap(await client.DELETE("/projects/{owner}/{project}/builds/{buildNumber}/comments/{commentId}/subscription", { params: { path: {
884
+ owner,
885
+ project,
886
+ buildNumber,
887
+ commentId
888
+ } } }))
889
+ });
890
+ //#endregion
891
+ //#region src/commands/comment/index.ts
892
+ function commentCommand(program) {
893
+ const comment = program.command("comment").description("List, post, and act on build comments");
894
+ registerCommentList(comment);
895
+ registerCommentCreate(comment);
896
+ registerCommentGet(comment);
897
+ registerCommentEdit(comment);
898
+ registerCommentDelete(comment);
899
+ registerCommentResolve(comment);
900
+ registerCommentUnresolve(comment);
901
+ registerCommentReact(comment);
902
+ registerCommentUnreact(comment);
903
+ registerCommentSubscribe(comment);
904
+ registerCommentUnsubscribe(comment);
423
905
  }
424
906
  //#endregion
425
907
  //#region src/commands/login.ts
@@ -564,6 +1046,10 @@ function loginCommand(program) {
564
1046
  await saveToken(data.token);
565
1047
  console.log(successColor("Logged in to Argos successfully."));
566
1048
  });
1049
+ }
1050
+ //#endregion
1051
+ //#region src/commands/logout.ts
1052
+ function logoutCommand(program) {
567
1053
  program.command("logout").description("Log out from Argos").action(async () => {
568
1054
  if (!await getStoredToken()) {
569
1055
  console.log("No token found. You are already logged out.");
@@ -595,6 +1081,17 @@ function deployCommand(program) {
595
1081
  });
596
1082
  }
597
1083
  //#endregion
1084
+ //#region src/commands/whoami.ts
1085
+ function whoamiCommand(program) {
1086
+ program.command("whoami").description("Display the user authenticated with the current Argos token").addOption(tokenOption).addOption(jsonOption).action(async (options) => {
1087
+ try {
1088
+ output(unwrap(await createApiClient(await resolveToken(options)).GET("/me")), options, formatMe);
1089
+ } catch (error) {
1090
+ handleCliError(error, "user");
1091
+ }
1092
+ });
1093
+ }
1094
+ //#endregion
598
1095
  //#region src/index.ts
599
1096
  const rawPkg = await readFile(resolve(fileURLToPath(new URL(".", import.meta.url)), "..", "package.json"), "utf8");
600
1097
  const pkg = JSON.parse(rawPkg);
@@ -603,8 +1100,12 @@ uploadCommand(program);
603
1100
  skipCommand(program);
604
1101
  finalizeCommand(program);
605
1102
  buildCommand(program);
1103
+ reviewCommand(program);
1104
+ commentCommand(program);
606
1105
  loginCommand(program);
1106
+ logoutCommand(program);
607
1107
  deployCommand(program);
1108
+ whoamiCommand(program);
608
1109
  if (!process.argv.slice(2).length) program.outputHelp();
609
1110
  else program.parse(process.argv);
610
1111
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/cli",
3
3
  "description": "Command-line (CLI) for visual testing with Argos.",
4
- "version": "5.1.3",
4
+ "version": "6.1.0",
5
5
  "bin": {
6
6
  "argos": "./bin/argos-cli.js"
7
7
  },
@@ -34,8 +34,8 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "@argos-ci/api-client": "0.22.1",
38
- "@argos-ci/core": "6.2.3",
37
+ "@argos-ci/api-client": "0.24.0",
38
+ "@argos-ci/core": "6.4.0",
39
39
  "commander": "^15.0.0",
40
40
  "open": "^11.0.0",
41
41
  "ora": "^9.4.0",
@@ -46,12 +46,13 @@
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsdown",
49
- "e2e": "vitest --tags-filter=\"not oidc and not tokenless\"",
50
- "e2e-oidc": "vitest e2e/upload-oidc.test.js",
51
- "e2e-tokenless": "vitest e2e/upload-tokenless.test.js",
49
+ "test": "vitest run src",
50
+ "e2e": "vitest e2e --tags-filter=\"not oidc and not tokenless\"",
51
+ "e2e-oidc": "vitest e2e/upload-oidc.test.ts",
52
+ "e2e-tokenless": "vitest e2e/upload-tokenless.test.ts",
52
53
  "check-types": "tsc",
53
54
  "check-format": "prettier --check --ignore-unknown --ignore-path=../../.gitignore --ignore-path=../../.prettierignore .",
54
55
  "lint": "eslint ."
55
56
  },
56
- "gitHead": "70ab43ebd8cbeeb25bb95e978556bbe754b8c073"
57
+ "gitHead": "ee2e5d3c14c83e07dfffa14ddc9f34f934f8c368"
57
58
  }