@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.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +101 -0
  3. package/dist/client/api/baseClient.d.ts +39 -0
  4. package/dist/client/api/baseClient.js +103 -0
  5. package/dist/client/api/baseClient.js.map +1 -0
  6. package/dist/client/api/cases.d.ts +102 -0
  7. package/dist/client/api/cases.js +200 -0
  8. package/dist/client/api/cases.js.map +1 -0
  9. package/dist/client/api/index.d.ts +39 -0
  10. package/dist/client/api/index.js +50 -0
  11. package/dist/client/api/index.js.map +1 -0
  12. package/dist/client/api/milestones.d.ts +12 -0
  13. package/dist/client/api/milestones.js +22 -0
  14. package/dist/client/api/milestones.js.map +1 -0
  15. package/dist/client/api/plans.d.ts +12 -0
  16. package/dist/client/api/plans.js +20 -0
  17. package/dist/client/api/plans.js.map +1 -0
  18. package/dist/client/api/projects.d.ts +12 -0
  19. package/dist/client/api/projects.js +31 -0
  20. package/dist/client/api/projects.js.map +1 -0
  21. package/dist/client/api/results.d.ts +56 -0
  22. package/dist/client/api/results.js +125 -0
  23. package/dist/client/api/results.js.map +1 -0
  24. package/dist/client/api/runs.d.ts +40 -0
  25. package/dist/client/api/runs.js +79 -0
  26. package/dist/client/api/runs.js.map +1 -0
  27. package/dist/client/api/sections.d.ts +40 -0
  28. package/dist/client/api/sections.js +89 -0
  29. package/dist/client/api/sections.js.map +1 -0
  30. package/dist/client/api/sharedSteps.d.ts +11 -0
  31. package/dist/client/api/sharedSteps.js +20 -0
  32. package/dist/client/api/sharedSteps.js.map +1 -0
  33. package/dist/client/api/suites.d.ts +36 -0
  34. package/dist/client/api/suites.js +63 -0
  35. package/dist/client/api/suites.js.map +1 -0
  36. package/dist/client/api/tests.d.ts +32 -0
  37. package/dist/client/api/tests.js +47 -0
  38. package/dist/client/api/tests.js.map +1 -0
  39. package/dist/client/api/utils.d.ts +7 -0
  40. package/dist/client/api/utils.js +24 -0
  41. package/dist/client/api/utils.js.map +1 -0
  42. package/dist/index.d.ts +1 -0
  43. package/dist/index.js +5 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/server/api/cases.d.ts +8 -0
  46. package/dist/server/api/cases.js +431 -0
  47. package/dist/server/api/cases.js.map +1 -0
  48. package/dist/server/api/index.d.ts +18 -0
  49. package/dist/server/api/index.js +40 -0
  50. package/dist/server/api/index.js.map +1 -0
  51. package/dist/server/api/milestones.d.ts +8 -0
  52. package/dist/server/api/milestones.js +29 -0
  53. package/dist/server/api/milestones.js.map +1 -0
  54. package/dist/server/api/plans.d.ts +8 -0
  55. package/dist/server/api/plans.js +29 -0
  56. package/dist/server/api/plans.js.map +1 -0
  57. package/dist/server/api/projects.d.ts +8 -0
  58. package/dist/server/api/projects.js +51 -0
  59. package/dist/server/api/projects.js.map +1 -0
  60. package/dist/server/api/results.d.ts +8 -0
  61. package/dist/server/api/results.js +164 -0
  62. package/dist/server/api/results.js.map +1 -0
  63. package/dist/server/api/runs.d.ts +8 -0
  64. package/dist/server/api/runs.js +113 -0
  65. package/dist/server/api/runs.js.map +1 -0
  66. package/dist/server/api/sections.d.ts +8 -0
  67. package/dist/server/api/sections.js +138 -0
  68. package/dist/server/api/sections.js.map +1 -0
  69. package/dist/server/api/sharedSteps.d.ts +8 -0
  70. package/dist/server/api/sharedSteps.js +26 -0
  71. package/dist/server/api/sharedSteps.js.map +1 -0
  72. package/dist/server/api/suites.d.ts +8 -0
  73. package/dist/server/api/suites.js +111 -0
  74. package/dist/server/api/suites.js.map +1 -0
  75. package/dist/server/api/tests.d.ts +8 -0
  76. package/dist/server/api/tests.js +68 -0
  77. package/dist/server/api/tests.js.map +1 -0
  78. package/dist/server/api/utils.d.ts +7 -0
  79. package/dist/server/api/utils.js +25 -0
  80. package/dist/server/api/utils.js.map +1 -0
  81. package/dist/server/server.d.ts +2 -0
  82. package/dist/server/server.js +70 -0
  83. package/dist/server/server.js.map +1 -0
  84. package/dist/server/templates.d.ts +8 -0
  85. package/dist/server/templates.js +43 -0
  86. package/dist/server/templates.js.map +1 -0
  87. package/dist/shared/schemas/cases.d.ts +668 -0
  88. package/dist/shared/schemas/cases.js +178 -0
  89. package/dist/shared/schemas/cases.js.map +1 -0
  90. package/dist/shared/schemas/common.d.ts +117 -0
  91. package/dist/shared/schemas/common.js +50 -0
  92. package/dist/shared/schemas/common.js.map +1 -0
  93. package/dist/shared/schemas/index.d.ts +10 -0
  94. package/dist/shared/schemas/index.js +23 -0
  95. package/dist/shared/schemas/index.js.map +1 -0
  96. package/dist/shared/schemas/milestones.d.ts +59 -0
  97. package/dist/shared/schemas/milestones.js +26 -0
  98. package/dist/shared/schemas/milestones.js.map +1 -0
  99. package/dist/shared/schemas/plans.d.ts +416 -0
  100. package/dist/shared/schemas/plans.js +43 -0
  101. package/dist/shared/schemas/plans.js.map +1 -0
  102. package/dist/shared/schemas/projects.d.ts +135 -0
  103. package/dist/shared/schemas/projects.js +61 -0
  104. package/dist/shared/schemas/projects.js.map +1 -0
  105. package/dist/shared/schemas/results.d.ts +407 -0
  106. package/dist/shared/schemas/results.js +178 -0
  107. package/dist/shared/schemas/results.js.map +1 -0
  108. package/dist/shared/schemas/runs.d.ts +267 -0
  109. package/dist/shared/schemas/runs.js +133 -0
  110. package/dist/shared/schemas/runs.js.map +1 -0
  111. package/dist/shared/schemas/sections.d.ts +136 -0
  112. package/dist/shared/schemas/sections.js +68 -0
  113. package/dist/shared/schemas/sections.js.map +1 -0
  114. package/dist/shared/schemas/sharedSteps.d.ts +135 -0
  115. package/dist/shared/schemas/sharedSteps.js +65 -0
  116. package/dist/shared/schemas/sharedSteps.js.map +1 -0
  117. package/dist/shared/schemas/suites.d.ts +120 -0
  118. package/dist/shared/schemas/suites.js +44 -0
  119. package/dist/shared/schemas/suites.js.map +1 -0
  120. package/dist/shared/schemas/tests.d.ts +87 -0
  121. package/dist/shared/schemas/tests.js +52 -0
  122. package/dist/shared/schemas/tests.js.map +1 -0
  123. package/dist/sse.d.ts +1 -0
  124. package/dist/sse.js +5 -0
  125. package/dist/sse.js.map +1 -0
  126. package/dist/stdio.d.ts +1 -0
  127. package/dist/stdio.js +52 -0
  128. package/dist/stdio.js.map +1 -0
  129. package/package.json +48 -0
