@smartbear/mcp 0.8.0 → 0.9.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.
Files changed (44) hide show
  1. package/dist/api-hub/client/api.js +51 -10
  2. package/dist/api-hub/client/registry-types.js +8 -0
  3. package/dist/api-hub/client/tools.js +7 -1
  4. package/dist/api-hub/client.js +3 -0
  5. package/dist/bugsnag/client/api/CurrentUser.js +12 -49
  6. package/dist/bugsnag/client/api/Error.js +29 -142
  7. package/dist/bugsnag/client/api/Project.js +52 -113
  8. package/dist/bugsnag/client/api/api.js +3743 -0
  9. package/dist/bugsnag/client/api/base.js +97 -34
  10. package/dist/bugsnag/client/api/configuration.js +26 -0
  11. package/dist/bugsnag/client/api/index.js +2 -0
  12. package/dist/bugsnag/client/filters.js +28 -0
  13. package/dist/bugsnag/client.js +100 -151
  14. package/dist/common/server.js +25 -3
  15. package/dist/common/types.js +6 -1
  16. package/dist/pactflow/client/prompt-utils.js +2 -1
  17. package/dist/pactflow/client/utils.js +5 -4
  18. package/dist/pactflow/client.js +10 -9
  19. package/dist/qmetry/client/api/client-api.js +21 -16
  20. package/dist/qmetry/client/api/error-handler.js +329 -0
  21. package/dist/qmetry/client/auto-resolve.js +74 -0
  22. package/dist/qmetry/client/handlers.js +19 -2
  23. package/dist/qmetry/client/issues.js +26 -0
  24. package/dist/qmetry/client/project.js +56 -0
  25. package/dist/qmetry/client/requirement.js +76 -0
  26. package/dist/qmetry/client/testcase.js +46 -8
  27. package/dist/qmetry/client/testsuite.js +117 -0
  28. package/dist/qmetry/client/tools.js +1455 -4
  29. package/dist/qmetry/client/utils.js +16 -0
  30. package/dist/qmetry/client.js +19 -16
  31. package/dist/qmetry/config/constants.js +14 -0
  32. package/dist/qmetry/config/rest-endpoints.js +20 -0
  33. package/dist/qmetry/types/common.js +313 -8
  34. package/dist/qmetry/types/issues.js +6 -0
  35. package/dist/qmetry/types/project.js +10 -0
  36. package/dist/qmetry/types/requirements.js +19 -0
  37. package/dist/qmetry/types/testcase.js +14 -0
  38. package/dist/qmetry/types/testsuite.js +26 -0
  39. package/dist/reflect/client.js +7 -6
  40. package/dist/zephyr/common/auth-service.js +1 -0
  41. package/package.json +1 -1
  42. package/dist/bugsnag/client/api/filters.js +0 -167
  43. package/dist/bugsnag/client/configuration.js +0 -10
  44. package/dist/bugsnag/client/index.js +0 -2
@@ -1,56 +1,47 @@
1
- import { BaseAPI, pickFieldsFromArray } from "./base.js";
2
- // --- API Class ---
1
+ import { ProjectsApiFetchParamCreator } from "./api.js";
2
+ import { BaseAPI, getQueryParams } from "./base.js";
3
3
  export class ProjectAPI extends BaseAPI {
4
4
  static projectFields = [
5
5
  "id",
6
6
  "name",
7
7
  "slug",
8
- "api_key",
9
- "stability_target_type",
10
- "target_stability",
11
- "critical_stability",
12
- ];
13
- static filterFields = [
14
- "errors_url",
15
- "events_url",
16
- "url",
17
- "html_url",
8
+ "apiKey",
9
+ "stabilityTargetType",
10
+ "targetStability",
11
+ "criticalStability",
18
12
  ];
19
13
  static eventFieldFields = [
20
14
  "custom",
21
- "display_id",
22
- "filter_options",
23
- "pivot_options",
15
+ "displayId",
16
+ "filterOptions",
17
+ "pivotOptions",
24
18
  ];
25
19
  static buildFields = [
26
20
  "id",
27
- "release_time",
28
- "app_version",
29
- "release_stage",
30
- "errors_introduced_count",
31
- "errors_seen_count",
32
- "total_sessions_count",
33
- "unhandled_sessions_count",
34
- "accumulative_daily_users_seen",
35
- "accumulative_daily_users_with_unhandled",
21
+ "releaseTime",
22
+ "appVersion",
23
+ "releaseStage",
24
+ "errorsIntroducedCount",
25
+ "errorsSeenCount",
26
+ "totalSessionsCount",
27
+ "unhandledSessionsCount",
28
+ "accumulativeDailyUsersSeen",
29
+ "accumulativeDailyUsersWithUnhandled",
36
30
  ];
37
31
  static releaseFields = [
38
32
  "id",
39
- "release_stage_name",
40
- "app_version",
41
- "first_released_at",
42
- "first_release_id",
43
- "releases_count",
33
+ "releaseStageName",
34
+ "appVersion",
35
+ "firstReleasedAt",
36
+ "firstReleaseId",
37
+ "releasesCount",
44
38
  "visible",
45
- "total_sessions_count",
46
- "unhandled_sessions_count",
47
- "sessions_count_in_last_24h",
48
- "accumulative_daily_users_seen",
49
- "accumulative_daily_users_with_unhandled",
39
+ "totalSessionsCount",
40
+ "unhandledSessionsCount",
41
+ "sessionsCountInLast24h",
42
+ "accumulativeDailyUsersSeen",
43
+ "accumulativeDailyUsersWithUnhandled",
50
44
  ];
51
- constructor(configuration) {
52
- super(configuration, ProjectAPI.filterFields);
53
- }
54
45
  /**
55
46
  * List the Event Fields for a Project
56
47
  * GET /projects/{project_id}/event_fields
@@ -58,64 +49,19 @@ export class ProjectAPI extends BaseAPI {
58
49
  * @returns A promise that resolves to the list of event fields
59
50
  */
60
51
  async listProjectEventFields(projectId) {
61
- const url = `/projects/${projectId}/event_fields`;
62
- const data = await this.request({
63
- method: "GET",
64
- url,
65
- });
66
- // Only return allowed fields
67
- return {
68
- ...data,
69
- body: pickFieldsFromArray(data.body || [], ProjectAPI.eventFieldFields),
70
- };
71
- }
72
- /**
73
- * Create a Project in an Organization
74
- * POST /organizations/{organization_id}/projects
75
- * @param organizationId The organization ID
76
- * @param data The project creation request body
77
- * @returns A promise that resolves to the created project
78
- */
79
- async createProject(organizationId, data) {
80
- const url = `/organizations/${organizationId}/projects`;
81
- return await this.request({
82
- method: "POST",
83
- url,
84
- body: data,
85
- });
86
- }
87
- /**
88
- * Lists builds for a specific project.
89
- * GET /projects/{project_id}/releases
90
- * @param projectId The ID of the project.
91
- * @param opts Options for listing releases, including filtering by release stage.
92
- * @returns A promise that resolves to an array of `ListReleasesResponse` objects.
93
- */
94
- async listBuilds(projectId, opts) {
95
- const url = opts.next_url ??
96
- `/projects/${projectId}/releases${opts.release_stage ? `?release_stage=${opts.release_stage}` : ""}`;
97
- const response = await this.request({
98
- method: "GET",
99
- url,
100
- }, false);
101
- return {
102
- ...response,
103
- body: pickFieldsFromArray(response.body || [], ProjectAPI.buildFields),
104
- };
52
+ const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listProjectEventFields(projectId);
53
+ return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, true, ProjectAPI.eventFieldFields);
105
54
  }
