@smartbear/mcp 0.38.0 → 0.40.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 (42) hide show
  1. package/dist/package.json.js +1 -1
  2. package/dist/pactflow/client/admin-api.js +491 -0
  3. package/dist/pactflow/client/ai-api.js +139 -0
  4. package/dist/pactflow/client/contract-api.js +366 -0
  5. package/dist/pactflow/client/environment-api.js +156 -0
  6. package/dist/pactflow/client/http-client.js +47 -0
  7. package/dist/pactflow/client/pacticipant-api.js +288 -0
  8. package/dist/pactflow/client/webhook-api.js +113 -0
  9. package/dist/pactflow/client.js +29 -1967
  10. package/dist/qmetry/client/auto-resolve.js +7 -0
  11. package/dist/qmetry/client/handlers.js +5 -2
  12. package/dist/qmetry/client/issues.js +8 -1
  13. package/dist/qmetry/client/project.js +103 -2
  14. package/dist/qmetry/client/requirement.js +99 -3
  15. package/dist/qmetry/client/testcase.js +51 -2
  16. package/dist/qmetry/client/testsuite.js +7 -1
  17. package/dist/qmetry/client/tools/issue-tools.js +1 -15
  18. package/dist/qmetry/client/tools/project-tools.js +2 -2
  19. package/dist/qmetry/client/tools/requirement-tools.js +124 -11
  20. package/dist/qmetry/client/tools/testcase-tools.js +116 -56
  21. package/dist/qmetry/client/tools/testsuite-tools.js +1 -19
  22. package/dist/qmetry/client/tools/udf-tools.js +15 -4
  23. package/dist/qmetry/client/udf.js +2 -2
  24. package/dist/qmetry/client.js +19 -11
  25. package/dist/qmetry/config/constants.js +3 -0
  26. package/dist/qmetry/config/rest-endpoints.js +4 -2
  27. package/dist/qmetry/types/ai-agent.js +8 -4
  28. package/dist/qmetry/types/common.js +69 -43
  29. package/dist/qmetry/types/requirements.js +7 -1
  30. package/dist/qmetry/types/testcase.js +2 -1
  31. package/dist/qmetry/types/udf.js +5 -12
  32. package/dist/swagger/client/api.js +29 -4
  33. package/dist/swagger/client/functional-testing-api.js +56 -27
  34. package/dist/swagger/client/functional-testing-tools.js +5 -5
  35. package/dist/swagger/client/functional-testing-types.js +75 -9
  36. package/dist/swagger/client/functional-testing-url-utils.js +110 -0
  37. package/dist/swagger/client/registry-types.js +2 -2
  38. package/dist/swagger/client/tools.js +2 -2
  39. package/dist/zephyr/client.js +2 -0
  40. package/dist/zephyr/common/rest-api-schemas.js +345 -4
  41. package/dist/zephyr/tool/folder/get-folders.js +69 -0
  42. package/package.json +1 -1
