allure 3.0.0-beta.21 → 3.0.0-beta.23

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.
@@ -54,7 +54,7 @@ export class ProjectsCreateCommand extends Command {
54
54
  "",
55
55
  green("{"),
56
56
  green(" allureService: {"),
57
- green(` project: "${project.name}"`),
57
+ green(` project: "${project.id}"`),
58
58
  green(" }"),
59
59
  green("}"),
60
60
  ];
@@ -2,7 +2,7 @@ import { Command } from "clipanion";
2
2
  export declare class ProjectsDeleteCommand extends Command {
3
3
  static paths: string[][];
4
4
  static usage: import("clipanion").Usage;
5
- projectName: string;
5
+ projectUuid: string;
6
6
  force: boolean | undefined;
7
7
  config: string | undefined;
8
8
  cwd: string | undefined;
@@ -9,7 +9,7 @@ import { logError } from "../../utils/logs.js";
9
9
  export class ProjectsDeleteCommand extends Command {
10
10
  constructor() {
11
11
  super(...arguments);
12
- this.projectName = Option.String({ required: true, name: "Project name" });
12
+ this.projectUuid = Option.String({ required: true, name: "Project ID" });
13
13
  this.force = Option.Boolean("--force", {
14
14
  description: "Delete project with no confirmation",
15
15
  });
@@ -32,7 +32,7 @@ export class ProjectsDeleteCommand extends Command {
32
32
  const res = await prompts({
33
33
  type: "confirm",
34
34
  name: "value",
35
- message: `Are you sure you want to delete project "${this.projectName}"?`,
35
+ message: `Are you sure you want to delete project "${this.projectUuid}"?`,
36
36
  });
37
37
  if (!res.value) {
38
38
  exit(0);
@@ -41,7 +41,7 @@ export class ProjectsDeleteCommand extends Command {
41
41
  }
42
42
  try {
43
43
  await serviceClient.deleteProject({
44
- name: this.projectName,
44
+ id: this.projectUuid,
45
45
  });
46
46
  console.info(green("Project has been deleted"));
47
47
  }
@@ -25,7 +25,7 @@ export class ProjectsListCommand extends Command {
25
25
  }
26
26
  const serviceClient = new AllureServiceClient(config.allureService);
27
27
  try {
28
- const projects = await serviceClient.projects();
28
+ const { projects } = await serviceClient.projects();
29
29
  if (projects.length === 0) {
30
30
  console.info(yellow("No projects found. Create a new one with `allure project-create` command"));
31
31
  return;
@@ -36,7 +36,7 @@ export class ProjectsListCommand extends Command {
36
36
  message: "Select a project",
37
37
  choices: projects.map((project) => ({
38
38
  title: project.name,
39
- value: project.name,
39
+ value: project.id,
40
40
  })),
41
41
  });
42
42
  if (!res?.project) {
@@ -23,13 +23,10 @@ export class WhoamiCommand extends Command {
23
23
  return;
24
24
  }
25
25
  const serviceClient = new AllureServiceClient(config.allureService);
26
+ const outputLines = [];
26
27
  try {
27
28
  const profile = await serviceClient.profile();
28
- const lines = [`You are logged in as "${profile.email}"`];
29
- if (config.allureService?.project) {
30
- lines.push(`Current project is "${config.allureService.project}"`);
31
- }
32
- console.info(green(lines.join("\n")));
29
+ outputLines.push(`You are logged in as "${profile.email}"`);
33
30
  }
34
31
  catch (error) {
35
32
  if (error instanceof KnownError) {
@@ -40,6 +37,16 @@ export class WhoamiCommand extends Command {
40
37
  await logError("Failed to get profile due to unexpected error", error);
41
38
  exit(1);
42
39
  }
40
+ if (config.allureService.project) {
41
+ try {
42
+ const { project } = await serviceClient.project(config.allureService.project);
43
+ outputLines.push(`Current project is "${project.name}" (id: ${project.id})`);
44
+ }
45
+ catch (err) {
46
+ outputLines.push(`Configured project can't be resolved (id: ${config.allureService.project})`);
47
+ }
48
+ }
49
+ console.info(green(outputLines.join("\n")));
43
50
  }
44
51
  }
45
52
  WhoamiCommand.paths = [["whoami"]];
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { defineConfig } from "@allurereport/plugin-api";
1
+ export { type Config as AllureConfig, defineConfig } from "@allurereport/plugin-api";
2
2
  export { defaultChartsConfig } from "@allurereport/charts-api";
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Builtins, Cli } from "clipanion";
2
- import console from "node:console";
3
2
  import { readFileSync } from "node:fs";
4
- import { argv, cwd } from "node:process";
3
+ import { argv } from "node:process";
5
4
  import { Allure2Command, AwesomeCommand, ClassicCommand, CsvCommand, DashboardCommand, GenerateCommand, HistoryCommand, JiraClearCommand, KnownIssueCommand, LogCommand, LoginCommand, LogoutCommand, OpenCommand, ProjectsCreateCommand, ProjectsDeleteCommand, ProjectsListCommand, QualityGateCommand, ResultsPackCommand, ResultsUnpackCommand, RunCommand, SlackCommand, TestPlanCommand, WatchCommand, WhoamiCommand, } from "./commands/index.js";
6
5
  const [node, app, ...args] = argv;
7
6
  const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
@@ -35,7 +34,7 @@ cli.register(ProjectsListCommand);
35
34
  cli.register(ResultsPackCommand);
36
35
  cli.register(ResultsUnpackCommand);
37
36
  cli.register(Builtins.HelpCommand);
37
+ cli.register(Builtins.VersionCommand);
38
38
  cli.runExit(args);
39
- console.log(cwd());
40
39
  export { defineConfig } from "@allurereport/plugin-api";
41
40
  export { defaultChartsConfig } from "@allurereport/charts-api";
@@ -0,0 +1,2 @@
1
+ export { qualityGateDefaultRules, maxFailuresRule, minTestsCountRule, successRateRule } from "@allurereport/core";
2
+ export type { QualityGateRule, QualityGateRuleState, QualityGateValidationResult } from "@allurereport/plugin-api";
package/dist/rules.js ADDED
@@ -0,0 +1 @@
1
+ export { qualityGateDefaultRules, maxFailuresRule, minTestsCountRule, successRateRule } from "@allurereport/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allure",
3
- "version": "3.0.0-beta.21",
3
+ "version": "3.0.0-beta.23",
4
4
  "description": "Allure Commandline Tool",
5
5
  "keywords": [
6
6
  "allure",
@@ -13,6 +13,7 @@
13
13
  "type": "module",
14
14
  "exports": {
15
15
  ".": "./dist/index.js",
16
+ "./rules": "./dist/rules.js",
16
17
  "./qualityGate": "./dist/qualityGate.js"
17
18
  },
18
19
  "main": "./dist/index.js",
@@ -31,27 +32,27 @@
31
32
  "test": "vitest run"
32
33
  },
33
34
  "dependencies": {
34
- "@allurereport/charts-api": "3.0.0-beta.21",
35
- "@allurereport/core": "3.0.0-beta.21",
36
- "@allurereport/core-api": "3.0.0-beta.21",
37
- "@allurereport/directory-watcher": "3.0.0-beta.21",
38
- "@allurereport/plugin-allure2": "3.0.0-beta.21",
39
- "@allurereport/plugin-api": "3.0.0-beta.21",
40
- "@allurereport/plugin-awesome": "3.0.0-beta.21",
41
- "@allurereport/plugin-classic": "3.0.0-beta.21",
42
- "@allurereport/plugin-csv": "3.0.0-beta.21",
43
- "@allurereport/plugin-dashboard": "3.0.0-beta.21",
44
- "@allurereport/plugin-jira": "3.0.0-beta.21",
45
- "@allurereport/plugin-log": "3.0.0-beta.21",
46
- "@allurereport/plugin-progress": "3.0.0-beta.21",
47
- "@allurereport/plugin-server-reload": "3.0.0-beta.21",
48
- "@allurereport/plugin-slack": "3.0.0-beta.21",
49
- "@allurereport/reader-api": "3.0.0-beta.21",
50
- "@allurereport/service": "3.0.0-beta.21",
51
- "@allurereport/static-server": "3.0.0-beta.21",
35
+ "@allurereport/charts-api": "3.0.0-beta.23",
36
+ "@allurereport/core": "3.0.0-beta.23",
37
+ "@allurereport/core-api": "3.0.0-beta.23",
38
+ "@allurereport/directory-watcher": "3.0.0-beta.23",
39
+ "@allurereport/plugin-allure2": "3.0.0-beta.23",
40
+ "@allurereport/plugin-api": "3.0.0-beta.23",
41
+ "@allurereport/plugin-awesome": "3.0.0-beta.23",
42
+ "@allurereport/plugin-classic": "3.0.0-beta.23",
43
+ "@allurereport/plugin-csv": "3.0.0-beta.23",
44
+ "@allurereport/plugin-dashboard": "3.0.0-beta.23",
45
+ "@allurereport/plugin-jira": "3.0.0-beta.23",
46
+ "@allurereport/plugin-log": "3.0.0-beta.23",
47
+ "@allurereport/plugin-progress": "3.0.0-beta.23",
48
+ "@allurereport/plugin-server-reload": "3.0.0-beta.23",
49
+ "@allurereport/plugin-slack": "3.0.0-beta.23",
50
+ "@allurereport/reader-api": "3.0.0-beta.23",
51
+ "@allurereport/service": "3.0.0-beta.23",
52
+ "@allurereport/static-server": "3.0.0-beta.23",
52
53
  "adm-zip": "^0.5.16",
53
54
  "clipanion": "^4.0.0-rc.4",
54
- "glob": "^11.0.3",
55
+ "glob": "^11.1.0",
55
56
  "lodash.omit": "^4.5.0",
56
57
  "prompts": "^2.4.2",
57
58
  "terminate": "^2.8.0",