@allurereport/plugin-testops 3.3.1 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/utils.js CHANGED
@@ -18,7 +18,7 @@ export const unwrapStepsAttachments = (steps) => {
18
18
  };
19
19
  export const resolvePluginOptions = (options) => {
20
20
  const { ALLURE_TOKEN, ALLURE_ENDPOINT, ALLURE_PROJECT_ID, ALLURE_LAUNCH_TAGS, ALLURE_LAUNCH_NAME } = env;
21
- const { accessToken = ALLURE_TOKEN, endpoint = ALLURE_ENDPOINT, projectId = ALLURE_PROJECT_ID, launchTags = ALLURE_LAUNCH_TAGS, launchName = ALLURE_LAUNCH_NAME, } = options;
21
+ const { accessToken = ALLURE_TOKEN, endpoint = ALLURE_ENDPOINT, projectId = ALLURE_PROJECT_ID, launchTags = ALLURE_LAUNCH_TAGS, launchName = ALLURE_LAUNCH_NAME, autocloseLaunch, } = options;
22
22
  const tags = !launchTags
23
23
  ? []
24
24
  : Array.isArray(launchTags)
@@ -30,5 +30,38 @@ export const resolvePluginOptions = (options) => {
30
30
  accessToken: accessToken || "",
31
31
  endpoint: endpoint || "",
32
32
  projectId: projectId || "",
33
+ ...(autocloseLaunch !== undefined ? { autocloseLaunch } : {}),
33
34
  };
34
35
  };
36
+ export function attachmentsResolverFactory(store) {
37
+ const attachmentsResolver = async (tr) => {
38
+ const attachments = await store.attachmentsByTrId(tr.id);
39
+ const result = [];
40
+ await Promise.all(attachments.map(async (attachment) => {
41
+ const content = await store.attachmentContentById(attachment.id);
42
+ const body = await content?.readContent(async (s) => s);
43
+ const name = attachment.name || attachment.originalFileName;
44
+ if (name === undefined || body === undefined) {
45
+ return undefined;
46
+ }
47
+ result.push({
48
+ originalFileName: name,
49
+ contentType: attachment.contentType ?? "application/octet-stream",
50
+ content: body,
51
+ });
52
+ }));
53
+ return result;
54
+ };
55
+ return attachmentsResolver;
56
+ }
57
+ export function fixturesResolverFactory(store) {
58
+ const fixturesResolver = async (tr) => {
59
+ const fixtures = await store.fixturesByTrId(tr.id);
60
+ return fixtures.map((fxt) => ({
61
+ ...fxt,
62
+ type: fxt.type.toUpperCase(),
63
+ steps: unwrapStepsAttachments(fxt.steps),
64
+ }));
65
+ };
66
+ return fixturesResolver;
67
+ }
package/package.json CHANGED
@@ -1,67 +1,56 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-testops",
3
- "version": "3.3.1",
3
+ "version": "3.4.1",
4
4
  "description": "Allure Plugin TestOps",
5
5
  "keywords": [
6
6
  "allure",
7
- "testing",
8
- "report",
9
- "plugin",
10
7
  "html",
8
+ "plugin",
9
+ "report",
10
+ "testing",
11
11
  "testops",
12
12
  "uploader"
13
13
  ],
14
- "repository": "https://github.com/allure-framework/allure3",
15
14
  "license": "Apache-2.0",
16
15
  "author": "Qameta Software",
16
+ "repository": "https://github.com/allure-framework/allure3",
17
+ "files": [
18
+ "./dist"
19
+ ],
17
20
  "type": "module",
18
- "exports": {
19
- ".": "./dist/index.js"
20
- },
21
21
  "main": "./dist/index.js",
22
22
  "module": "./dist/index.js",
23
23
  "types": "./dist/index.d.ts",
24
- "files": [
25
- "./dist"
26
- ],
24
+ "exports": {
25
+ ".": "./dist/index.js"
26
+ },
27
27
  "scripts": {
28
28
  "build": "run clean && tsc --project ./tsconfig.json",
29
29
  "clean": "rimraf ./dist",
30
- "eslint": "eslint ./src/**/*.{js,jsx,ts,tsx}",
31
- "eslint:format": "eslint --fix ./src/**/*.{js,jsx,ts,tsx}",
32
- "test": "rimraf ./out && vitest run"
30
+ "test": "rimraf ./out && vitest run",
31
+ "lint": "oxlint --import-plugin src test features stories",
32
+ "lint:fix": "oxlint --import-plugin --fix src test features stories"
33
33
  },
34
34
  "dependencies": {
35
- "@allurereport/ci": "3.3.1",
36
- "@allurereport/core-api": "3.3.1",
37
- "@allurereport/plugin-api": "3.3.1",
38
- "@allurereport/reader-api": "3.3.1",
35
+ "@allurereport/ci": "3.4.1",
36
+ "@allurereport/core-api": "3.4.1",
37
+ "@allurereport/plugin-api": "3.4.1",
38
+ "@allurereport/reader-api": "3.4.1",
39
39
  "axios": "^1.13.5",
40
40
  "form-data": "^4.0.5",
41
- "lodash.chunk": "^4.2.0",
41
+ "lodash-es": "^4",
42
42
  "p-limit": "^7.3.0",
43
- "progress": "^2.0.3"
43
+ "progress": "^2.0.3",
44
+ "yoctocolors": "^2"
44
45
  },
45
46
  "devDependencies": {
46
- "@stylistic/eslint-plugin": "^2.6.1",
47
47
  "@types/d3-shape": "^3.1.6",
48
- "@types/eslint": "^8.56.11",
49
- "@types/form-data": "^2.5.2",
50
- "@types/lodash.chunk": "^4",
48
+ "@types/lodash-es": "^4",
51
49
  "@types/node": "^20.17.9",
52
50
  "@types/progress": "^2",
53
- "@typescript-eslint/eslint-plugin": "^8.0.0",
54
- "@typescript-eslint/parser": "^8.0.0",
55
51
  "@vitest/runner": "^2.1.9",
56
52
  "@vitest/snapshot": "^2.1.9",
57
53
  "allure-vitest": "^3.3.3",
58
- "eslint": "^8.57.0",
59
- "eslint-config-prettier": "^9.1.0",
60
- "eslint-plugin-import": "^2.29.1",
61
- "eslint-plugin-jsdoc": "^50.0.0",
62
- "eslint-plugin-n": "^17.10.1",
63
- "eslint-plugin-no-null": "^1.0.2",
64
- "eslint-plugin-prefer-arrow": "^1.2.3",
65
54
  "rimraf": "^6.0.1",
66
55
  "typescript": "^5.6.3",
67
56
  "vitest": "^2.1.9"