@zereight/mcp-gitlab 1.0.52 → 1.0.54
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 +16 -1
- package/build/schemas.js +6 -6
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -12,6 +12,9 @@ import { fileURLToPath } from "url";
|
|
|
12
12
|
import { dirname } from "path";
|
|
13
13
|
import fs from "fs";
|
|
14
14
|
import path from "path";
|
|
15
|
+
// Add type imports for proxy agents
|
|
16
|
+
import { Agent } from "http";
|
|
17
|
+
import { Agent as HttpsAgent } from 'https';
|
|
15
18
|
import { URL } from "url";
|
|
16
19
|
import { GitLabForkSchema, GitLabReferenceSchema, GitLabRepositorySchema, GitLabIssueSchema, GitLabMergeRequestSchema, GitLabContentSchema, GitLabCreateUpdateFileResponseSchema, GitLabSearchResponseSchema, GitLabTreeSchema, GitLabCommitSchema, GitLabNamespaceSchema, GitLabNamespaceExistsResponseSchema, GitLabProjectSchema, CreateOrUpdateFileSchema, SearchRepositoriesSchema, CreateRepositorySchema, GetFileContentsSchema, PushFilesSchema, CreateIssueSchema, CreateMergeRequestSchema, ForkRepositorySchema, CreateBranchSchema, GitLabMergeRequestDiffSchema, GetMergeRequestSchema, GetMergeRequestDiffsSchema, UpdateMergeRequestSchema, ListIssuesSchema, GetIssueSchema, UpdateIssueSchema, DeleteIssueSchema, GitLabIssueLinkSchema, GitLabIssueWithLinkDetailsSchema, ListIssueLinksSchema, ListIssueDiscussionsSchema, GetIssueLinkSchema, CreateIssueLinkSchema, DeleteIssueLinkSchema, ListNamespacesSchema, GetNamespaceSchema, VerifyNamespaceSchema, GetProjectSchema, ListProjectsSchema, ListLabelsSchema, GetLabelSchema, CreateLabelSchema, UpdateLabelSchema, DeleteLabelSchema, CreateNoteSchema, CreateMergeRequestThreadSchema, ListGroupProjectsSchema, ListWikiPagesSchema, GetWikiPageSchema, CreateWikiPageSchema, UpdateWikiPageSchema, DeleteWikiPageSchema, GitLabWikiPageSchema, GetRepositoryTreeSchema, GitLabTreeItemSchema, GitLabPipelineSchema, GetPipelineSchema, ListPipelinesSchema, ListPipelineJobsSchema, CreatePipelineSchema, RetryPipelineSchema, CancelPipelineSchema,
|
|
17
20
|
// pipeline job schemas
|
|
@@ -53,6 +56,16 @@ const USE_PIPELINE = process.env.USE_PIPELINE === "true";
|
|
|
53
56
|
// Add proxy configuration
|
|
54
57
|
const HTTP_PROXY = process.env.HTTP_PROXY;
|
|
55
58
|
const HTTPS_PROXY = process.env.HTTPS_PROXY;
|
|
59
|
+
const NODE_TLS_REJECT_UNAUTHORIZED = process.env.NODE_TLS_REJECT_UNAUTHORIZED;
|
|
60
|
+
const GITLAB_CA_CERT_PATH = process.env.GITLAB_CA_CERT_PATH;
|
|
61
|
+
let sslOptions = undefined;
|
|
62
|
+
if (NODE_TLS_REJECT_UNAUTHORIZED === '0') {
|
|
63
|
+
sslOptions = { rejectUnauthorized: false };
|
|
64
|
+
}
|
|
65
|
+
else if (GITLAB_CA_CERT_PATH) {
|
|
66
|
+
const ca = fs.readFileSync(GITLAB_CA_CERT_PATH);
|
|
67
|
+
sslOptions = { ca };
|
|
68
|
+
}
|
|
56
69
|
// Configure proxy agents if proxies are set
|
|
57
70
|
let httpAgent = undefined;
|
|
58
71
|
let httpsAgent = undefined;
|
|
@@ -69,9 +82,11 @@ if (HTTPS_PROXY) {
|
|
|
69
82
|
httpsAgent = new SocksProxyAgent(HTTPS_PROXY);
|
|
70
83
|
}
|
|
71
84
|
else {
|
|
72
|
-
httpsAgent = new HttpsProxyAgent(HTTPS_PROXY);
|
|
85
|
+
httpsAgent = new HttpsProxyAgent(HTTPS_PROXY, sslOptions);
|
|
73
86
|
}
|
|
74
87
|
}
|
|
88
|
+
httpsAgent = httpsAgent || new HttpsAgent(sslOptions);
|
|
89
|
+
httpAgent = httpAgent || new Agent();
|
|
75
90
|
// Modify DEFAULT_HEADERS to include agent configuration
|
|
76
91
|
const DEFAULT_HEADERS = {
|
|
77
92
|
Accept: "application/json",
|
package/build/schemas.js
CHANGED
|
@@ -572,21 +572,21 @@ export const GitLabDiscussionNoteSchema = z.object({
|
|
|
572
572
|
old_path: z.string(),
|
|
573
573
|
new_path: z.string(),
|
|
574
574
|
position_type: z.enum(["text", "image", "file"]),
|
|
575
|
-
old_line: z.number().
|
|
576
|
-
new_line: z.number().
|
|
575
|
+
old_line: z.number().nullish(), // This is missing for image diffs
|
|
576
|
+
new_line: z.number().nullish(), // This is missing for image diffs
|
|
577
577
|
line_range: z
|
|
578
578
|
.object({
|
|
579
579
|
start: z.object({
|
|
580
580
|
line_code: z.string(),
|
|
581
581
|
type: z.enum(["new", "old", "expanded"]),
|
|
582
|
-
old_line: z.number().
|
|
583
|
-
new_line: z.number().
|
|
582
|
+
old_line: z.number().nullish(), // This is missing for image diffs
|
|
583
|
+
new_line: z.number().nullish(), // This is missing for image diffs
|
|
584
584
|
}),
|
|
585
585
|
end: z.object({
|
|
586
586
|
line_code: z.string(),
|
|
587
587
|
type: z.enum(["new", "old", "expanded"]),
|
|
588
|
-
old_line: z.number().
|
|
589
|
-
new_line: z.number().
|
|
588
|
+
old_line: z.number().nullish(), // This is missing for image diffs
|
|
589
|
+
new_line: z.number().nullish(), // This is missing for image diffs
|
|
590
590
|
}),
|
|
591
591
|
})
|
|
592
592
|
.nullable()
|