@bun913/mcp-testrail 0.11.4
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/LICENSE +21 -0
- package/README.md +101 -0
- package/dist/client/api/baseClient.d.ts +39 -0
- package/dist/client/api/baseClient.js +103 -0
- package/dist/client/api/baseClient.js.map +1 -0
- package/dist/client/api/cases.d.ts +102 -0
- package/dist/client/api/cases.js +200 -0
- package/dist/client/api/cases.js.map +1 -0
- package/dist/client/api/index.d.ts +39 -0
- package/dist/client/api/index.js +50 -0
- package/dist/client/api/index.js.map +1 -0
- package/dist/client/api/milestones.d.ts +12 -0
- package/dist/client/api/milestones.js +22 -0
- package/dist/client/api/milestones.js.map +1 -0
- package/dist/client/api/plans.d.ts +12 -0
- package/dist/client/api/plans.js +20 -0
- package/dist/client/api/plans.js.map +1 -0
- package/dist/client/api/projects.d.ts +12 -0
- package/dist/client/api/projects.js +31 -0
- package/dist/client/api/projects.js.map +1 -0
- package/dist/client/api/results.d.ts +56 -0
- package/dist/client/api/results.js +125 -0
- package/dist/client/api/results.js.map +1 -0
- package/dist/client/api/runs.d.ts +40 -0
- package/dist/client/api/runs.js +79 -0
- package/dist/client/api/runs.js.map +1 -0
- package/dist/client/api/sections.d.ts +40 -0
- package/dist/client/api/sections.js +89 -0
- package/dist/client/api/sections.js.map +1 -0
- package/dist/client/api/sharedSteps.d.ts +11 -0
- package/dist/client/api/sharedSteps.js +20 -0
- package/dist/client/api/sharedSteps.js.map +1 -0
- package/dist/client/api/suites.d.ts +36 -0
- package/dist/client/api/suites.js +63 -0
- package/dist/client/api/suites.js.map +1 -0
- package/dist/client/api/tests.d.ts +32 -0
- package/dist/client/api/tests.js +47 -0
- package/dist/client/api/tests.js.map +1 -0
- package/dist/client/api/utils.d.ts +7 -0
- package/dist/client/api/utils.js +24 -0
- package/dist/client/api/utils.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/server/api/cases.d.ts +8 -0
- package/dist/server/api/cases.js +431 -0
- package/dist/server/api/cases.js.map +1 -0
- package/dist/server/api/index.d.ts +18 -0
- package/dist/server/api/index.js +40 -0
- package/dist/server/api/index.js.map +1 -0
- package/dist/server/api/milestones.d.ts +8 -0
- package/dist/server/api/milestones.js +29 -0
- package/dist/server/api/milestones.js.map +1 -0
- package/dist/server/api/plans.d.ts +8 -0
- package/dist/server/api/plans.js +29 -0
- package/dist/server/api/plans.js.map +1 -0
- package/dist/server/api/projects.d.ts +8 -0
- package/dist/server/api/projects.js +51 -0
- package/dist/server/api/projects.js.map +1 -0
- package/dist/server/api/results.d.ts +8 -0
- package/dist/server/api/results.js +164 -0
- package/dist/server/api/results.js.map +1 -0
- package/dist/server/api/runs.d.ts +8 -0
- package/dist/server/api/runs.js +113 -0
- package/dist/server/api/runs.js.map +1 -0
- package/dist/server/api/sections.d.ts +8 -0
- package/dist/server/api/sections.js +138 -0
- package/dist/server/api/sections.js.map +1 -0
- package/dist/server/api/sharedSteps.d.ts +8 -0
- package/dist/server/api/sharedSteps.js +26 -0
- package/dist/server/api/sharedSteps.js.map +1 -0
- package/dist/server/api/suites.d.ts +8 -0
- package/dist/server/api/suites.js +111 -0
- package/dist/server/api/suites.js.map +1 -0
- package/dist/server/api/tests.d.ts +8 -0
- package/dist/server/api/tests.js +68 -0
- package/dist/server/api/tests.js.map +1 -0
- package/dist/server/api/utils.d.ts +7 -0
- package/dist/server/api/utils.js +25 -0
- package/dist/server/api/utils.js.map +1 -0
- package/dist/server/server.d.ts +2 -0
- package/dist/server/server.js +70 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/templates.d.ts +8 -0
- package/dist/server/templates.js +43 -0
- package/dist/server/templates.js.map +1 -0
- package/dist/shared/schemas/cases.d.ts +668 -0
- package/dist/shared/schemas/cases.js +178 -0
- package/dist/shared/schemas/cases.js.map +1 -0
- package/dist/shared/schemas/common.d.ts +117 -0
- package/dist/shared/schemas/common.js +50 -0
- package/dist/shared/schemas/common.js.map +1 -0
- package/dist/shared/schemas/index.d.ts +10 -0
- package/dist/shared/schemas/index.js +23 -0
- package/dist/shared/schemas/index.js.map +1 -0
- package/dist/shared/schemas/milestones.d.ts +59 -0
- package/dist/shared/schemas/milestones.js +26 -0
- package/dist/shared/schemas/milestones.js.map +1 -0
- package/dist/shared/schemas/plans.d.ts +416 -0
- package/dist/shared/schemas/plans.js +43 -0
- package/dist/shared/schemas/plans.js.map +1 -0
- package/dist/shared/schemas/projects.d.ts +135 -0
- package/dist/shared/schemas/projects.js +61 -0
- package/dist/shared/schemas/projects.js.map +1 -0
- package/dist/shared/schemas/results.d.ts +407 -0
- package/dist/shared/schemas/results.js +178 -0
- package/dist/shared/schemas/results.js.map +1 -0
- package/dist/shared/schemas/runs.d.ts +267 -0
- package/dist/shared/schemas/runs.js +133 -0
- package/dist/shared/schemas/runs.js.map +1 -0
- package/dist/shared/schemas/sections.d.ts +136 -0
- package/dist/shared/schemas/sections.js +68 -0
- package/dist/shared/schemas/sections.js.map +1 -0
- package/dist/shared/schemas/sharedSteps.d.ts +135 -0
- package/dist/shared/schemas/sharedSteps.js +65 -0
- package/dist/shared/schemas/sharedSteps.js.map +1 -0
- package/dist/shared/schemas/suites.d.ts +120 -0
- package/dist/shared/schemas/suites.js +44 -0
- package/dist/shared/schemas/suites.js.map +1 -0
- package/dist/shared/schemas/tests.d.ts +87 -0
- package/dist/shared/schemas/tests.js +52 -0
- package/dist/shared/schemas/tests.js.map +1 -0
- package/dist/sse.d.ts +1 -0
- package/dist/sse.js +5 -0
- package/dist/sse.js.map +1 -0
- package/dist/stdio.d.ts +1 -0
- package/dist/stdio.js +52 -0
- package/dist/stdio.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAwB,MAAM,iBAAiB,CAAC;AAC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IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;CACD;AAID,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { TestRailMilestone } from "../../shared/schemas/milestones.js";
|
|
3
|
+
import { GetMilestonesInputType } from "../../shared/schemas/milestones.js";
|
|
4
|
+
export declare class MilestonesClient extends BaseTestRailClient {
|
|
5
|
+
/**
|
|
6
|
+
* Gets all milestones for a project
|
|
7
|
+
* @param projectId The ID of the project
|
|
8
|
+
* @param filters Optional filter parameters
|
|
9
|
+
* @returns Promise with array of milestones
|
|
10
|
+
*/
|
|
11
|
+
getMilestones(projectId: GetMilestonesInputType["projectId"], filters?: Record<string, string | number | boolean | null | undefined>): Promise<TestRailMilestone[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { handleApiError } from "./utils.js";
|
|
3
|
+
export class MilestonesClient extends BaseTestRailClient {
|
|
4
|
+
/**
|
|
5
|
+
* Gets all milestones for a project
|
|
6
|
+
* @param projectId The ID of the project
|
|
7
|
+
* @param filters Optional filter parameters
|
|
8
|
+
* @returns Promise with array of milestones
|
|
9
|
+
*/
|
|
10
|
+
async getMilestones(projectId, filters) {
|
|
11
|
+
try {
|
|
12
|
+
const response = await this.client.get(`/api/v2/get_milestones/${projectId}`, {
|
|
13
|
+
params: filters,
|
|
14
|
+
});
|
|
15
|
+
return response.data;
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
throw handleApiError(error, `Failed to get milestones for project ${projectId}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=milestones.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milestones.js","sourceRoot":"","sources":["../../../src/client/api/milestones.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,MAAM,OAAO,gBAAiB,SAAQ,kBAAkB;IACvD;;;;;OAKG;IACH,KAAK,CAAC,aAAa,CAClB,SAA8C,EAC9C,OAAsE;QAEtE,IAAI,CAAC;YACJ,MAAM,QAAQ,GACb,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,0BAA0B,SAAS,EAAE,EAAE;gBAC5D,MAAM,EAAE,OAAO;aACf,CAAC,CAAC;YACJ,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CACnB,KAAK,EACL,wCAAwC,SAAS,EAAE,CACnD,CAAC;QACH,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { TestRailPlan } from "../../shared/schemas/plans.js";
|
|
3
|
+
import { GetPlansInputType } from "../../shared/schemas/plans.js";
|
|
4
|
+
export declare class PlansClient extends BaseTestRailClient {
|
|
5
|
+
/**
|
|
6
|
+
* Gets all test plans for a project
|
|
7
|
+
* @param projectId The ID of the project
|
|
8
|
+
* @param filters Optional filter parameters
|
|
9
|
+
* @returns Promise with array of test plans
|
|
10
|
+
*/
|
|
11
|
+
getPlans(projectId: GetPlansInputType["projectId"], filters?: Record<string, string | number | boolean | null | undefined>): Promise<TestRailPlan[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { handleApiError } from "./utils.js";
|
|
3
|
+
export class PlansClient extends BaseTestRailClient {
|
|
4
|
+
/**
|
|
5
|
+
* Gets all test plans for a project
|
|
6
|
+
* @param projectId The ID of the project
|
|
7
|
+
* @param filters Optional filter parameters
|
|
8
|
+
* @returns Promise with array of test plans
|
|
9
|
+
*/
|
|
10
|
+
async getPlans(projectId, filters) {
|
|
11
|
+
try {
|
|
12
|
+
const response = await this.client.get(`/api/v2/get_plans/${projectId}`, { params: filters });
|
|
13
|
+
return response.data;
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
throw handleApiError(error, `Failed to get test plans for project ${projectId}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=plans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../../../src/client/api/plans.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,MAAM,OAAO,WAAY,SAAQ,kBAAkB;IAClD;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CACb,SAAyC,EACzC,OAAsE;QAEtE,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAkC,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACpE,qBAAqB,SAAS,EAAE,EAChC,EAAE,MAAM,EAAE,OAAO,EAAE,CACnB,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CACnB,KAAK,EACL,wCAAwC,SAAS,EAAE,CACnD,CAAC;QACH,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { GetProjectInput, TestRailProject } from "../../shared/schemas/projects.js";
|
|
3
|
+
export declare class ProjectsClient extends BaseTestRailClient {
|
|
4
|
+
/**
|
|
5
|
+
* Get a specific project
|
|
6
|
+
*/
|
|
7
|
+
getProject(projectId: GetProjectInput["projectId"]): Promise<TestRailProject>;
|
|
8
|
+
/**
|
|
9
|
+
* Get all projects
|
|
10
|
+
*/
|
|
11
|
+
getProjects(params?: Record<string, string | number | boolean | null | undefined>): Promise<TestRailProject[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { handleApiError } from "./utils.js";
|
|
3
|
+
export class ProjectsClient extends BaseTestRailClient {
|
|
4
|
+
/**
|
|
5
|
+
* Get a specific project
|
|
6
|
+
*/
|
|
7
|
+
async getProject(projectId) {
|
|
8
|
+
try {
|
|
9
|
+
const response = await this.client.get(`/api/v2/get_project/${projectId}`);
|
|
10
|
+
return response.data;
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
throw handleApiError(error, `Failed to get project ${projectId}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get all projects
|
|
18
|
+
*/
|
|
19
|
+
async getProjects(params) {
|
|
20
|
+
try {
|
|
21
|
+
const response = await this.client.get("/api/v2/get_projects", { params });
|
|
22
|
+
// For debugging
|
|
23
|
+
console.error("TestRail API getProjects raw response:", JSON.stringify(response.data));
|
|
24
|
+
return response.data;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw handleApiError(error, "Failed to get projects");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../../src/client/api/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAQrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,OAAO,cAAe,SAAQ,kBAAkB;IACrD;;OAEG;IACH,KAAK,CAAC,UAAU,CACf,SAAuC;QAEvC,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACrC,uBAAuB,SAAS,EAAE,CAClC,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,yBAAyB,SAAS,EAAE,CAAC,CAAC;QACnE,CAAC;IACF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAChB,MAAqE;QAErE,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACrC,sBAAsB,EACtB,EAAE,MAAM,EAAE,CACV,CAAC;YACF,gBAAgB;YAChB,OAAO,CAAC,KAAK,CACZ,wCAAwC,EACxC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;QACvD,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { TestRailResult } from "../../shared/schemas/results.js";
|
|
3
|
+
import { GetResultsInputType, GetResultsForCaseInputType, GetResultsForRunInputType, AddResultInputType, AddResultForCaseInputType, AddResultsInputType, AddResultsForCasesInputType } from "../../shared/schemas/results.js";
|
|
4
|
+
export declare class ResultsClient extends BaseTestRailClient {
|
|
5
|
+
/**
|
|
6
|
+
* Returns a list of results for a test
|
|
7
|
+
* @param testId ID of the test
|
|
8
|
+
* @param params Optional parameters (limit, offset, defects_filter, status_id)
|
|
9
|
+
* @returns List of test results
|
|
10
|
+
*/
|
|
11
|
+
getResults(testId: GetResultsInputType["testId"], params?: Record<string, string | number | boolean | null | undefined>): Promise<TestRailResult[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns a list of results for a test case based on the test run ID and case ID
|
|
14
|
+
* @param runId ID of the test run
|
|
15
|
+
* @param caseId ID of the test case
|
|
16
|
+
* @param params Optional parameters (limit, offset, defects_filter, status_id)
|
|
17
|
+
* @returns List of test results
|
|
18
|
+
*/
|
|
19
|
+
getResultsForCase(runId: GetResultsForCaseInputType["runId"], caseId: GetResultsForCaseInputType["caseId"], params?: Omit<GetResultsForCaseInputType, "runId" | "caseId">): Promise<TestRailResult[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Returns a list of results for a test run
|
|
22
|
+
* @param runId ID of the test run
|
|
23
|
+
* @param params Optional parameters (limit, offset, defects_filter, status_id)
|
|
24
|
+
* @returns List of test results
|
|
25
|
+
*/
|
|
26
|
+
getResultsForRun(runId: GetResultsForRunInputType["runId"], params?: Record<string, string | number | boolean | null | undefined>): Promise<TestRailResult[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Adds a result to a test
|
|
29
|
+
* @param testId ID of the test
|
|
30
|
+
* @param data Result data (status_id, comment, version, elapsed, defects, assignedto_id, etc.)
|
|
31
|
+
* @returns Added test result
|
|
32
|
+
*/
|
|
33
|
+
addResult(testId: AddResultInputType["testId"], data: Record<string, unknown>): Promise<TestRailResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Adds a result for a test case based on the test run and case ID
|
|
36
|
+
* @param runId ID of the test run
|
|
37
|
+
* @param caseId ID of the test case
|
|
38
|
+
* @param data Result data (status_id, comment, version, elapsed, defects, assignedto_id, etc.)
|
|
39
|
+
* @returns Added test result
|
|
40
|
+
*/
|
|
41
|
+
addResultForCase(runId: AddResultForCaseInputType["runId"], caseId: AddResultForCaseInputType["caseId"], data: Partial<Omit<AddResultForCaseInputType, "runId" | "caseId">>): Promise<TestRailResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Adds multiple results to a test run at once
|
|
44
|
+
* @param runId ID of the test run
|
|
45
|
+
* @param data Result data (including results array)
|
|
46
|
+
* @returns List of added test results
|
|
47
|
+
*/
|
|
48
|
+
addResults(runId: AddResultsInputType["runId"], data: Record<string, unknown>): Promise<TestRailResult[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Adds multiple case results to a test run at once
|
|
51
|
+
* @param runId ID of the test run
|
|
52
|
+
* @param data Result data (including results array)
|
|
53
|
+
* @returns List of added test results
|
|
54
|
+
*/
|
|
55
|
+
addResultsForCases(runId: AddResultsForCasesInputType["runId"], data: Record<string, unknown>): Promise<TestRailResult[]>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { handleApiError } from "./utils.js";
|
|
3
|
+
export class ResultsClient extends BaseTestRailClient {
|
|
4
|
+
/**
|
|
5
|
+
* Returns a list of results for a test
|
|
6
|
+
* @param testId ID of the test
|
|
7
|
+
* @param params Optional parameters (limit, offset, defects_filter, status_id)
|
|
8
|
+
* @returns List of test results
|
|
9
|
+
*/
|
|
10
|
+
async getResults(testId, params) {
|
|
11
|
+
try {
|
|
12
|
+
const response = await this.client.get(`/api/v2/get_results/${testId}`, { params });
|
|
13
|
+
return response.data;
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
throw handleApiError(error, `Failed to get results for test ${testId}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns a list of results for a test case based on the test run ID and case ID
|
|
21
|
+
* @param runId ID of the test run
|
|
22
|
+
* @param caseId ID of the test case
|
|
23
|
+
* @param params Optional parameters (limit, offset, defects_filter, status_id)
|
|
24
|
+
* @returns List of test results
|
|
25
|
+
*/
|
|
26
|
+
async getResultsForCase(runId, caseId, params) {
|
|
27
|
+
try {
|
|
28
|
+
const response = await this.client.get(`/api/v2/get_results_for_case/${runId}/${caseId}`, { params });
|
|
29
|
+
return response.data;
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
throw handleApiError(error, `Failed to get results for case ${caseId} in run ${runId}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns a list of results for a test run
|
|
37
|
+
* @param runId ID of the test run
|
|
38
|
+
* @param params Optional parameters (limit, offset, defects_filter, status_id)
|
|
39
|
+
* @returns List of test results
|
|
40
|
+
*/
|
|
41
|
+
async getResultsForRun(runId, params) {
|
|
42
|
+
try {
|
|
43
|
+
const response = await this.client.get(`/api/v2/get_results_for_run/${runId}`, { params });
|
|
44
|
+
return response.data;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
throw handleApiError(error, `Failed to get results for run ${runId}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Adds a result to a test
|
|
52
|
+
* @param testId ID of the test
|
|
53
|
+
* @param data Result data (status_id, comment, version, elapsed, defects, assignedto_id, etc.)
|
|
54
|
+
* @returns Added test result
|
|
55
|
+
*/
|
|
56
|
+
async addResult(testId, data) {
|
|
57
|
+
// TEMPORARILY COMMENTED OUT: add_result implementation
|
|
58
|
+
/*
|
|
59
|
+
try {
|
|
60
|
+
const response: AxiosResponse<TestRailResult> = await this.client.post(
|
|
61
|
+
`/api/v2/add_result/${testId}`,
|
|
62
|
+
data,
|
|
63
|
+
);
|
|
64
|
+
return response.data;
|
|
65
|
+
} catch (error) {
|
|
66
|
+
throw handleApiError(error, `Failed to add result for test ${testId}`);
|
|
67
|
+
}
|
|
68
|
+
*/
|
|
69
|
+
throw new Error("Method temporarily disabled");
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Adds a result for a test case based on the test run and case ID
|
|
73
|
+
* @param runId ID of the test run
|
|
74
|
+
* @param caseId ID of the test case
|
|
75
|
+
* @param data Result data (status_id, comment, version, elapsed, defects, assignedto_id, etc.)
|
|
76
|
+
* @returns Added test result
|
|
77
|
+
*/
|
|
78
|
+
async addResultForCase(runId, caseId, data) {
|
|
79
|
+
try {
|
|
80
|
+
// Convert camelCase to snake_case for API
|
|
81
|
+
const response = await this.client.post(`/api/v2/add_result_for_case/${runId}/${caseId}`, data);
|
|
82
|
+
return response.data;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
throw handleApiError(error, `Failed to add result for case ${caseId} in run ${runId}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Adds multiple results to a test run at once
|
|
90
|
+
* @param runId ID of the test run
|
|
91
|
+
* @param data Result data (including results array)
|
|
92
|
+
* @returns List of added test results
|
|
93
|
+
*/
|
|
94
|
+
async addResults(runId, data) {
|
|
95
|
+
// TEMPORARILY COMMENTED OUT: add_results implementation
|
|
96
|
+
/*
|
|
97
|
+
try {
|
|
98
|
+
const response: AxiosResponse<TestRailResult[]> = await this.client.post(
|
|
99
|
+
`/api/v2/add_results/${runId}`,
|
|
100
|
+
data,
|
|
101
|
+
);
|
|
102
|
+
return response.data;
|
|
103
|
+
} catch (error) {
|
|
104
|
+
throw handleApiError(error, `Failed to add results for run ${runId}`);
|
|
105
|
+
}
|
|
106
|
+
*/
|
|
107
|
+
throw new Error("Method temporarily disabled");
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Adds multiple case results to a test run at once
|
|
111
|
+
* @param runId ID of the test run
|
|
112
|
+
* @param data Result data (including results array)
|
|
113
|
+
* @returns List of added test results
|
|
114
|
+
*/
|
|
115
|
+
async addResultsForCases(runId, data) {
|
|
116
|
+
try {
|
|
117
|
+
const response = await this.client.post(`/api/v2/add_results_for_cases/${runId}`, data);
|
|
118
|
+
return response.data;
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
throw handleApiError(error, `Failed to add results for cases in run ${runId}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../../src/client/api/results.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAW5C,MAAM,OAAO,aAAc,SAAQ,kBAAkB;IACpD;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CACf,MAAqC,EACrC,MAAqE;QAErE,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAoC,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACtE,uBAAuB,MAAM,EAAE,EAC/B,EAAE,MAAM,EAAE,CACV,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,kCAAkC,MAAM,EAAE,CAAC,CAAC;QACzE,CAAC;IACF,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,iBAAiB,CACtB,KAA0C,EAC1C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,cAAc,CACnB,KAAK,EACL,iCAAiC,MAAM,WAAW,KAAK,EAAE,CACzD,CAAC;QACH,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CACf,KAAmC,EACnC,IAA6B;QAE7B,wDAAwD;QACxD;;;;;;;;;;UAUE;QACF,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,kBAAkB,CACvB,KAA2C,EAC3C,IAA6B;QAE7B,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAoC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACvE,iCAAiC,KAAK,EAAE,EACxC,IAAI,CACJ,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CACnB,KAAK,EACL,0CAA0C,KAAK,EAAE,CACjD,CAAC;QACH,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { TestRailRun } from "../../shared/schemas/runs.js";
|
|
3
|
+
import { TestRailResult } from "../../shared/schemas/results.js";
|
|
4
|
+
import { GetRunInputType, GetRunsInputType, AddRunInputType, UpdateRunInputType } from "../../shared/schemas/runs.js";
|
|
5
|
+
export declare class RunsClient extends BaseTestRailClient {
|
|
6
|
+
/**
|
|
7
|
+
* Gets a specific test run by ID
|
|
8
|
+
* @param runId The ID of the test run
|
|
9
|
+
* @returns Promise with test run details
|
|
10
|
+
*/
|
|
11
|
+
getRun(runId: GetRunInputType["runId"]): Promise<TestRailRun>;
|
|
12
|
+
/**
|
|
13
|
+
* Gets all test runs for a project
|
|
14
|
+
* @param projectId The ID of the project
|
|
15
|
+
* @param filters Optional filter parameters
|
|
16
|
+
* @returns Promise with array of test runs
|
|
17
|
+
*/
|
|
18
|
+
getRuns(projectId: GetRunsInputType["projectId"], filters?: Record<string, string | number | boolean | null | undefined>): Promise<TestRailRun[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Adds a new test run to a project
|
|
21
|
+
* @param projectId The ID of the project
|
|
22
|
+
* @param data The test run data
|
|
23
|
+
* @returns Promise with created test run
|
|
24
|
+
*/
|
|
25
|
+
addRun(projectId: AddRunInputType["projectId"], data: Record<string, unknown>): Promise<TestRailRun>;
|
|
26
|
+
/**
|
|
27
|
+
* Updates an existing test run
|
|
28
|
+
* @param runId The ID of the test run
|
|
29
|
+
* @param data The test run data to update
|
|
30
|
+
* @returns Promise with updated test run
|
|
31
|
+
*/
|
|
32
|
+
updateRun(runId: UpdateRunInputType["runId"], data: Record<string, unknown>): Promise<TestRailRun>;
|
|
33
|
+
/**
|
|
34
|
+
* Adds a result to a test
|
|
35
|
+
* @param testId The ID of the test
|
|
36
|
+
* @param data The result data
|
|
37
|
+
* @returns Promise with the created result
|
|
38
|
+
*/
|
|
39
|
+
addResult(testId: number, data: Record<string, unknown>): Promise<TestRailResult>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { handleApiError } from "./utils.js";
|
|
3
|
+
export class RunsClient extends BaseTestRailClient {
|
|
4
|
+
/**
|
|
5
|
+
* Gets a specific test run by ID
|
|
6
|
+
* @param runId The ID of the test run
|
|
7
|
+
* @returns Promise with test run details
|
|
8
|
+
*/
|
|
9
|
+
async getRun(runId) {
|
|
10
|
+
try {
|
|
11
|
+
const response = await this.client.get(`/api/v2/get_run/${runId}`);
|
|
12
|
+
return response.data;
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
throw handleApiError(error, `Failed to get test run ${runId}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Gets all test runs for a project
|
|
20
|
+
* @param projectId The ID of the project
|
|
21
|
+
* @param filters Optional filter parameters
|
|
22
|
+
* @returns Promise with array of test runs
|
|
23
|
+
*/
|
|
24
|
+
async getRuns(projectId, filters) {
|
|
25
|
+
try {
|
|
26
|
+
const response = await this.client.get(`/api/v2/get_runs/${projectId}`, { params: filters });
|
|
27
|
+
return response.data;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
throw handleApiError(error, `Failed to get test runs for project ${projectId}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Adds a new test run to a project
|
|
35
|
+
* @param projectId The ID of the project
|
|
36
|
+
* @param data The test run data
|
|
37
|
+
* @returns Promise with created test run
|
|
38
|
+
*/
|
|
39
|
+
async addRun(projectId, data) {
|
|
40
|
+
try {
|
|
41
|
+
const response = await this.client.post(`/api/v2/add_run/${projectId}`, data);
|
|
42
|
+
return response.data;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
throw handleApiError(error, `Failed to add test run to project ${projectId}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Updates an existing test run
|
|
50
|
+
* @param runId The ID of the test run
|
|
51
|
+
* @param data The test run data to update
|
|
52
|
+
* @returns Promise with updated test run
|
|
53
|
+
*/
|
|
54
|
+
async updateRun(runId, data) {
|
|
55
|
+
try {
|
|
56
|
+
const response = await this.client.post(`/api/v2/update_run/${runId}`, data);
|
|
57
|
+
return response.data;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
throw handleApiError(error, `Failed to update test run ${runId}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Adds a result to a test
|
|
65
|
+
* @param testId The ID of the test
|
|
66
|
+
* @param data The result data
|
|
67
|
+
* @returns Promise with the created result
|
|
68
|
+
*/
|
|
69
|
+
async addResult(testId, data) {
|
|
70
|
+
try {
|
|
71
|
+
const response = await this.client.post(`/api/v2/add_result/${testId}`, data);
|
|
72
|
+
return response.data;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
throw handleApiError(error, `Failed to add result for test ${testId}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../../src/client/api/runs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAQ5C,MAAM,OAAO,UAAW,SAAQ,kBAAkB;IACjD;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,KAA+B;QAC3C,IAAI,CAAC;YACJ,MAAM,QAAQ,GAA+B,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACjE,mBAAmB,KAAK,EAAE,CAC1B,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,0BAA0B,KAAK,EAAE,CAAC,CAAC;QAChE,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CACZ,SAAwC,EACxC,OAAsE;QAEtE,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAiC,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACnE,oBAAoB,SAAS,EAAE,EAC/B,EAAE,MAAM,EAAE,OAAO,EAAE,CACnB,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CACnB,KAAK,EACL,uCAAuC,SAAS,EAAE,CAClD,CAAC;QACH,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACX,SAAuC,EACvC,IAA6B;QAE7B,IAAI,CAAC;YACJ,MAAM,QAAQ,GAA+B,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAClE,mBAAmB,SAAS,EAAE,EAC9B,IAAI,CACJ,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CACnB,KAAK,EACL,qCAAqC,SAAS,EAAE,CAChD,CAAC;QACH,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACd,KAAkC,EAClC,IAA6B;QAE7B,IAAI,CAAC;YACJ,MAAM,QAAQ,GAA+B,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAClE,sBAAsB,KAAK,EAAE,EAC7B,IAAI,CACJ,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,6BAA6B,KAAK,EAAE,CAAC,CAAC;QACnE,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACd,MAAc,EACd,IAA6B;QAE7B,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAkC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrE,sBAAsB,MAAM,EAAE,EAC9B,IAAI,CACJ,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,iCAAiC,MAAM,EAAE,CAAC,CAAC;QACxE,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { TestRailSection } from "../../shared/schemas/sections.js";
|
|
3
|
+
import { GetSectionInputType, GetSectionsInputType, AddSectionInputType, MoveSectionInputType, UpdateSectionInputType, DeleteSectionInputType } from "../../shared/schemas/sections.js";
|
|
4
|
+
export declare class SectionsClient extends BaseTestRailClient {
|
|
5
|
+
/**
|
|
6
|
+
* Get a specific section
|
|
7
|
+
*/
|
|
8
|
+
getSection(sectionId: GetSectionInputType["sectionId"]): Promise<TestRailSection>;
|
|
9
|
+
/**
|
|
10
|
+
* Get all sections for a project
|
|
11
|
+
*/
|
|
12
|
+
getSections(projectId: GetSectionsInputType["projectId"], suiteId?: GetSectionsInputType["suiteId"], params?: Record<string, string | number | boolean | null | undefined>): Promise<TestRailSection[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Add a new section
|
|
15
|
+
*/
|
|
16
|
+
addSection(projectId: AddSectionInputType["projectId"], data: {
|
|
17
|
+
name: AddSectionInputType["name"];
|
|
18
|
+
description?: AddSectionInputType["description"];
|
|
19
|
+
suite_id?: AddSectionInputType["suiteId"];
|
|
20
|
+
parent_id?: AddSectionInputType["parentId"];
|
|
21
|
+
}): Promise<TestRailSection>;
|
|
22
|
+
/**
|
|
23
|
+
* Move a section to a different parent or position
|
|
24
|
+
*/
|
|
25
|
+
moveSection(sectionId: MoveSectionInputType["sectionId"], data: {
|
|
26
|
+
parent_id?: MoveSectionInputType["parentId"];
|
|
27
|
+
after_id?: MoveSectionInputType["afterId"];
|
|
28
|
+
}): Promise<TestRailSection>;
|
|
29
|
+
/**
|
|
30
|
+
* Update an existing section
|
|
31
|
+
*/
|
|
32
|
+
updateSection(sectionId: UpdateSectionInputType["sectionId"], data: {
|
|
33
|
+
name?: UpdateSectionInputType["name"];
|
|
34
|
+
description?: UpdateSectionInputType["description"];
|
|
35
|
+
}): Promise<TestRailSection>;
|
|
36
|
+
/**
|
|
37
|
+
* Delete an existing section
|
|
38
|
+
*/
|
|
39
|
+
deleteSection(sectionId: DeleteSectionInputType["sectionId"], soft?: DeleteSectionInputType["soft"]): Promise<void>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { handleApiError } from "./utils.js";
|
|
3
|
+
export class SectionsClient extends BaseTestRailClient {
|
|
4
|
+
/**
|
|
5
|
+
* Get a specific section
|
|
6
|
+
*/
|
|
7
|
+
async getSection(sectionId) {
|
|
8
|
+
try {
|
|
9
|
+
console.log(`Getting section ${sectionId}`);
|
|
10
|
+
const response = await this.client.get(`/api/v2/get_section/${sectionId}`);
|
|
11
|
+
return response.data;
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
throw handleApiError(error, `Failed to get section ${sectionId}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get all sections for a project
|
|
19
|
+
*/
|
|
20
|
+
async getSections(projectId, suiteId, params) {
|
|
21
|
+
try {
|
|
22
|
+
console.log(`Getting sections for project ${projectId}`);
|
|
23
|
+
const url = `/api/v2/get_sections/${projectId}`;
|
|
24
|
+
const queryParams = suiteId ? { ...params, suite_id: suiteId } : params;
|
|
25
|
+
const response = await this.client.get(url, {
|
|
26
|
+
params: queryParams,
|
|
27
|
+
});
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
throw handleApiError(error, `Failed to get sections for project ${projectId}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Add a new section
|
|
36
|
+
*/
|
|
37
|
+
async addSection(projectId, data) {
|
|
38
|
+
try {
|
|
39
|
+
console.log(`Adding section to project ${projectId}`);
|
|
40
|
+
const response = await this.client.post(`/api/v2/add_section/${projectId}`, data);
|
|
41
|
+
return response.data;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
throw handleApiError(error, `Failed to add section to project ${projectId}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Move a section to a different parent or position
|
|
49
|
+
*/
|
|
50
|
+
async moveSection(sectionId, data) {
|
|
51
|
+
try {
|
|
52
|
+
console.log(`Moving section ${sectionId}`);
|
|
53
|
+
const response = await this.client.post(`/api/v2/move_section/${sectionId}`, data);
|
|
54
|
+
return response.data;
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
throw handleApiError(error, `Failed to move section ${sectionId}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Update an existing section
|
|
62
|
+
*/
|
|
63
|
+
async updateSection(sectionId, data) {
|
|
64
|
+
try {
|
|
65
|
+
console.log(`Updating section ${sectionId}`);
|
|
66
|
+
const response = await this.client.post(`/api/v2/update_section/${sectionId}`, data);
|
|
67
|
+
return response.data;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
throw handleApiError(error, `Failed to update section ${sectionId}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Delete an existing section
|
|
75
|
+
*/
|
|
76
|
+
async deleteSection(sectionId, soft) {
|
|
77
|
+
try {
|
|
78
|
+
console.log(`Deleting section ${sectionId}`);
|
|
79
|
+
const url = soft
|
|
80
|
+
? `/api/v2/delete_section/${sectionId}?soft=1`
|
|
81
|
+
: `/api/v2/delete_section/${sectionId}`;
|
|
82
|
+
await this.client.post(url, {});
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
throw handleApiError(error, `Failed to delete section ${sectionId}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../../src/client/api/sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAU5C,MAAM,OAAO,cAAe,SAAQ,kBAAkB;IACrD;;OAEG;IACH,KAAK,CAAC,UAAU,CACf,SAA2C;QAE3C,IAAI,CAAC;YACJ,OAAO,CAAC,GAAG,CAAC,mBAAmB,S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I,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,4BAA4B,SAAS,EAAE,CAAC,CAAC;QACtE,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { TestRailSharedStep, GetSharedStepsInputType } from "../../shared/schemas/sharedSteps.js";
|
|
3
|
+
export declare class SharedStepsClient extends BaseTestRailClient {
|
|
4
|
+
/**
|
|
5
|
+
* Get all shared steps for a project
|
|
6
|
+
* @param projectId The ID of the project
|
|
7
|
+
* @param filters Optional filter parameters (created_after, created_before, updated_after, updated_before, created_by, limit, offset)
|
|
8
|
+
* @returns Promise with array of shared steps
|
|
9
|
+
*/
|
|
10
|
+
getSharedSteps(projectId: GetSharedStepsInputType["projectId"], filters?: Record<string, string | number | boolean | null | undefined>): Promise<TestRailSharedStep[]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseTestRailClient } from "./baseClient.js";
|
|
2
|
+
import { handleApiError } from "./utils.js";
|
|
3
|
+
export class SharedStepsClient extends BaseTestRailClient {
|
|
4
|
+
/**
|
|
5
|
+
* Get all shared steps for a project
|
|
6
|
+
* @param projectId The ID of the project
|
|
7
|
+
* @param filters Optional filter parameters (created_after, created_before, updated_after, updated_before, created_by, limit, offset)
|
|
8
|
+
* @returns Promise with array of shared steps
|
|
9
|
+
*/
|
|
10
|
+
async getSharedSteps(projectId, filters) {
|
|
11
|
+
try {
|
|
12
|
+
const response = await this.client.get(`/api/v2/get_shared_steps/${projectId}`, { params: filters });
|
|
13
|
+
return response.data;
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
throw handleApiError(error, `Failed to get shared steps for project ${projectId}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=sharedSteps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedSteps.js","sourceRoot":"","sources":["../../../src/client/api/sharedSteps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAKrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,OAAO,iBAAkB,SAAQ,kBAAkB;IACxD;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CACnB,SAA+C,EAC/C,OAAsE;QAEtE,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACrC,4BAA4B,SAAS,EAAE,EACvC,EAAE,MAAM,EAAE,OAAO,EAAE,CACnB,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CACnB,KAAK,EACL,0CAA0C,SAAS,EAAE,CACrD,CAAC;QACH,CAAC;IACF,CAAC;CACD"}
|