Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
25be1947b9 | |||
864ee77ae6 | |||
dc6cc59434 | |||
5924fd3ed4 | |||
f4b265bf2e | |||
b326f4c3c3 | |||
1350a024b5 | |||
4c57c37888 |
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,3 +1,15 @@
|
|||||||
|
## [1.0.42] - 2025-05-22
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 이슈(issues)에 노트(note)를 생성하고 수정할 수 있는 기능이 추가되었습니다.
|
||||||
|
- 이제 버그나 할 일 같은 이슈에도 댓글(메모)을 달거나, 이미 단 댓글을 고칠 수 있습니다.
|
||||||
|
- 예시: "버그를 고쳤어요!"라는 댓글을 이슈에 달 수 있고, 필요하면 "버그를 완전히 고쳤어요!"로 바꿀 수 있습니다.
|
||||||
|
- 함수형 프로그래밍 원칙과 SOLID 원칙을 준수하여, 코드의 재사용성과 유지보수성이 높아졌습니다.
|
||||||
|
- 출처: [PR #47](https://github.com/zereight/gitlab-mcp/pull/47)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## [1.0.38] - 2025-05-17
|
## [1.0.38] - 2025-05-17
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
57
README.md
57
README.md
@ -52,10 +52,10 @@ When using with the Claude App, you need to set up your API key and URLs directl
|
|||||||
"GITLAB_READ_ONLY_MODE",
|
"GITLAB_READ_ONLY_MODE",
|
||||||
"-e",
|
"-e",
|
||||||
"USE_GITLAB_WIKI",
|
"USE_GITLAB_WIKI",
|
||||||
"nkwd/mcp-gitlab"
|
"nkwd/gitlab-mcp"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"GITLAB_PERSONAL_ACCESS": "your_gitlab_token",
|
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
|
||||||
"GITLAB_API_URL": "https://gitlab.com/api/v4", // Optional, for self-hosted GitLab
|
"GITLAB_API_URL": "https://gitlab.com/api/v4", // Optional, for self-hosted GitLab
|
||||||
"GITLAB_READ_ONLY_MODE": "false",
|
"GITLAB_READ_ONLY_MODE": "false",
|
||||||
"USE_GITLAB_WIKI": "true"
|
"USE_GITLAB_WIKI": "true"
|
||||||
@ -93,29 +93,32 @@ When using with the Claude App, you need to set up your API key and URLs directl
|
|||||||
15. `mr_discussions` - List discussion items for a merge request
|
15. `mr_discussions` - List discussion items for a merge request
|
||||||
16. `update_merge_request_note` - Modify an existing merge request thread note
|
16. `update_merge_request_note` - Modify an existing merge request thread note
|
||||||
17. `create_merge_request_note` - Add a new note to an existing merge request thread
|
17. `create_merge_request_note` - Add a new note to an existing merge request thread
|
||||||
18. `list_issues` - List issues in a GitLab project with filtering options
|
18. `update_issue_note` - Update the content of an existing issue note
|
||||||
19. `get_issue` - Get details of a specific issue in a GitLab project
|
19. `create_issue_note` - Add a new note to an existing issue thread
|
||||||
20. `update_issue` - Update an issue in a GitLab project
|
20. `list_issues` - List issues in a GitLab project with filtering options
|
||||||
21. `delete_issue` - Delete an issue from a GitLab project
|
21. `get_issue` - Get details of a specific issue in a GitLab project
|
||||||
22. `list_issue_links` - List all issue links for a specific issue
|
22. `update_issue` - Update an issue in a GitLab project
|
||||||
23. `get_issue_link` - Get a specific issue link
|
23. `delete_issue` - Delete an issue from a GitLab project
|
||||||
24. `create_issue_link` - Create an issue link between two issues
|
24. `list_issue_links` - List all issue links for a specific issue
|
||||||
25. `delete_issue_link` - Delete an issue link
|
25. `list_issue_discussions` - List discussions for an issue in a GitLab project
|
||||||
26. `list_namespaces` - List all namespaces available to the current user
|
26. `get_issue_link` - Get a specific issue link
|
||||||
27. `get_namespace` - Get details of a namespace by ID or path
|
27. `create_issue_link` - Create an issue link between two issues
|
||||||
28. `verify_namespace` - Verify if a namespace path exists
|
28. `delete_issue_link` - Delete an issue link
|
||||||
29. `get_project` - Get details of a specific project
|
29. `list_namespaces` - List all namespaces available to the current user
|
||||||
30. `list_projects` - List projects accessible by the current user
|
30. `get_namespace` - Get details of a namespace by ID or path
|
||||||
31. `list_labels` - List labels for a project
|
31. `verify_namespace` - Verify if a namespace path exists
|
||||||
32. `get_label` - Get a single label from a project
|
32. `get_project` - Get details of a specific project
|
||||||
33. `create_label` - Create a new label in a project
|
33. `list_projects` - List projects accessible by the current user
|
||||||
34. `update_label` - Update an existing label in a project
|
34. `list_labels` - List labels for a project
|
||||||
35. `delete_label` - Delete a label from a project
|
35. `get_label` - Get a single label from a project
|
||||||
36. `list_group_projects` - List projects in a GitLab group with filtering options
|
36. `create_label` - Create a new label in a project
|
||||||
37. `list_wiki_pages` - List wiki pages in a GitLab project
|
37. `update_label` - Update an existing label in a project
|
||||||
38. `get_wiki_page` - Get details of a specific wiki page
|
38. `delete_label` - Delete a label from a project
|
||||||
39. `create_wiki_page` - Create a new wiki page in a GitLab project
|
39. `list_group_projects` - List projects in a GitLab group with filtering options
|
||||||
40. `update_wiki_page` - Update an existing wiki page in a GitLab project
|
40. `list_wiki_pages` - List wiki pages in a GitLab project
|
||||||
41. `delete_wiki_page` - Delete a wiki page from a GitLab project
|
41. `get_wiki_page` - Get details of a specific wiki page
|
||||||
42. `get_repository_tree` - Get the repository tree for a GitLab project (list files and directories)
|
42. `create_wiki_page` - Create a new wiki page in a GitLab project
|
||||||
|
43. `update_wiki_page` - Update an existing wiki page in a GitLab project
|
||||||
|
44. `delete_wiki_page` - Delete a wiki page from a GitLab project
|
||||||
|
45. `get_repository_tree` - Get the repository tree for a GitLab project (list files and directories)
|
||||||
<!-- TOOLS-END -->
|
<!-- TOOLS-END -->
|
||||||
|
194
index.ts
194
index.ts
@ -61,6 +61,7 @@ import {
|
|||||||
GitLabIssueLinkSchema,
|
GitLabIssueLinkSchema,
|
||||||
GitLabIssueWithLinkDetailsSchema,
|
GitLabIssueWithLinkDetailsSchema,
|
||||||
ListIssueLinksSchema,
|
ListIssueLinksSchema,
|
||||||
|
ListIssueDiscussionsSchema,
|
||||||
GetIssueLinkSchema,
|
GetIssueLinkSchema,
|
||||||
CreateIssueLinkSchema,
|
CreateIssueLinkSchema,
|
||||||
DeleteIssueLinkSchema,
|
DeleteIssueLinkSchema,
|
||||||
@ -120,6 +121,8 @@ import {
|
|||||||
GetRepositoryTreeSchema,
|
GetRepositoryTreeSchema,
|
||||||
type GitLabTreeItem,
|
type GitLabTreeItem,
|
||||||
type GetRepositoryTreeOptions,
|
type GetRepositoryTreeOptions,
|
||||||
|
UpdateIssueNoteSchema,
|
||||||
|
CreateIssueNoteSchema,
|
||||||
} from "./schemas.js";
|
} from "./schemas.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -286,6 +289,16 @@ const allTools = [
|
|||||||
description: "Add a new note to an existing merge request thread",
|
description: "Add a new note to an existing merge request thread",
|
||||||
inputSchema: zodToJsonSchema(CreateMergeRequestNoteSchema),
|
inputSchema: zodToJsonSchema(CreateMergeRequestNoteSchema),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "update_issue_note",
|
||||||
|
description: "Modify an existing issue thread note",
|
||||||
|
inputSchema: zodToJsonSchema(UpdateIssueNoteSchema),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "create_issue_note",
|
||||||
|
description: "Add a new note to an existing issue thread",
|
||||||
|
inputSchema: zodToJsonSchema(CreateIssueNoteSchema),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "list_issues",
|
name: "list_issues",
|
||||||
description: "List issues in a GitLab project with filtering options",
|
description: "List issues in a GitLab project with filtering options",
|
||||||
@ -311,6 +324,11 @@ const allTools = [
|
|||||||
description: "List all issue links for a specific issue",
|
description: "List all issue links for a specific issue",
|
||||||
inputSchema: zodToJsonSchema(ListIssueLinksSchema),
|
inputSchema: zodToJsonSchema(ListIssueLinksSchema),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "list_issue_discussions",
|
||||||
|
description: "List discussions for an issue in a GitLab project",
|
||||||
|
inputSchema: zodToJsonSchema(ListIssueDiscussionsSchema),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "get_issue_link",
|
name: "get_issue_link",
|
||||||
description: "Get a specific issue link",
|
description: "Get a specific issue link",
|
||||||
@ -424,6 +442,7 @@ const readOnlyTools = [
|
|||||||
"list_issues",
|
"list_issues",
|
||||||
"get_issue",
|
"get_issue",
|
||||||
"list_issue_links",
|
"list_issue_links",
|
||||||
|
"list_issue_discussions",
|
||||||
"get_issue_link",
|
"get_issue_link",
|
||||||
"list_namespaces",
|
"list_namespaces",
|
||||||
"get_namespace",
|
"get_namespace",
|
||||||
@ -1023,6 +1042,56 @@ async function listMergeRequestDiscussions(
|
|||||||
return z.array(GitLabDiscussionSchema).parse(data);
|
return z.array(GitLabDiscussionSchema).parse(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List discussions for an issue
|
||||||
|
*
|
||||||
|
* @param {string} projectId - The ID or URL-encoded path of the project
|
||||||
|
* @param {number} issueIid - The internal ID of the project issue
|
||||||
|
* @param {Object} options - Pagination and sorting options
|
||||||
|
* @returns {Promise<GitLabDiscussion[]>} List of issue discussions
|
||||||
|
*/
|
||||||
|
async function listIssueDiscussions(
|
||||||
|
projectId: string,
|
||||||
|
issueIid: number,
|
||||||
|
options: {
|
||||||
|
page?: number,
|
||||||
|
per_page?: number,
|
||||||
|
sort?: "asc" | "desc",
|
||||||
|
order_by?: "created_at" | "updated_at"
|
||||||
|
} = {}
|
||||||
|
): Promise<GitLabDiscussion[]> {
|
||||||
|
projectId = decodeURIComponent(projectId); // Decode project ID
|
||||||
|
const url = new URL(
|
||||||
|
`${GITLAB_API_URL}/projects/${encodeURIComponent(
|
||||||
|
projectId
|
||||||
|
)}/issues/${issueIid}/discussions`
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add query parameters for pagination and sorting
|
||||||
|
if (options.page) {
|
||||||
|
url.searchParams.append("page", options.page.toString());
|
||||||
|
}
|
||||||
|
if (options.per_page) {
|
||||||
|
url.searchParams.append("per_page", options.per_page.toString());
|
||||||
|
}
|
||||||
|
if (options.sort) {
|
||||||
|
url.searchParams.append("sort", options.sort);
|
||||||
|
}
|
||||||
|
if (options.order_by) {
|
||||||
|
url.searchParams.append("order_by", options.order_by);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(url.toString(), {
|
||||||
|
...DEFAULT_FETCH_CONFIG,
|
||||||
|
});
|
||||||
|
|
||||||
|
await handleGitLabError(response);
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
// Parse the response as an array of discussions
|
||||||
|
return z.array(GitLabDiscussionSchema).parse(data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify an existing merge request thread note
|
* Modify an existing merge request thread note
|
||||||
* 병합 요청 토론 노트 수정
|
* 병합 요청 토론 노트 수정
|
||||||
@ -1069,6 +1138,81 @@ async function updateMergeRequestNote(
|
|||||||
return GitLabDiscussionNoteSchema.parse(data);
|
return GitLabDiscussionNoteSchema.parse(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update an issue discussion note
|
||||||
|
* @param {string} projectId - The ID or URL-encoded path of the project
|
||||||
|
* @param {number} issueIid - The IID of an issue
|
||||||
|
* @param {string} discussionId - The ID of a thread
|
||||||
|
* @param {number} noteId - The ID of a thread note
|
||||||
|
* @param {string} body - The new content of the note
|
||||||
|
* @returns {Promise<GitLabDiscussionNote>} The updated note
|
||||||
|
*/
|
||||||
|
async function updateIssueNote(
|
||||||
|
projectId: string,
|
||||||
|
issueIid: number,
|
||||||
|
discussionId: string,
|
||||||
|
noteId: number,
|
||||||
|
body: string
|
||||||
|
): Promise<GitLabDiscussionNote> {
|
||||||
|
projectId = decodeURIComponent(projectId); // Decode project ID
|
||||||
|
const url = new URL(
|
||||||
|
`${GITLAB_API_URL}/projects/${encodeURIComponent(
|
||||||
|
projectId
|
||||||
|
)}/issues/${issueIid}/discussions/${discussionId}/notes/${noteId}`
|
||||||
|
);
|
||||||
|
|
||||||
|
const payload = { body };
|
||||||
|
|
||||||
|
const response = await fetch(url.toString(), {
|
||||||
|
...DEFAULT_FETCH_CONFIG,
|
||||||
|
method: "PUT",
|
||||||
|
body: JSON.stringify(payload),
|
||||||
|
});
|
||||||
|
|
||||||
|
await handleGitLabError(response);
|
||||||
|
const data = await response.json();
|
||||||
|
return GitLabDiscussionNoteSchema.parse(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a note in an issue discussion
|
||||||
|
* @param {string} projectId - The ID or URL-encoded path of the project
|
||||||
|
* @param {number} issueIid - The IID of an issue
|
||||||
|
* @param {string} discussionId - The ID of a thread
|
||||||
|
* @param {string} body - The content of the new note
|
||||||
|
* @param {string} [createdAt] - The creation date of the note (ISO 8601 format)
|
||||||
|
* @returns {Promise<GitLabDiscussionNote>} The created note
|
||||||
|
*/
|
||||||
|
async function createIssueNote(
|
||||||
|
projectId: string,
|
||||||
|
issueIid: number,
|
||||||
|
discussionId: string,
|
||||||
|
body: string,
|
||||||
|
createdAt?: string
|
||||||
|
): Promise<GitLabDiscussionNote> {
|
||||||
|
projectId = decodeURIComponent(projectId); // Decode project ID
|
||||||
|
const url = new URL(
|
||||||
|
`${GITLAB_API_URL}/projects/${encodeURIComponent(
|
||||||
|
projectId
|
||||||
|
)}/issues/${issueIid}/discussions/${discussionId}/notes`
|
||||||
|
);
|
||||||
|
|
||||||
|
const payload: { body: string; created_at?: string } = { body };
|
||||||
|
if (createdAt) {
|
||||||
|
payload.created_at = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(url.toString(), {
|
||||||
|
...DEFAULT_FETCH_CONFIG,
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(payload),
|
||||||
|
});
|
||||||
|
|
||||||
|
await handleGitLabError(response);
|
||||||
|
const data = await response.json();
|
||||||
|
return GitLabDiscussionNoteSchema.parse(data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new note to an existing merge request thread
|
* Add a new note to an existing merge request thread
|
||||||
* 기존 병합 요청 스레드에 새 노트 추가
|
* 기존 병합 요청 스레드에 새 노트 추가
|
||||||
@ -1581,7 +1725,7 @@ async function createNote(
|
|||||||
* Create a new thread on a merge request
|
* Create a new thread on a merge request
|
||||||
* 📦 새로운 함수: createMergeRequestThread - 병합 요청에 새로운 스레드(토론)를 생성하는 함수
|
* 📦 새로운 함수: createMergeRequestThread - 병합 요청에 새로운 스레드(토론)를 생성하는 함수
|
||||||
* (New function: createMergeRequestThread - Function to create a new thread (discussion) on a merge request)
|
* (New function: createMergeRequestThread - Function to create a new thread (discussion) on a merge request)
|
||||||
*
|
*
|
||||||
* This function provides more capabilities than createNote, including the ability to:
|
* This function provides more capabilities than createNote, including the ability to:
|
||||||
* - Create diff notes (comments on specific lines of code)
|
* - Create diff notes (comments on specific lines of code)
|
||||||
* - Specify exact positions for comments
|
* - Specify exact positions for comments
|
||||||
@ -1609,12 +1753,12 @@ async function createMergeRequestThread(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const payload: Record<string, any> = { body };
|
const payload: Record<string, any> = { body };
|
||||||
|
|
||||||
// Add optional parameters if provided
|
// Add optional parameters if provided
|
||||||
if (position) {
|
if (position) {
|
||||||
payload.position = position;
|
payload.position = position;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (createdAt) {
|
if (createdAt) {
|
||||||
payload.created_at = createdAt;
|
payload.created_at = createdAt;
|
||||||
}
|
}
|
||||||
@ -2387,7 +2531,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|||||||
content: [{ type: "text", text: JSON.stringify(note, null, 2) }],
|
content: [{ type: "text", text: JSON.stringify(note, null, 2) }],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
case "create_merge_request_note": {
|
case "create_merge_request_note": {
|
||||||
const args = CreateMergeRequestNoteSchema.parse(
|
const args = CreateMergeRequestNoteSchema.parse(
|
||||||
request.params.arguments
|
request.params.arguments
|
||||||
@ -2404,6 +2548,38 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "update_issue_note": {
|
||||||
|
const args = UpdateIssueNoteSchema.parse(
|
||||||
|
request.params.arguments
|
||||||
|
);
|
||||||
|
const note = await updateIssueNote(
|
||||||
|
args.project_id,
|
||||||
|
args.issue_iid,
|
||||||
|
args.discussion_id,
|
||||||
|
args.note_id,
|
||||||
|
args.body
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
content: [{ type: "text", text: JSON.stringify(note, null, 2) }],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case "create_issue_note": {
|
||||||
|
const args = CreateIssueNoteSchema.parse(
|
||||||
|
request.params.arguments
|
||||||
|
);
|
||||||
|
const note = await createIssueNote(
|
||||||
|
args.project_id,
|
||||||
|
args.issue_iid,
|
||||||
|
args.discussion_id,
|
||||||
|
args.body,
|
||||||
|
args.created_at
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
content: [{ type: "text", text: JSON.stringify(note, null, 2) }],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case "get_merge_request": {
|
case "get_merge_request": {
|
||||||
const args = GetMergeRequestSchema.parse(request.params.arguments);
|
const args = GetMergeRequestSchema.parse(request.params.arguments);
|
||||||
const mergeRequest = await getMergeRequest(
|
const mergeRequest = await getMergeRequest(
|
||||||
@ -2647,6 +2823,16 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "list_issue_discussions": {
|
||||||
|
const args = ListIssueDiscussionsSchema.parse(request.params.arguments);
|
||||||
|
const { project_id, issue_iid, ...options } = args;
|
||||||
|
|
||||||
|
const discussions = await listIssueDiscussions(project_id, issue_iid, options);
|
||||||
|
return {
|
||||||
|
content: [{ type: "text", text: JSON.stringify(discussions, null, 2) }],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case "get_issue_link": {
|
case "get_issue_link": {
|
||||||
const args = GetIssueLinkSchema.parse(request.params.arguments);
|
const args = GetIssueLinkSchema.parse(request.params.arguments);
|
||||||
const link = await getIssueLink(
|
const link = await getIssueLink(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@zereight/mcp-gitlab",
|
"name": "@zereight/mcp-gitlab",
|
||||||
"version": "1.0.39",
|
"version": "1.0.42",
|
||||||
"description": "MCP server for using the GitLab API",
|
"description": "MCP server for using the GitLab API",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "zereight",
|
"author": "zereight",
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
### Fixed
|
### 1.0.40 (2025-05-21)
|
||||||
|
|
||||||
- Added `expanded` property to `start` and `end` in `GitLabDiscussionNoteSchema`
|
- Added support for listing discussions (comments/notes) on GitLab issues.
|
||||||
Now you can expand or collapse more information at the start and end of discussion notes.
|
- Example: You can now easily fetch all conversations (comments) attached to an issue via the API.
|
||||||
Example: In code review, you can choose to show or hide specific parts of the discussion.
|
- Related PR: [#44](https://github.com/zereight/gitlab-mcp/pull/44)
|
||||||
(See: [PR #40](https://github.com/zereight/gitlab-mcp/pull/40))
|
|
||||||
|
28
schemas.ts
28
schemas.ts
@ -491,6 +491,22 @@ export const CreateMergeRequestNoteSchema = ProjectParamsSchema.extend({
|
|||||||
created_at: z.string().optional().describe("Date the note was created at (ISO 8601 format)"),
|
created_at: z.string().optional().describe("Date the note was created at (ISO 8601 format)"),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Input schema for updating an issue discussion note
|
||||||
|
export const UpdateIssueNoteSchema = ProjectParamsSchema.extend({
|
||||||
|
issue_iid: z.number().describe("The IID of an issue"),
|
||||||
|
discussion_id: z.string().describe("The ID of a thread"),
|
||||||
|
note_id: z.number().describe("The ID of a thread note"),
|
||||||
|
body: z.string().describe("The content of the note or reply"),
|
||||||
|
});
|
||||||
|
|
||||||
|
// Input schema for adding a note to an existing issue discussion
|
||||||
|
export const CreateIssueNoteSchema = ProjectParamsSchema.extend({
|
||||||
|
issue_iid: z.number().describe("The IID of an issue"),
|
||||||
|
discussion_id: z.string().describe("The ID of a thread"),
|
||||||
|
body: z.string().describe("The content of the note or reply"),
|
||||||
|
created_at: z.string().optional().describe("Date the note was created at (ISO 8601 format)"),
|
||||||
|
});
|
||||||
|
|
||||||
// API Operation Parameter Schemas
|
// API Operation Parameter Schemas
|
||||||
|
|
||||||
export const CreateOrUpdateFileSchema = ProjectParamsSchema.extend({
|
export const CreateOrUpdateFileSchema = ProjectParamsSchema.extend({
|
||||||
@ -757,6 +773,15 @@ export const ListIssueLinksSchema = z.object({
|
|||||||
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const ListIssueDiscussionsSchema = z.object({
|
||||||
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||||
|
issue_iid: z.number().describe("The internal ID of the project issue"),
|
||||||
|
page: z.number().optional().describe("Page number for pagination"),
|
||||||
|
per_page: z.number().optional().describe("Number of items per page"),
|
||||||
|
sort: z.enum(["asc", "desc"]).optional().describe("Return issue discussions sorted in ascending or descending order"),
|
||||||
|
order_by: z.enum(["created_at", "updated_at"]).optional().describe("Return issue discussions ordered by created_at or updated_at fields"),
|
||||||
|
});
|
||||||
|
|
||||||
export const GetIssueLinkSchema = z.object({
|
export const GetIssueLinkSchema = z.object({
|
||||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||||
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
||||||
@ -1075,6 +1100,9 @@ export type GitLabMergeRequestDiff = z.infer<
|
|||||||
>;
|
>;
|
||||||
export type CreateNoteOptions = z.infer<typeof CreateNoteSchema>;
|
export type CreateNoteOptions = z.infer<typeof CreateNoteSchema>;
|
||||||
export type GitLabIssueLink = z.infer<typeof GitLabIssueLinkSchema>;
|
export type GitLabIssueLink = z.infer<typeof GitLabIssueLinkSchema>;
|
||||||
|
export type ListIssueDiscussionsOptions = z.infer<typeof ListIssueDiscussionsSchema>;
|
||||||
|
export type UpdateIssueNoteOptions = z.infer<typeof UpdateIssueNoteSchema>;
|
||||||
|
export type CreateIssueNoteOptions = z.infer<typeof CreateIssueNoteSchema>;
|
||||||
export type GitLabNamespace = z.infer<typeof GitLabNamespaceSchema>;
|
export type GitLabNamespace = z.infer<typeof GitLabNamespaceSchema>;
|
||||||
export type GitLabNamespaceExistsResponse = z.infer<
|
export type GitLabNamespaceExistsResponse = z.infer<
|
||||||
typeof GitLabNamespaceExistsResponseSchema
|
typeof GitLabNamespaceExistsResponseSchema
|
||||||
|
Reference in New Issue
Block a user