@zereight/mcp-gitlab 1.0.71 → 1.0.74
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/customSchemas.js +19 -0
- package/build/index.js +6 -5
- package/build/schemas.js +193 -199
- package/package.json +1 -1
- package/build/tests/integration.test.js +0 -151
- package/build/tests/unit.test.js +0 -122
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { pino } from 'pino';
|
|
3
|
+
const logger = pino({
|
|
4
|
+
level: process.env.LOG_LEVEL || 'info',
|
|
5
|
+
transport: {
|
|
6
|
+
target: 'pino-pretty',
|
|
7
|
+
options: {
|
|
8
|
+
colorize: true,
|
|
9
|
+
levelFirst: true,
|
|
10
|
+
destination: 2,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const flexibleBoolean = z.preprocess((val) => {
|
|
15
|
+
if (typeof val === 'string') {
|
|
16
|
+
return val.toLowerCase() === 'true';
|
|
17
|
+
}
|
|
18
|
+
return val;
|
|
19
|
+
}, z.boolean());
|
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({
|
|
@@ -846,12 +845,12 @@ async function listIssues(projectId, options = {}) {
|
|
|
846
845
|
url.searchParams.append(`${key}[]`, label.toString());
|
|
847
846
|
});
|
|
848
847
|
}
|
|
849
|
-
else {
|
|
848
|
+
else if (value) {
|
|
850
849
|
url.searchParams.append(`${key}[]`, value.toString());
|
|
851
850
|
}
|
|
852
851
|
}
|
|
853
852
|
else {
|
|
854
|
-
url.searchParams.append(key, value
|
|
853
|
+
url.searchParams.append(key, String(value));
|
|
855
854
|
}
|
|
856
855
|
}
|
|
857
856
|
});
|
|
@@ -880,7 +879,7 @@ async function listMergeRequests(projectId, options = {}) {
|
|
|
880
879
|
url.searchParams.append(key, value.join(","));
|
|
881
880
|
}
|
|
882
881
|
else {
|
|
883
|
-
url.searchParams.append(key, value
|
|
882
|
+
url.searchParams.append(key, String(value));
|
|
884
883
|
}
|
|
885
884
|
}
|
|
886
885
|
});
|
|
@@ -1059,7 +1058,7 @@ async function createMergeRequest(projectId, options) {
|
|
|
1059
1058
|
labels: options.labels?.join(","),
|
|
1060
1059
|
allow_collaboration: options.allow_collaboration,
|
|
1061
1060
|
draft: options.draft,
|
|
1062
|
-
remove_source_branch:
|
|
1061
|
+
remove_source_branch: options.remove_source_branch,
|
|
1063
1062
|
squash: options.squash,
|
|
1064
1063
|
}),
|
|
1065
1064
|
});
|
|
@@ -2618,6 +2617,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
2618
2617
|
if (GITLAB_AUTH_COOKIE_PATH) {
|
|
2619
2618
|
await ensureSessionForRequest();
|
|
2620
2619
|
}
|
|
2620
|
+
logger.info(request.params.name);
|
|
2621
2621
|
switch (request.params.name) {
|
|
2622
2622
|
case "fork_repository": {
|
|
2623
2623
|
if (GITLAB_PROJECT_ID) {
|
|
@@ -3306,6 +3306,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3306
3306
|
}
|
|
3307
3307
|
}
|
|
3308
3308
|
catch (error) {
|
|
3309
|
+
logger.debug(request.params);
|
|
3309
3310
|
if (error instanceof z.ZodError) {
|
|
3310
3311
|
throw new Error(`Invalid arguments: ${error.errors
|
|
3311
3312
|
.map(e => `${e.path.join(".")}: ${e.message}`)
|