@smartbear/mcp 0.12.1 → 0.13.1
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/README.md +30 -6
- package/dist/bugsnag/client/api/CurrentUser.js +50 -26
- package/dist/bugsnag/client/api/Error.js +156 -93
- package/dist/bugsnag/client/api/Project.js +398 -276
- package/dist/bugsnag/client/api/api.js +4087 -3837
- package/dist/bugsnag/client/api/base.js +155 -173
- package/dist/bugsnag/client/api/configuration.js +28 -25
- package/dist/bugsnag/client/filters.js +11 -20
- package/dist/bugsnag/client.js +1398 -1281
- package/dist/bugsnag/input-schemas.js +39 -57
- package/dist/collaborator/client.js +335 -371
- package/dist/common/bugsnag.js +5 -3
- package/dist/common/cache.js +50 -57
- package/dist/common/client-registry.js +106 -119
- package/dist/common/info.js +7 -3
- package/dist/common/register-clients.js +0 -16
- package/dist/common/server.js +270 -228
- package/dist/common/tools.js +19 -0
- package/dist/common/transport-http.js +252 -343
- package/dist/common/transport-stdio.js +40 -37
- package/dist/common/zod-utils.js +20 -0
- package/dist/index.js +18 -23
- package/dist/package.json.js +11 -0
- package/dist/pactflow/client/ai.js +142 -169
- package/dist/pactflow/client/base.js +41 -51
- package/dist/pactflow/client/prompt-utils.js +93 -84
- package/dist/pactflow/client/prompts.js +95 -92
- package/dist/pactflow/client/tools.js +94 -83
- package/dist/pactflow/client/utils.js +60 -64
- package/dist/pactflow/client.js +399 -320
- package/dist/qmetry/client/api/client-api.js +43 -41
- package/dist/qmetry/client/api/error-handler.js +264 -310
- package/dist/qmetry/client/auto-resolve.js +78 -99
- package/dist/qmetry/client/automation.js +139 -162
- package/dist/qmetry/client/handlers.js +49 -46
- package/dist/qmetry/client/issues.js +133 -115
- package/dist/qmetry/client/project.js +153 -174
- package/dist/qmetry/client/requirement.js +82 -70
- package/dist/qmetry/client/testcase.js +240 -208
- package/dist/qmetry/client/testsuite.js +332 -293
- package/dist/qmetry/client/tools/automation-tools.js +291 -288
- package/dist/qmetry/client/tools/index.js +16 -13
- package/dist/qmetry/client/tools/issue-tools.js +534 -543
- package/dist/qmetry/client/tools/project-tools.js +635 -656
- package/dist/qmetry/client/tools/requirement-tools.js +525 -528
- package/dist/qmetry/client/tools/testcase-tools.js +773 -786
- package/dist/qmetry/client/tools/testsuite-tools.js +1069 -1083
- package/dist/qmetry/client/utils.js +8 -14
- package/dist/qmetry/client.js +111 -109
- package/dist/qmetry/config/constants.js +48 -44
- package/dist/qmetry/config/rest-endpoints.js +51 -48
- package/dist/qmetry/types/automation.js +7 -7
- package/dist/qmetry/types/common.js +763 -1049
- package/dist/qmetry/types/issues.js +26 -19
- package/dist/qmetry/types/project.js +32 -25
- package/dist/qmetry/types/requirements.js +26 -21
- package/dist/qmetry/types/testcase.js +55 -44
- package/dist/qmetry/types/testsuite.js +66 -52
- package/dist/reflect/client.js +284 -226
- package/dist/swagger/client/api.js +645 -662
- package/dist/swagger/client/configuration.js +31 -33
- package/dist/swagger/client/portal-types.js +204 -244
- package/dist/swagger/client/registry-types.js +62 -96
- package/dist/swagger/client/tools.js +148 -158
- package/dist/swagger/client/user-management-types.js +11 -22
- package/dist/swagger/client.js +143 -135
- package/dist/swagger/config-utils.js +10 -16
- package/dist/zephyr/client.js +43 -42
- package/dist/zephyr/common/api-client.js +35 -30
- package/dist/zephyr/common/auth-service.js +16 -13
- package/dist/zephyr/common/rest-api-schemas.js +3173 -5146
- package/dist/zephyr/tool/environment/get-environments.js +66 -66
- package/dist/zephyr/tool/priority/get-priorities.js +41 -41
- package/dist/zephyr/tool/project/get-project.js +37 -37
- package/dist/zephyr/tool/project/get-projects.js +46 -46
- package/dist/zephyr/tool/status/get-statuses.js +47 -47
- package/dist/zephyr/tool/test-case/get-test-case.js +37 -37
- package/dist/zephyr/tool/test-case/get-test-cases.js +62 -62
- package/dist/zephyr/tool/test-cycle/get-test-cycle.js +37 -37
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +70 -70
- package/dist/zephyr/tool/test-execution/get-test-execution.js +37 -37
- package/dist/zephyr/tool/test-execution/get-test-executions.js +43 -43
- package/package.json +5 -5
- package/dist/bugsnag/client/api/index.js +0 -6
- package/dist/common/types.js +0 -6
- package/dist/qmetry/client/tools/types.js +0 -1
- package/dist/swagger/client/index.js +0 -6
- package/dist/tests/unit/bugsnag/utils/factories.js +0 -86
- package/dist/zephyr/tool/zephyr-tool.js +0 -1
|
@@ -1,377 +1,341 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
const ConfigurationSchema = z.object({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.string()
|
|
7
|
-
.describe("Collaborator login ticket for authentication"),
|
|
3
|
+
base_url: z.url().describe("Collaborator server base URL"),
|
|
4
|
+
username: z.string().describe("Collaborator username for authentication"),
|
|
5
|
+
login_ticket: z.string().describe("Collaborator login ticket for authentication")
|
|
8
6
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
class CollaboratorClient {
|
|
8
|
+
name = "Collaborator";
|
|
9
|
+
toolPrefix = "collaborator";
|
|
10
|
+
configPrefix = "Collaborator";
|
|
11
|
+
config = ConfigurationSchema;
|
|
12
|
+
baseUrl;
|
|
13
|
+
username;
|
|
14
|
+
loginTicket;
|
|
15
|
+
async configure(_server, config, _cache) {
|
|
16
|
+
this.baseUrl = config.base_url;
|
|
17
|
+
this.username = config.username;
|
|
18
|
+
this.loginTicket = config.login_ticket;
|
|
19
|
+
}
|
|
20
|
+
isConfigured() {
|
|
21
|
+
return this.baseUrl !== void 0 && this.username !== void 0 && this.loginTicket !== void 0;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Calls the Collaborator API with the given commands, prepending authentication automatically.
|
|
25
|
+
* @param commands Array of Collaborator API commands (excluding authentication)
|
|
26
|
+
* @returns Raw Collaborator API response
|
|
27
|
+
*/
|
|
28
|
+
async call(commands) {
|
|
29
|
+
const url = `${this.baseUrl}/services/json/v1`;
|
|
30
|
+
const body = [
|
|
31
|
+
{
|
|
32
|
+
command: "SessionService.authenticate",
|
|
33
|
+
args: { login: this.username, ticket: this.loginTicket }
|
|
34
|
+
},
|
|
35
|
+
...commands
|
|
36
|
+
];
|
|
37
|
+
const response = await fetch(url, {
|
|
38
|
+
method: "POST",
|
|
39
|
+
headers: { "Content-Type": "application/json" },
|
|
40
|
+
body: JSON.stringify(body)
|
|
41
|
+
});
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
throw new Error(
|
|
44
|
+
`Collaborator API call failed: ${response.status} - ${await response.text()}`
|
|
45
|
+
);
|
|
22
46
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
return await response.json();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Registers the Collaborator API tool with the MCP server. Accepts commands (excluding authentication).
|
|
51
|
+
*/
|
|
52
|
+
async registerTools(register, _getInput) {
|
|
53
|
+
register(
|
|
54
|
+
{
|
|
55
|
+
title: "Find Collaborator Review By ID",
|
|
56
|
+
summary: "Finds a review in Collaborator by its review ID.",
|
|
57
|
+
inputSchema: z.object({
|
|
58
|
+
reviewId: z.string().describe("The Collaborator review ID to find.")
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
async (args, _extra) => {
|
|
62
|
+
const { reviewId } = args;
|
|
63
|
+
const commands = [
|
|
64
|
+
{
|
|
65
|
+
command: "ReviewService.findReviewById",
|
|
66
|
+
args: { reviewId }
|
|
67
|
+
}
|
|
40
68
|
];
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
? Number(args.id)
|
|
311
|
-
: args.id;
|
|
312
|
-
const commands = [
|
|
313
|
-
{
|
|
314
|
-
command: "AdminRemoteSystemService.deleteIntegration",
|
|
315
|
-
args: commandArgs,
|
|
316
|
-
},
|
|
317
|
-
];
|
|
318
|
-
const result = await this.call(commands);
|
|
319
|
-
return {
|
|
320
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
321
|
-
};
|
|
322
|
-
});
|
|
323
|
-
register({
|
|
324
|
-
title: "Update Collaborator Remote System Configuration Webhook",
|
|
325
|
-
summary: "Updates the webhook for a remote system configuration in Collaborator by its ID.",
|
|
326
|
-
inputSchema: z.object({
|
|
327
|
-
id: z
|
|
328
|
-
.union([z.string(), z.number()])
|
|
329
|
-
.describe("ID of the remote system Configuration to update the webhook for."),
|
|
330
|
-
}),
|
|
331
|
-
}, async (args, _extra) => {
|
|
332
|
-
const commandArgs = {};
|
|
333
|
-
if (args.id !== undefined)
|
|
334
|
-
commandArgs.id =
|
|
335
|
-
typeof args.id === "string" && !Number.isNaN(Number(args.id))
|
|
336
|
-
? Number(args.id)
|
|
337
|
-
: args.id;
|
|
338
|
-
const commands = [
|
|
339
|
-
{
|
|
340
|
-
command: "AdminRemoteSystemService.updateWebhook",
|
|
341
|
-
args: commandArgs,
|
|
342
|
-
},
|
|
343
|
-
];
|
|
344
|
-
const result = await this.call(commands);
|
|
345
|
-
return {
|
|
346
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
347
|
-
};
|
|
348
|
-
});
|
|
349
|
-
// Test connection tool
|
|
350
|
-
register({
|
|
351
|
-
title: "Test Collaborator Remote System Configuration Connection",
|
|
352
|
-
summary: "Tests the connection for a remote system configuration in Collaborator by its ID.",
|
|
353
|
-
inputSchema: z.object({
|
|
354
|
-
id: z
|
|
355
|
-
.union([z.string(), z.number()])
|
|
356
|
-
.describe("ID of the remote system Configuration to test connection for."),
|
|
357
|
-
}),
|
|
358
|
-
}, async (args, _extra) => {
|
|
359
|
-
const commandArgs = {};
|
|
360
|
-
if (args.id !== undefined)
|
|
361
|
-
commandArgs.id =
|
|
362
|
-
typeof args.id === "string" && !Number.isNaN(Number(args.id))
|
|
363
|
-
? Number(args.id)
|
|
364
|
-
: args.id;
|
|
365
|
-
const commands = [
|
|
366
|
-
{
|
|
367
|
-
command: "AdminRemoteSystemService.testConnection",
|
|
368
|
-
args: commandArgs,
|
|
369
|
-
},
|
|
370
|
-
];
|
|
371
|
-
const result = await this.call(commands);
|
|
372
|
-
return {
|
|
373
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
374
|
-
};
|
|
375
|
-
});
|
|
376
|
-
}
|
|
69
|
+
const result = await this.call(commands);
|
|
70
|
+
return {
|
|
71
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
register(
|
|
76
|
+
{
|
|
77
|
+
title: "Create Collaborator Review",
|
|
78
|
+
summary: "Creates a new review in Collaborator. All parameters are optional.",
|
|
79
|
+
inputSchema: z.object({
|
|
80
|
+
creator: z.string().optional().describe(
|
|
81
|
+
"Collaborator username of the review creator. Optional. Default: currently logged in user."
|
|
82
|
+
),
|
|
83
|
+
title: z.string().optional().describe("Title of the review. Optional. Default: null."),
|
|
84
|
+
templateName: z.string().optional().describe(
|
|
85
|
+
"Review template name. Optional. Default: system default template."
|
|
86
|
+
),
|
|
87
|
+
accessPolicy: z.string().optional().describe(
|
|
88
|
+
"Access policy for the review. Optional. Default: ANYONE."
|
|
89
|
+
)
|
|
90
|
+
})
|
|
91
|
+
},
|
|
92
|
+
async (args, _extra) => {
|
|
93
|
+
const commandArgs = {};
|
|
94
|
+
if (args.creator !== void 0) commandArgs.creator = args.creator;
|
|
95
|
+
if (args.title !== void 0) commandArgs.title = args.title;
|
|
96
|
+
if (args.templateName !== void 0)
|
|
97
|
+
commandArgs.templateName = args.templateName;
|
|
98
|
+
if (args.accessPolicy !== void 0)
|
|
99
|
+
commandArgs.accessPolicy = args.accessPolicy;
|
|
100
|
+
const commands = [
|
|
101
|
+
{
|
|
102
|
+
command: "ReviewService.createReview",
|
|
103
|
+
args: commandArgs
|
|
104
|
+
}
|
|
105
|
+
];
|
|
106
|
+
const result = await this.call(commands);
|
|
107
|
+
return {
|
|
108
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
register(
|
|
113
|
+
{
|
|
114
|
+
title: "Reject Collaborator Review",
|
|
115
|
+
summary: "Rejects a review in Collaborator by its review ID and reason.",
|
|
116
|
+
inputSchema: z.object({
|
|
117
|
+
reviewId: z.union([z.string(), z.number()]).describe("The Collaborator review ID to reject."),
|
|
118
|
+
reason: z.string().describe("Reason for rejecting the review.")
|
|
119
|
+
})
|
|
120
|
+
},
|
|
121
|
+
async (args, _extra) => {
|
|
122
|
+
const { reviewId, reason } = args;
|
|
123
|
+
const commands = [
|
|
124
|
+
{
|
|
125
|
+
command: "ReviewService.reject",
|
|
126
|
+
args: {
|
|
127
|
+
reviewId,
|
|
128
|
+
reason
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
];
|
|
132
|
+
const result = await this.call(commands);
|
|
133
|
+
return {
|
|
134
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
register(
|
|
139
|
+
{
|
|
140
|
+
title: "ReviewService Action",
|
|
141
|
+
summary: "Invoke any ReviewService method by name and arguments. For finishReviewPhase and waitOnPhase, provide reviewId (required) and until (optional, defaults to 'ANY').",
|
|
142
|
+
inputSchema: z.object({
|
|
143
|
+
action: z.enum([
|
|
144
|
+
"moveReviewToAnnotatePhase",
|
|
145
|
+
"cancel",
|
|
146
|
+
"reopen",
|
|
147
|
+
"uncancel"
|
|
148
|
+
]),
|
|
149
|
+
args: z.record(z.string(), z.any())
|
|
150
|
+
})
|
|
151
|
+
},
|
|
152
|
+
async (params, _extra) => {
|
|
153
|
+
const { action, args } = params;
|
|
154
|
+
const commands = [{ command: `ReviewService.${action}`, args }];
|
|
155
|
+
const result = await this.call(commands);
|
|
156
|
+
return {
|
|
157
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
register(
|
|
162
|
+
{
|
|
163
|
+
title: "Get Collaborator Reviews",
|
|
164
|
+
summary: "Retrieves reviews from Collaborator using ReviewService.getReviews. All parameters are optional and only provided ones are sent.",
|
|
165
|
+
inputSchema: z.object({
|
|
166
|
+
login: z.string().optional().describe("Collaborator username to filter reviews."),
|
|
167
|
+
role: z.string().optional().describe("Role to filter reviews (e.g., AUTHOR)."),
|
|
168
|
+
creator: z.boolean().optional().describe("Whether to filter by creator."),
|
|
169
|
+
reviewPhase: z.string().optional().describe("Review phase to filter (e.g., PLANNING)."),
|
|
170
|
+
fullInfo: z.boolean().optional().describe("Whether to retrieve full review info."),
|
|
171
|
+
fromDate: z.string().optional().describe('Minimal creation date in format "yyyy-MM-dd"'),
|
|
172
|
+
toDate: z.string().optional().describe('Maximal creation date in format "yyyy-MM-dd"')
|
|
173
|
+
})
|
|
174
|
+
},
|
|
175
|
+
async (args, _extra) => {
|
|
176
|
+
const reviewArgs = {};
|
|
177
|
+
if (args.login !== void 0) reviewArgs.login = args.login;
|
|
178
|
+
if (args.role !== void 0) reviewArgs.role = args.role;
|
|
179
|
+
if (args.creator !== void 0) reviewArgs.creator = args.creator;
|
|
180
|
+
if (args.reviewPhase !== void 0)
|
|
181
|
+
reviewArgs.reviewPhase = args.reviewPhase;
|
|
182
|
+
if (args.fullInfo !== void 0) reviewArgs.fullInfo = args.fullInfo;
|
|
183
|
+
if (args.fromDate !== void 0) reviewArgs.fromDate = args.fromDate;
|
|
184
|
+
if (args.toDate !== void 0) reviewArgs.toDate = args.toDate;
|
|
185
|
+
const commands = [
|
|
186
|
+
{
|
|
187
|
+
command: "ReviewService.getReviews",
|
|
188
|
+
args: reviewArgs
|
|
189
|
+
}
|
|
190
|
+
];
|
|
191
|
+
const result = await this.call(commands);
|
|
192
|
+
return {
|
|
193
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
register(
|
|
198
|
+
{
|
|
199
|
+
title: "Create Collaborator Remote System Configuration",
|
|
200
|
+
summary: "Creates a remote system configuration in Collaborator (e.g., Bitbucket, GitHub, etc).",
|
|
201
|
+
inputSchema: z.object({
|
|
202
|
+
token: z.string().describe("Remote system token, e.g., BITBUCKET, GITHUB, etc."),
|
|
203
|
+
title: z.string().describe("Remote system title."),
|
|
204
|
+
config: z.string().describe(
|
|
205
|
+
"JSON string containing configuration parameters for the remote system."
|
|
206
|
+
),
|
|
207
|
+
reviewTemplateId: z.string().optional().describe(
|
|
208
|
+
"Optional review template ID used by this remote system."
|
|
209
|
+
)
|
|
210
|
+
})
|
|
211
|
+
},
|
|
212
|
+
async (args, _extra) => {
|
|
213
|
+
const { token, title, config, reviewTemplateId } = args;
|
|
214
|
+
const commandArgs = { token, title, config };
|
|
215
|
+
if (reviewTemplateId) commandArgs.reviewTemplateId = reviewTemplateId;
|
|
216
|
+
const commands = [
|
|
217
|
+
{
|
|
218
|
+
command: "AdminRemoteSystemService.createIntegration",
|
|
219
|
+
args: commandArgs
|
|
220
|
+
}
|
|
221
|
+
];
|
|
222
|
+
const result = await this.call(commands);
|
|
223
|
+
return {
|
|
224
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
register(
|
|
229
|
+
{
|
|
230
|
+
title: "Edit Collaborator Remote System Configuration",
|
|
231
|
+
summary: "Edits parameters of an existing remote system configuration in Collaborator. Only title and config are editable after creation.",
|
|
232
|
+
inputSchema: z.object({
|
|
233
|
+
id: z.string().describe("ID of the remote system Configuration to edit."),
|
|
234
|
+
title: z.string().optional().describe("Remote system title."),
|
|
235
|
+
config: z.string().optional().describe(
|
|
236
|
+
"JSON string containing configuration parameters for the remote system."
|
|
237
|
+
),
|
|
238
|
+
reviewTemplateId: z.string().optional().describe(
|
|
239
|
+
"Optional review template ID used by this remote system."
|
|
240
|
+
)
|
|
241
|
+
})
|
|
242
|
+
},
|
|
243
|
+
async (args, _extra) => {
|
|
244
|
+
const { id, title, config, reviewTemplateId } = args;
|
|
245
|
+
const commandArgs = { id };
|
|
246
|
+
if (title) commandArgs.title = title;
|
|
247
|
+
if (config) commandArgs.config = config;
|
|
248
|
+
if (reviewTemplateId) commandArgs.reviewTemplateId = reviewTemplateId;
|
|
249
|
+
const commands = [
|
|
250
|
+
{
|
|
251
|
+
command: "AdminRemoteSystemService.editIntegration",
|
|
252
|
+
args: commandArgs
|
|
253
|
+
}
|
|
254
|
+
];
|
|
255
|
+
const result = await this.call(commands);
|
|
256
|
+
return {
|
|
257
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
register(
|
|
262
|
+
{
|
|
263
|
+
title: "Delete Collaborator Remote System Configuration",
|
|
264
|
+
summary: "Deletes a remote system configuration in Collaborator by its ID.",
|
|
265
|
+
inputSchema: z.object({
|
|
266
|
+
id: z.union([z.string(), z.number()]).describe("ID of the remote system Configuration to delete.")
|
|
267
|
+
})
|
|
268
|
+
},
|
|
269
|
+
async (args, _extra) => {
|
|
270
|
+
const commandArgs = {};
|
|
271
|
+
if (args.id !== void 0)
|
|
272
|
+
commandArgs.id = typeof args.id === "string" && !Number.isNaN(Number(args.id)) ? Number(args.id) : args.id;
|
|
273
|
+
const commands = [
|
|
274
|
+
{
|
|
275
|
+
command: "AdminRemoteSystemService.deleteIntegration",
|
|
276
|
+
args: commandArgs
|
|
277
|
+
}
|
|
278
|
+
];
|
|
279
|
+
const result = await this.call(commands);
|
|
280
|
+
return {
|
|
281
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
register(
|
|
286
|
+
{
|
|
287
|
+
title: "Update Collaborator Remote System Configuration Webhook",
|
|
288
|
+
summary: "Updates the webhook for a remote system configuration in Collaborator by its ID.",
|
|
289
|
+
inputSchema: z.object({
|
|
290
|
+
id: z.union([z.string(), z.number()]).describe(
|
|
291
|
+
"ID of the remote system Configuration to update the webhook for."
|
|
292
|
+
)
|
|
293
|
+
})
|
|
294
|
+
},
|
|
295
|
+
async (args, _extra) => {
|
|
296
|
+
const commandArgs = {};
|
|
297
|
+
if (args.id !== void 0)
|
|
298
|
+
commandArgs.id = typeof args.id === "string" && !Number.isNaN(Number(args.id)) ? Number(args.id) : args.id;
|
|
299
|
+
const commands = [
|
|
300
|
+
{
|
|
301
|
+
command: "AdminRemoteSystemService.updateWebhook",
|
|
302
|
+
args: commandArgs
|
|
303
|
+
}
|
|
304
|
+
];
|
|
305
|
+
const result = await this.call(commands);
|
|
306
|
+
return {
|
|
307
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
register(
|
|
312
|
+
{
|
|
313
|
+
title: "Test Collaborator Remote System Configuration Connection",
|
|
314
|
+
summary: "Tests the connection for a remote system configuration in Collaborator by its ID.",
|
|
315
|
+
inputSchema: z.object({
|
|
316
|
+
id: z.union([z.string(), z.number()]).describe(
|
|
317
|
+
"ID of the remote system Configuration to test connection for."
|
|
318
|
+
)
|
|
319
|
+
})
|
|
320
|
+
},
|
|
321
|
+
async (args, _extra) => {
|
|
322
|
+
const commandArgs = {};
|
|
323
|
+
if (args.id !== void 0)
|
|
324
|
+
commandArgs.id = typeof args.id === "string" && !Number.isNaN(Number(args.id)) ? Number(args.id) : args.id;
|
|
325
|
+
const commands = [
|
|
326
|
+
{
|
|
327
|
+
command: "AdminRemoteSystemService.testConnection",
|
|
328
|
+
args: commandArgs
|
|
329
|
+
}
|
|
330
|
+
];
|
|
331
|
+
const result = await this.call(commands);
|
|
332
|
+
return {
|
|
333
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
}
|
|
377
338
|
}
|
|
339
|
+
export {
|
|
340
|
+
CollaboratorClient
|
|
341
|
+
};
|