@@ -0,0 +1,288 @@
1
+ class PacticipantApi {
2
+ constructor(http) {
3
+ this.http = http;
4
+ }
5
+ /**
6
+ * Retrieves all pacticipants, with optional pagination.
7
+ */
8
+ async listPacticipants(params) {
9
+ const queryParams = new URLSearchParams();
10
+ if (params?.pageNumber) queryParams.set("page", String(params.pageNumber));
11
+ if (params?.pageSize) queryParams.set("size", String(params.pageSize));
12
+ const qs = queryParams.toString();
13
+ return await this.http.fetch(
14
+ `${this.http.baseUrl}/pacticipants${qs ? `?${qs}` : ""}`,
15
+ { method: "GET", errorContext: "List Pacticipants" }
16
+ );
17
+ }
18
+ /**
19
+ * Retrieves metadata for a specific pacticipant by name.
20
+ */
21
+ async getPacticipant({
22
+ pacticipantName
23
+ }) {
24
+ return await this.http.fetch(
25
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}`,
26
+ { method: "GET", errorContext: "Get Pacticipant" }
27
+ );
28
+ }
29
+ /**
30
+ * Retrieves all branches for a given pacticipant, with optional name filtering
31
+ * and pagination.
32
+ */
33
+ async listBranches({
34
+ pacticipantName,
35
+ q,
36
+ pageNumber,
37
+ pageSize
38
+ }) {
39
+ const queryParams = new URLSearchParams();
40
+ if (q) queryParams.set("q", q);
41
+ if (pageNumber) queryParams.set("pageNumber", String(pageNumber));
42
+ if (pageSize) queryParams.set("pageSize", String(pageSize));
43
+ const qs = queryParams.toString();
44
+ return await this.http.fetch(
45
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/branches${qs ? `?${qs}` : ""}`,
46
+ { method: "GET", errorContext: "List Branches" }
47
+ );
48
+ }
49
+ /**
50
+ * Retrieves all published versions for a given pacticipant, with optional pagination.
51
+ */
52
+ async listVersions({
53
+ pacticipantName,
54
+ pageNumber,
55
+ pageSize
56
+ }) {
57
+ const queryParams = new URLSearchParams();
58
+ if (pageNumber) queryParams.set("page", String(pageNumber));
59
+ if (pageSize) queryParams.set("size", String(pageSize));
60
+ const qs = queryParams.toString();
61
+ return await this.http.fetch(
62
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/versions${qs ? `?${qs}` : ""}`,
63
+ { method: "GET", errorContext: "List Versions" }
64
+ );
65
+ }
66
+ /**
67
+ * Retrieves metadata for a specific version of a pacticipant.
68
+ */
69
+ async getVersion({
70
+ pacticipantName,
71
+ versionNumber
72
+ }) {
73
+ return await this.http.fetch(
74
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/versions/${encodeURIComponent(versionNumber)}`,
75
+ { method: "GET", errorContext: "Get Version" }
76
+ );
77
+ }
78
+ /**
79
+ * Retrieves the latest version of a pacticipant, optionally filtered by tag.
80
+ */
81
+ async getLatestVersion({
82
+ pacticipantName,
83
+ tag
84
+ }) {
85
+ const path = tag ? `/pacticipants/${encodeURIComponent(pacticipantName)}/latest-version/${encodeURIComponent(tag)}` : `/pacticipants/${encodeURIComponent(pacticipantName)}/latest-version`;
86
+ return await this.http.fetch(
87
+ `${this.http.baseUrl}${path}`,
88
+ {
89
+ method: "GET",
90
+ errorContext: "Get Latest Version"
91
+ }
92
+ );
93
+ }
94
+ /**
95
+ * Fully replaces a pacticipant's metadata.
96
+ */
97
+ async updatePacticipant({
98
+ pacticipantName,
99
+ ...body
100
+ }) {
101
+ return await this.http.fetch(
102
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}`,
103
+ { method: "PUT", body, errorContext: "Update Pacticipant" }
104
+ );
105
+ }
106
+ /**
107
+ * Partially updates a pacticipant's metadata.
108
+ */
109
+ async patchPacticipant({
110
+ pacticipantName,
111
+ ...body
112
+ }) {
113
+ return await this.http.fetch(
114
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}`,
115
+ { method: "PATCH", body, errorContext: "Patch Pacticipant" }
116
+ );
117
+ }
118
+ /**
119
+ * Updates metadata for a specific pacticipant version.
120
+ */
121
+ async updateVersion({
122
+ pacticipantName,
123
+ versionNumber,
124
+ ...body
125
+ }) {
126
+ return await this.http.fetch(
127
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/versions/${encodeURIComponent(versionNumber)}`,
128
+ { method: "PUT", body, errorContext: "Update Version" }
129
+ );
130
+ }
131
+ /**
132
+ * Retrieves all versions published from a specific branch of a pacticipant.
133
+ */
134
+ async getBranchVersions({
135
+ pacticipantName,
136
+ branchName,
137
+ pageNumber,
138
+ pageSize
139
+ }) {
140
+ const queryParams = new URLSearchParams();
141
+ if (pageNumber) queryParams.set("page", String(pageNumber));
142
+ if (pageSize) queryParams.set("size", String(pageSize));
143
+ const qs = queryParams.toString();
144
+ return await this.http.fetch(
145
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/branches/${encodeURIComponent(branchName)}/versions${qs ? `?${qs}` : ""}`,
146
+ { method: "GET", errorContext: "Get Branch Versions" }
147
+ );
148
+ }
149
+ /**
150
+ * Registers a new pacticipant in the workspace.
151
+ */
152
+ async createPacticipant({
153
+ ...body
154
+ }) {
155
+ return await this.http.fetch(
156
+ `${this.http.baseUrl}/pacticipants`,
157
+ {
158
+ method: "POST",
159
+ body,
160
+ errorContext: "Create Pacticipant"
161
+ }
162
+ );
163
+ }
164
+ /**
165
+ * Permanently removes a pacticipant and all its associated data.
166
+ */
167
+ async deletePacticipant({
168
+ pacticipantName
169
+ }) {
170
+ return await this.http.fetch(
171
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}`,
172
+ {
173
+ method: "DELETE",
174
+ errorContext: "Delete Pacticipant"
175
+ }
176
+ );
177
+ }
178
+ /**
179
+ * Retrieves metadata for a specific branch of a pacticipant.
180
+ */
181
+ async getBranch({
182
+ pacticipantName,
183
+ branchName
184
+ }) {
185
+ return await this.http.fetch(
186
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/branches/${encodeURIComponent(branchName)}`,
187
+ { method: "GET", errorContext: "Get Branch" }
188
+ );
189
+ }
190
+ /**
191
+ * Deletes a branch and its version associations from a pacticipant.
192
+ */
193
+ async deleteBranch({
194
+ pacticipantName,
195
+ branchName
196
+ }) {
197
+ return await this.http.fetch(
198
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/branches/${encodeURIComponent(branchName)}`,
199
+ { method: "DELETE", errorContext: "Delete Branch" }
200
+ );
201
+ }
202
+ /**
203
+ * Applies a label to a pacticipant.
204
+ */
205
+ async addLabel({
206
+ pacticipantName,
207
+ labelName
208
+ }) {
209
+ return await this.http.fetch(
210
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/labels/${encodeURIComponent(labelName)}`,
211
+ { method: "PUT", body: {}, errorContext: "Add Label" }
212
+ );
213
+ }
214
+ /**
215
+ * Removes a label from a pacticipant.
216
+ */
217
+ async removeLabel({
218
+ pacticipantName,
219
+ labelName
220
+ }) {
221
+ return await this.http.fetch(
222
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/labels/${encodeURIComponent(labelName)}`,
223
+ { method: "DELETE", errorContext: "Remove Label" }
224
+ );
225
+ }
226
+ /**
227
+ * Retrieves all labels across all pacticipants.
228
+ */
229
+ async listLabels(params) {
230
+ const queryParams = new URLSearchParams();
231
+ if (params?.pageNumber) queryParams.set("page", String(params.pageNumber));
232
+ if (params?.pageSize) queryParams.set("size", String(params.pageSize));
233
+ const qs = queryParams.toString();
234
+ return await this.http.fetch(
235
+ `${this.http.baseUrl}/labels${qs ? `?${qs}` : ""}`,
236
+ { method: "GET", errorContext: "List Labels" }
237
+ );
238
+ }
239
+ /**
240
+ * Checks whether a specific label is applied to a pacticipant.
241
+ */
242
+ async getPacticipantLabel({
243
+ pacticipantName,
244
+ labelName
245
+ }) {
246
+ return await this.http.fetch(
247
+ `${this.http.baseUrl}/pacticipants/${encodeURIComponent(pacticipantName)}/labels/${encodeURIComponent(labelName)}`,
248
+ { method: "GET", errorContext: "Get Pacticipant Label" }
249
+ );
250
+ }
251
+ /**
252
+ * Retrieves all pacticipants that have a specific label applied.
253
+ */
254
+ async listPacticipantsByLabel({
255
+ labelName
256
+ }) {
257
+ return await this.http.fetch(
258
+ `${this.http.baseUrl}/pacticipants/label/${encodeURIComponent(labelName)}`,
259
+ { method: "GET", errorContext: "List Pacticipants by Label" }
260
+ );
261
+ }
262
+ get handlers() {
263
+ return {
264
+ listPacticipants: this.listPacticipants.bind(this),
265
+ getPacticipant: this.getPacticipant.bind(this),
266
+ listBranches: this.listBranches.bind(this),
267
+ listVersions: this.listVersions.bind(this),
268
+ getVersion: this.getVersion.bind(this),
269
+ getLatestVersion: this.getLatestVersion.bind(this),
270
+ updatePacticipant: this.updatePacticipant.bind(this),
271
+ patchPacticipant: this.patchPacticipant.bind(this),
272
+ updateVersion: this.updateVersion.bind(this),
273
+ getBranchVersions: this.getBranchVersions.bind(this),
274
+ createPacticipant: this.createPacticipant.bind(this),
275
+ deletePacticipant: this.deletePacticipant.bind(this),
276
+ getBranch: this.getBranch.bind(this),
277
+ deleteBranch: this.deleteBranch.bind(this),
278
+ addLabel: this.addLabel.bind(this),
279
+ removeLabel: this.removeLabel.bind(this),
280
+ listLabels: this.listLabels.bind(this),
281
+ getPacticipantLabel: this.getPacticipantLabel.bind(this),
282
+ listPacticipantsByLabel: this.listPacticipantsByLabel.bind(this)
283
+ };
284
+ }
285
+ }
286
+ export {
287
+ PacticipantApi
288
+ };
@@ -0,0 +1,113 @@
1
+ class WebhookApi {
2
+ constructor(http) {
3
+ this.http = http;
4
+ }
5
+ /**
6
+ * Retrieves all webhooks configured in the workspace.
7
+ *
8
+ * @returns List of webhook definitions and their trigger configurations.
9
+ * @throws ToolError if the request fails.
10
+ */
11
+ async listWebhooks() {
12
+ return await this.http.fetch(
13
+ `${this.http.baseUrl}/webhooks`,
14
+ { method: "GET", errorContext: "List Webhooks" }
15
+ );
16
+ }
17
+ /**
18
+ * Retrieves the configuration for a specific webhook by UUID.
19
+ *
20
+ * @param params - `webhookId`: UUID of the webhook.
21
+ * @returns Webhook definition including its URL, events, and consumer/provider filters.
22
+ * @throws ToolError if the webhook is not found or the request fails.
23
+ */
24
+ async getWebhook({ webhookId }) {
25
+ return await this.http.fetch(
26
+ `${this.http.baseUrl}/webhooks/${encodeURIComponent(webhookId)}`,
27
+ { method: "GET", errorContext: "Get Webhook" }
28
+ );
29
+ }
30
+ /**
31
+ * Creates a new webhook triggered by pact publication or verification events.
32
+ *
33
+ * @param body - Webhook URL, HTTP method, headers, body, events, and optional
34
+ * consumer/provider filters.
35
+ * @returns The created webhook resource.
36
+ * @throws ToolError if the request fails.
37
+ */
38
+ async createWebhook({
39
+ ...body
40
+ }) {
41
+ return await this.http.fetch(
42
+ `${this.http.baseUrl}/webhooks`,
43
+ { method: "POST", body, errorContext: "Create Webhook" }
44
+ );
45
+ }
46
+ /**
47
+ * Replaces the configuration of an existing webhook.
48
+ *
49
+ * @param params - `webhookId` (UUID) plus the full updated webhook definition.
50
+ * @returns The updated webhook resource.
51
+ * @throws ToolError if the webhook is not found or the request fails.
52
+ */
53
+ async updateWebhook({
54
+ webhookId,
55
+ ...body
56
+ }) {
57
+ return await this.http.fetch(
58
+ `${this.http.baseUrl}/webhooks/${encodeURIComponent(webhookId)}`,
59
+ { method: "PUT", body, errorContext: "Update Webhook" }
60
+ );
61
+ }
62
+ /**
63
+ * Deletes a webhook by UUID.
64
+ *
65
+ * @param params - `webhookId`: UUID of the webhook to delete.
66
+ * @throws ToolError if the webhook is not found or the request fails.
67
+ */
68
+ async deleteWebhook({ webhookId }) {
69
+ return await this.http.fetch(
70
+ `${this.http.baseUrl}/webhooks/${encodeURIComponent(webhookId)}`,
71
+ { method: "DELETE", errorContext: "Delete Webhook" }
72
+ );
73
+ }
74
+ /**
75
+ * Fires all webhooks in the workspace as a test, regardless of their trigger conditions.
76
+ *
77
+ * @throws ToolError if the request fails.
78
+ */
79
+ async executeWebhooks() {
80
+ return await this.http.fetch(
81
+ `${this.http.baseUrl}/webhooks/execute`,
82
+ { method: "POST", body: {}, errorContext: "Execute Webhooks" }
83
+ );
84
+ }
85
+ /**
86
+ * Fires a specific webhook as a test, regardless of its trigger conditions.
87
+ *
88
+ * @param params - `webhookId`: UUID of the webhook to execute.
89
+ * @throws ToolError if the webhook is not found or the request fails.
90
+ */
91
+ async executeWebhook({
92
+ webhookId
93
+ }) {
94
+ return await this.http.fetch(
95
+ `${this.http.baseUrl}/webhooks/${encodeURIComponent(webhookId)}/execute`,
96
+ { method: "POST", body: {}, errorContext: "Execute Webhook" }
97
+ );
98
+ }
99
+ get handlers() {
100
+ return {
101
+ listWebhooks: this.listWebhooks.bind(this),
102
+ getWebhook: this.getWebhook.bind(this),
103
+ createWebhook: this.createWebhook.bind(this),
104
+ updateWebhook: this.updateWebhook.bind(this),
105
+ deleteWebhook: this.deleteWebhook.bind(this),
106
+ executeWebhooks: this.executeWebhooks.bind(this),
107
+ executeWebhook: this.executeWebhook.bind(this)
108
+ };
109
+ }
110
+ }
111
+ export {
112
+ WebhookApi
113
+ };