106
55
  /**
107
56
  * Retrieves a specific build from a project.
108
57
  * GET /projects/{project_id}/releases/{release_id}
109
58
  * @param projectId The ID of the project.
110
- * @param buildId The ID of the release to retrieve.
59
+ * @param releaseId The ID of the release to retrieve.
111
60
  * @returns A promise that resolves to the release data.
112
61
  */
113
- async getBuild(projectId, buildId) {
114
- const url = `/projects/${projectId}/releases/${buildId}`;
115
- return await this.request({
116
- method: "GET",
117
- url,
118
- });
62
+ async getProjectReleaseById(projectId, releaseId) {
63
+ const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectReleaseById(projectId, releaseId);
64
+ return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options, ProjectAPI.buildFields);
119
65
  }
120
66
  /**
121
67
  * Lists releases for a specific project.
@@ -124,20 +70,19 @@ export class ProjectAPI extends BaseAPI {
124
70
  * @param opts Options for listing releases, including filtering by release stage and visibility.
125
71
  * @returns A promise that resolves to an array of `ReleaseSummaryResponse` objects.
126
72
  */
127
- async listReleases(projectId, opts) {
128
- const url = opts.next_url ??
129
- `/projects/${projectId}/release_groups?` +
130
- `release_stage_name=${opts.release_stage_name ?? "production"}&` +
131
- `visible_only=${opts.visible_only ?? false}&` +
132
- `top_only=${opts.top_only ?? false}`;
133
- const response = await this.request({
134
- method: "GET",
135
- url,
136
- }, false);
137
- return {
138
- ...response,
139
- body: pickFieldsFromArray(response.body || [], ProjectAPI.releaseFields),
140
- };
73
+ async listProjectReleaseGroups(projectId, releaseStageName, topOnly, visibleOnly, perPage, nextUrl) {
74
+ const options = getQueryParams(nextUrl);
75
+ // Next links need to be used as-is to ensure results are consistent, so only the page size can be modified
76
+ // the others will get overridden
77
+ if (nextUrl) {
78
+ options.query.per_page = perPage ? perPage.toString() : undefined;
79
+ topOnly = undefined;
80
+ visibleOnly = undefined;
81
+ }
82
+ const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listProjectReleaseGroups(projectId, releaseStageName, topOnly, visibleOnly, perPage, undefined, // pageToken passed in through options
83
+ options);
84
+ return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, false, // Paginate results
85
+ ProjectAPI.releaseFields);
141
86
  }
142
87
  /**
143
88
  * Retrieves a specific release by its ID.
@@ -145,12 +90,9 @@ export class ProjectAPI extends BaseAPI {
145
90
  * @param releaseId The ID of the release to retrieve.
146
91
  * @returns A promise that resolves to the release data.
147
92
  */
148
- async getRelease(releaseId) {
149
- const url = `/release_groups/${releaseId}`;
150
- return await this.request({
151
- method: "GET",
152
- url,
153
- });
93
+ async getReleaseGroup(releaseId) {
94
+ const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getReleaseGroup(releaseId);
95
+ return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options, ProjectAPI.releaseFields);
154
96
  }
155
97
  /**
156
98
  * Lists builds associated with a specific release group.
@@ -159,10 +101,7 @@ export class ProjectAPI extends BaseAPI {
159
101
  * @return A promise that resolves to an array of `BuildResponse` objects.
160
102
  */
161
103
  async listBuildsInRelease(releaseId) {
162
- const url = `/release_groups/${releaseId}/releases`;
163
- return await this.request({
164
- method: "GET",
165
- url,
166
- }, true);
104
+ const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getReleaseGroup(releaseId);
105
+ return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, true, ProjectAPI.buildFields);
167
106
  }
168
107
  }