@structured-world/gitlab-mcp 6.4.1 → 6.6.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/README.md +41 -10
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.js +2 -1
- package/dist/src/config.js.map +1 -1
- package/dist/src/entities/core/schema-readonly.d.ts +2 -2
- package/dist/src/entities/index.d.ts +1 -0
- package/dist/src/entities/index.js +1 -0
- package/dist/src/entities/index.js.map +1 -1
- package/dist/src/entities/labels/registry.js +57 -68
- package/dist/src/entities/labels/registry.js.map +1 -1
- package/dist/src/entities/labels/schema-readonly.d.ts +10 -9
- package/dist/src/entities/labels/schema-readonly.js +19 -11
- package/dist/src/entities/labels/schema-readonly.js.map +1 -1
- package/dist/src/entities/labels/schema.d.ts +9 -16
- package/dist/src/entities/labels/schema.js +24 -22
- package/dist/src/entities/labels/schema.js.map +1 -1
- package/dist/src/entities/utils.d.ts +5 -0
- package/dist/src/entities/utils.js +10 -0
- package/dist/src/entities/utils.js.map +1 -1
- package/dist/src/entities/variables/registry.js +61 -80
- 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 +14 -11
- package/dist/src/entities/variables/schema-readonly.js.map +1 -1
- package/dist/src/entities/variables/schema.d.ts +8 -26
- package/dist/src/entities/variables/schema.js +20 -69
- package/dist/src/entities/variables/schema.js.map +1 -1
- package/dist/src/entities/webhooks/index.d.ts +7 -0
- package/dist/src/entities/webhooks/index.js +31 -0
- package/dist/src/entities/webhooks/index.js.map +1 -0
- package/dist/src/entities/webhooks/registry.d.ts +5 -0
- package/dist/src/entities/webhooks/registry.js +158 -0
- package/dist/src/entities/webhooks/registry.js.map +1 -0
- package/dist/src/entities/webhooks/schema-readonly.d.ts +12 -0
- package/dist/src/entities/webhooks/schema-readonly.js +17 -0
- package/dist/src/entities/webhooks/schema-readonly.js.map +1 -0
- package/dist/src/entities/webhooks/schema.d.ts +57 -0
- package/dist/src/entities/webhooks/schema.js +100 -0
- package/dist/src/entities/webhooks/schema.js.map +1 -0
- package/dist/src/registry-manager.js +10 -0
- package/dist/src/registry-manager.js.map +1 -1
- package/dist/src/services/ToolAvailability.js +6 -0
- package/dist/src/services/ToolAvailability.js.map +1 -1
- package/dist/structured-world-gitlab-mcp-6.6.0.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/structured-world-gitlab-mcp-6.4.1.tgz +0 -0
|
@@ -42,103 +42,84 @@ const schema_readonly_1 = require("./schema-readonly");
|
|
|
42
42
|
const schema_1 = require("./schema");
|
|
43
43
|
const gitlab_api_1 = require("../../utils/gitlab-api");
|
|
44
44
|
const namespace_1 = require("../../utils/namespace");
|
|
45
|
+
const utils_1 = require("../utils");
|
|
45
46
|
exports.variablesToolRegistry = new Map([
|
|
46
47
|
[
|
|
47
|
-
"
|
|
48
|
+
"browse_variables",
|
|
48
49
|
{
|
|
49
|
-
name: "
|
|
50
|
-
description:
|
|
51
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.
|
|
50
|
+
name: "browse_variables",
|
|
51
|
+
description: 'BROWSE CI/CD variables. Actions: "list" shows all variables in project/group with pagination, "get" retrieves single variable details by key with optional environment scope filter.',
|
|
52
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseVariablesSchema),
|
|
52
53
|
handler: async (args) => {
|
|
53
|
-
const
|
|
54
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (options.filter?.environment_scope) {
|
|
72
|
-
query["filter[environment_scope]"] = options.filter.environment_scope;
|
|
73
|
-
}
|
|
74
|
-
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/variables/${encodeURIComponent(options.key)}`, {
|
|
75
|
-
query,
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
[
|
|
81
|
-
"create_variable",
|
|
82
|
-
{
|
|
83
|
-
name: "create_variable",
|
|
84
|
-
description: "Add new CI/CD environment variable for pipeline configuration, secrets, or deployment settings. Use for API keys, database URLs, feature flags. Supports masking sensitive values, protection for specific branches, environment scoping, and file type for certificates/configs. Group variables apply to all child projects.",
|
|
85
|
-
inputSchema: z.toJSONSchema(schema_1.CreateVariableSchema),
|
|
86
|
-
handler: async (args) => {
|
|
87
|
-
const options = schema_1.CreateVariableSchema.parse(args);
|
|
88
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
|
|
89
|
-
const { namespace: _namespace, ...body } = options;
|
|
90
|
-
return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/variables`, {
|
|
91
|
-
body,
|
|
92
|
-
contentType: "json",
|
|
93
|
-
});
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
[
|
|
98
|
-
"update_variable",
|
|
99
|
-
{
|
|
100
|
-
name: "update_variable",
|
|
101
|
-
description: "Modify CI/CD variable value or configuration. Use to rotate secrets, update endpoints, change security settings, or adjust environment scopes. Can convert between env_var and file types. Changes take effect in next pipeline run. Be cautious with production variables.",
|
|
102
|
-
inputSchema: z.toJSONSchema(schema_1.UpdateVariableSchema),
|
|
103
|
-
handler: async (args) => {
|
|
104
|
-
const options = schema_1.UpdateVariableSchema.parse(args);
|
|
105
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
|
|
106
|
-
const { namespace: _namespace, key, filter, ...body } = options;
|
|
107
|
-
const query = {};
|
|
108
|
-
if (filter?.environment_scope) {
|
|
109
|
-
query["filter[environment_scope]"] = filter.environment_scope;
|
|
54
|
+
const input = schema_readonly_1.BrowseVariablesSchema.parse(args);
|
|
55
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
56
|
+
switch (input.action) {
|
|
57
|
+
case "list": {
|
|
58
|
+
const { action: _action, namespace: _namespace, key: _key, filter: _filter, ...rest } = input;
|
|
59
|
+
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
60
|
+
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/variables`, { query });
|
|
61
|
+
}
|
|
62
|
+
case "get": {
|
|
63
|
+
(0, utils_1.assertDefined)(input.key, "key");
|
|
64
|
+
const query = {};
|
|
65
|
+
if (input.filter?.environment_scope) {
|
|
66
|
+
query["filter[environment_scope]"] = input.filter.environment_scope;
|
|
67
|
+
}
|
|
68
|
+
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/variables/${encodeURIComponent(input.key)}`, { query });
|
|
69
|
+
}
|
|
70
|
+
default:
|
|
71
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
110
72
|
}
|
|
111
|
-
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/variables/${encodeURIComponent(key)}`, {
|
|
112
|
-
query,
|
|
113
|
-
body,
|
|
114
|
-
contentType: "json",
|
|
115
|
-
});
|
|
116
73
|
},
|
|
117
74
|
},
|
|
118
75
|
],
|
|
119
76
|
[
|
|
120
|
-
"
|
|
77
|
+
"manage_variable",
|
|
121
78
|
{
|
|
122
|
-
name: "
|
|
123
|
-
description:
|
|
124
|
-
inputSchema: z.toJSONSchema(schema_1.
|
|
79
|
+
name: "manage_variable",
|
|
80
|
+
description: 'MANAGE CI/CD variables. Actions: "create" adds new variable (requires key and value), "update" modifies existing variable, "delete" removes variable permanently. Supports environment scoping and protection settings.',
|
|
81
|
+
inputSchema: z.toJSONSchema(schema_1.ManageVariableSchema),
|
|
125
82
|
handler: async (args) => {
|
|
126
|
-
const
|
|
127
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
83
|
+
const input = schema_1.ManageVariableSchema.parse(args);
|
|
84
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
85
|
+
switch (input.action) {
|
|
86
|
+
case "create": {
|
|
87
|
+
(0, utils_1.assertDefined)(input.value, "value");
|
|
88
|
+
const { action: _action, namespace: _namespace, filter: _filter, ...body } = input;
|
|
89
|
+
return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/variables`, {
|
|
90
|
+
body,
|
|
91
|
+
contentType: "json",
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
case "update": {
|
|
95
|
+
const { action: _action, namespace: _namespace, key, filter, ...body } = input;
|
|
96
|
+
const query = {};
|
|
97
|
+
if (filter?.environment_scope) {
|
|
98
|
+
query["filter[environment_scope]"] = filter.environment_scope;
|
|
99
|
+
}
|
|
100
|
+
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/variables/${encodeURIComponent(key)}`, {
|
|
101
|
+
query,
|
|
102
|
+
body,
|
|
103
|
+
contentType: "json",
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
case "delete": {
|
|
107
|
+
const query = {};
|
|
108
|
+
if (input.filter?.environment_scope) {
|
|
109
|
+
query["filter[environment_scope]"] = input.filter.environment_scope;
|
|
110
|
+
}
|
|
111
|
+
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/variables/${encodeURIComponent(input.key)}`, { query });
|
|
112
|
+
return { deleted: true };
|
|
113
|
+
}
|
|
114
|
+
default:
|
|
115
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
131
116
|
}
|
|
132
|
-
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/variables/${encodeURIComponent(options.key)}`, {
|
|
133
|
-
query,
|
|
134
|
-
});
|
|
135
|
-
return { deleted: true };
|
|
136
117
|
},
|
|
137
118
|
},
|
|
138
119
|
],
|
|
139
120
|
]);
|
|
140
121
|
function getVariablesReadOnlyToolNames() {
|
|
141
|
-
return ["
|
|
122
|
+
return ["browse_variables"];
|
|
142
123
|
}
|
|
143
124
|
function getVariablesToolDefinitions() {
|
|
144
125
|
return Array.from(exports.variablesToolRegistry.values());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/variables/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/variables/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoIA,sEAEC;AAKD,kEAEC;AAKD,8DAQC;AA1JD,uCAAyB;AACzB,uDAA0D;AAC1D,qCAAgD;AAChD,uDAAyD;AACzD,qDAA+D;AAE/D,oCAAyC;AAQ5B,QAAA,qBAAqB,GAAiB,IAAI,GAAG,CAAiC;IAIzF;QACE,kBAAkB;QAClB;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EACT,sLAAsL;YACxL,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,uCAAqB,CAAC;YAClD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;gBAC/B,MAAM,KAAK,GAAG,uCAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAChD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,kCAAsB,EAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBAElF,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;oBACrB,KAAK,MAAM,CAAC,CAAC,CAAC;wBACZ,MAAM,EACJ,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,UAAU,EACrB,GAAG,EAAE,IAAI,EACT,MAAM,EAAE,OAAO,EACf,GAAG,IAAI,EACR,GAAG,KAAK,CAA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AAE,IAAI,EAAE,CAAC;oBAC3B,CAAC;oBAGD;wBACE,MAAM,IAAI,KAAK,CAAC,mBAAoB,KAA4B,CAAC,MAAM,EAAE,CAAC,CAAC;gBAC/E,CAAC;YACH,CAAC;SACF;KACF;CACF,CAAC,CAAC;AAKH,SAAgB,6BAA6B;IAC3C,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9B,CAAC;AAKD,SAAgB,2BAA2B;IACzC,OAAO,KAAK,CAAC,IAAI,CAAC,6BAAqB,CAAC,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC;AAKD,SAAgB,yBAAyB,CAAC,eAAwB,KAAK;IACrE,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,aAAa,GAAG,6BAA6B,EAAE,CAAC;QACtD,OAAO,KAAK,CAAC,IAAI,CAAC,6BAAqB,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAC9D,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;IACD,OAAO,2BAA2B,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const BrowseVariablesSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<{
|
|
4
|
+
list: "list";
|
|
5
|
+
get: "get";
|
|
6
|
+
}>;
|
|
3
7
|
namespace: z.ZodString;
|
|
4
|
-
|
|
5
|
-
per_page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
export declare const GetVariableSchema: z.ZodObject<{
|
|
8
|
-
namespace: z.ZodString;
|
|
9
|
-
key: z.ZodString;
|
|
8
|
+
key: z.ZodOptional<z.ZodString>;
|
|
10
9
|
filter: z.ZodOptional<z.ZodObject<{
|
|
11
10
|
environment_scope: z.ZodOptional<z.ZodString>;
|
|
12
11
|
}, z.core.$strip>>;
|
|
12
|
+
per_page: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
13
14
|
}, z.core.$strip>;
|
|
14
|
-
export type
|
|
15
|
-
export type GetVariableOptions = z.infer<typeof GetVariableSchema>;
|
|
15
|
+
export type BrowseVariablesInput = z.infer<typeof BrowseVariablesSchema>;
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.BrowseVariablesSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
|
|
6
|
-
exports.ListVariablesSchema = zod_1.z
|
|
5
|
+
exports.BrowseVariablesSchema = zod_1.z
|
|
7
6
|
.object({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.merge(shared_1.PaginationOptionsSchema);
|
|
11
|
-
exports.GetVariableSchema = zod_1.z.object({
|
|
12
|
-
namespace: zod_1.z.string().describe("Namespace path (group or project) containing the variable"),
|
|
7
|
+
action: zod_1.z.enum(["list", "get"]).describe("Action to perform"),
|
|
8
|
+
namespace: zod_1.z.string().describe("Namespace path (group or project)"),
|
|
13
9
|
key: zod_1.z
|
|
14
10
|
.string()
|
|
15
|
-
.
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("The key of the CI/CD variable. Required for 'get' action. Maximum 255 characters, alphanumeric and underscore only."),
|
|
16
13
|
filter: zod_1.z
|
|
17
14
|
.object({
|
|
18
15
|
environment_scope: zod_1.z
|
|
19
16
|
.string()
|
|
20
17
|
.optional()
|
|
21
|
-
.describe('The environment scope filter
|
|
18
|
+
.describe('The environment scope filter. Use "*" for all environments or specific environment name like "production".'),
|
|
22
19
|
})
|
|
23
20
|
.optional()
|
|
24
|
-
.describe("Filter parameters for
|
|
21
|
+
.describe("Filter parameters for variable lookup (for 'get' action)"),
|
|
22
|
+
per_page: zod_1.z.number().optional().describe("Number of items per page"),
|
|
23
|
+
page: zod_1.z.number().optional().describe("Page number"),
|
|
24
|
+
})
|
|
25
|
+
.refine(data => data.action !== "get" || data.key !== undefined, {
|
|
26
|
+
message: "key is required for 'get' action",
|
|
27
|
+
path: ["key"],
|
|
25
28
|
});
|
|
26
29
|
//# sourceMappingURL=schema-readonly.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/variables/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/variables/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AASX,QAAA,qBAAqB,GAAG,OAAC;KACnC,MAAM,CAAC;IACN,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC7D,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAEnE,GAAG,EAAE,OAAC;SACH,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,qHAAqH,CACtH;IAEH,MAAM,EAAE,OAAC;SACN,MAAM,CAAC;QACN,iBAAiB,EAAE,OAAC;aACjB,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,4GAA4G,CAC7G;KACJ,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IAEvE,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;KACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,EAAE;IAC/D,OAAO,EAAE,kCAAkC;IAC3C,IAAI,EAAE,CAAC,KAAK,CAAC;CACd,CAAC,CAAC"}
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
env_var: "env_var";
|
|
9
|
-
}>>>>;
|
|
10
|
-
environment_scope: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
11
|
-
protected: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>>;
|
|
12
|
-
masked: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>>;
|
|
13
|
-
raw: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>>;
|
|
14
|
-
description: z.ZodOptional<z.ZodString>;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
export declare const UpdateVariableSchema: z.ZodObject<{
|
|
2
|
+
export declare const ManageVariableSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<{
|
|
4
|
+
create: "create";
|
|
5
|
+
update: "update";
|
|
6
|
+
delete: "delete";
|
|
7
|
+
}>;
|
|
17
8
|
namespace: z.ZodString;
|
|
18
9
|
key: z.ZodString;
|
|
19
|
-
value: z.ZodString
|
|
10
|
+
value: z.ZodOptional<z.ZodString>;
|
|
20
11
|
variable_type: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
|
|
21
12
|
file: "file";
|
|
22
13
|
env_var: "env_var";
|
|
@@ -30,13 +21,4 @@ export declare const UpdateVariableSchema: z.ZodObject<{
|
|
|
30
21
|
environment_scope: z.ZodOptional<z.ZodString>;
|
|
31
22
|
}, z.core.$strip>>;
|
|
32
23
|
}, z.core.$strip>;
|
|
33
|
-
export
|
|
34
|
-
namespace: z.ZodString;
|
|
35
|
-
key: z.ZodString;
|
|
36
|
-
filter: z.ZodOptional<z.ZodObject<{
|
|
37
|
-
environment_scope: z.ZodOptional<z.ZodString>;
|
|
38
|
-
}, z.core.$strip>>;
|
|
39
|
-
}, z.core.$strip>;
|
|
40
|
-
export type CreateVariableOptions = z.infer<typeof CreateVariableSchema>;
|
|
41
|
-
export type UpdateVariableOptions = z.infer<typeof UpdateVariableSchema>;
|
|
42
|
-
export type DeleteVariableOptions = z.infer<typeof DeleteVariableSchema>;
|
|
24
|
+
export type ManageVariableInput = z.infer<typeof ManageVariableSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ManageVariableSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const flexibleVariableType = zod_1.z.preprocess(val => {
|
|
@@ -15,98 +15,49 @@ const flexibleVariableType = zod_1.z.preprocess(val => {
|
|
|
15
15
|
}
|
|
16
16
|
return val;
|
|
17
17
|
}, zod_1.z.enum(["env_var", "file"]));
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return val;
|
|
23
|
-
}, zod_1.z
|
|
24
|
-
.string()
|
|
25
|
-
.max(255)
|
|
26
|
-
.regex(/^[a-zA-Z0-9_]+$/, "Key must contain only alphanumeric characters and underscores"));
|
|
27
|
-
exports.CreateVariableSchema = zod_1.z.object({
|
|
28
|
-
namespace: zod_1.z.string().describe("Namespace path (group or project) to create variable in"),
|
|
29
|
-
key: variableKey.describe("The unique key for the CI/CD variable. Maximum 255 characters, only alphanumeric and underscore characters allowed. Used to reference the variable in CI/CD pipelines (e.g., $MY_API_KEY)"),
|
|
30
|
-
value: zod_1.z
|
|
31
|
-
.string()
|
|
32
|
-
.describe("The value of the CI/CD variable. This is the actual content that will be available in your CI/CD pipeline. For file type variables, this should be the file content"),
|
|
33
|
-
variable_type: flexibleVariableType
|
|
34
|
-
.optional()
|
|
35
|
-
.default("env_var")
|
|
36
|
-
.describe('The type of variable: "env_var" for environment variables (default) or "file" for file variables. File variables create temporary files with the variable content during pipeline execution'),
|
|
37
|
-
environment_scope: zod_1.z
|
|
38
|
-
.string()
|
|
39
|
-
.optional()
|
|
40
|
-
.default("*")
|
|
41
|
-
.describe('The environment scope for this variable. Use "*" for all environments (default), or specify environment names like "production", "staging", "review/*" for environment-specific values'),
|
|
42
|
-
protected: utils_1.flexibleBoolean
|
|
43
|
-
.optional()
|
|
44
|
-
.default(false)
|
|
45
|
-
.describe("Whether this variable is protected. Protected variables are only available to protected branches/tags (typically main/master). Enhances security for sensitive production variables"),
|
|
46
|
-
masked: utils_1.flexibleBoolean
|
|
47
|
-
.optional()
|
|
48
|
-
.default(false)
|
|
49
|
-
.describe("Whether this variable should be masked in job logs. MASKING REQUIREMENTS: Value must be (1) at least 8 characters, (2) single line with NO SPACES, (3) contain only these characters: A-Z a-z 0-9 + / = . ~ - _ @ : (tested on GitLab 18.4.0). FORBIDDEN characters include: spaces, commas, dollar signs, most special symbols. Common API keys, tokens, and UUIDs typically work. If masking fails with 400 error, set masked=false."),
|
|
50
|
-
raw: utils_1.flexibleBoolean
|
|
51
|
-
.optional()
|
|
52
|
-
.default(false)
|
|
53
|
-
.describe("Whether variable expansion is disabled. When true, variables like $OTHER_VAR in the value will NOT be expanded/substituted. Useful for values containing literal dollar signs"),
|
|
54
|
-
description: zod_1.z
|
|
55
|
-
.string()
|
|
56
|
-
.optional()
|
|
57
|
-
.describe("Optional description explaining the purpose and usage of this variable. Helps team members understand what this variable is for and how it should be used (Available in GitLab 16.2+)"),
|
|
58
|
-
});
|
|
59
|
-
exports.UpdateVariableSchema = zod_1.z.object({
|
|
60
|
-
namespace: zod_1.z.string().describe("Namespace path (group or project) containing the variable"),
|
|
18
|
+
exports.ManageVariableSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
action: zod_1.z.enum(["create", "update", "delete"]).describe("Action to perform"),
|
|
21
|
+
namespace: zod_1.z.string().describe("Namespace path (group or project)"),
|
|
61
22
|
key: zod_1.z
|
|
62
23
|
.string()
|
|
63
|
-
.describe("The key of the
|
|
24
|
+
.describe("The key of the CI/CD variable. Maximum 255 characters, only alphanumeric and underscore characters allowed."),
|
|
64
25
|
value: zod_1.z
|
|
65
26
|
.string()
|
|
66
|
-
.
|
|
27
|
+
.optional()
|
|
28
|
+
.describe("The value of the CI/CD variable. Required for 'create' action. For file type variables, this is the file content."),
|
|
67
29
|
variable_type: flexibleVariableType
|
|
68
30
|
.optional()
|
|
69
|
-
.describe('
|
|
31
|
+
.describe('The type of variable: "env_var" for environment variables (default) or "file" for file variables.'),
|
|
70
32
|
environment_scope: zod_1.z
|
|
71
33
|
.string()
|
|
72
34
|
.optional()
|
|
73
|
-
.describe('
|
|
35
|
+
.describe('The environment scope. Use "*" for all environments (default), or specify like "production", "staging".'),
|
|
74
36
|
protected: utils_1.flexibleBoolean
|
|
75
37
|
.optional()
|
|
76
|
-
.describe("
|
|
38
|
+
.describe("Whether this variable is protected. Protected variables are only available to protected branches/tags."),
|
|
77
39
|
masked: utils_1.flexibleBoolean
|
|
78
40
|
.optional()
|
|
79
|
-
.describe("
|
|
41
|
+
.describe("Whether this variable should be masked in job logs. MASKING REQUIREMENTS: Value must be at least 8 characters, single line with no spaces, only A-Z a-z 0-9 + / = . ~ - _ @ : characters."),
|
|
80
42
|
raw: utils_1.flexibleBoolean
|
|
81
43
|
.optional()
|
|
82
|
-
.describe("
|
|
44
|
+
.describe("Whether variable expansion is disabled. When true, variables like $OTHER_VAR in the value will NOT be expanded."),
|
|
83
45
|
description: zod_1.z
|
|
84
46
|
.string()
|
|
85
47
|
.optional()
|
|
86
|
-
.describe("
|
|
87
|
-
filter: zod_1.z
|
|
88
|
-
.object({
|
|
89
|
-
environment_scope: zod_1.z
|
|
90
|
-
.string()
|
|
91
|
-
.optional()
|
|
92
|
-
.describe("Filter to specify which environment scope variant to update when multiple variables exist with the same key"),
|
|
93
|
-
})
|
|
94
|
-
.optional()
|
|
95
|
-
.describe("Filter parameters to identify the specific variable to update"),
|
|
96
|
-
});
|
|
97
|
-
exports.DeleteVariableSchema = zod_1.z.object({
|
|
98
|
-
namespace: zod_1.z.string().describe("Namespace path (group or project) containing the variable"),
|
|
99
|
-
key: zod_1.z
|
|
100
|
-
.string()
|
|
101
|
-
.describe("The key of the CI/CD variable to delete. This will permanently remove the variable from the project"),
|
|
48
|
+
.describe("Optional description explaining the purpose of this variable (GitLab 16.2+)."),
|
|
102
49
|
filter: zod_1.z
|
|
103
50
|
.object({
|
|
104
51
|
environment_scope: zod_1.z
|
|
105
52
|
.string()
|
|
106
53
|
.optional()
|
|
107
|
-
.describe(
|
|
54
|
+
.describe("Filter to specify which environment scope variant to update/delete when multiple variables exist with the same key."),
|
|
108
55
|
})
|
|
109
56
|
.optional()
|
|
110
|
-
.describe("Filter parameters to identify the specific variable
|
|
57
|
+
.describe("Filter parameters to identify the specific variable (for 'update' and 'delete' actions)"),
|
|
58
|
+
})
|
|
59
|
+
.refine(data => data.action !== "create" || data.value !== undefined, {
|
|
60
|
+
message: "value is required for 'create' action",
|
|
61
|
+
path: ["value"],
|
|
111
62
|
});
|
|
112
63
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/variables/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA2C;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/variables/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA2C;AAU3C,MAAM,oBAAoB,GAAG,OAAC,CAAC,UAAU,CACvC,GAAG,CAAC,EAAE;IACJ,IAAI,OAAO,GA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AA2L,CAC5L;IACH,GAAG,EAAE,uBAAe;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,iHAAiH,CAClH;IACH,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,8EAA8E,CAAC;IAE3F,MAAM,EAAE,OAAC;SACN,MAAM,CAAC;QACN,iBAAiB,EAAE,OAAC;aACjB,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,qHAAqH,CACtH;KACJ,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CACP,yFAAyF,CAC1F;CACJ,CAAC;KACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;IACpE,OAAO,EAAE,uCAAuC;IAChD,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "../shared";
|
|
2
|
+
export * from "./schema-readonly";
|
|
3
|
+
export * from "./schema";
|
|
4
|
+
export * from "./registry";
|
|
5
|
+
import type { ToolDefinition } from "../../types";
|
|
6
|
+
export declare const webhooksTools: ToolDefinition[];
|
|
7
|
+
export declare const webhooksReadOnlyTools: string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.webhooksReadOnlyTools = exports.webhooksTools = void 0;
|
|
18
|
+
__exportStar(require("../shared"), exports);
|
|
19
|
+
__exportStar(require("./schema-readonly"), exports);
|
|
20
|
+
__exportStar(require("./schema"), exports);
|
|
21
|
+
__exportStar(require("./registry"), exports);
|
|
22
|
+
const registry_1 = require("./registry");
|
|
23
|
+
const isReadOnly = process.env.GITLAB_READ_ONLY_MODE === "true";
|
|
24
|
+
const webhooksToolsFromRegistry = (0, registry_1.getFilteredWebhooksTools)(isReadOnly);
|
|
25
|
+
exports.webhooksTools = webhooksToolsFromRegistry.map((tool) => ({
|
|
26
|
+
name: tool.name,
|
|
27
|
+
description: tool.description,
|
|
28
|
+
inputSchema: tool.inputSchema,
|
|
29
|
+
}));
|
|
30
|
+
exports.webhooksReadOnlyTools = (0, registry_1.getWebhooksReadOnlyToolNames)();
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/entities/webhooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,4CAA0B;AAG1B,oDAAkC;AAGlC,2CAAyB;AAGzB,6CAA2B;AAG3B,yCAAoF;AAIpF,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM,CAAC;AAGhE,MAAM,yBAAyB,GAAG,IAAA,mCAAwB,EAAC,UAAU,CAAC,CAAC;AAG1D,QAAA,aAAa,GAAqB,yBAAyB,CAAC,GAAG,CAC1E,CAAC,IAAI,EAAkB,EAAE,CAAC,CAAC;IACzB,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,WAAW,EAAE,IAAI,CAAC,WAAW;IAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;CAC9B,CAAC,CACH,CAAC;AAGW,QAAA,qBAAqB,GAAG,IAAA,uCAA4B,GAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ToolRegistry, EnhancedToolDefinition } from "../../types";
|
|
2
|
+
export declare const webhooksToolRegistry: ToolRegistry;
|
|
3
|
+
export declare function getWebhooksReadOnlyToolNames(): string[];
|
|
4
|
+
export declare function getWebhooksToolDefinitions(): EnhancedToolDefinition[];
|
|
5
|
+
export declare function getFilteredWebhooksTools(readOnlyMode?: boolean): EnhancedToolDefinition[];
|