@allurereport/service 3.2.0 → 3.3.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.
package/dist/history.d.ts CHANGED
@@ -3,14 +3,16 @@ import type { AllureServiceClient } from "./service.js";
3
3
  export declare class AllureRemoteHistory implements AllureHistory {
4
4
  readonly params: {
5
5
  allureServiceClient: AllureServiceClient;
6
- branch?: string;
7
6
  limit?: number;
7
+ branch?: string;
8
8
  };
9
9
  constructor(params: {
10
10
  allureServiceClient: AllureServiceClient;
11
- branch?: string;
12
11
  limit?: number;
12
+ branch?: string;
13
13
  });
14
- readHistory(): Promise<import("@allurereport/core-api").HistoryDataPoint[]>;
14
+ readHistory(params?: {
15
+ branch?: string;
16
+ }): Promise<import("@allurereport/core-api").HistoryDataPoint[]>;
15
17
  appendHistory(): Promise<void>;
16
18
  }
package/dist/history.js CHANGED
@@ -3,14 +3,11 @@ export class AllureRemoteHistory {
3
3
  constructor(params) {
4
4
  this.params = params;
5
5
  }
6
- async readHistory() {
7
- const { allureServiceClient, branch, limit } = this.params;
8
- if (!branch) {
9
- return [];
10
- }
6
+ async readHistory(params) {
7
+ const { limit } = this.params;
11
8
  try {
12
- const res = await allureServiceClient.downloadHistory({
13
- branch,
9
+ const res = await this.params.allureServiceClient.downloadHistory({
10
+ branch: params?.branch ?? this.params.branch,
14
11
  limit,
15
12
  });
16
13
  return res;
package/dist/service.d.ts CHANGED
@@ -25,7 +25,7 @@ export declare class AllureServiceClient {
25
25
  };
26
26
  }>;
27
27
  downloadHistory(payload: {
28
- branch: string;
28
+ branch?: string;
29
29
  limit?: number;
30
30
  }): Promise<HistoryDataPoint[]>;
31
31
  createReport(payload: {
package/dist/service.js CHANGED
@@ -61,10 +61,15 @@ export class AllureServiceClient {
61
61
  return __classPrivateFieldGet(this, _AllureServiceClient_client, "f").get(`/projects/${uuid}`);
62
62
  }
63
63
  async downloadHistory(payload) {
64
- const { branch, limit } = payload;
65
- const { history } = await __classPrivateFieldGet(this, _AllureServiceClient_client, "f").get(limit
66
- ? `/projects/history/${encodeURIComponent(branch)}?limit=${encodeURIComponent(limit.toString())}`
67
- : `/projects/history/${encodeURIComponent(branch)}`);
64
+ const { branch, limit } = payload ?? {};
65
+ const params = new URLSearchParams();
66
+ if (limit) {
67
+ params.append("limit", encodeURIComponent(limit));
68
+ }
69
+ if (branch) {
70
+ params.append("branch", encodeURIComponent(branch));
71
+ }
72
+ const { history } = await __classPrivateFieldGet(this, _AllureServiceClient_client, "f").get(params.size > 0 ? `/projects/history?${params.toString()}` : "/projects/history");
68
73
  return history;
69
74
  }
70
75
  async createReport(payload) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/service",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Allure Service API",
5
5
  "keywords": [
6
6
  "allure",
@@ -30,8 +30,8 @@
30
30
  "test": "rimraf ./out && vitest run"
31
31
  },
32
32
  "dependencies": {
33
- "@allurereport/core-api": "3.2.0",
34
- "@allurereport/plugin-api": "3.2.0",
33
+ "@allurereport/core-api": "3.3.0",
34
+ "@allurereport/plugin-api": "3.3.0",
35
35
  "axios": "^1.13.5",
36
36
  "open": "^10.1.0"
37
37
  },