@structured-world/gitlab-mcp 6.8.0 → 6.9.0
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/LICENSE +202 -21
- package/LICENSE.MIT +21 -0
- package/README.md +149 -1
- package/dist/src/config.d.ts +5 -0
- package/dist/src/config.js +88 -1
- package/dist/src/config.js.map +1 -1
- package/dist/src/entities/core/registry.js +68 -63
- package/dist/src/entities/core/registry.js.map +1 -1
- package/dist/src/entities/core/schema-readonly.d.ts +93 -36
- package/dist/src/entities/core/schema-readonly.js +146 -121
- package/dist/src/entities/core/schema-readonly.js.map +1 -1
- package/dist/src/entities/core/schema.d.ts +33 -23
- package/dist/src/entities/core/schema.js +65 -60
- package/dist/src/entities/core/schema.js.map +1 -1
- package/dist/src/entities/files/registry.js +14 -21
- package/dist/src/entities/files/registry.js.map +1 -1
- package/dist/src/entities/files/schema-readonly.d.ts +8 -7
- package/dist/src/entities/files/schema-readonly.js +20 -25
- package/dist/src/entities/files/schema-readonly.js.map +1 -1
- package/dist/src/entities/files/schema.d.ts +22 -15
- package/dist/src/entities/files/schema.js +32 -73
- package/dist/src/entities/files/schema.js.map +1 -1
- package/dist/src/entities/integrations/registry.js +3 -0
- package/dist/src/entities/integrations/registry.js.map +1 -1
- package/dist/src/entities/integrations/schema.d.ts +114 -8
- package/dist/src/entities/integrations/schema.js +27 -9
- package/dist/src/entities/integrations/schema.js.map +1 -1
- package/dist/src/entities/labels/registry.js +8 -7
- package/dist/src/entities/labels/registry.js.map +1 -1
- package/dist/src/entities/labels/schema-readonly.d.ts +8 -7
- package/dist/src/entities/labels/schema-readonly.js +20 -18
- package/dist/src/entities/labels/schema-readonly.js.map +1 -1
- package/dist/src/entities/labels/schema.d.ts +15 -8
- package/dist/src/entities/labels/schema.js +36 -27
- package/dist/src/entities/labels/schema.js.map +1 -1
- package/dist/src/entities/milestones/registry.js +7 -8
- package/dist/src/entities/milestones/registry.js.map +1 -1
- package/dist/src/entities/milestones/schema-readonly.d.ts +25 -10
- package/dist/src/entities/milestones/schema-readonly.js +47 -26
- package/dist/src/entities/milestones/schema-readonly.js.map +1 -1
- package/dist/src/entities/milestones/schema.d.ts +19 -9
- package/dist/src/entities/milestones/schema.js +31 -20
- package/dist/src/entities/milestones/schema.js.map +1 -1
- package/dist/src/entities/mrs/registry.js +75 -79
- package/dist/src/entities/mrs/registry.js.map +1 -1
- package/dist/src/entities/mrs/schema-readonly.d.ts +36 -23
- package/dist/src/entities/mrs/schema-readonly.js +197 -338
- package/dist/src/entities/mrs/schema-readonly.js.map +1 -1
- package/dist/src/entities/mrs/schema.d.ts +113 -37
- package/dist/src/entities/mrs/schema.js +140 -258
- package/dist/src/entities/mrs/schema.js.map +1 -1
- package/dist/src/entities/pipelines/registry.js +10 -4
- package/dist/src/entities/pipelines/registry.js.map +1 -1
- package/dist/src/entities/pipelines/schema-readonly.d.ts +30 -14
- package/dist/src/entities/pipelines/schema-readonly.js +62 -52
- package/dist/src/entities/pipelines/schema-readonly.js.map +1 -1
- package/dist/src/entities/pipelines/schema.d.ts +23 -16
- package/dist/src/entities/pipelines/schema.js +44 -26
- package/dist/src/entities/pipelines/schema.js.map +1 -1
- package/dist/src/entities/snippets/registry.js +79 -67
- package/dist/src/entities/snippets/registry.js.map +1 -1
- package/dist/src/entities/snippets/schema-readonly.d.ts +8 -9
- package/dist/src/entities/snippets/schema-readonly.js +30 -35
- package/dist/src/entities/snippets/schema-readonly.js.map +1 -1
- package/dist/src/entities/snippets/schema.d.ts +7 -11
- package/dist/src/entities/snippets/schema.js +31 -65
- package/dist/src/entities/snippets/schema.js.map +1 -1
- package/dist/src/entities/variables/registry.js +9 -5
- package/dist/src/entities/variables/registry.js.map +1 -1
- package/dist/src/entities/variables/schema-readonly.d.ts +9 -9
- package/dist/src/entities/variables/schema-readonly.js +22 -18
- package/dist/src/entities/variables/schema-readonly.js.map +1 -1
- package/dist/src/entities/variables/schema.d.ts +24 -7
- package/dist/src/entities/variables/schema.js +67 -38
- package/dist/src/entities/variables/schema.js.map +1 -1
- package/dist/src/entities/webhooks/registry.js +48 -46
- package/dist/src/entities/webhooks/registry.js.map +1 -1
- package/dist/src/entities/webhooks/schema-readonly.d.ts +9 -8
- package/dist/src/entities/webhooks/schema-readonly.js +14 -9
- package/dist/src/entities/webhooks/schema-readonly.js.map +1 -1
- package/dist/src/entities/webhooks/schema.d.ts +79 -26
- package/dist/src/entities/webhooks/schema.js +70 -61
- package/dist/src/entities/webhooks/schema.js.map +1 -1
- package/dist/src/entities/wiki/registry.js +7 -4
- package/dist/src/entities/wiki/registry.js.map +1 -1
- package/dist/src/entities/wiki/schema-readonly.d.ts +7 -7
- package/dist/src/entities/wiki/schema-readonly.js +11 -15
- package/dist/src/entities/wiki/schema-readonly.js.map +1 -1
- package/dist/src/entities/wiki/schema.d.ts +19 -8
- package/dist/src/entities/wiki/schema.js +32 -29
- package/dist/src/entities/wiki/schema.js.map +1 -1
- package/dist/src/entities/workitems/registry.js +7 -8
- package/dist/src/entities/workitems/registry.js.map +1 -1
- package/dist/src/entities/workitems/schema-readonly.d.ts +7 -8
- package/dist/src/entities/workitems/schema-readonly.js +12 -14
- package/dist/src/entities/workitems/schema-readonly.js.map +1 -1
- package/dist/src/entities/workitems/schema.d.ts +17 -11
- package/dist/src/entities/workitems/schema.js +25 -25
- package/dist/src/entities/workitems/schema.js.map +1 -1
- package/dist/src/registry-manager.js +22 -11
- package/dist/src/registry-manager.js.map +1 -1
- package/dist/src/utils/schema-utils.d.ts +28 -0
- package/dist/src/utils/schema-utils.js +244 -0
- package/dist/src/utils/schema-utils.js.map +1 -0
- package/dist/structured-world-gitlab-mcp-6.9.0.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/structured-world-gitlab-mcp-6.8.0.tgz +0 -0
|
@@ -1,38 +1,46 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const ManageWebhookSchema: z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
export declare const ManageWebhookSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
push_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
4
|
+
push_events_branch_filter: z.ZodOptional<z.ZodString>;
|
|
5
|
+
tag_push_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
6
|
+
merge_requests_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
7
|
+
issues_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
8
|
+
confidential_issues_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
9
|
+
note_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
10
|
+
confidential_note_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
11
|
+
job_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
12
|
+
pipeline_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
13
|
+
wiki_page_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
14
|
+
deployment_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
15
|
+
feature_flag_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
16
|
+
releases_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
17
|
+
emoji_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
18
|
+
resource_access_token_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
19
|
+
member_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
20
|
+
subgroup_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
21
|
+
project_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
22
|
+
enable_ssl_verification: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
23
|
+
action: z.ZodLiteral<"create">;
|
|
10
24
|
scope: z.ZodEnum<{
|
|
11
25
|
project: "project";
|
|
12
26
|
group: "group";
|
|
13
27
|
}>;
|
|
14
28
|
projectId: z.ZodOptional<z.ZodString>;
|
|
15
29
|
groupId: z.ZodOptional<z.ZodString>;
|
|
16
|
-
|
|
17
|
-
trigger: z.ZodOptional<z.ZodEnum<{
|
|
18
|
-
push_events: "push_events";
|
|
19
|
-
tag_push_events: "tag_push_events";
|
|
20
|
-
merge_requests_events: "merge_requests_events";
|
|
21
|
-
issues_events: "issues_events";
|
|
22
|
-
confidential_issues_events: "confidential_issues_events";
|
|
23
|
-
note_events: "note_events";
|
|
24
|
-
job_events: "job_events";
|
|
25
|
-
pipeline_events: "pipeline_events";
|
|
26
|
-
wiki_page_events: "wiki_page_events";
|
|
27
|
-
releases_events: "releases_events";
|
|
28
|
-
milestone_events: "milestone_events";
|
|
29
|
-
emoji_events: "emoji_events";
|
|
30
|
-
resource_access_token_events: "resource_access_token_events";
|
|
31
|
-
}>>;
|
|
32
|
-
url: z.ZodOptional<z.ZodString>;
|
|
30
|
+
url: z.ZodString;
|
|
33
31
|
name: z.ZodOptional<z.ZodString>;
|
|
34
32
|
description: z.ZodOptional<z.ZodString>;
|
|
35
33
|
token: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
+
action: z.ZodLiteral<"read">;
|
|
36
|
+
scope: z.ZodEnum<{
|
|
37
|
+
project: "project";
|
|
38
|
+
group: "group";
|
|
39
|
+
}>;
|
|
40
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
groupId: z.ZodOptional<z.ZodString>;
|
|
42
|
+
hookId: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
43
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
36
44
|
push_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
37
45
|
push_events_branch_filter: z.ZodOptional<z.ZodString>;
|
|
38
46
|
tag_push_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
@@ -53,5 +61,50 @@ export declare const ManageWebhookSchema: z.ZodObject<{
|
|
|
53
61
|
subgroup_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
54
62
|
project_events: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
55
63
|
enable_ssl_verification: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
56
|
-
|
|
64
|
+
action: z.ZodLiteral<"update">;
|
|
65
|
+
scope: z.ZodEnum<{
|
|
66
|
+
project: "project";
|
|
67
|
+
group: "group";
|
|
68
|
+
}>;
|
|
69
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
groupId: z.ZodOptional<z.ZodString>;
|
|
71
|
+
hookId: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
72
|
+
url: z.ZodOptional<z.ZodString>;
|
|
73
|
+
name: z.ZodOptional<z.ZodString>;
|
|
74
|
+
description: z.ZodOptional<z.ZodString>;
|
|
75
|
+
token: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
77
|
+
action: z.ZodLiteral<"delete">;
|
|
78
|
+
scope: z.ZodEnum<{
|
|
79
|
+
project: "project";
|
|
80
|
+
group: "group";
|
|
81
|
+
}>;
|
|
82
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
83
|
+
groupId: z.ZodOptional<z.ZodString>;
|
|
84
|
+
hookId: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
action: z.ZodLiteral<"test">;
|
|
87
|
+
scope: z.ZodEnum<{
|
|
88
|
+
project: "project";
|
|
89
|
+
group: "group";
|
|
90
|
+
}>;
|
|
91
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
92
|
+
groupId: z.ZodOptional<z.ZodString>;
|
|
93
|
+
hookId: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
94
|
+
trigger: z.ZodEnum<{
|
|
95
|
+
push_events: "push_events";
|
|
96
|
+
tag_push_events: "tag_push_events";
|
|
97
|
+
merge_requests_events: "merge_requests_events";
|
|
98
|
+
issues_events: "issues_events";
|
|
99
|
+
confidential_issues_events: "confidential_issues_events";
|
|
100
|
+
note_events: "note_events";
|
|
101
|
+
job_events: "job_events";
|
|
102
|
+
pipeline_events: "pipeline_events";
|
|
103
|
+
wiki_page_events: "wiki_page_events";
|
|
104
|
+
releases_events: "releases_events";
|
|
105
|
+
milestone_events: "milestone_events";
|
|
106
|
+
emoji_events: "emoji_events";
|
|
107
|
+
resource_access_token_events: "resource_access_token_events";
|
|
108
|
+
}>;
|
|
109
|
+
}, z.core.$strip>], "action">;
|
|
57
110
|
export type ManageWebhookOptions = z.infer<typeof ManageWebhookSchema>;
|
|
@@ -3,37 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ManageWebhookSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
|
-
|
|
7
|
-
.object({
|
|
8
|
-
action: zod_1.z
|
|
9
|
-
.enum(["create", "read", "update", "delete", "test"])
|
|
10
|
-
.describe("Action to perform on webhook"),
|
|
11
|
-
scope: zod_1.z.enum(["project", "group"]).describe("Scope of webhook (project or group)"),
|
|
12
|
-
projectId: zod_1.z.string().optional().describe("Project ID or path (required if scope=project)"),
|
|
13
|
-
groupId: zod_1.z.string().optional().describe("Group ID or path (required if scope=group)"),
|
|
14
|
-
hookId: zod_1.z.number().optional().describe("Webhook ID (required for read/update/delete/test)"),
|
|
15
|
-
trigger: zod_1.z
|
|
16
|
-
.enum([
|
|
17
|
-
"push_events",
|
|
18
|
-
"tag_push_events",
|
|
19
|
-
"merge_requests_events",
|
|
20
|
-
"issues_events",
|
|
21
|
-
"confidential_issues_events",
|
|
22
|
-
"note_events",
|
|
23
|
-
"job_events",
|
|
24
|
-
"pipeline_events",
|
|
25
|
-
"wiki_page_events",
|
|
26
|
-
"releases_events",
|
|
27
|
-
"milestone_events",
|
|
28
|
-
"emoji_events",
|
|
29
|
-
"resource_access_token_events",
|
|
30
|
-
])
|
|
31
|
-
.optional()
|
|
32
|
-
.describe("Event type to test (required for test action)"),
|
|
33
|
-
url: zod_1.z.string().optional().describe("Webhook URL (required for create)"),
|
|
34
|
-
name: zod_1.z.string().optional().describe("Human-readable webhook name (GitLab 16.11+)"),
|
|
35
|
-
description: zod_1.z.string().optional().describe("Webhook description (GitLab 16.11+)"),
|
|
36
|
-
token: zod_1.z.string().optional().describe("Secret token for webhook validation"),
|
|
6
|
+
const WebhookEventFields = {
|
|
37
7
|
push_events: utils_1.flexibleBoolean.optional().describe("Enable push events"),
|
|
38
8
|
push_events_branch_filter: zod_1.z
|
|
39
9
|
.string()
|
|
@@ -46,9 +16,7 @@ exports.ManageWebhookSchema = zod_1.z
|
|
|
46
16
|
.optional()
|
|
47
17
|
.describe("Enable confidential issue events"),
|
|
48
18
|
note_events: utils_1.flexibleBoolean.optional().describe("Enable note/comment events"),
|
|
49
|
-
confidential_note_events: utils_1.flexibleBoolean
|
|
50
|
-
.optional()
|
|
51
|
-
.describe("Enable confidential note events"),
|
|
19
|
+
confidential_note_events: utils_1.flexibleBoolean.optional().describe("Enable confidential note events"),
|
|
52
20
|
job_events: utils_1.flexibleBoolean.optional().describe("Enable job/build events"),
|
|
53
21
|
pipeline_events: utils_1.flexibleBoolean.optional().describe("Enable pipeline events"),
|
|
54
22
|
wiki_page_events: utils_1.flexibleBoolean.optional().describe("Enable wiki page events"),
|
|
@@ -69,32 +37,73 @@ exports.ManageWebhookSchema = zod_1.z
|
|
|
69
37
|
enable_ssl_verification: utils_1.flexibleBoolean
|
|
70
38
|
.optional()
|
|
71
39
|
.describe("Enable SSL certificate verification"),
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
40
|
+
};
|
|
41
|
+
const TriggerEventSchema = zod_1.z.enum([
|
|
42
|
+
"push_events",
|
|
43
|
+
"tag_push_events",
|
|
44
|
+
"merge_requests_events",
|
|
45
|
+
"issues_events",
|
|
46
|
+
"confidential_issues_events",
|
|
47
|
+
"note_events",
|
|
48
|
+
"job_events",
|
|
49
|
+
"pipeline_events",
|
|
50
|
+
"wiki_page_events",
|
|
51
|
+
"releases_events",
|
|
52
|
+
"milestone_events",
|
|
53
|
+
"emoji_events",
|
|
54
|
+
"resource_access_token_events",
|
|
55
|
+
]);
|
|
56
|
+
const scopeField = zod_1.z.enum(["project", "group"]).describe("Scope of webhook (project or group)");
|
|
57
|
+
const CreateWebhookSchema = zod_1.z.object({
|
|
58
|
+
action: zod_1.z.literal("create"),
|
|
59
|
+
scope: scopeField,
|
|
60
|
+
projectId: zod_1.z.string().optional().describe("Project ID or path (required if scope=project)"),
|
|
61
|
+
groupId: zod_1.z.string().optional().describe("Group ID or path (required if scope=group)"),
|
|
62
|
+
url: zod_1.z.string().describe("Webhook URL (required)"),
|
|
63
|
+
name: zod_1.z.string().optional().describe("Human-readable webhook name (GitLab 16.11+)"),
|
|
64
|
+
description: zod_1.z.string().optional().describe("Webhook description (GitLab 16.11+)"),
|
|
65
|
+
token: zod_1.z.string().optional().describe("Secret token for webhook validation"),
|
|
66
|
+
...WebhookEventFields,
|
|
67
|
+
});
|
|
68
|
+
const ReadWebhookSchema = zod_1.z.object({
|
|
69
|
+
action: zod_1.z.literal("read"),
|
|
70
|
+
scope: scopeField,
|
|
71
|
+
projectId: zod_1.z.string().optional().describe("Project ID or path (required if scope=project)"),
|
|
72
|
+
groupId: zod_1.z.string().optional().describe("Group ID or path (required if scope=group)"),
|
|
73
|
+
hookId: utils_1.requiredId.describe("Webhook ID (required)"),
|
|
74
|
+
});
|
|
75
|
+
const UpdateWebhookSchema = zod_1.z.object({
|
|
76
|
+
action: zod_1.z.literal("update"),
|
|
77
|
+
scope: scopeField,
|
|
78
|
+
projectId: zod_1.z.string().optional().describe("Project ID or path (required if scope=project)"),
|
|
79
|
+
groupId: zod_1.z.string().optional().describe("Group ID or path (required if scope=group)"),
|
|
80
|
+
hookId: utils_1.requiredId.describe("Webhook ID (required)"),
|
|
81
|
+
url: zod_1.z.string().optional().describe("Webhook URL"),
|
|
82
|
+
name: zod_1.z.string().optional().describe("Human-readable webhook name (GitLab 16.11+)"),
|
|
83
|
+
description: zod_1.z.string().optional().describe("Webhook description (GitLab 16.11+)"),
|
|
84
|
+
token: zod_1.z.string().optional().describe("Secret token for webhook validation"),
|
|
85
|
+
...WebhookEventFields,
|
|
86
|
+
});
|
|
87
|
+
const DeleteWebhookSchema = zod_1.z.object({
|
|
88
|
+
action: zod_1.z.literal("delete"),
|
|
89
|
+
scope: scopeField,
|
|
90
|
+
projectId: zod_1.z.string().optional().describe("Project ID or path (required if scope=project)"),
|
|
91
|
+
groupId: zod_1.z.string().optional().describe("Group ID or path (required if scope=group)"),
|
|
92
|
+
hookId: utils_1.requiredId.describe("Webhook ID (required)"),
|
|
93
|
+
});
|
|
94
|
+
const TestWebhookSchema = zod_1.z.object({
|
|
95
|
+
action: zod_1.z.literal("test"),
|
|
96
|
+
scope: scopeField,
|
|
97
|
+
projectId: zod_1.z.string().optional().describe("Project ID or path (required if scope=project)"),
|
|
98
|
+
groupId: zod_1.z.string().optional().describe("Group ID or path (required if scope=group)"),
|
|
99
|
+
hookId: utils_1.requiredId.describe("Webhook ID (required)"),
|
|
100
|
+
trigger: TriggerEventSchema.describe("Event type to test (required)"),
|
|
99
101
|
});
|
|
102
|
+
exports.ManageWebhookSchema = zod_1.z.discriminatedUnion("action", [
|
|
103
|
+
CreateWebhookSchema,
|
|
104
|
+
ReadWebhookSchema,
|
|
105
|
+
UpdateWebhookSchema,
|
|
106
|
+
DeleteWebhookSchema,
|
|
107
|
+
TestWebhookSchema,
|
|
108
|
+
]);
|
|
100
109
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/webhooks/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/webhooks/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAuD;AAevD,MAAM,kBAAkB,GAAG;IACzB,WAAW,EAAE,uBAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IACtE,yBAAy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itlab_api_1 = require("../../utils/gitlab-api");
|
|
44
44
|
const namespace_1 = require("../../utils/namespace");
|
|
45
|
-
const
|
|
45
|
+
const config_1 = require("../../config");
|
|
46
46
|
exports.wikiToolRegistry = new Map([
|
|
47
47
|
[
|
|
48
48
|
"browse_wiki",
|
|
@@ -52,6 +52,9 @@ exports.wikiToolRegistry = new Map([
|
|
|
52
52
|
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseWikiSchema),
|
|
53
53
|
handler: async (args) => {
|
|
54
54
|
const input = schema_readonly_1.BrowseWikiSchema.parse(args);
|
|
55
|
+
if ((0, config_1.isActionDenied)("browse_wiki", input.action)) {
|
|
56
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_wiki tool`);
|
|
57
|
+
}
|
|
55
58
|
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
56
59
|
switch (input.action) {
|
|
57
60
|
case "list": {
|
|
@@ -60,7 +63,6 @@ exports.wikiToolRegistry = new Map([
|
|
|
60
63
|
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/wikis`, { query });
|
|
61
64
|
}
|
|
62
65
|
case "get": {
|
|
63
|
-
(0, utils_1.assertDefined)(input.slug, "slug");
|
|
64
66
|
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/wikis/${encodeURIComponent(input.slug)}`);
|
|
65
67
|
}
|
|
66
68
|
default:
|
|
@@ -77,6 +79,9 @@ exports.wikiToolRegistry = new Map([
|
|
|
77
79
|
inputSchema: z.toJSONSchema(schema_1.ManageWikiSchema),
|
|
78
80
|
handler: async (args) => {
|
|
79
81
|
const input = schema_1.ManageWikiSchema.parse(args);
|
|
82
|
+
if ((0, config_1.isActionDenied)("manage_wiki", input.action)) {
|
|
83
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_wiki tool`);
|
|
84
|
+
}
|
|
80
85
|
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
81
86
|
switch (input.action) {
|
|
82
87
|
case "create": {
|
|
@@ -87,7 +92,6 @@ exports.wikiToolRegistry = new Map([
|
|
|
87
92
|
});
|
|
88
93
|
}
|
|
89
94
|
case "update": {
|
|
90
|
-
(0, utils_1.assertDefined)(input.slug, "slug");
|
|
91
95
|
const { action: _action, namespace: _namespace, slug, ...body } = input;
|
|
92
96
|
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/wikis/${encodeURIComponent(slug)}`, {
|
|
93
97
|
body,
|
|
@@ -95,7 +99,6 @@ exports.wikiToolRegistry = new Map([
|
|
|
95
99
|
});
|
|
96
100
|
}
|
|
97
101
|
case "delete": {
|
|
98
|
-
(0, utils_1.assertDefined)(input.slug, "slug");
|
|
99
102
|
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/wikis/${encodeURIComponent(input.slug)}`);
|
|
100
103
|
return { deleted: true };
|
|
101
104
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/wiki/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/wiki/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0HA,4DAEC;AAKD,wDAEC;AAKD,oDAMC;AA9ID,uCAAyB;AACzB,uDAAqD;AACrD,qCAA4C;AAC5C,uDAAyD;AACzD,qDAA+D;AAE/D,yCAA8C;AAQjC,QAAA,gBAAgB,GAAiB,IAAI,GAAG,CAAiC;IAKpF;QACE,aAAa;QACb;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EACT,6HAA6H;YAC/H,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,kCAAgB,CAAC;YAC7C,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;gBAC/B,MAAM,KAAK,GAAG,kCAAgB,CAAC,KAAK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;gBAC/E,CAAC;YACH,CAAC;SACF;KACF;CACF,CAAC,CAAC;AAKH,SAAgB,wBAAwB;IACtC,OAAO,CAAC,aAAa,CAAC,CAAC;AACzB,CAAC;AAKD,SAAgB,sBAAsB;IACpC,OAAO,KAAK,CAAC,IAAI,CAAC,wBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;AAC/C,CAAC;AAKD,SAAgB,oBAAoB,CAAC,eAAwB,KAAK;IAChE,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,aAAa,GAAG,wBAAwB,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC,IAAI,CAAC,wBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjG,CAAC;IACD,OAAO,sBAAsB,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const BrowseWikiSchema: z.ZodObject<{
|
|
3
|
-
action: z.
|
|
4
|
-
list: "list";
|
|
5
|
-
get: "get";
|
|
6
|
-
}>;
|
|
2
|
+
export declare const BrowseWikiSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
action: z.ZodLiteral<"list">;
|
|
7
4
|
namespace: z.ZodString;
|
|
8
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
9
5
|
with_content: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
10
6
|
per_page: z.ZodOptional<z.ZodNumber>;
|
|
11
7
|
page: z.ZodOptional<z.ZodNumber>;
|
|
12
|
-
}, z.core.$strip
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
action: z.ZodLiteral<"get">;
|
|
10
|
+
namespace: z.ZodString;
|
|
11
|
+
slug: z.ZodString;
|
|
12
|
+
}, z.core.$strip>], "action">;
|
|
13
13
|
export declare const GitLabWikiPageSchema: z.ZodObject<{
|
|
14
14
|
title: z.ZodString;
|
|
15
15
|
slug: z.ZodString;
|
|
@@ -3,24 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GitLabWikiPageSchema = exports.BrowseWikiSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
action: zod_1.z.
|
|
9
|
-
namespace:
|
|
10
|
-
|
|
11
|
-
.string()
|
|
12
|
-
.optional()
|
|
13
|
-
.describe("URL-encoded slug of the wiki page. Required for 'get' action."),
|
|
14
|
-
with_content: utils_1.flexibleBoolean
|
|
15
|
-
.optional()
|
|
16
|
-
.describe("For 'list': include content of the wiki pages"),
|
|
6
|
+
const namespaceField = zod_1.z.string().describe("Namespace path (group or project)");
|
|
7
|
+
const ListWikiSchema = zod_1.z.object({
|
|
8
|
+
action: zod_1.z.literal("list").describe("List all wiki pages"),
|
|
9
|
+
namespace: namespaceField,
|
|
10
|
+
with_content: utils_1.flexibleBoolean.optional().describe("Include content of the wiki pages"),
|
|
17
11
|
per_page: zod_1.z.number().optional().describe("Number of items per page"),
|
|
18
12
|
page: zod_1.z.number().optional().describe("Page number"),
|
|
19
|
-
})
|
|
20
|
-
.refine(data => data.action !== "get" || data.slug !== undefined, {
|
|
21
|
-
message: "slug is required for 'get' action",
|
|
22
|
-
path: ["slug"],
|
|
23
13
|
});
|
|
14
|
+
const GetWikiSchema = zod_1.z.object({
|
|
15
|
+
action: zod_1.z.literal("get").describe("Get a single wiki page by slug"),
|
|
16
|
+
namespace: namespaceField,
|
|
17
|
+
slug: zod_1.z.string().describe("URL-encoded slug of the wiki page"),
|
|
18
|
+
});
|
|
19
|
+
exports.BrowseWikiSchema = zod_1.z.discriminatedUnion("action", [ListWikiSchema, GetWikiSchema]);
|
|
24
20
|
exports.GitLabWikiPageSchema = zod_1.z.object({
|
|
25
21
|
title: zod_1.z.string(),
|
|
26
22
|
slug: zod_1.z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/wiki/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA2C;
|
|
1
|
+
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/wiki/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA2C;AAU3C,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC;AAGhF,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACzD,SAAS,EAAE,cAAc;IACzB,YAAY,EAAE,uBAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACtF,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACpE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;CACpD,CAAC,CAAC;AAGH,MAAM,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IACnE,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;CAC/D,CAAC,CAAC;AAGU,QAAA,gBAAgB,GAAG,OAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;AAMnF,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const ManageWikiSchema: z.ZodObject<{
|
|
3
|
-
action: z.
|
|
4
|
-
create: "create";
|
|
5
|
-
update: "update";
|
|
6
|
-
delete: "delete";
|
|
7
|
-
}>;
|
|
2
|
+
export declare const ManageWikiSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
action: z.ZodLiteral<"create">;
|
|
8
4
|
namespace: z.ZodString;
|
|
9
|
-
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
content: z.ZodString;
|
|
7
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
markdown: "markdown";
|
|
9
|
+
rdoc: "rdoc";
|
|
10
|
+
asciidoc: "asciidoc";
|
|
11
|
+
org: "org";
|
|
12
|
+
}>>;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
action: z.ZodLiteral<"update">;
|
|
15
|
+
namespace: z.ZodString;
|
|
16
|
+
slug: z.ZodString;
|
|
10
17
|
title: z.ZodOptional<z.ZodString>;
|
|
11
18
|
content: z.ZodOptional<z.ZodString>;
|
|
12
19
|
format: z.ZodOptional<z.ZodEnum<{
|
|
@@ -15,5 +22,9 @@ export declare const ManageWikiSchema: z.ZodObject<{
|
|
|
15
22
|
asciidoc: "asciidoc";
|
|
16
23
|
org: "org";
|
|
17
24
|
}>>;
|
|
18
|
-
}, z.core.$strip
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
action: z.ZodLiteral<"delete">;
|
|
27
|
+
namespace: z.ZodString;
|
|
28
|
+
slug: z.ZodString;
|
|
29
|
+
}, z.core.$strip>], "action">;
|
|
19
30
|
export type ManageWikiInput = z.infer<typeof ManageWikiSchema>;
|
|
@@ -2,34 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ManageWikiSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
format:
|
|
19
|
-
.enum(["markdown", "rdoc", "asciidoc", "org"])
|
|
20
|
-
.optional()
|
|
21
|
-
.describe("Content format (markdown, rdoc, asciidoc, org). Defaults to markdown."),
|
|
22
|
-
})
|
|
23
|
-
.refine(data => data.action === "create" || data.slug !== undefined, {
|
|
24
|
-
message: "slug is required for 'update' and 'delete' actions",
|
|
25
|
-
path: ["slug"],
|
|
26
|
-
})
|
|
27
|
-
.refine(data => data.action !== "create" || data.title !== undefined, {
|
|
28
|
-
message: "title is required for 'create' action",
|
|
29
|
-
path: ["title"],
|
|
30
|
-
})
|
|
31
|
-
.refine(data => data.action !== "create" || data.content !== undefined, {
|
|
32
|
-
message: "content is required for 'create' action",
|
|
33
|
-
path: ["content"],
|
|
5
|
+
const namespaceField = zod_1.z.string().describe("Namespace path (group or project)");
|
|
6
|
+
const slugField = zod_1.z.string().describe("URL-encoded slug of the wiki page");
|
|
7
|
+
const titleField = zod_1.z.string().describe("Title of the wiki page");
|
|
8
|
+
const contentField = zod_1.z.string().describe("Content of the wiki page");
|
|
9
|
+
const formatField = zod_1.z
|
|
10
|
+
.enum(["markdown", "rdoc", "asciidoc", "org"])
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("Content format (markdown, rdoc, asciidoc, org). Defaults to markdown.");
|
|
13
|
+
const CreateWikiSchema = zod_1.z.object({
|
|
14
|
+
action: zod_1.z.literal("create").describe("Create a new wiki page"),
|
|
15
|
+
namespace: namespaceField,
|
|
16
|
+
title: titleField,
|
|
17
|
+
content: contentField,
|
|
18
|
+
format: formatField,
|
|
34
19
|
});
|
|
20
|
+
const UpdateWikiSchema = zod_1.z.object({
|
|
21
|
+
action: zod_1.z.literal("update").describe("Update an existing wiki page"),
|
|
22
|
+
namespace: namespaceField,
|
|
23
|
+
slug: slugField,
|
|
24
|
+
title: zod_1.z.string().optional().describe("New title of the wiki page"),
|
|
25
|
+
content: zod_1.z.string().optional().describe("New content of the wiki page"),
|
|
26
|
+
format: formatField,
|
|
27
|
+
});
|
|
28
|
+
const DeleteWikiSchema = zod_1.z.object({
|
|
29
|
+
action: zod_1.z.literal("delete").describe("Delete a wiki page"),
|
|
30
|
+
namespace: namespaceField,
|
|
31
|
+
slug: slugField,
|
|
32
|
+
});
|
|
33
|
+
exports.ManageWikiSchema = zod_1.z.discriminatedUnion("action", [
|
|
34
|
+
CreateWikiSchema,
|
|
35
|
+
UpdateWikiSchema,
|
|
36
|
+
DeleteWikiSchema,
|
|
37
|
+
]);
|
|
35
38
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/wiki/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/wiki/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAUxB,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC;AAChF,MAAM,SAAS,GAAG,OAAC,CAAC,MAAM,E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B,IAAI,EAAE,SAAS;CAChB,CAAC,CAAC;AAGU,QAAA,gBAAgB,GAAG,OAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IAC7D,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;CACjB,CAAC,CAAC"}
|
|
@@ -41,7 +41,7 @@ const z = __importStar(require("zod"));
|
|
|
41
41
|
const schema_readonly_1 = require("./schema-readonly");
|
|
42
42
|
const schema_1 = require("./schema");
|
|
43
43
|
const ConnectionManager_1 = require("../../services/ConnectionManager");
|
|
44
|
-
const
|
|
44
|
+
const config_1 = require("../../config");
|
|
45
45
|
const workItemTypes_1 = require("../../utils/workItemTypes");
|
|
46
46
|
const idConversion_1 = require("../../utils/idConversion");
|
|
47
47
|
const workItems_1 = require("../../graphql/workItems");
|
|
@@ -140,9 +140,11 @@ exports.workitemsToolRegistry = new Map([
|
|
|
140
140
|
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseWorkItemsSchema),
|
|
141
141
|
handler: async (args) => {
|
|
142
142
|
const input = schema_readonly_1.BrowseWorkItemsSchema.parse(args);
|
|
143
|
+
if ((0, config_1.isActionDenied)("browse_work_items", input.action)) {
|
|
144
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_work_items tool`);
|
|
145
|
+
}
|
|
143
146
|
switch (input.action) {
|
|
144
147
|
case "list": {
|
|
145
|
-
(0, utils_1.assertDefined)(input.namespace, "namespace");
|
|
146
148
|
const { namespace, types, state, first, after, simple } = input;
|
|
147
149
|
const namespacePath = namespace;
|
|
148
150
|
console.log("browse_work_items list called with:", {
|
|
@@ -186,7 +188,6 @@ exports.workitemsToolRegistry = new Map([
|
|
|
186
188
|
};
|
|
187
189
|
}
|
|
188
190
|
case "get": {
|
|
189
|
-
(0, utils_1.assertDefined)(input.id, "id");
|
|
190
191
|
const workItemId = input.id;
|
|
191
192
|
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
192
193
|
const client = connectionManager.getClient();
|
|
@@ -211,11 +212,11 @@ exports.workitemsToolRegistry = new Map([
|
|
|
211
212
|
inputSchema: z.toJSONSchema(schema_1.ManageWorkItemSchema),
|
|
212
213
|
handler: async (args) => {
|
|
213
214
|
const input = schema_1.ManageWorkItemSchema.parse(args);
|
|
215
|
+
if ((0, config_1.isActionDenied)("manage_work_item", input.action)) {
|
|
216
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_work_item tool`);
|
|
217
|
+
}
|
|
214
218
|
switch (input.action) {
|
|
215
219
|
case "create": {
|
|
216
|
-
(0, utils_1.assertDefined)(input.namespace, "namespace");
|
|
217
|
-
(0, utils_1.assertDefined)(input.title, "title");
|
|
218
|
-
(0, utils_1.assertDefined)(input.workItemType, "workItemType");
|
|
219
220
|
const { namespace, title, workItemType, description, assigneeIds, labelIds, milestoneId, } = input;
|
|
220
221
|
const namespacePath = namespace;
|
|
221
222
|
const workItemTitle = title;
|
|
@@ -258,7 +259,6 @@ exports.workitemsToolRegistry = new Map([
|
|
|
258
259
|
return (0, idConversion_1.cleanWorkItemResponse)(response.workItemCreate.workItem);
|
|
259
260
|
}
|
|
260
261
|
case "update": {
|
|
261
|
-
(0, utils_1.assertDefined)(input.id, "id");
|
|
262
262
|
const { id, title, description, state, assigneeIds, labelIds, milestoneId } = input;
|
|
263
263
|
const workItemId = id;
|
|
264
264
|
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
@@ -292,7 +292,6 @@ exports.workitemsToolRegistry = new Map([
|
|
|
292
292
|
return (0, idConversion_1.cleanWorkItemResponse)(response.workItemUpdate.workItem);
|
|
293
293
|
}
|
|
294
294
|
case "delete": {
|
|
295
|
-
(0, utils_1.assertDefined)(input.id, "id");
|
|
296
295
|
const workItemId = input.id;
|
|
297
296
|
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
298
297
|
const client = connectionManager.getClient();
|