@zereight/mcp-gitlab 1.0.49 → 1.0.51
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 +17 -2
- package/build/index.js +364 -45
- package/build/schemas.js +210 -241
- package/build/scripts/generate-tools-readme.js +12 -12
- package/build/tests/integration.test.js +151 -0
- package/build/tests/unit.test.js +122 -0
- package/package.json +14 -3
package/build/schemas.js
CHANGED
|
@@ -20,13 +20,16 @@ export const GitLabPipelineSchema = z.object({
|
|
|
20
20
|
started_at: z.string().nullable().optional(),
|
|
21
21
|
finished_at: z.string().nullable().optional(),
|
|
22
22
|
coverage: z.number().nullable().optional(),
|
|
23
|
-
user: z
|
|
23
|
+
user: z
|
|
24
|
+
.object({
|
|
24
25
|
id: z.number(),
|
|
25
26
|
name: z.string(),
|
|
26
27
|
username: z.string(),
|
|
27
28
|
avatar_url: z.string().nullable().optional(),
|
|
28
|
-
})
|
|
29
|
-
|
|
29
|
+
})
|
|
30
|
+
.optional(),
|
|
31
|
+
detailed_status: z
|
|
32
|
+
.object({
|
|
30
33
|
icon: z.string().optional(),
|
|
31
34
|
text: z.string().optional(),
|
|
32
35
|
label: z.string().optional(),
|
|
@@ -34,13 +37,17 @@ export const GitLabPipelineSchema = z.object({
|
|
|
34
37
|
tooltip: z.string().optional(),
|
|
35
38
|
has_details: z.boolean().optional(),
|
|
36
39
|
details_path: z.string().optional(),
|
|
37
|
-
illustration: z
|
|
40
|
+
illustration: z
|
|
41
|
+
.object({
|
|
38
42
|
image: z.string().optional(),
|
|
39
43
|
size: z.string().optional(),
|
|
40
44
|
title: z.string().optional(),
|
|
41
|
-
})
|
|
45
|
+
})
|
|
46
|
+
.nullable()
|
|
47
|
+
.optional(),
|
|
42
48
|
favicon: z.string().optional(),
|
|
43
|
-
})
|
|
49
|
+
})
|
|
50
|
+
.optional(),
|
|
44
51
|
});
|
|
45
52
|
// Pipeline job related schemas
|
|
46
53
|
export const GitLabPipelineJobSchema = z.object({
|
|
@@ -55,41 +62,74 @@ export const GitLabPipelineJobSchema = z.object({
|
|
|
55
62
|
started_at: z.string().nullable().optional(),
|
|
56
63
|
finished_at: z.string().nullable().optional(),
|
|
57
64
|
duration: z.number().nullable().optional(),
|
|
58
|
-
user: z
|
|
65
|
+
user: z
|
|
66
|
+
.object({
|
|
59
67
|
id: z.number(),
|
|
60
68
|
name: z.string(),
|
|
61
69
|
username: z.string(),
|
|
62
70
|
avatar_url: z.string().nullable().optional(),
|
|
63
|
-
})
|
|
64
|
-
|
|
71
|
+
})
|
|
72
|
+
.optional(),
|
|
73
|
+
commit: z
|
|
74
|
+
.object({
|
|
65
75
|
id: z.string(),
|
|
66
76
|
short_id: z.string(),
|
|
67
77
|
title: z.string(),
|
|
68
78
|
author_name: z.string(),
|
|
69
79
|
author_email: z.string(),
|
|
70
|
-
})
|
|
71
|
-
|
|
80
|
+
})
|
|
81
|
+
.optional(),
|
|
82
|
+
pipeline: z
|
|
83
|
+
.object({
|
|
72
84
|
id: z.number(),
|
|
73
85
|
project_id: z.number(),
|
|
74
86
|
status: z.string(),
|
|
75
87
|
ref: z.string(),
|
|
76
88
|
sha: z.string(),
|
|
77
|
-
})
|
|
89
|
+
})
|
|
90
|
+
.optional(),
|
|
78
91
|
web_url: z.string().optional(),
|
|
79
92
|
});
|
|
80
93
|
// Schema for listing pipelines
|
|
81
94
|
export const ListPipelinesSchema = z.object({
|
|
82
95
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
83
|
-
scope: z
|
|
84
|
-
|
|
96
|
+
scope: z
|
|
97
|
+
.enum(["running", "pending", "finished", "branches", "tags"])
|
|
98
|
+
.optional()
|
|
99
|
+
.describe("The scope of pipelines"),
|
|
100
|
+
status: z
|
|
101
|
+
.enum([
|
|
102
|
+
"created",
|
|
103
|
+
"waiting_for_resource",
|
|
104
|
+
"preparing",
|
|
105
|
+
"pending",
|
|
106
|
+
"running",
|
|
107
|
+
"success",
|
|
108
|
+
"failed",
|
|
109
|
+
"canceled",
|
|
110
|
+
"skipped",
|
|
111
|
+
"manual",
|
|
112
|
+
"scheduled",
|
|
113
|
+
])
|
|
114
|
+
.optional()
|
|
115
|
+
.describe("The status of pipelines"),
|
|
85
116
|
ref: z.string().optional().describe("The ref of pipelines"),
|
|
86
117
|
sha: z.string().optional().describe("The SHA of pipelines"),
|
|
87
118
|
yaml_errors: z.boolean().optional().describe("Returns pipelines with invalid configurations"),
|
|
88
119
|
username: z.string().optional().describe("The username of the user who triggered pipelines"),
|
|
89
|
-
updated_after: z
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
120
|
+
updated_after: z
|
|
121
|
+
.string()
|
|
122
|
+
.optional()
|
|
123
|
+
.describe("Return pipelines updated after the specified date"),
|
|
124
|
+
updated_before: z
|
|
125
|
+
.string()
|
|
126
|
+
.optional()
|
|
127
|
+
.describe("Return pipelines updated before the specified date"),
|
|
128
|
+
order_by: z
|
|
129
|
+
.enum(["id", "status", "ref", "updated_at", "user_id"])
|
|
130
|
+
.optional()
|
|
131
|
+
.describe("Order pipelines by"),
|
|
132
|
+
sort: z.enum(["asc", "desc"]).optional().describe("Sort pipelines"),
|
|
93
133
|
page: z.number().optional().describe("Page number for pagination"),
|
|
94
134
|
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
|
95
135
|
});
|
|
@@ -102,7 +142,10 @@ export const GetPipelineSchema = z.object({
|
|
|
102
142
|
export const ListPipelineJobsSchema = z.object({
|
|
103
143
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
104
144
|
pipeline_id: z.number().describe("The ID of the pipeline"),
|
|
105
|
-
scope: z
|
|
145
|
+
scope: z
|
|
146
|
+
.enum(["created", "pending", "running", "failed", "success", "canceled", "skipped", "manual"])
|
|
147
|
+
.optional()
|
|
148
|
+
.describe("The scope of jobs to show"),
|
|
106
149
|
include_retried: z.boolean().optional().describe("Whether to include retried jobs"),
|
|
107
150
|
page: z.number().optional().describe("Page number for pagination"),
|
|
108
151
|
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
|
@@ -267,18 +310,9 @@ export const GetRepositoryTreeSchema = z.object({
|
|
|
267
310
|
.string()
|
|
268
311
|
.optional()
|
|
269
312
|
.describe("The name of a repository branch or tag. Defaults to the default branch."),
|
|
270
|
-
recursive: z
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
.describe("Boolean value to get a recursive tree"),
|
|
274
|
-
per_page: z
|
|
275
|
-
.number()
|
|
276
|
-
.optional()
|
|
277
|
-
.describe("Number of results to show per page"),
|
|
278
|
-
page_token: z
|
|
279
|
-
.string()
|
|
280
|
-
.optional()
|
|
281
|
-
.describe("The tree record ID for pagination"),
|
|
313
|
+
recursive: z.boolean().optional().describe("Boolean value to get a recursive tree"),
|
|
314
|
+
per_page: z.number().optional().describe("Number of results to show per page"),
|
|
315
|
+
page_token: z.string().optional().describe("The tree record ID for pagination"),
|
|
282
316
|
pagination: z.string().optional().describe("Pagination method (keyset)"),
|
|
283
317
|
});
|
|
284
318
|
export const GitLabTreeSchema = z.object({
|
|
@@ -306,6 +340,21 @@ export const GitLabReferenceSchema = z.object({
|
|
|
306
340
|
web_url: z.string(), // Changed from url to match GitLab API
|
|
307
341
|
}),
|
|
308
342
|
});
|
|
343
|
+
// Milestones rest api output schemas
|
|
344
|
+
export const GitLabMilestonesSchema = z.object({
|
|
345
|
+
id: z.number(),
|
|
346
|
+
iid: z.number(),
|
|
347
|
+
project_id: z.number(),
|
|
348
|
+
title: z.string(),
|
|
349
|
+
description: z.string().nullable(),
|
|
350
|
+
due_date: z.string().nullable(),
|
|
351
|
+
start_date: z.string().nullable(),
|
|
352
|
+
state: z.string(),
|
|
353
|
+
updated_at: z.string(),
|
|
354
|
+
created_at: z.string(),
|
|
355
|
+
expired: z.boolean(),
|
|
356
|
+
web_url: z.string().optional(),
|
|
357
|
+
});
|
|
309
358
|
// Input schemas for operations
|
|
310
359
|
export const CreateRepositoryOptionsSchema = z.object({
|
|
311
360
|
name: z.string(),
|
|
@@ -543,10 +592,12 @@ export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({
|
|
|
543
592
|
note_id: z.number().describe("The ID of a thread note"),
|
|
544
593
|
body: z.string().optional().describe("The content of the note or reply"),
|
|
545
594
|
resolved: z.boolean().optional().describe("Resolve or unresolve the note"),
|
|
546
|
-
})
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
595
|
+
})
|
|
596
|
+
.refine(data => data.body !== undefined || data.resolved !== undefined, {
|
|
597
|
+
message: "At least one of 'body' or 'resolved' must be provided",
|
|
598
|
+
})
|
|
599
|
+
.refine(data => !(data.body !== undefined && data.resolved !== undefined), {
|
|
600
|
+
message: "Only one of 'body' or 'resolved' can be provided, not both",
|
|
550
601
|
});
|
|
551
602
|
// Input schema for adding a note to an existing merge request discussion
|
|
552
603
|
export const CreateMergeRequestNoteSchema = ProjectParamsSchema.extend({
|
|
@@ -575,26 +626,14 @@ export const CreateOrUpdateFileSchema = ProjectParamsSchema.extend({
|
|
|
575
626
|
content: z.string().describe("Content of the file"),
|
|
576
627
|
commit_message: z.string().describe("Commit message"),
|
|
577
628
|
branch: z.string().describe("Branch to create/update the file in"),
|
|
578
|
-
previous_path: z
|
|
579
|
-
.string()
|
|
580
|
-
.optional()
|
|
581
|
-
.describe("Path of the file to move/rename"),
|
|
629
|
+
previous_path: z.string().optional().describe("Path of the file to move/rename"),
|
|
582
630
|
last_commit_id: z.string().optional().describe("Last known file commit ID"),
|
|
583
|
-
commit_id: z
|
|
584
|
-
.string()
|
|
585
|
-
.optional()
|
|
586
|
-
.describe("Current file commit ID (for update operations)"),
|
|
631
|
+
commit_id: z.string().optional().describe("Current file commit ID (for update operations)"),
|
|
587
632
|
});
|
|
588
633
|
export const SearchRepositoriesSchema = z.object({
|
|
589
634
|
search: z.string().describe("Search query"), // Changed from query to match GitLab API
|
|
590
|
-
page: z
|
|
591
|
-
|
|
592
|
-
.optional()
|
|
593
|
-
.describe("Page number for pagination (default: 1)"),
|
|
594
|
-
per_page: z
|
|
595
|
-
.number()
|
|
596
|
-
.optional()
|
|
597
|
-
.describe("Number of results per page (default: 20)"),
|
|
635
|
+
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
|
636
|
+
per_page: z.number().optional().describe("Number of results per page (default: 20)"),
|
|
598
637
|
});
|
|
599
638
|
export const CreateRepositorySchema = z.object({
|
|
600
639
|
name: z.string().describe("Repository name"),
|
|
@@ -603,10 +642,7 @@ export const CreateRepositorySchema = z.object({
|
|
|
603
642
|
.enum(["private", "internal", "public"])
|
|
604
643
|
.optional()
|
|
605
644
|
.describe("Repository visibility level"),
|
|
606
|
-
initialize_with_readme: z
|
|
607
|
-
.boolean()
|
|
608
|
-
.optional()
|
|
609
|
-
.describe("Initialize with README.md"),
|
|
645
|
+
initialize_with_readme: z.boolean().optional().describe("Initialize with README.md"),
|
|
610
646
|
});
|
|
611
647
|
export const GetFileContentsSchema = ProjectParamsSchema.extend({
|
|
612
648
|
file_path: z.string().describe("Path to the file or directory"),
|
|
@@ -625,10 +661,7 @@ export const PushFilesSchema = ProjectParamsSchema.extend({
|
|
|
625
661
|
export const CreateIssueSchema = ProjectParamsSchema.extend({
|
|
626
662
|
title: z.string().describe("Issue title"),
|
|
627
663
|
description: z.string().optional().describe("Issue description"),
|
|
628
|
-
assignee_ids: z
|
|
629
|
-
.array(z.number())
|
|
630
|
-
.optional()
|
|
631
|
-
.describe("Array of user IDs to assign"),
|
|
664
|
+
assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign"),
|
|
632
665
|
labels: z.array(z.string()).optional().describe("Array of label names"),
|
|
633
666
|
milestone_id: z.number().optional().describe("Milestone ID to assign"),
|
|
634
667
|
});
|
|
@@ -638,10 +671,7 @@ export const CreateMergeRequestSchema = ProjectParamsSchema.extend({
|
|
|
638
671
|
source_branch: z.string().describe("Branch containing changes"),
|
|
639
672
|
target_branch: z.string().describe("Branch to merge into"),
|
|
640
673
|
draft: z.boolean().optional().describe("Create as draft merge request"),
|
|
641
|
-
allow_collaboration: z
|
|
642
|
-
.boolean()
|
|
643
|
-
.optional()
|
|
644
|
-
.describe("Allow commits from upstream members"),
|
|
674
|
+
allow_collaboration: z.boolean().optional().describe("Allow commits from upstream members"),
|
|
645
675
|
});
|
|
646
676
|
export const ForkRepositorySchema = ProjectParamsSchema.extend({
|
|
647
677
|
namespace: z.string().optional().describe("Namespace to fork to (full path)"),
|
|
@@ -661,23 +691,14 @@ export const GitLabMergeRequestDiffSchema = z.object({
|
|
|
661
691
|
deleted_file: z.boolean(),
|
|
662
692
|
});
|
|
663
693
|
export const GetMergeRequestSchema = ProjectParamsSchema.extend({
|
|
664
|
-
merge_request_iid: z
|
|
665
|
-
.number()
|
|
666
|
-
.optional()
|
|
667
|
-
.describe("The IID of a merge request"),
|
|
694
|
+
merge_request_iid: z.number().optional().describe("The IID of a merge request"),
|
|
668
695
|
source_branch: z.string().optional().describe("Source branch name"),
|
|
669
696
|
});
|
|
670
697
|
export const UpdateMergeRequestSchema = GetMergeRequestSchema.extend({
|
|
671
698
|
title: z.string().optional().describe("The title of the merge request"),
|
|
672
|
-
description: z
|
|
673
|
-
.string()
|
|
674
|
-
.optional()
|
|
675
|
-
.describe("The description of the merge request"),
|
|
699
|
+
description: z.string().optional().describe("The description of the merge request"),
|
|
676
700
|
target_branch: z.string().optional().describe("The target branch"),
|
|
677
|
-
assignee_ids: z
|
|
678
|
-
.array(z.number())
|
|
679
|
-
.optional()
|
|
680
|
-
.describe("The ID of the users to assign the MR to"),
|
|
701
|
+
assignee_ids: z.array(z.number()).optional().describe("The ID of the users to assign the MR to"),
|
|
681
702
|
labels: z.array(z.string()).optional().describe("Labels for the MR"),
|
|
682
703
|
state_event: z
|
|
683
704
|
.enum(["close", "reopen"])
|
|
@@ -687,10 +708,7 @@ export const UpdateMergeRequestSchema = GetMergeRequestSchema.extend({
|
|
|
687
708
|
.boolean()
|
|
688
709
|
.optional()
|
|
689
710
|
.describe("Flag indicating if the source branch should be removed"),
|
|
690
|
-
squash: z
|
|
691
|
-
.boolean()
|
|
692
|
-
.optional()
|
|
693
|
-
.describe("Squash commits into a single commit when merging"),
|
|
711
|
+
squash: z.boolean().optional().describe("Squash commits into a single commit when merging"),
|
|
694
712
|
draft: z.boolean().optional().describe("Work in progress merge request"),
|
|
695
713
|
});
|
|
696
714
|
export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
|
|
@@ -707,38 +725,14 @@ export const CreateNoteSchema = z.object({
|
|
|
707
725
|
// Issues API operation schemas
|
|
708
726
|
export const ListIssuesSchema = z.object({
|
|
709
727
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
710
|
-
assignee_id: z
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
author_id: z
|
|
719
|
-
.number()
|
|
720
|
-
.optional()
|
|
721
|
-
.describe("Return issues created by the given user ID"),
|
|
722
|
-
author_username: z
|
|
723
|
-
.string()
|
|
724
|
-
.optional()
|
|
725
|
-
.describe("Return issues created by the given username"),
|
|
726
|
-
confidential: z
|
|
727
|
-
.boolean()
|
|
728
|
-
.optional()
|
|
729
|
-
.describe("Filter confidential or public issues"),
|
|
730
|
-
created_after: z
|
|
731
|
-
.string()
|
|
732
|
-
.optional()
|
|
733
|
-
.describe("Return issues created after the given time"),
|
|
734
|
-
created_before: z
|
|
735
|
-
.string()
|
|
736
|
-
.optional()
|
|
737
|
-
.describe("Return issues created before the given time"),
|
|
738
|
-
due_date: z
|
|
739
|
-
.string()
|
|
740
|
-
.optional()
|
|
741
|
-
.describe("Return issues that have the due date"),
|
|
728
|
+
assignee_id: z.number().optional().describe("Return issues assigned to the given user ID"),
|
|
729
|
+
assignee_username: z.string().optional().describe("Return issues assigned to the given username"),
|
|
730
|
+
author_id: z.number().optional().describe("Return issues created by the given user ID"),
|
|
731
|
+
author_username: z.string().optional().describe("Return issues created by the given username"),
|
|
732
|
+
confidential: z.boolean().optional().describe("Filter confidential or public issues"),
|
|
733
|
+
created_after: z.string().optional().describe("Return issues created after the given time"),
|
|
734
|
+
created_before: z.string().optional().describe("Return issues created before the given time"),
|
|
735
|
+
due_date: z.string().optional().describe("Return issues that have the due date"),
|
|
742
736
|
label_name: z.array(z.string()).optional().describe("Array of label names"),
|
|
743
737
|
milestone: z.string().optional().describe("Milestone title"),
|
|
744
738
|
scope: z
|
|
@@ -750,18 +744,9 @@ export const ListIssuesSchema = z.object({
|
|
|
750
744
|
.enum(["opened", "closed", "all"])
|
|
751
745
|
.optional()
|
|
752
746
|
.describe("Return issues with a specific state"),
|
|
753
|
-
updated_after: z
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
.describe("Return issues updated after the given time"),
|
|
757
|
-
updated_before: z
|
|
758
|
-
.string()
|
|
759
|
-
.optional()
|
|
760
|
-
.describe("Return issues updated before the given time"),
|
|
761
|
-
with_labels_details: z
|
|
762
|
-
.boolean()
|
|
763
|
-
.optional()
|
|
764
|
-
.describe("Return more details for each label"),
|
|
747
|
+
updated_after: z.string().optional().describe("Return issues updated after the given time"),
|
|
748
|
+
updated_before: z.string().optional().describe("Return issues updated before the given time"),
|
|
749
|
+
with_labels_details: z.boolean().optional().describe("Return more details for each label"),
|
|
765
750
|
page: z.number().optional().describe("Page number for pagination"),
|
|
766
751
|
per_page: z.number().optional().describe("Number of items per page"),
|
|
767
752
|
});
|
|
@@ -776,10 +761,7 @@ export const ListMergeRequestsSchema = z.object({
|
|
|
776
761
|
.string()
|
|
777
762
|
.optional()
|
|
778
763
|
.describe("Returns merge requests assigned to the given username"),
|
|
779
|
-
author_id: z
|
|
780
|
-
.number()
|
|
781
|
-
.optional()
|
|
782
|
-
.describe("Returns merge requests created by the given user ID"),
|
|
764
|
+
author_id: z.number().optional().describe("Returns merge requests created by the given user ID"),
|
|
783
765
|
author_username: z
|
|
784
766
|
.string()
|
|
785
767
|
.optional()
|
|
@@ -835,14 +817,8 @@ export const ListMergeRequestsSchema = z.object({
|
|
|
835
817
|
.string()
|
|
836
818
|
.optional()
|
|
837
819
|
.describe("Return merge requests from a specific source branch"),
|
|
838
|
-
wip: z
|
|
839
|
-
|
|
840
|
-
.optional()
|
|
841
|
-
.describe("Filter merge requests against their wip status"),
|
|
842
|
-
with_labels_details: z
|
|
843
|
-
.boolean()
|
|
844
|
-
.optional()
|
|
845
|
-
.describe("Return more details for each label"),
|
|
820
|
+
wip: z.enum(["yes", "no"]).optional().describe("Filter merge requests against their wip status"),
|
|
821
|
+
with_labels_details: z.boolean().optional().describe("Return more details for each label"),
|
|
846
822
|
page: z.number().optional().describe("Page number for pagination"),
|
|
847
823
|
per_page: z.number().optional().describe("Number of items per page"),
|
|
848
824
|
});
|
|
@@ -855,28 +831,13 @@ export const UpdateIssueSchema = z.object({
|
|
|
855
831
|
issue_iid: z.number().describe("The internal ID of the project issue"),
|
|
856
832
|
title: z.string().optional().describe("The title of the issue"),
|
|
857
833
|
description: z.string().optional().describe("The description of the issue"),
|
|
858
|
-
assignee_ids: z
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
confidential: z
|
|
863
|
-
.boolean()
|
|
864
|
-
.optional()
|
|
865
|
-
.describe("Set the issue to be confidential"),
|
|
866
|
-
discussion_locked: z
|
|
867
|
-
.boolean()
|
|
868
|
-
.optional()
|
|
869
|
-
.describe("Flag to lock discussions"),
|
|
870
|
-
due_date: z
|
|
871
|
-
.string()
|
|
872
|
-
.optional()
|
|
873
|
-
.describe("Date the issue is due (YYYY-MM-DD)"),
|
|
834
|
+
assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign issue to"),
|
|
835
|
+
confidential: z.boolean().optional().describe("Set the issue to be confidential"),
|
|
836
|
+
discussion_locked: z.boolean().optional().describe("Flag to lock discussions"),
|
|
837
|
+
due_date: z.string().optional().describe("Date the issue is due (YYYY-MM-DD)"),
|
|
874
838
|
labels: z.array(z.string()).optional().describe("Array of label names"),
|
|
875
839
|
milestone_id: z.number().optional().describe("Milestone ID to assign"),
|
|
876
|
-
state_event: z
|
|
877
|
-
.enum(["close", "reopen"])
|
|
878
|
-
.optional()
|
|
879
|
-
.describe("Update issue state (close/reopen)"),
|
|
840
|
+
state_event: z.enum(["close", "reopen"]).optional().describe("Update issue state (close/reopen)"),
|
|
880
841
|
weight: z.number().optional().describe("Weight of the issue (0-9)"),
|
|
881
842
|
});
|
|
882
843
|
export const DeleteIssueSchema = z.object({
|
|
@@ -898,8 +859,14 @@ export const ListIssueDiscussionsSchema = z.object({
|
|
|
898
859
|
issue_iid: z.number().describe("The internal ID of the project issue"),
|
|
899
860
|
page: z.number().optional().describe("Page number for pagination"),
|
|
900
861
|
per_page: z.number().optional().describe("Number of items per page"),
|
|
901
|
-
sort: z
|
|
902
|
-
|
|
862
|
+
sort: z
|
|
863
|
+
.enum(["asc", "desc"])
|
|
864
|
+
.optional()
|
|
865
|
+
.describe("Return issue discussions sorted in ascending or descending order"),
|
|
866
|
+
order_by: z
|
|
867
|
+
.enum(["created_at", "updated_at"])
|
|
868
|
+
.optional()
|
|
869
|
+
.describe("Return issue discussions ordered by created_at or updated_at fields"),
|
|
903
870
|
});
|
|
904
871
|
export const GetIssueLinkSchema = z.object({
|
|
905
872
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
@@ -909,12 +876,8 @@ export const GetIssueLinkSchema = z.object({
|
|
|
909
876
|
export const CreateIssueLinkSchema = z.object({
|
|
910
877
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
911
878
|
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
|
912
|
-
target_project_id: z
|
|
913
|
-
|
|
914
|
-
.describe("The ID or URL-encoded path of a target project"),
|
|
915
|
-
target_issue_iid: z
|
|
916
|
-
.number()
|
|
917
|
-
.describe("The internal ID of a target project's issue"),
|
|
879
|
+
target_project_id: z.string().describe("The ID or URL-encoded path of a target project"),
|
|
880
|
+
target_issue_iid: z.number().describe("The internal ID of a target project's issue"),
|
|
918
881
|
link_type: z
|
|
919
882
|
.enum(["relates_to", "blocks", "is_blocked_by"])
|
|
920
883
|
.optional()
|
|
@@ -930,10 +893,7 @@ export const ListNamespacesSchema = z.object({
|
|
|
930
893
|
search: z.string().optional().describe("Search term for namespaces"),
|
|
931
894
|
page: z.number().optional().describe("Page number for pagination"),
|
|
932
895
|
per_page: z.number().optional().describe("Number of items per page"),
|
|
933
|
-
owned: z
|
|
934
|
-
.boolean()
|
|
935
|
-
.optional()
|
|
936
|
-
.describe("Filter for namespaces owned by current user"),
|
|
896
|
+
owned: z.boolean().optional().describe("Filter for namespaces owned by current user"),
|
|
937
897
|
});
|
|
938
898
|
export const GetNamespaceSchema = z.object({
|
|
939
899
|
namespace_id: z.string().describe("Namespace ID or full path"),
|
|
@@ -949,18 +909,9 @@ export const ListProjectsSchema = z.object({
|
|
|
949
909
|
search: z.string().optional().describe("Search term for projects"),
|
|
950
910
|
page: z.number().optional().describe("Page number for pagination"),
|
|
951
911
|
per_page: z.number().optional().describe("Number of items per page"),
|
|
952
|
-
search_namespaces: z
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
.describe("Needs to be true if search is full path"),
|
|
956
|
-
owned: z
|
|
957
|
-
.boolean()
|
|
958
|
-
.optional()
|
|
959
|
-
.describe("Filter for projects owned by current user"),
|
|
960
|
-
membership: z
|
|
961
|
-
.boolean()
|
|
962
|
-
.optional()
|
|
963
|
-
.describe("Filter for projects where current user is a member"),
|
|
912
|
+
search_namespaces: z.boolean().optional().describe("Needs to be true if search is full path"),
|
|
913
|
+
owned: z.boolean().optional().describe("Filter for projects owned by current user"),
|
|
914
|
+
membership: z.boolean().optional().describe("Filter for projects where current user is a member"),
|
|
964
915
|
simple: z.boolean().optional().describe("Return only limited fields"),
|
|
965
916
|
archived: z.boolean().optional().describe("Filter for archived projects"),
|
|
966
917
|
visibility: z
|
|
@@ -968,14 +919,7 @@ export const ListProjectsSchema = z.object({
|
|
|
968
919
|
.optional()
|
|
969
920
|
.describe("Filter by project visibility"),
|
|
970
921
|
order_by: z
|
|
971
|
-
.enum([
|
|
972
|
-
"id",
|
|
973
|
-
"name",
|
|
974
|
-
"path",
|
|
975
|
-
"created_at",
|
|
976
|
-
"updated_at",
|
|
977
|
-
"last_activity_at",
|
|
978
|
-
])
|
|
922
|
+
.enum(["id", "name", "path", "created_at", "updated_at", "last_activity_at"])
|
|
979
923
|
.optional()
|
|
980
924
|
.describe("Return projects ordered by field"),
|
|
981
925
|
sort: z
|
|
@@ -990,10 +934,7 @@ export const ListProjectsSchema = z.object({
|
|
|
990
934
|
.boolean()
|
|
991
935
|
.optional()
|
|
992
936
|
.describe("Filter projects with merge requests feature enabled"),
|
|
993
|
-
min_access_level: z
|
|
994
|
-
.number()
|
|
995
|
-
.optional()
|
|
996
|
-
.describe("Filter by minimum access level"),
|
|
937
|
+
min_access_level: z.number().optional().describe("Filter by minimum access level"),
|
|
997
938
|
});
|
|
998
939
|
// Label operation schemas
|
|
999
940
|
export const ListLabelsSchema = z.object({
|
|
@@ -1002,19 +943,13 @@ export const ListLabelsSchema = z.object({
|
|
|
1002
943
|
.boolean()
|
|
1003
944
|
.optional()
|
|
1004
945
|
.describe("Whether or not to include issue and merge request counts"),
|
|
1005
|
-
include_ancestor_groups: z
|
|
1006
|
-
.boolean()
|
|
1007
|
-
.optional()
|
|
1008
|
-
.describe("Include ancestor groups"),
|
|
946
|
+
include_ancestor_groups: z.boolean().optional().describe("Include ancestor groups"),
|
|
1009
947
|
search: z.string().optional().describe("Keyword to filter labels by"),
|
|
1010
948
|
});
|
|
1011
949
|
export const GetLabelSchema = z.object({
|
|
1012
950
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
1013
951
|
label_id: z.string().describe("The ID or title of a project's label"),
|
|
1014
|
-
include_ancestor_groups: z
|
|
1015
|
-
.boolean()
|
|
1016
|
-
.optional()
|
|
1017
|
-
.describe("Include ancestor groups"),
|
|
952
|
+
include_ancestor_groups: z.boolean().optional().describe("Include ancestor groups"),
|
|
1018
953
|
});
|
|
1019
954
|
export const CreateLabelSchema = z.object({
|
|
1020
955
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
@@ -1023,11 +958,7 @@ export const CreateLabelSchema = z.object({
|
|
|
1023
958
|
.string()
|
|
1024
959
|
.describe("The color of the label given in 6-digit hex notation with leading '#' sign"),
|
|
1025
960
|
description: z.string().optional().describe("The description of the label"),
|
|
1026
|
-
priority: z
|
|
1027
|
-
.number()
|
|
1028
|
-
.nullable()
|
|
1029
|
-
.optional()
|
|
1030
|
-
.describe("The priority of the label"),
|
|
961
|
+
priority: z.number().nullable().optional().describe("The priority of the label"),
|
|
1031
962
|
});
|
|
1032
963
|
export const UpdateLabelSchema = z.object({
|
|
1033
964
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
@@ -1037,15 +968,8 @@ export const UpdateLabelSchema = z.object({
|
|
|
1037
968
|
.string()
|
|
1038
969
|
.optional()
|
|
1039
970
|
.describe("The color of the label given in 6-digit hex notation with leading '#' sign"),
|
|
1040
|
-
description: z
|
|
1041
|
-
|
|
1042
|
-
.optional()
|
|
1043
|
-
.describe("The new description of the label"),
|
|
1044
|
-
priority: z
|
|
1045
|
-
.number()
|
|
1046
|
-
.nullable()
|
|
1047
|
-
.optional()
|
|
1048
|
-
.describe("The new priority of the label"),
|
|
971
|
+
description: z.string().optional().describe("The new description of the label"),
|
|
972
|
+
priority: z.number().nullable().optional().describe("The new priority of the label"),
|
|
1049
973
|
});
|
|
1050
974
|
export const DeleteLabelSchema = z.object({
|
|
1051
975
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
@@ -1054,10 +978,7 @@ export const DeleteLabelSchema = z.object({
|
|
|
1054
978
|
// Group projects schema
|
|
1055
979
|
export const ListGroupProjectsSchema = z.object({
|
|
1056
980
|
group_id: z.string().describe("Group ID or path"),
|
|
1057
|
-
include_subgroups: z
|
|
1058
|
-
.boolean()
|
|
1059
|
-
.optional()
|
|
1060
|
-
.describe("Include projects from subgroups"),
|
|
981
|
+
include_subgroups: z.boolean().optional().describe("Include projects from subgroups"),
|
|
1061
982
|
search: z.string().optional().describe("Search term to filter projects"),
|
|
1062
983
|
order_by: z
|
|
1063
984
|
.enum(["name", "path", "created_at", "updated_at", "last_activity_at"])
|
|
@@ -1079,24 +1000,12 @@ export const ListGroupProjectsSchema = z.object({
|
|
|
1079
1000
|
.boolean()
|
|
1080
1001
|
.optional()
|
|
1081
1002
|
.describe("Filter projects with merge requests feature enabled"),
|
|
1082
|
-
min_access_level: z
|
|
1083
|
-
|
|
1084
|
-
.optional()
|
|
1085
|
-
.describe("Filter by minimum access level"),
|
|
1086
|
-
with_programming_language: z
|
|
1087
|
-
.string()
|
|
1088
|
-
.optional()
|
|
1089
|
-
.describe("Filter by programming language"),
|
|
1003
|
+
min_access_level: z.number().optional().describe("Filter by minimum access level"),
|
|
1004
|
+
with_programming_language: z.string().optional().describe("Filter by programming language"),
|
|
1090
1005
|
starred: z.boolean().optional().describe("Filter by starred projects"),
|
|
1091
1006
|
statistics: z.boolean().optional().describe("Include project statistics"),
|
|
1092
|
-
with_custom_attributes: z
|
|
1093
|
-
|
|
1094
|
-
.optional()
|
|
1095
|
-
.describe("Include custom attributes"),
|
|
1096
|
-
with_security_reports: z
|
|
1097
|
-
.boolean()
|
|
1098
|
-
.optional()
|
|
1099
|
-
.describe("Include security reports"),
|
|
1007
|
+
with_custom_attributes: z.boolean().optional().describe("Include custom attributes"),
|
|
1008
|
+
with_security_reports: z.boolean().optional().describe("Include security reports"),
|
|
1100
1009
|
});
|
|
1101
1010
|
// Add wiki operation schemas
|
|
1102
1011
|
export const ListWikiPagesSchema = z.object({
|
|
@@ -1112,20 +1021,14 @@ export const CreateWikiPageSchema = z.object({
|
|
|
1112
1021
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
1113
1022
|
title: z.string().describe("Title of the wiki page"),
|
|
1114
1023
|
content: z.string().describe("Content of the wiki page"),
|
|
1115
|
-
format: z
|
|
1116
|
-
.string()
|
|
1117
|
-
.optional()
|
|
1118
|
-
.describe("Content format, e.g., markdown, rdoc"),
|
|
1024
|
+
format: z.string().optional().describe("Content format, e.g., markdown, rdoc"),
|
|
1119
1025
|
});
|
|
1120
1026
|
export const UpdateWikiPageSchema = z.object({
|
|
1121
1027
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
1122
1028
|
slug: z.string().describe("URL-encoded slug of the wiki page"),
|
|
1123
1029
|
title: z.string().optional().describe("New title of the wiki page"),
|
|
1124
1030
|
content: z.string().optional().describe("New content of the wiki page"),
|
|
1125
|
-
format: z
|
|
1126
|
-
.string()
|
|
1127
|
-
.optional()
|
|
1128
|
-
.describe("Content format, e.g., markdown, rdoc"),
|
|
1031
|
+
format: z.string().optional().describe("Content format, e.g., markdown, rdoc"),
|
|
1129
1032
|
});
|
|
1130
1033
|
export const DeleteWikiPageSchema = z.object({
|
|
1131
1034
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
@@ -1162,3 +1065,69 @@ export const CreateMergeRequestThreadSchema = ProjectParamsSchema.extend({
|
|
|
1162
1065
|
position: MergeRequestThreadPositionSchema.optional().describe("Position when creating a diff note"),
|
|
1163
1066
|
created_at: z.string().optional().describe("Date the thread was created at (ISO 8601 format)"),
|
|
1164
1067
|
});
|
|
1068
|
+
// Milestone related schemas
|
|
1069
|
+
// Schema for listing project milestones
|
|
1070
|
+
export const ListProjectMilestonesSchema = ProjectParamsSchema.extend({
|
|
1071
|
+
iids: z.array(z.number()).optional().describe("Return only the milestones having the given iid"),
|
|
1072
|
+
state: z
|
|
1073
|
+
.enum(["active", "closed"])
|
|
1074
|
+
.optional()
|
|
1075
|
+
.describe("Return only active or closed milestones"),
|
|
1076
|
+
title: z
|
|
1077
|
+
.string()
|
|
1078
|
+
.optional()
|
|
1079
|
+
.describe("Return only milestones with a title matching the provided string"),
|
|
1080
|
+
search: z
|
|
1081
|
+
.string()
|
|
1082
|
+
.optional()
|
|
1083
|
+
.describe("Return only milestones with a title or description matching the provided string"),
|
|
1084
|
+
include_ancestors: z.boolean().optional().describe("Include ancestor groups"),
|
|
1085
|
+
updated_before: z
|
|
1086
|
+
.string()
|
|
1087
|
+
.optional()
|
|
1088
|
+
.describe("Return milestones updated before the specified date (ISO 8601 format)"),
|
|
1089
|
+
updated_after: z
|
|
1090
|
+
.string()
|
|
1091
|
+
.optional()
|
|
1092
|
+
.describe("Return milestones updated after the specified date (ISO 8601 format)"),
|
|
1093
|
+
page: z.number().optional().describe("Page number for pagination"),
|
|
1094
|
+
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
|
1095
|
+
});
|
|
1096
|
+
// Schema for getting a single milestone
|
|
1097
|
+
export const GetProjectMilestoneSchema = ProjectParamsSchema.extend({
|
|
1098
|
+
milestone_id: z.number().describe("The ID of a project milestone"),
|
|
1099
|
+
});
|
|
1100
|
+
// Schema for creating a new milestone
|
|
1101
|
+
export const CreateProjectMilestoneSchema = ProjectParamsSchema.extend({
|
|
1102
|
+
title: z.string().describe("The title of the milestone"),
|
|
1103
|
+
description: z.string().optional().describe("The description of the milestone"),
|
|
1104
|
+
due_date: z.string().optional().describe("The due date of the milestone (YYYY-MM-DD)"),
|
|
1105
|
+
start_date: z.string().optional().describe("The start date of the milestone (YYYY-MM-DD)"),
|
|
1106
|
+
});
|
|
1107
|
+
// Schema for editing a milestone
|
|
1108
|
+
export const EditProjectMilestoneSchema = GetProjectMilestoneSchema.extend({
|
|
1109
|
+
title: z.string().optional().describe("The title of the milestone"),
|
|
1110
|
+
description: z.string().optional().describe("The description of the milestone"),
|
|
1111
|
+
due_date: z.string().optional().describe("The due date of the milestone (YYYY-MM-DD)"),
|
|
1112
|
+
start_date: z.string().optional().describe("The start date of the milestone (YYYY-MM-DD)"),
|
|
1113
|
+
state_event: z
|
|
1114
|
+
.enum(["close", "activate"])
|
|
1115
|
+
.optional()
|
|
1116
|
+
.describe("The state event of the milestone"),
|
|
1117
|
+
});
|
|
1118
|
+
// Schema for deleting a milestone
|
|
1119
|
+
export const DeleteProjectMilestoneSchema = GetProjectMilestoneSchema;
|
|
1120
|
+
// Schema for getting issues assigned to a milestone
|
|
1121
|
+
export const GetMilestoneIssuesSchema = GetProjectMilestoneSchema;
|
|
1122
|
+
// Schema for getting merge requests assigned to a milestone
|
|
1123
|
+
export const GetMilestoneMergeRequestsSchema = GetProjectMilestoneSchema.extend({
|
|
1124
|
+
page: z.number().optional().describe("Page number for pagination"),
|
|
1125
|
+
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
|
1126
|
+
});
|
|
1127
|
+
// Schema for promoting a project milestone to a group milestone
|
|
1128
|
+
export const PromoteProjectMilestoneSchema = GetProjectMilestoneSchema;
|
|
1129
|
+
// Schema for getting burndown chart events for a milestone
|
|
1130
|
+
export const GetMilestoneBurndownEventsSchema = GetProjectMilestoneSchema.extend({
|
|
1131
|
+
page: z.number().optional().describe("Page number for pagination"),
|
|
1132
|
+
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
|
1133
|
+
});
|