@@ -0,0 +1,36 @@
1
+ import { BaseTestRailClient } from "./baseClient.js";
2
+ import { GetSuiteInput, GetSuitesInput, AddSuiteInput, UpdateSuiteInput, TestRailSuite } from "../../shared/schemas/suites.js";
3
+ export declare class SuitesClient extends BaseTestRailClient {
4
+ /**
5
+ * Gets a specific test suite by ID
6
+ * @param suiteId The ID of the test suite
7
+ * @returns Promise with test suite details
8
+ */
9
+ getSuite(suiteId: GetSuiteInput["suiteId"]): Promise<TestRailSuite>;
10
+ /**
11
+ * Gets all test suites for a project
12
+ * @param projectId The ID of the project
13
+ * @returns Promise with array of test suites
14
+ */
15
+ getSuites(projectId: GetSuitesInput["projectId"]): Promise<TestRailSuite[]>;
16
+ /**
17
+ * Adds a new test suite to a project
18
+ * @param projectId The ID of the project
19
+ * @param data The test suite data
20
+ * @returns Promise with created test suite
21
+ */
22
+ addSuite(projectId: AddSuiteInput["projectId"], data: {
23
+ name: AddSuiteInput["name"];
24
+ description?: AddSuiteInput["description"];
25
+ }): Promise<TestRailSuite>;
26
+ /**
27
+ * Updates an existing test suite
28
+ * @param suiteId The ID of the test suite
29
+ * @param data The test suite data to update
30
+ * @returns Promise with updated test suite
31
+ */
32
+ updateSuite(suiteId: UpdateSuiteInput["suiteId"], data: {
33
+ name?: UpdateSuiteInput["name"];
34
+ description?: UpdateSuiteInput["description"];
35
+ }): Promise<TestRailSuite>;
36
+ }
@@ -0,0 +1,63 @@
1
+ import { BaseTestRailClient } from "./baseClient.js";
2
+ import { handleApiError } from "./utils.js";
3
+ export class SuitesClient extends BaseTestRailClient {
4
+ /**
5
+ * Gets a specific test suite by ID
6
+ * @param suiteId The ID of the test suite
7
+ * @returns Promise with test suite details
8
+ */
9
+ async getSuite(suiteId) {
10
+ try {
11
+ const response = await this.client.get(`/api/v2/get_suite/${suiteId}`);
12
+ return response.data;
13
+ }
14
+ catch (error) {
15
+ throw handleApiError(error, `Failed to get test suite ${suiteId}`);
16
+ }
17
+ }
18
+ /**
19
+ * Gets all test suites for a project
20
+ * @param projectId The ID of the project
21
+ * @returns Promise with array of test suites
22
+ */
23
+ async getSuites(projectId) {
24
+ try {
25
+ const response = await this.client.get(`/api/v2/get_suites/${projectId}`);
26
+ return response.data;
27
+ }
28
+ catch (error) {
29
+ throw handleApiError(error, `Failed to get test suites for project ${projectId}`);
30
+ }
31
+ }
32
+ /**
33
+ * Adds a new test suite to a project
34
+ * @param projectId The ID of the project
35
+ * @param data The test suite data
36
+ * @returns Promise with created test suite
37
+ */
38
+ async addSuite(projectId, data) {
39
+ try {
40
+ const response = await this.client.post(`/api/v2/add_suite/${projectId}`, data);
41
+ return response.data;
42
+ }
43
+ catch (error) {
44
+ throw handleApiError(error, `Failed to add test suite to project ${projectId}`);
45
+ }
46
+ }
47
+ /**
48
+ * Updates an existing test suite
49
+ * @param suiteId The ID of the test suite
50
+ * @param data The test suite data to update
51
+ * @returns Promise with updated test suite
52
+ */
53
+ async updateSuite(suiteId, data) {
54
+ try {
55
+ const response = await this.client.post(`/api/v2/update_suite/${suiteId}`, data);
56
+ return response.data;
57
+ }
58
+ catch (error) {
59
+ throw handleApiError(error, `Failed to update test suite ${suiteId}`);
60
+ }
61
+ }
62
+ }
63
+ //# sourceMappingURL=suites.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suites.js","sourceRoot":"","sources":["../../../src/client/api/suites.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAQrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,OAAO,YAAa,SAAQ,kBAAkB;IACnD;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAiC;QAC/C,IAAI,CAAC;YAC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,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,+BAA+B,OAAO,EAAE,CAAC,CAAC;QACvE,CAAC;IACF,CAAC;CACD"}
@@ -0,0 +1,32 @@
1
+ import { BaseTestRailClient } from "./baseClient.js";
2
+ import { GetTestInput, GetTestsInput, TestRailTest } from "../../shared/schemas/tests.js";
3
+ interface GetTestsParams {
4
+ limit?: number;
5
+ offset?: number;
6
+ [key: string]: string | number | boolean | null | undefined;
7
+ }
8
+ export declare class TestsClient extends BaseTestRailClient {
9
+ /**
10
+ * Gets a specific test by ID
11
+ * @param suiteId The ID of the test
12
+ * @returns Promise with test details
13
+ */
14
+ getTest(testId: GetTestInput["testId"]): Promise<TestRailTest>;
15
+ /**
16
+ * Gets all tests for a run
17
+ * @param runId The ID of the run
18
+ * @param params Optional parameters including pagination (limit, offset)
19
+ * @returns Promise with array of tests and pagination metadata
20
+ */
21
+ getTests(runId: GetTestsInput["runId"], params?: Partial<GetTestsParams>): Promise<{
22
+ tests: TestRailTest[];
23
+ offset: number;
24
+ limit: number;
25
+ size: number;
26
+ _links: {
27
+ next: string | null;
28
+ prev: string | null;
29
+ };
30
+ }>;
31
+ }
32
+ export {};
@@ -0,0 +1,47 @@
1
+ import { BaseTestRailClient } from "./baseClient.js";
2
+ import { handleApiError } from "./utils.js";
3
+ export class TestsClient extends BaseTestRailClient {
4
+ /**
5
+ * Gets a specific test by ID
6
+ * @param suiteId The ID of the test
7
+ * @returns Promise with test details
8
+ */
9
+ async getTest(testId) {
10
+ try {
11
+ const response = await this.client.get(`/api/v2/get_test/${testId}`);
12
+ return response.data;
13
+ }
14
+ catch (error) {
15
+ throw handleApiError(error, `Failed to get test ${testId}`);
16
+ }
17
+ }
18
+ /**
19
+ * Gets all tests for a run
20
+ * @param runId The ID of the run
21
+ * @param params Optional parameters including pagination (limit, offset)
22
+ * @returns Promise with array of tests and pagination metadata
23
+ */
24
+ async getTests(runId, params) {
25
+ try {
26
+ const defaultParams = {
27
+ limit: 50,
28
+ offset: 0,
29
+ ...params,
30
+ };
31
+ const response = await this.client.get(`/api/v2/get_tests/${runId}`, {
32
+ params: defaultParams,
33
+ });
34
+ return {
35
+ tests: response.data.tests,
36
+ offset: response.data.offset,
37
+ limit: response.data.limit,
38
+ size: response.data.size,
39
+ _links: response.data._links,
40
+ };
41
+ }
42
+ catch (error) {
43
+ throw handleApiError(error, `Failed to get tests for run ${runId}`);
44
+ }
45
+ }
46
+ }
47
+ //# sourceMappingURL=tests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tests.js","sourceRoot":"","sources":["../../../src/client/api/tests.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAMrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAQ5C,MAAM,OAAO,WAAY,SAAQ,kBAAkB;IAClD;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,MAA8B;QAC3C,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAgC,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAClE,oBAAoB,MAAM,EAAE,CAC5B,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,sBAAsB,MAAM,EAAE,CAAC,CAAC;QAC7D,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CACb,KAA6B,EAC7B,MAAgC;QAQhC,IAAI,CAAC;YACJ,MAAM,aAAa,GAAG;gBACrB,KAAK,EAAE,EAAE;gBACT,MAAM,EAAE,CAAC;gBACT,GAAG,MAAM;aACT,CAAC;YAEF,MAAM,QAAQ,GAMT,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,KAAK,EAAE,EAAE;gBACxD,MAAM,EAAE,aAAa;aACrB,CAAC,CAAC;YAEH,OAAO;gBACN,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;gBAC1B,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;gBAC5B,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;gBAC1B,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI;gBACxB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;aAC5B,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,cAAc,CAAC,KAAK,EAAE,+BAA+B,KAAK,EAAE,CAAC,CAAC;QACrE,CAAC;IACF,CAAC;CACD"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Handles API errors with better context
3
+ * @param error The error object from catch
4
+ * @param message Optional context message
5
+ * @returns Enhanced error with better context
6
+ */
7
+ export declare function handleApiError(error: unknown, message: string): Error;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Handles API errors with better context
3
+ * @param error The error object from catch
4
+ * @param message Optional context message
5
+ * @returns Enhanced error with better context
6
+ */
7
+ export function handleApiError(error, message) {
8
+ // If it's an Axios error, we can get more context
9
+ if (error instanceof Error) {
10
+ const axiosError = error;
11
+ if (axiosError.response) {
12
+ const status = axiosError.response.status;
13
+ const responseData = axiosError.response.data;
14
+ console.error(`${message}: ${JSON.stringify({ response: { status, data: responseData } })}`);
15
+ }
16
+ else {
17
+ console.error(`${message}: ${error}`);
18
+ }
19
+ return error;
20
+ }
21
+ // For non-Error objects, create a new Error
22
+ return new Error(`${message}: ${String(error)}`);
23
+ }
24
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/client/api/utils.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc,EAAE,OAAe;IAC7D,kDAAkD;IAClD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,KAAmB,CAAC;QACvC,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC1C,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC9C,OAAO,CAAC,KAAK,CACZ,GAAG,OAAO,KAAK,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,CAAC,EAAE,CAC7E,CAAC;QACH,CAAC;aAAM,CAAC;YACP,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,4CAA4C;IAC5C,OAAO,IAAI,KAAK,CAAC,GAAG,OAAO,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ // TestRail MCP Serverのエントリーポイント
2
+ import { startServer } from "./server/server.js";
3
+ // サーバー起動
4
+ startServer();
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,SAAS;AACT,WAAW,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TestRailClient } from "../../client/api/index.js";
3
+ /**
4
+ * Function to register test case-related API tools
5
+ * @param server McpServer instance
6
+ * @param testRailClient TestRail client instance
7
+ */
8
+ export declare function registerCaseTools(server: McpServer, testRailClient: TestRailClient): void;