@zereight/mcp-gitlab 1.0.70 → 1.0.72
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/build/index.js +2 -2
- package/build/schemas.js +153 -161
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -29,7 +29,6 @@ GitLabDiscussionNoteSchema, // Added
|
|
|
29
29
|
GitLabDiscussionSchema, PaginatedDiscussionsResponseSchema, UpdateMergeRequestNoteSchema, // Added
|
|
30
30
|
CreateMergeRequestNoteSchema, // Added
|
|
31
31
|
ListMergeRequestDiscussionsSchema, UpdateIssueNoteSchema, CreateIssueNoteSchema, ListMergeRequestsSchema, GitLabMilestonesSchema, ListProjectMilestonesSchema, GetProjectMilestoneSchema, CreateProjectMilestoneSchema, EditProjectMilestoneSchema, DeleteProjectMilestoneSchema, GetMilestoneIssuesSchema, GetMilestoneMergeRequestsSchema, PromoteProjectMilestoneSchema, GetMilestoneBurndownEventsSchema, GitLabCompareResultSchema, GetBranchDiffsSchema, ListCommitsSchema, GetCommitSchema, GetCommitDiffSchema, ListMergeRequestDiffsSchema, } from "./schemas.js";
|
|
32
|
-
import { formatBoolean } from "./utils.js";
|
|
33
32
|
import { randomUUID } from "crypto";
|
|
34
33
|
import { pino } from 'pino';
|
|
35
34
|
const logger = pino({
|
|
@@ -39,6 +38,7 @@ const logger = pino({
|
|
|
39
38
|
options: {
|
|
40
39
|
colorize: true,
|
|
41
40
|
levelFirst: true,
|
|
41
|
+
destination: 2,
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
});
|
|
@@ -1058,7 +1058,7 @@ async function createMergeRequest(projectId, options) {
|
|
|
1058
1058
|
labels: options.labels?.join(","),
|
|
1059
1059
|
allow_collaboration: options.allow_collaboration,
|
|
1060
1060
|
draft: options.draft,
|
|
1061
|
-
remove_source_branch:
|
|
1061
|
+
remove_source_branch: options.remove_source_branch,
|
|
1062
1062
|
squash: options.squash,
|
|
1063
1063
|
}),
|
|
1064
1064
|
});
|
package/build/schemas.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
const flexibleBoolean = z.preprocess((val) => {
|
|
3
|
+
if (typeof val === 'string') {
|
|
4
|
+
return val.toLowerCase() === 'true';
|
|
5
|
+
}
|
|
6
|
+
return val;
|
|
7
|
+
}, z.boolean());
|
|
2
8
|
// Base schemas for common types
|
|
3
9
|
export const GitLabAuthorSchema = z.object({
|
|
4
10
|
name: z.string(),
|
|
@@ -7,8 +13,8 @@ export const GitLabAuthorSchema = z.object({
|
|
|
7
13
|
});
|
|
8
14
|
// Pipeline related schemas
|
|
9
15
|
export const GitLabPipelineSchema = z.object({
|
|
10
|
-
id: z.number(),
|
|
11
|
-
project_id: z.number(),
|
|
16
|
+
id: z.string().or(z.number()),
|
|
17
|
+
project_id: z.string().or(z.number()),
|
|
12
18
|
sha: z.string(),
|
|
13
19
|
ref: z.string(),
|
|
14
20
|
status: z.string(),
|
|
@@ -22,7 +28,7 @@ export const GitLabPipelineSchema = z.object({
|
|
|
22
28
|
coverage: z.number().nullable().optional(),
|
|
23
29
|
user: z
|
|
24
30
|
.object({
|
|
25
|
-
id: z.number(),
|
|
31
|
+
id: z.string().or(z.number()),
|
|
26
32
|
name: z.string(),
|
|
27
33
|
username: z.string(),
|
|
28
34
|
avatar_url: z.string().nullable().optional(),
|
|
@@ -35,7 +41,7 @@ export const GitLabPipelineSchema = z.object({
|
|
|
35
41
|
label: z.string().optional(),
|
|
36
42
|
group: z.string().optional(),
|
|
37
43
|
tooltip: z.string().optional(),
|
|
38
|
-
has_details:
|
|
44
|
+
has_details: flexibleBoolean.optional(),
|
|
39
45
|
details_path: z.string().optional(),
|
|
40
46
|
illustration: z
|
|
41
47
|
.object({
|
|
@@ -51,12 +57,12 @@ export const GitLabPipelineSchema = z.object({
|
|
|
51
57
|
});
|
|
52
58
|
// Pipeline job related schemas
|
|
53
59
|
export const GitLabPipelineJobSchema = z.object({
|
|
54
|
-
id: z.number(),
|
|
60
|
+
id: z.string().or(z.number()),
|
|
55
61
|
status: z.string(),
|
|
56
62
|
stage: z.string(),
|
|
57
63
|
name: z.string(),
|
|
58
64
|
ref: z.string(),
|
|
59
|
-
tag:
|
|
65
|
+
tag: flexibleBoolean,
|
|
60
66
|
coverage: z.number().nullable().optional(),
|
|
61
67
|
created_at: z.string(),
|
|
62
68
|
started_at: z.string().nullable().optional(),
|
|
@@ -64,7 +70,7 @@ export const GitLabPipelineJobSchema = z.object({
|
|
|
64
70
|
duration: z.number().nullable().optional(),
|
|
65
71
|
user: z
|
|
66
72
|
.object({
|
|
67
|
-
id: z.number(),
|
|
73
|
+
id: z.string().or(z.number()),
|
|
68
74
|
name: z.string(),
|
|
69
75
|
username: z.string(),
|
|
70
76
|
avatar_url: z.string().nullable().optional(),
|
|
@@ -81,8 +87,8 @@ export const GitLabPipelineJobSchema = z.object({
|
|
|
81
87
|
.optional(),
|
|
82
88
|
pipeline: z
|
|
83
89
|
.object({
|
|
84
|
-
id: z.number(),
|
|
85
|
-
project_id: z.number(),
|
|
90
|
+
id: z.string().or(z.number()),
|
|
91
|
+
project_id: z.string().or(z.number()),
|
|
86
92
|
status: z.string(),
|
|
87
93
|
ref: z.string(),
|
|
88
94
|
sha: z.string(),
|
|
@@ -121,7 +127,7 @@ export const ListPipelinesSchema = z.object({
|
|
|
121
127
|
.describe("The status of pipelines"),
|
|
122
128
|
ref: z.string().optional().describe("The ref of pipelines"),
|
|
123
129
|
sha: z.string().optional().describe("The SHA of pipelines"),
|
|
124
|
-
yaml_errors:
|
|
130
|
+
yaml_errors: flexibleBoolean.optional().describe("Returns pipelines with invalid configurations"),
|
|
125
131
|
username: z.string().optional().describe("The username of the user who triggered pipelines"),
|
|
126
132
|
updated_after: z
|
|
127
133
|
.string()
|
|
@@ -140,17 +146,17 @@ export const ListPipelinesSchema = z.object({
|
|
|
140
146
|
// Schema for getting a specific pipeline
|
|
141
147
|
export const GetPipelineSchema = z.object({
|
|
142
148
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
143
|
-
pipeline_id: z.number().describe("The ID of the pipeline"),
|
|
149
|
+
pipeline_id: z.string().or(z.number().describe("The ID of the pipeline")),
|
|
144
150
|
});
|
|
145
151
|
// Schema for listing jobs in a pipeline
|
|
146
152
|
export const ListPipelineJobsSchema = z.object({
|
|
147
153
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
148
|
-
pipeline_id: z.number().describe("The ID of the pipeline"),
|
|
154
|
+
pipeline_id: z.string().or(z.number().describe("The ID of the pipeline")),
|
|
149
155
|
scope: z
|
|
150
156
|
.enum(["created", "pending", "running", "failed", "success", "canceled", "skipped", "manual"])
|
|
151
157
|
.optional()
|
|
152
158
|
.describe("The scope of jobs to show"),
|
|
153
|
-
include_retried:
|
|
159
|
+
include_retried: flexibleBoolean.optional().describe("Whether to include retried jobs"),
|
|
154
160
|
}).merge(PaginationOptionsSchema);
|
|
155
161
|
// Schema for creating a new pipeline
|
|
156
162
|
export const CreatePipelineSchema = z.object({
|
|
@@ -167,24 +173,24 @@ export const CreatePipelineSchema = z.object({
|
|
|
167
173
|
// Schema for retrying a pipeline
|
|
168
174
|
export const RetryPipelineSchema = z.object({
|
|
169
175
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
170
|
-
pipeline_id: z.number().describe("The ID of the pipeline to retry"),
|
|
176
|
+
pipeline_id: z.string().or(z.number().describe("The ID of the pipeline to retry")),
|
|
171
177
|
});
|
|
172
178
|
// Schema for canceling a pipeline
|
|
173
179
|
export const CancelPipelineSchema = z.object({
|
|
174
180
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
175
|
-
pipeline_id: z.number().describe("The ID of the pipeline to cancel"),
|
|
181
|
+
pipeline_id: z.string().or(z.number().describe("The ID of the pipeline to cancel")),
|
|
176
182
|
});
|
|
177
183
|
// Schema for the input parameters for pipeline job operations
|
|
178
184
|
export const GetPipelineJobOutputSchema = z.object({
|
|
179
185
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
180
|
-
job_id: z.number().describe("The ID of the job"),
|
|
186
|
+
job_id: z.string().or(z.number().describe("The ID of the job")),
|
|
181
187
|
limit: z.number().optional().describe("Maximum number of lines to return from the end of the log (default: 1000)"),
|
|
182
188
|
offset: z.number().optional().describe("Number of lines to skip from the end of the log (default: 0)"),
|
|
183
189
|
});
|
|
184
190
|
// User schemas
|
|
185
191
|
export const GitLabUserSchema = z.object({
|
|
186
192
|
username: z.string(), // Changed from login to match GitLab API
|
|
187
|
-
id: z.number(),
|
|
193
|
+
id: z.string().or(z.number()),
|
|
188
194
|
name: z.string(),
|
|
189
195
|
avatar_url: z.string().nullable(),
|
|
190
196
|
web_url: z.string(), // Changed from html_url to match GitLab API
|
|
@@ -193,7 +199,7 @@ export const GetUsersSchema = z.object({
|
|
|
193
199
|
usernames: z.array(z.string()).describe("Array of usernames to search for"),
|
|
194
200
|
});
|
|
195
201
|
export const GitLabUsersResponseSchema = z.record(z.string(), z.object({
|
|
196
|
-
id: z.number(),
|
|
202
|
+
id: z.string().or(z.number()),
|
|
197
203
|
username: z.string(),
|
|
198
204
|
name: z.string(),
|
|
199
205
|
avatar_url: z.string().nullable(),
|
|
@@ -205,12 +211,12 @@ const ProjectParamsSchema = z.object({
|
|
|
205
211
|
project_id: z.string().describe("Project ID or complete URL-encoded path to project"), // Changed from owner/repo to match GitLab API
|
|
206
212
|
});
|
|
207
213
|
export const GitLabNamespaceSchema = z.object({
|
|
208
|
-
id: z.number(),
|
|
214
|
+
id: z.string().or(z.number()),
|
|
209
215
|
name: z.string(),
|
|
210
216
|
path: z.string(),
|
|
211
217
|
kind: z.enum(["user", "group"]),
|
|
212
218
|
full_path: z.string(),
|
|
213
|
-
parent_id: z.number().nullable(),
|
|
219
|
+
parent_id: z.string().or(z.number().nullable()),
|
|
214
220
|
avatar_url: z.string().nullable(),
|
|
215
221
|
web_url: z.string(),
|
|
216
222
|
members_count_with_descendants: z.number().optional(),
|
|
@@ -220,32 +226,32 @@ export const GitLabNamespaceSchema = z.object({
|
|
|
220
226
|
plan: z.string().optional(),
|
|
221
227
|
end_date: z.string().nullable().optional(),
|
|
222
228
|
trial_ends_on: z.string().nullable().optional(),
|
|
223
|
-
trial:
|
|
229
|
+
trial: flexibleBoolean.optional(),
|
|
224
230
|
root_repository_size: z.number().optional(),
|
|
225
231
|
projects_count: z.number().optional(),
|
|
226
232
|
});
|
|
227
233
|
export const GitLabNamespaceExistsResponseSchema = z.object({
|
|
228
|
-
exists:
|
|
234
|
+
exists: flexibleBoolean,
|
|
229
235
|
suggests: z.array(z.string()).optional(),
|
|
230
236
|
});
|
|
231
237
|
// Repository related schemas
|
|
232
238
|
export const GitLabOwnerSchema = z.object({
|
|
233
239
|
username: z.string(), // Changed from login to match GitLab API
|
|
234
|
-
id: z.number(),
|
|
240
|
+
id: z.string().or(z.number()),
|
|
235
241
|
avatar_url: z.string().nullable(),
|
|
236
242
|
web_url: z.string(), // Changed from html_url to match GitLab API
|
|
237
243
|
name: z.string(), // Added as GitLab includes full name
|
|
238
244
|
state: z.string(), // Added as GitLab includes user state
|
|
239
245
|
});
|
|
240
246
|
export const GitLabRepositorySchema = z.object({
|
|
241
|
-
id: z.number(),
|
|
247
|
+
id: z.string().or(z.number()),
|
|
242
248
|
name: z.string(),
|
|
243
249
|
path_with_namespace: z.string(),
|
|
244
250
|
visibility: z.string().optional(),
|
|
245
251
|
owner: GitLabOwnerSchema.optional(),
|
|
246
252
|
web_url: z.string().optional(),
|
|
247
253
|
description: z.string().nullable(),
|
|
248
|
-
fork:
|
|
254
|
+
fork: flexibleBoolean.optional(),
|
|
249
255
|
ssh_url_to_repo: z.string().optional(),
|
|
250
256
|
http_url_to_repo: z.string().optional(),
|
|
251
257
|
created_at: z.string().optional(),
|
|
@@ -253,7 +259,7 @@ export const GitLabRepositorySchema = z.object({
|
|
|
253
259
|
default_branch: z.string().optional(),
|
|
254
260
|
namespace: z
|
|
255
261
|
.object({
|
|
256
|
-
id: z.number(),
|
|
262
|
+
id: z.string().or(z.number()),
|
|
257
263
|
name: z.string(),
|
|
258
264
|
path: z.string(),
|
|
259
265
|
kind: z.string(),
|
|
@@ -266,7 +272,7 @@ export const GitLabRepositorySchema = z.object({
|
|
|
266
272
|
topics: z.array(z.string()).optional(),
|
|
267
273
|
tag_list: z.array(z.string()).optional(), // deprecated but still present
|
|
268
274
|
open_issues_count: z.number().optional(),
|
|
269
|
-
archived:
|
|
275
|
+
archived: flexibleBoolean.optional(),
|
|
270
276
|
forks_count: z.number().optional(),
|
|
271
277
|
star_count: z.number().optional(),
|
|
272
278
|
permissions: z
|
|
@@ -287,20 +293,20 @@ export const GitLabRepositorySchema = z.object({
|
|
|
287
293
|
.nullable(),
|
|
288
294
|
})
|
|
289
295
|
.optional(),
|
|
290
|
-
container_registry_enabled:
|
|
296
|
+
container_registry_enabled: flexibleBoolean.optional(),
|
|
291
297
|
container_registry_access_level: z.string().optional(),
|
|
292
|
-
issues_enabled:
|
|
293
|
-
merge_requests_enabled:
|
|
298
|
+
issues_enabled: flexibleBoolean.optional(),
|
|
299
|
+
merge_requests_enabled: flexibleBoolean.optional(),
|
|
294
300
|
merge_requests_template: z.string().nullable().optional(),
|
|
295
|
-
wiki_enabled:
|
|
296
|
-
jobs_enabled:
|
|
297
|
-
snippets_enabled:
|
|
298
|
-
can_create_merge_request_in:
|
|
299
|
-
resolve_outdated_diff_discussions:
|
|
300
|
-
shared_runners_enabled:
|
|
301
|
+
wiki_enabled: flexibleBoolean.optional(),
|
|
302
|
+
jobs_enabled: flexibleBoolean.optional(),
|
|
303
|
+
snippets_enabled: flexibleBoolean.optional(),
|
|
304
|
+
can_create_merge_request_in: flexibleBoolean.optional(),
|
|
305
|
+
resolve_outdated_diff_discussions: flexibleBoolean.nullable().optional(),
|
|
306
|
+
shared_runners_enabled: flexibleBoolean.optional(),
|
|
301
307
|
shared_with_groups: z
|
|
302
308
|
.array(z.object({
|
|
303
|
-
group_id: z.number(),
|
|
309
|
+
group_id: z.string().or(z.number()),
|
|
304
310
|
group_name: z.string(),
|
|
305
311
|
group_full_path: z.string(),
|
|
306
312
|
group_access_level: z.number(),
|
|
@@ -321,7 +327,7 @@ export const GitLabFileContentSchema = z.object({
|
|
|
321
327
|
blob_id: z.string(), // Added to match GitLab API
|
|
322
328
|
commit_id: z.string(), // ID of the current file version
|
|
323
329
|
last_commit_id: z.string(), // Added to match GitLab API
|
|
324
|
-
execute_filemode:
|
|
330
|
+
execute_filemode: flexibleBoolean.optional(), // Added to match GitLab API
|
|
325
331
|
});
|
|
326
332
|
export const GitLabDirectoryContentSchema = z.object({
|
|
327
333
|
name: z.string(),
|
|
@@ -355,7 +361,7 @@ export const GetRepositoryTreeSchema = z.object({
|
|
|
355
361
|
.string()
|
|
356
362
|
.optional()
|
|
357
363
|
.describe("The name of a repository branch or tag. Defaults to the default branch."),
|
|
358
|
-
recursive:
|
|
364
|
+
recursive: flexibleBoolean.optional().describe("Boolean value to get a recursive tree"),
|
|
359
365
|
per_page: z.number().optional().describe("Number of results to show per page"),
|
|
360
366
|
page_token: z.string().optional().describe("The tree record ID for pagination"),
|
|
361
367
|
pagination: z.string().optional().describe("Pagination method (keyset)"),
|
|
@@ -396,9 +402,9 @@ export const GitLabReferenceSchema = z.object({
|
|
|
396
402
|
});
|
|
397
403
|
// Milestones rest api output schemas
|
|
398
404
|
export const GitLabMilestonesSchema = z.object({
|
|
399
|
-
id: z.number(),
|
|
400
|
-
iid: z.number(),
|
|
401
|
-
project_id: z.number(),
|
|
405
|
+
id: z.string().or(z.number()),
|
|
406
|
+
iid: z.string().or(z.number()),
|
|
407
|
+
project_id: z.string().or(z.number()),
|
|
402
408
|
title: z.string(),
|
|
403
409
|
description: z.string().nullable(),
|
|
404
410
|
due_date: z.string().nullable(),
|
|
@@ -406,7 +412,7 @@ export const GitLabMilestonesSchema = z.object({
|
|
|
406
412
|
state: z.string(),
|
|
407
413
|
updated_at: z.string(),
|
|
408
414
|
created_at: z.string(),
|
|
409
|
-
expired:
|
|
415
|
+
expired: flexibleBoolean,
|
|
410
416
|
web_url: z.string().optional(),
|
|
411
417
|
});
|
|
412
418
|
// Input schemas for operations
|
|
@@ -414,42 +420,24 @@ export const CreateRepositoryOptionsSchema = z.object({
|
|
|
414
420
|
name: z.string(),
|
|
415
421
|
description: z.string().optional(),
|
|
416
422
|
visibility: z.enum(["private", "internal", "public"]).optional(), // Changed from private to match GitLab API
|
|
417
|
-
initialize_with_readme:
|
|
423
|
+
initialize_with_readme: flexibleBoolean.optional(), // Changed from auto_init to match GitLab API
|
|
418
424
|
});
|
|
419
425
|
export const CreateIssueOptionsSchema = z.object({
|
|
420
426
|
title: z.string(),
|
|
421
427
|
description: z.string().optional(), // Changed from body to match GitLab API
|
|
422
428
|
assignee_ids: z.array(z.number()).optional(), // Changed from assignees to match GitLab API
|
|
423
|
-
milestone_id: z.number().optional(), // Changed from milestone to match GitLab API
|
|
429
|
+
milestone_id: z.string().or(z.number().optional()), // Changed from milestone to match GitLab API
|
|
424
430
|
labels: z.array(z.string()).optional(),
|
|
425
431
|
});
|
|
426
|
-
export const CreateMergeRequestOptionsSchema = z.object({
|
|
427
|
-
// Changed from CreatePullRequestOptionsSchema
|
|
428
|
-
title: z.string(),
|
|
429
|
-
description: z.string().optional(), // Changed from body to match GitLab API
|
|
430
|
-
source_branch: z.string(), // Changed from head to match GitLab API
|
|
431
|
-
target_branch: z.string(), // Changed from base to match GitLab API
|
|
432
|
-
assignee_ids: z
|
|
433
|
-
.array(z.number())
|
|
434
|
-
.optional(),
|
|
435
|
-
reviewer_ids: z
|
|
436
|
-
.array(z.number())
|
|
437
|
-
.optional(),
|
|
438
|
-
labels: z.array(z.string()).optional(),
|
|
439
|
-
allow_collaboration: z.boolean().optional(), // Changed from maintainer_can_modify to match GitLab API
|
|
440
|
-
draft: z.boolean().optional(),
|
|
441
|
-
remove_source_branch: z.boolean().optional().describe("Flag indicating if a merge request should remove the source branch when merging."),
|
|
442
|
-
squash: z.boolean().optional().describe("If true, squash all commits into a single commit on merge.")
|
|
443
|
-
});
|
|
444
432
|
export const GitLabDiffSchema = z.object({
|
|
445
433
|
old_path: z.string(),
|
|
446
434
|
new_path: z.string(),
|
|
447
435
|
a_mode: z.string(),
|
|
448
436
|
b_mode: z.string(),
|
|
449
437
|
diff: z.string(),
|
|
450
|
-
new_file:
|
|
451
|
-
renamed_file:
|
|
452
|
-
deleted_file:
|
|
438
|
+
new_file: flexibleBoolean,
|
|
439
|
+
renamed_file: flexibleBoolean,
|
|
440
|
+
deleted_file: flexibleBoolean,
|
|
453
441
|
});
|
|
454
442
|
// Response schemas for operations
|
|
455
443
|
export const GitLabCreateUpdateFileResponseSchema = z.object({
|
|
@@ -480,12 +468,12 @@ export const GitLabCompareResultSchema = z.object({
|
|
|
480
468
|
}).optional(),
|
|
481
469
|
commits: z.array(GitLabCommitSchema),
|
|
482
470
|
diffs: z.array(GitLabDiffSchema),
|
|
483
|
-
compare_timeout:
|
|
484
|
-
compare_same_ref:
|
|
471
|
+
compare_timeout: flexibleBoolean.optional(),
|
|
472
|
+
compare_same_ref: flexibleBoolean.optional(),
|
|
485
473
|
});
|
|
486
474
|
// Issue related schemas
|
|
487
475
|
export const GitLabLabelSchema = z.object({
|
|
488
|
-
id: z.number(),
|
|
476
|
+
id: z.string().or(z.number()),
|
|
489
477
|
name: z.string(),
|
|
490
478
|
color: z.string(),
|
|
491
479
|
text_color: z.string(),
|
|
@@ -494,22 +482,22 @@ export const GitLabLabelSchema = z.object({
|
|
|
494
482
|
open_issues_count: z.number().optional(),
|
|
495
483
|
closed_issues_count: z.number().optional(),
|
|
496
484
|
open_merge_requests_count: z.number().optional(),
|
|
497
|
-
subscribed:
|
|
485
|
+
subscribed: flexibleBoolean.optional(),
|
|
498
486
|
priority: z.number().nullable().optional(),
|
|
499
|
-
is_project_label:
|
|
487
|
+
is_project_label: flexibleBoolean.optional(),
|
|
500
488
|
});
|
|
501
489
|
export const GitLabMilestoneSchema = z.object({
|
|
502
|
-
id: z.number(),
|
|
503
|
-
iid: z.number(), // Added to match GitLab API
|
|
490
|
+
id: z.string().or(z.number()),
|
|
491
|
+
iid: z.string().or(z.number()), // Added to match GitLab API
|
|
504
492
|
title: z.string(),
|
|
505
493
|
description: z.string().nullable().default(""),
|
|
506
494
|
state: z.string(),
|
|
507
495
|
web_url: z.string(), // Changed from html_url to match GitLab API
|
|
508
496
|
});
|
|
509
497
|
export const GitLabIssueSchema = z.object({
|
|
510
|
-
id: z.number(),
|
|
511
|
-
iid: z.number(), // Added to match GitLab API
|
|
512
|
-
project_id: z.number(), // Added to match GitLab API
|
|
498
|
+
id: z.string().or(z.number()),
|
|
499
|
+
iid: z.string().or(z.number()), // Added to match GitLab API
|
|
500
|
+
project_id: z.string().or(z.number()), // Added to match GitLab API
|
|
513
501
|
title: z.string(),
|
|
514
502
|
description: z.string().nullable().default(""), // Changed from body to match GitLab API
|
|
515
503
|
state: z.string(),
|
|
@@ -536,14 +524,14 @@ export const GitLabIssueSchema = z.object({
|
|
|
536
524
|
human_total_time_spent: z.string().nullable(),
|
|
537
525
|
})
|
|
538
526
|
.optional(),
|
|
539
|
-
confidential:
|
|
527
|
+
confidential: flexibleBoolean.optional(),
|
|
540
528
|
due_date: z.string().nullable().optional(),
|
|
541
|
-
discussion_locked:
|
|
529
|
+
discussion_locked: flexibleBoolean.nullable().optional(),
|
|
542
530
|
weight: z.number().nullable().optional(),
|
|
543
531
|
});
|
|
544
532
|
// NEW SCHEMA: For issue with link details (used in listing issue links)
|
|
545
533
|
export const GitLabIssueWithLinkDetailsSchema = GitLabIssueSchema.extend({
|
|
546
|
-
issue_link_id: z.number(),
|
|
534
|
+
issue_link_id: z.string().or(z.number()),
|
|
547
535
|
link_type: z.enum(["relates_to", "blocks", "is_blocked_by"]),
|
|
548
536
|
link_created_at: z.string(),
|
|
549
537
|
link_updated_at: z.string(),
|
|
@@ -555,7 +543,7 @@ export const GitLabForkParentSchema = z.object({
|
|
|
555
543
|
owner: z
|
|
556
544
|
.object({
|
|
557
545
|
username: z.string(), // Changed from login to match GitLab API
|
|
558
|
-
id: z.number(),
|
|
546
|
+
id: z.string().or(z.number()),
|
|
559
547
|
avatar_url: z.string().nullable(),
|
|
560
548
|
})
|
|
561
549
|
.optional(), // Made optional to handle cases where GitLab API doesn't include it
|
|
@@ -571,14 +559,14 @@ export const GitLabMergeRequestDiffRefSchema = z.object({
|
|
|
571
559
|
start_sha: z.string(),
|
|
572
560
|
});
|
|
573
561
|
export const GitLabMergeRequestSchema = z.object({
|
|
574
|
-
id: z.number(),
|
|
575
|
-
iid: z.number(),
|
|
576
|
-
project_id: z.number(),
|
|
562
|
+
id: z.string().or(z.number()),
|
|
563
|
+
iid: z.string().or(z.number()),
|
|
564
|
+
project_id: z.string().or(z.number()),
|
|
577
565
|
title: z.string(),
|
|
578
566
|
description: z.string().nullable(),
|
|
579
567
|
state: z.string(),
|
|
580
|
-
merged:
|
|
581
|
-
draft:
|
|
568
|
+
merged: flexibleBoolean.optional(),
|
|
569
|
+
draft: flexibleBoolean.optional(),
|
|
582
570
|
author: GitLabUserSchema,
|
|
583
571
|
assignees: z.array(GitLabUserSchema).optional(),
|
|
584
572
|
reviewers: z.array(GitLabUserSchema).optional(),
|
|
@@ -594,15 +582,15 @@ export const GitLabMergeRequestSchema = z.object({
|
|
|
594
582
|
detailed_merge_status: z.string().optional(),
|
|
595
583
|
merge_status: z.string().optional(),
|
|
596
584
|
merge_error: z.string().nullable().optional(),
|
|
597
|
-
work_in_progress:
|
|
598
|
-
blocking_discussions_resolved:
|
|
599
|
-
should_remove_source_branch:
|
|
600
|
-
force_remove_source_branch:
|
|
601
|
-
allow_collaboration:
|
|
602
|
-
allow_maintainer_to_push:
|
|
585
|
+
work_in_progress: flexibleBoolean.optional(),
|
|
586
|
+
blocking_discussions_resolved: flexibleBoolean.optional(),
|
|
587
|
+
should_remove_source_branch: flexibleBoolean.nullable().optional(),
|
|
588
|
+
force_remove_source_branch: flexibleBoolean.nullable().optional(),
|
|
589
|
+
allow_collaboration: flexibleBoolean.optional(),
|
|
590
|
+
allow_maintainer_to_push: flexibleBoolean.optional(),
|
|
603
591
|
changes_count: z.string().nullable().optional(),
|
|
604
|
-
merge_when_pipeline_succeeds:
|
|
605
|
-
squash:
|
|
592
|
+
merge_when_pipeline_succeeds: flexibleBoolean.optional(),
|
|
593
|
+
squash: flexibleBoolean.optional(),
|
|
606
594
|
labels: z.array(z.string()).optional(),
|
|
607
595
|
});
|
|
608
596
|
export const LineRangeSchema = z.object({
|
|
@@ -621,20 +609,20 @@ export const LineRangeSchema = z.object({
|
|
|
621
609
|
}).describe("Line range for multiline comments on GitLab merge request diffs. VALIDATION RULES: 1) line_code is critical for GitLab API success, 2) start/end must have consistent types, 3) line numbers must form valid range, 4) get line_code from GitLab diff API, never generate manually.");
|
|
622
610
|
// Discussion related schemas
|
|
623
611
|
export const GitLabDiscussionNoteSchema = z.object({
|
|
624
|
-
id: z.number(),
|
|
612
|
+
id: z.string().or(z.number()),
|
|
625
613
|
type: z.enum(["DiscussionNote", "DiffNote", "Note"]).nullable(), // Allow null type for regular notes
|
|
626
614
|
body: z.string(),
|
|
627
615
|
attachment: z.any().nullable(), // Can be string or object, handle appropriately
|
|
628
616
|
author: GitLabUserSchema,
|
|
629
617
|
created_at: z.string(),
|
|
630
618
|
updated_at: z.string(),
|
|
631
|
-
system:
|
|
632
|
-
noteable_id: z.number(),
|
|
619
|
+
system: flexibleBoolean,
|
|
620
|
+
noteable_id: z.string().or(z.number()),
|
|
633
621
|
noteable_type: z.enum(["Issue", "MergeRequest", "Snippet", "Commit", "Epic"]),
|
|
634
|
-
project_id: z.number().optional(), // Optional for group-level discussions like Epics
|
|
622
|
+
project_id: z.string().or(z.number().optional()), // Optional for group-level discussions like Epics
|
|
635
623
|
noteable_iid: z.coerce.number().nullable(),
|
|
636
|
-
resolvable:
|
|
637
|
-
resolved:
|
|
624
|
+
resolvable: flexibleBoolean.optional(),
|
|
625
|
+
resolved: flexibleBoolean.optional(),
|
|
638
626
|
resolved_by: GitLabUserSchema.nullable().optional(),
|
|
639
627
|
resolved_at: z.string().nullable().optional(),
|
|
640
628
|
position: z
|
|
@@ -673,7 +661,7 @@ export const PaginatedResponseSchema = z.object({
|
|
|
673
661
|
});
|
|
674
662
|
export const GitLabDiscussionSchema = z.object({
|
|
675
663
|
id: z.string(),
|
|
676
|
-
individual_note:
|
|
664
|
+
individual_note: flexibleBoolean,
|
|
677
665
|
notes: z.array(GitLabDiscussionNoteSchema),
|
|
678
666
|
});
|
|
679
667
|
// Create a schema for paginated discussions response
|
|
@@ -683,19 +671,19 @@ export const PaginatedDiscussionsResponseSchema = z.object({
|
|
|
683
671
|
});
|
|
684
672
|
export const ListIssueDiscussionsSchema = z.object({
|
|
685
673
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
686
|
-
issue_iid: z.number().describe("The internal ID of the project issue"),
|
|
674
|
+
issue_iid: z.string().or(z.number().describe("The internal ID of the project issue")),
|
|
687
675
|
}).merge(PaginationOptionsSchema);
|
|
688
676
|
// Input schema for listing merge request discussions
|
|
689
677
|
export const ListMergeRequestDiscussionsSchema = ProjectParamsSchema.extend({
|
|
690
|
-
merge_request_iid: z.number().describe("The IID of a merge request"),
|
|
678
|
+
merge_request_iid: z.string().or(z.number().describe("The IID of a merge request")),
|
|
691
679
|
}).merge(PaginationOptionsSchema);
|
|
692
680
|
// Input schema for updating a merge request discussion note
|
|
693
681
|
export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({
|
|
694
|
-
merge_request_iid: z.number().describe("The IID of a merge request"),
|
|
682
|
+
merge_request_iid: z.string().or(z.number().describe("The IID of a merge request")),
|
|
695
683
|
discussion_id: z.string().describe("The ID of a thread"),
|
|
696
|
-
note_id: z.number().describe("The ID of a thread note"),
|
|
684
|
+
note_id: z.string().or(z.number().describe("The ID of a thread note")),
|
|
697
685
|
body: z.string().optional().describe("The content of the note or reply"),
|
|
698
|
-
resolved:
|
|
686
|
+
resolved: flexibleBoolean.optional().describe("Resolve or unresolve the note"),
|
|
699
687
|
})
|
|
700
688
|
.refine(data => data.body !== undefined || data.resolved !== undefined, {
|
|
701
689
|
message: "At least one of 'body' or 'resolved' must be provided",
|
|
@@ -705,21 +693,21 @@ export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({
|
|
|
705
693
|
});
|
|
706
694
|
// Input schema for adding a note to an existing merge request discussion
|
|
707
695
|
export const CreateMergeRequestNoteSchema = ProjectParamsSchema.extend({
|
|
708
|
-
merge_request_iid: z.number().describe("The IID of a merge request"),
|
|
696
|
+
merge_request_iid: z.string().or(z.number().describe("The IID of a merge request")),
|
|
709
697
|
discussion_id: z.string().describe("The ID of a thread"),
|
|
710
698
|
body: z.string().describe("The content of the note or reply"),
|
|
711
699
|
created_at: z.string().optional().describe("Date the note was created at (ISO 8601 format)"),
|
|
712
700
|
});
|
|
713
701
|
// Input schema for updating an issue discussion note
|
|
714
702
|
export const UpdateIssueNoteSchema = ProjectParamsSchema.extend({
|
|
715
|
-
issue_iid: z.number().describe("The IID of an issue"),
|
|
703
|
+
issue_iid: z.string().or(z.number().describe("The IID of an issue")),
|
|
716
704
|
discussion_id: z.string().describe("The ID of a thread"),
|
|
717
|
-
note_id: z.number().describe("The ID of a thread note"),
|
|
705
|
+
note_id: z.string().or(z.number().describe("The ID of a thread note")),
|
|
718
706
|
body: z.string().describe("The content of the note or reply"),
|
|
719
707
|
});
|
|
720
708
|
// Input schema for adding a note to an existing issue discussion
|
|
721
709
|
export const CreateIssueNoteSchema = ProjectParamsSchema.extend({
|
|
722
|
-
issue_iid: z.number().describe("The IID of an issue"),
|
|
710
|
+
issue_iid: z.string().or(z.number().describe("The IID of an issue")),
|
|
723
711
|
discussion_id: z.string().describe("The ID of a thread"),
|
|
724
712
|
body: z.string().describe("The content of the note or reply"),
|
|
725
713
|
created_at: z.string().optional().describe("Date the note was created at (ISO 8601 format)"),
|
|
@@ -744,7 +732,7 @@ export const CreateRepositorySchema = z.object({
|
|
|
744
732
|
.enum(["private", "internal", "public"])
|
|
745
733
|
.optional()
|
|
746
734
|
.describe("Repository visibility level"),
|
|
747
|
-
initialize_with_readme:
|
|
735
|
+
initialize_with_readme: flexibleBoolean.optional().describe("Initialize with README.md"),
|
|
748
736
|
});
|
|
749
737
|
export const GetFileContentsSchema = ProjectParamsSchema.extend({
|
|
750
738
|
file_path: z.string().describe("Path to the file or directory"),
|
|
@@ -765,9 +753,9 @@ export const CreateIssueSchema = ProjectParamsSchema.extend({
|
|
|
765
753
|
description: z.string().optional().describe("Issue description"),
|
|
766
754
|
assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign"),
|
|
767
755
|
labels: z.array(z.string()).optional().describe("Array of label names"),
|
|
768
|
-
milestone_id: z.number().optional().describe("Milestone ID to assign"),
|
|
756
|
+
milestone_id: z.string().or(z.number().optional().describe("Milestone ID to assign")),
|
|
769
757
|
});
|
|
770
|
-
|
|
758
|
+
const MergeRequestOptionsSchema = {
|
|
771
759
|
title: z.string().describe("Merge request title"),
|
|
772
760
|
description: z.string().optional().describe("Merge request description"),
|
|
773
761
|
source_branch: z.string().describe("Branch containing changes"),
|
|
@@ -781,12 +769,16 @@ export const CreateMergeRequestSchema = ProjectParamsSchema.extend({
|
|
|
781
769
|
.optional()
|
|
782
770
|
.describe("The ID of the users to assign as reviewers of the MR"),
|
|
783
771
|
labels: z.array(z.string()).optional().describe("Labels for the MR"),
|
|
784
|
-
draft:
|
|
772
|
+
draft: flexibleBoolean.optional().describe("Create as draft merge request"),
|
|
785
773
|
allow_collaboration: z
|
|
786
774
|
.boolean()
|
|
787
775
|
.optional()
|
|
788
776
|
.describe("Allow commits from upstream members"),
|
|
789
|
-
|
|
777
|
+
remove_source_branch: flexibleBoolean.optional().nullable().describe("Flag indicating if a merge request should remove the source branch when merging."),
|
|
778
|
+
squash: flexibleBoolean.optional().nullable().describe("If true, squash all commits into a single commit on merge."),
|
|
779
|
+
};
|
|
780
|
+
export const CreateMergeRequestOptionsSchema = z.object(MergeRequestOptionsSchema);
|
|
781
|
+
export const CreateMergeRequestSchema = ProjectParamsSchema.extend(MergeRequestOptionsSchema);
|
|
790
782
|
export const ForkRepositorySchema = ProjectParamsSchema.extend({
|
|
791
783
|
namespace: z.string().optional().describe("Namespace to fork to (full path)"),
|
|
792
784
|
});
|
|
@@ -798,11 +790,11 @@ export const CreateBranchSchema = ProjectParamsSchema.extend({
|
|
|
798
790
|
export const GetBranchDiffsSchema = ProjectParamsSchema.extend({
|
|
799
791
|
from: z.string().describe("The base branch or commit SHA to compare from"),
|
|
800
792
|
to: z.string().describe("The target branch or commit SHA to compare to"),
|
|
801
|
-
straight:
|
|
793
|
+
straight: flexibleBoolean.optional().describe("Comparison method: false for '...' (default), true for '--'"),
|
|
802
794
|
excluded_file_patterns: z.array(z.string()).optional().describe("Array of regex patterns to exclude files from the diff results. Each pattern is a JavaScript-compatible regular expression that matches file paths to ignore. Examples: [\"^test/mocks/\", \"\\.spec\\.ts$\", \"package-lock\\.json\"]"),
|
|
803
795
|
});
|
|
804
796
|
export const GetMergeRequestSchema = ProjectParamsSchema.extend({
|
|
805
|
-
merge_request_iid: z.number().optional().describe("The IID of a merge request"),
|
|
797
|
+
merge_request_iid: z.string().or(z.number().optional().describe("The IID of a merge request")),
|
|
806
798
|
source_branch: z.string().optional().describe("Source branch name"),
|
|
807
799
|
});
|
|
808
800
|
export const UpdateMergeRequestSchema = GetMergeRequestSchema.extend({
|
|
@@ -826,8 +818,8 @@ export const UpdateMergeRequestSchema = GetMergeRequestSchema.extend({
|
|
|
826
818
|
.boolean()
|
|
827
819
|
.optional()
|
|
828
820
|
.describe("Flag indicating if the source branch should be removed"),
|
|
829
|
-
squash:
|
|
830
|
-
draft:
|
|
821
|
+
squash: flexibleBoolean.optional().describe("Squash commits into a single commit when merging"),
|
|
822
|
+
draft: flexibleBoolean.optional().describe("Work in progress merge request"),
|
|
831
823
|
});
|
|
832
824
|
export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
|
|
833
825
|
view: z.enum(["inline", "parallel"]).optional().describe("Diff view type"),
|
|
@@ -835,7 +827,7 @@ export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
|
|
|
835
827
|
export const ListMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
|
|
836
828
|
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
|
837
829
|
per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
|
|
838
|
-
unidiff:
|
|
830
|
+
unidiff: flexibleBoolean.optional().describe("Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5."),
|
|
839
831
|
});
|
|
840
832
|
export const CreateNoteSchema = z.object({
|
|
841
833
|
project_id: z.string().describe("Project ID or namespace/project_path"),
|
|
@@ -848,11 +840,11 @@ export const CreateNoteSchema = z.object({
|
|
|
848
840
|
// Issues API operation schemas
|
|
849
841
|
export const ListIssuesSchema = z.object({
|
|
850
842
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
851
|
-
assignee_id: z.number().optional().describe("Return issues assigned to the given user ID"),
|
|
843
|
+
assignee_id: z.string().or(z.number().optional().describe("Return issues assigned to the given user ID")),
|
|
852
844
|
assignee_username: z.array(z.string()).optional().describe("Return issues assigned to the given username"),
|
|
853
|
-
author_id: z.number().optional().describe("Return issues created by the given user ID"),
|
|
845
|
+
author_id: z.string().or(z.number().optional().describe("Return issues created by the given user ID")),
|
|
854
846
|
author_username: z.string().optional().describe("Return issues created by the given username"),
|
|
855
|
-
confidential:
|
|
847
|
+
confidential: flexibleBoolean.optional().describe("Filter confidential or public issues"),
|
|
856
848
|
created_after: z.string().optional().describe("Return issues created after the given time"),
|
|
857
849
|
created_before: z.string().optional().describe("Return issues created before the given time"),
|
|
858
850
|
due_date: z.string().optional().describe("Return issues that have the due date"),
|
|
@@ -869,7 +861,7 @@ export const ListIssuesSchema = z.object({
|
|
|
869
861
|
.describe("Return issues with a specific state"),
|
|
870
862
|
updated_after: z.string().optional().describe("Return issues updated after the given time"),
|
|
871
863
|
updated_before: z.string().optional().describe("Return issues updated before the given time"),
|
|
872
|
-
with_labels_details:
|
|
864
|
+
with_labels_details: flexibleBoolean.optional().describe("Return more details for each label"),
|
|
873
865
|
}).merge(PaginationOptionsSchema);
|
|
874
866
|
// Merge Requests API operation schemas
|
|
875
867
|
export const ListMergeRequestsSchema = z.object({
|
|
@@ -882,7 +874,7 @@ export const ListMergeRequestsSchema = z.object({
|
|
|
882
874
|
.string()
|
|
883
875
|
.optional()
|
|
884
876
|
.describe("Returns merge requests assigned to the given username"),
|
|
885
|
-
author_id: z.number().optional().describe("Returns merge requests created by the given user ID"),
|
|
877
|
+
author_id: z.string().or(z.number().optional().describe("Returns merge requests created by the given user ID")),
|
|
886
878
|
author_username: z
|
|
887
879
|
.string()
|
|
888
880
|
.optional()
|
|
@@ -939,29 +931,29 @@ export const ListMergeRequestsSchema = z.object({
|
|
|
939
931
|
.optional()
|
|
940
932
|
.describe("Return merge requests from a specific source branch"),
|
|
941
933
|
wip: z.enum(["yes", "no"]).optional().describe("Filter merge requests against their wip status"),
|
|
942
|
-
with_labels_details:
|
|
934
|
+
with_labels_details: flexibleBoolean.optional().describe("Return more details for each label"),
|
|
943
935
|
}).merge(PaginationOptionsSchema);
|
|
944
936
|
export const GetIssueSchema = z.object({
|
|
945
937
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
946
|
-
issue_iid: z.number().describe("The internal ID of the project issue"),
|
|
938
|
+
issue_iid: z.string().or(z.number().describe("The internal ID of the project issue")),
|
|
947
939
|
});
|
|
948
940
|
export const UpdateIssueSchema = z.object({
|
|
949
941
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
950
|
-
issue_iid: z.number().describe("The internal ID of the project issue"),
|
|
942
|
+
issue_iid: z.string().or(z.number().describe("The internal ID of the project issue")),
|
|
951
943
|
title: z.string().optional().describe("The title of the issue"),
|
|
952
944
|
description: z.string().optional().describe("The description of the issue"),
|
|
953
945
|
assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign issue to"),
|
|
954
|
-
confidential:
|
|
955
|
-
discussion_locked:
|
|
946
|
+
confidential: flexibleBoolean.optional().describe("Set the issue to be confidential"),
|
|
947
|
+
discussion_locked: flexibleBoolean.optional().describe("Flag to lock discussions"),
|
|
956
948
|
due_date: z.string().optional().describe("Date the issue is due (YYYY-MM-DD)"),
|
|
957
949
|
labels: z.array(z.string()).optional().describe("Array of label names"),
|
|
958
|
-
milestone_id: z.number().optional().describe("Milestone ID to assign"),
|
|
950
|
+
milestone_id: z.string().or(z.number().optional().describe("Milestone ID to assign")),
|
|
959
951
|
state_event: z.enum(["close", "reopen"]).optional().describe("Update issue state (close/reopen)"),
|
|
960
952
|
weight: z.number().optional().describe("Weight of the issue (0-9)"),
|
|
961
953
|
});
|
|
962
954
|
export const DeleteIssueSchema = z.object({
|
|
963
955
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
964
|
-
issue_iid: z.number().describe("The internal ID of the project issue"),
|
|
956
|
+
issue_iid: z.string().or(z.number().describe("The internal ID of the project issue")),
|
|
965
957
|
});
|
|
966
958
|
// Issue links related schemas
|
|
967
959
|
export const GitLabIssueLinkSchema = z.object({
|
|
@@ -971,18 +963,18 @@ export const GitLabIssueLinkSchema = z.object({
|
|
|
971
963
|
});
|
|
972
964
|
export const ListIssueLinksSchema = z.object({
|
|
973
965
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
974
|
-
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
|
966
|
+
issue_iid: z.string().or(z.number().describe("The internal ID of a project's issue")),
|
|
975
967
|
});
|
|
976
968
|
export const GetIssueLinkSchema = z.object({
|
|
977
969
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
978
|
-
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
|
979
|
-
issue_link_id: z.number().describe("ID of an issue relationship"),
|
|
970
|
+
issue_iid: z.string().or(z.number().describe("The internal ID of a project's issue")),
|
|
971
|
+
issue_link_id: z.string().or(z.number().describe("ID of an issue relationship")),
|
|
980
972
|
});
|
|
981
973
|
export const CreateIssueLinkSchema = z.object({
|
|
982
974
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
983
|
-
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
|
975
|
+
issue_iid: z.string().or(z.number().describe("The internal ID of a project's issue")),
|
|
984
976
|
target_project_id: z.string().describe("The ID or URL-encoded path of a target project"),
|
|
985
|
-
target_issue_iid: z.number().describe("The internal ID of a target project's issue"),
|
|
977
|
+
target_issue_iid: z.string().or(z.number().describe("The internal ID of a target project's issue")),
|
|
986
978
|
link_type: z
|
|
987
979
|
.enum(["relates_to", "blocks", "is_blocked_by"])
|
|
988
980
|
.optional()
|
|
@@ -990,13 +982,13 @@ export const CreateIssueLinkSchema = z.object({
|
|
|
990
982
|
});
|
|
991
983
|
export const DeleteIssueLinkSchema = z.object({
|
|
992
984
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
993
|
-
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
|
994
|
-
issue_link_id: z.number().describe("The ID of an issue relationship"),
|
|
985
|
+
issue_iid: z.string().or(z.number().describe("The internal ID of a project's issue")),
|
|
986
|
+
issue_link_id: z.string().or(z.number().describe("The ID of an issue relationship")),
|
|
995
987
|
});
|
|
996
988
|
// Namespace API operation schemas
|
|
997
989
|
export const ListNamespacesSchema = z.object({
|
|
998
990
|
search: z.string().optional().describe("Search term for namespaces"),
|
|
999
|
-
owned:
|
|
991
|
+
owned: flexibleBoolean.optional().describe("Filter for namespaces owned by current user"),
|
|
1000
992
|
}).merge(PaginationOptionsSchema);
|
|
1001
993
|
export const GetNamespaceSchema = z.object({
|
|
1002
994
|
namespace_id: z.string().describe("Namespace ID or full path"),
|
|
@@ -1010,11 +1002,11 @@ export const GetProjectSchema = z.object({
|
|
|
1010
1002
|
});
|
|
1011
1003
|
export const ListProjectsSchema = z.object({
|
|
1012
1004
|
search: z.string().optional().describe("Search term for projects"),
|
|
1013
|
-
search_namespaces:
|
|
1014
|
-
owned:
|
|
1015
|
-
membership:
|
|
1016
|
-
simple:
|
|
1017
|
-
archived:
|
|
1005
|
+
search_namespaces: flexibleBoolean.optional().describe("Needs to be true if search is full path"),
|
|
1006
|
+
owned: flexibleBoolean.optional().describe("Filter for projects owned by current user"),
|
|
1007
|
+
membership: flexibleBoolean.optional().describe("Filter for projects where current user is a member"),
|
|
1008
|
+
simple: flexibleBoolean.optional().describe("Return only limited fields"),
|
|
1009
|
+
archived: flexibleBoolean.optional().describe("Filter for archived projects"),
|
|
1018
1010
|
visibility: z
|
|
1019
1011
|
.enum(["public", "internal", "private"])
|
|
1020
1012
|
.optional()
|
|
@@ -1044,13 +1036,13 @@ export const ListLabelsSchema = z.object({
|
|
|
1044
1036
|
.boolean()
|
|
1045
1037
|
.optional()
|
|
1046
1038
|
.describe("Whether or not to include issue and merge request counts"),
|
|
1047
|
-
include_ancestor_groups:
|
|
1039
|
+
include_ancestor_groups: flexibleBoolean.optional().describe("Include ancestor groups"),
|
|
1048
1040
|
search: z.string().optional().describe("Keyword to filter labels by"),
|
|
1049
1041
|
});
|
|
1050
1042
|
export const GetLabelSchema = z.object({
|
|
1051
1043
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
1052
1044
|
label_id: z.string().describe("The ID or title of a project's label"),
|
|
1053
|
-
include_ancestor_groups:
|
|
1045
|
+
include_ancestor_groups: flexibleBoolean.optional().describe("Include ancestor groups"),
|
|
1054
1046
|
});
|
|
1055
1047
|
export const CreateLabelSchema = z.object({
|
|
1056
1048
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
@@ -1079,14 +1071,14 @@ export const DeleteLabelSchema = z.object({
|
|
|
1079
1071
|
// Group projects schema
|
|
1080
1072
|
export const ListGroupProjectsSchema = z.object({
|
|
1081
1073
|
group_id: z.string().describe("Group ID or path"),
|
|
1082
|
-
include_subgroups:
|
|
1074
|
+
include_subgroups: flexibleBoolean.optional().describe("Include projects from subgroups"),
|
|
1083
1075
|
search: z.string().optional().describe("Search term to filter projects"),
|
|
1084
1076
|
order_by: z
|
|
1085
1077
|
.enum(["name", "path", "created_at", "updated_at", "last_activity_at"])
|
|
1086
1078
|
.optional()
|
|
1087
1079
|
.describe("Field to sort by"),
|
|
1088
1080
|
sort: z.enum(["asc", "desc"]).optional().describe("Sort direction"),
|
|
1089
|
-
archived:
|
|
1081
|
+
archived: flexibleBoolean.optional().describe("Filter for archived projects"),
|
|
1090
1082
|
visibility: z
|
|
1091
1083
|
.enum(["public", "internal", "private"])
|
|
1092
1084
|
.optional()
|
|
@@ -1101,15 +1093,15 @@ export const ListGroupProjectsSchema = z.object({
|
|
|
1101
1093
|
.describe("Filter projects with merge requests feature enabled"),
|
|
1102
1094
|
min_access_level: z.number().optional().describe("Filter by minimum access level"),
|
|
1103
1095
|
with_programming_language: z.string().optional().describe("Filter by programming language"),
|
|
1104
|
-
starred:
|
|
1105
|
-
statistics:
|
|
1106
|
-
with_custom_attributes:
|
|
1107
|
-
with_security_reports:
|
|
1096
|
+
starred: flexibleBoolean.optional().describe("Filter by starred projects"),
|
|
1097
|
+
statistics: flexibleBoolean.optional().describe("Include project statistics"),
|
|
1098
|
+
with_custom_attributes: flexibleBoolean.optional().describe("Include custom attributes"),
|
|
1099
|
+
with_security_reports: flexibleBoolean.optional().describe("Include security reports"),
|
|
1108
1100
|
}).merge(PaginationOptionsSchema);
|
|
1109
1101
|
// Add wiki operation schemas
|
|
1110
1102
|
export const ListWikiPagesSchema = z.object({
|
|
1111
1103
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
1112
|
-
with_content:
|
|
1104
|
+
with_content: flexibleBoolean.optional().describe("Include content of the wiki pages"),
|
|
1113
1105
|
}).merge(PaginationOptionsSchema);
|
|
1114
1106
|
export const GetWikiPageSchema = z.object({
|
|
1115
1107
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
@@ -1159,7 +1151,7 @@ export const MergeRequestThreadPositionSchema = z.object({
|
|
|
1159
1151
|
});
|
|
1160
1152
|
// Schema for creating a new merge request thread
|
|
1161
1153
|
export const CreateMergeRequestThreadSchema = ProjectParamsSchema.extend({
|
|
1162
|
-
merge_request_iid: z.number().describe("The IID of a merge request"),
|
|
1154
|
+
merge_request_iid: z.string().or(z.number().describe("The IID of a merge request")),
|
|
1163
1155
|
body: z.string().describe("The content of the thread"),
|
|
1164
1156
|
position: MergeRequestThreadPositionSchema.optional().describe("Position when creating a diff note"),
|
|
1165
1157
|
created_at: z.string().optional().describe("Date the thread was created at (ISO 8601 format)"),
|
|
@@ -1180,7 +1172,7 @@ export const ListProjectMilestonesSchema = ProjectParamsSchema.extend({
|
|
|
1180
1172
|
.string()
|
|
1181
1173
|
.optional()
|
|
1182
1174
|
.describe("Return only milestones with a title or description matching the provided string"),
|
|
1183
|
-
include_ancestors:
|
|
1175
|
+
include_ancestors: flexibleBoolean.optional().describe("Include ancestor groups"),
|
|
1184
1176
|
updated_before: z
|
|
1185
1177
|
.string()
|
|
1186
1178
|
.optional()
|
|
@@ -1192,7 +1184,7 @@ export const ListProjectMilestonesSchema = ProjectParamsSchema.extend({
|
|
|
1192
1184
|
}).merge(PaginationOptionsSchema);
|
|
1193
1185
|
// Schema for getting a single milestone
|
|
1194
1186
|
export const GetProjectMilestoneSchema = ProjectParamsSchema.extend({
|
|
1195
|
-
milestone_id: z.number().describe("The ID of a project milestone"),
|
|
1187
|
+
milestone_id: z.string().or(z.number().describe("The ID of a project milestone")),
|
|
1196
1188
|
});
|
|
1197
1189
|
// Schema for creating a new milestone
|
|
1198
1190
|
export const CreateProjectMilestoneSchema = ProjectParamsSchema.extend({
|
|
@@ -1230,18 +1222,18 @@ export const ListCommitsSchema = z.object({
|
|
|
1230
1222
|
until: z.string().optional().describe("Only commits before or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ"),
|
|
1231
1223
|
path: z.string().optional().describe("The file path"),
|
|
1232
1224
|
author: z.string().optional().describe("Search commits by commit author"),
|
|
1233
|
-
all:
|
|
1234
|
-
with_stats:
|
|
1235
|
-
first_parent:
|
|
1225
|
+
all: flexibleBoolean.optional().describe("Retrieve every commit from the repository"),
|
|
1226
|
+
with_stats: flexibleBoolean.optional().describe("Stats about each commit are added to the response"),
|
|
1227
|
+
first_parent: flexibleBoolean.optional().describe("Follow only the first parent commit upon seeing a merge commit"),
|
|
1236
1228
|
order: z.enum(["default", "topo"]).optional().describe("List commits in order"),
|
|
1237
|
-
trailers:
|
|
1229
|
+
trailers: flexibleBoolean.optional().describe("Parse and include Git trailers for every commit"),
|
|
1238
1230
|
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
|
1239
1231
|
per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
|
|
1240
1232
|
});
|
|
1241
1233
|
export const GetCommitSchema = z.object({
|
|
1242
1234
|
project_id: z.string().describe("Project ID or complete URL-encoded path to project"),
|
|
1243
1235
|
sha: z.string().describe("The commit hash or name of a repository branch or tag"),
|
|
1244
|
-
stats:
|
|
1236
|
+
stats: flexibleBoolean.optional().describe("Include commit stats"),
|
|
1245
1237
|
});
|
|
1246
1238
|
export const GetCommitDiffSchema = z.object({
|
|
1247
1239
|
project_id: z.string().describe("Project ID or complete URL-encoded path to project"),
|