@structured-world/gitlab-mcp 6.5.0 → 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 +9 -9
- 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/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.5.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -467,7 +467,7 @@ When OAuth is enabled, the following endpoints are available:
|
|
|
467
467
|
- `USE_LABELS`: When set to 'true', enables the label-related tools (list_labels, get_label, create_label, update_label, delete_label). By default, label features are enabled.
|
|
468
468
|
- `USE_MRS`: When set to 'true', enables the merge request-related tools (browse_merge_requests, browse_mr_discussions, manage_merge_request, manage_mr_discussion, manage_draft_notes). These 5 CQRS tools consolidate all MR operations. By default, merge request features are enabled.
|
|
469
469
|
- `USE_FILES`: When set to 'true', enables the file-related tools (browse_files, manage_files). These 2 CQRS tools consolidate all file operations. By default, file operation features are enabled.
|
|
470
|
-
- `USE_VARIABLES`: When set to 'true', enables the CI/CD variables-related tools (
|
|
470
|
+
- `USE_VARIABLES`: When set to 'true', enables the CI/CD variables-related tools (browse_variables, manage_variable). These 2 CQRS tools consolidate all variable operations. Supports both project-level and group-level variables. By default, variables features are enabled.
|
|
471
471
|
- `USE_WORKITEMS`: When set to 'true', enables the work items-related tools (browse_work_items, manage_work_item). These 2 CQRS tools consolidate all work item operations using GitLab GraphQL API. By default, work items features are enabled.
|
|
472
472
|
- `USE_WEBHOOKS`: When set to 'true', enables the webhooks-related tools (list_webhooks, manage_webhook). These 2 tools provide full CRUD operations plus testing for both project and group webhooks. Group webhooks require GitLab Premium tier. By default, webhooks features are enabled.
|
|
473
473
|
- `GITLAB_AUTH_COOKIE_PATH`: Path to an authentication cookie file for GitLab instances that require cookie-based authentication. When provided, the cookie will be included in all GitLab API requests.
|
|
@@ -542,7 +542,7 @@ export GITLAB_TOOL_MANAGE_WORK_ITEM="Create and manage tickets for our sprint pl
|
|
|
542
542
|
|
|
543
543
|
## Tools 🛠️
|
|
544
544
|
|
|
545
|
-
**
|
|
545
|
+
**57 Tools Available** - Organized by entity and functionality below.
|
|
546
546
|
|
|
547
547
|
### Key Features:
|
|
548
548
|
- **CQRS Pattern** - Consolidated action-based tools: `browse_*` for reads, `manage_*` for writes
|
|
@@ -614,14 +614,14 @@ Requires USE_FILES=true environment variable (enabled by default). Uses CQRS pat
|
|
|
614
614
|
- 📖 **`browse_files`**: BROWSE repository files. Actions: "tree" lists files/folders with pagination, "content" reads file contents. Use for exploring project structure or reading source code.
|
|
615
615
|
- ✏️ **`manage_files`**: MANAGE repository files. Actions: "single" creates/updates one file, "batch" commits multiple files atomically, "upload" adds markdown attachments.
|
|
616
616
|
|
|
617
|
-
### CI/CD Variables (
|
|
618
|
-
Requires USE_VARIABLES=true environment variable (enabled by default). Supports both project-level and group-level variables.
|
|
617
|
+
### CI/CD Variables (2 CQRS tools)
|
|
618
|
+
Requires USE_VARIABLES=true environment variable (enabled by default). Uses CQRS pattern with action-based tools. Supports both project-level and group-level variables.
|
|
619
619
|
|
|
620
|
-
|
|
621
|
-
- 📖 **`
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
- ✏️ **`
|
|
620
|
+
#### Variable Browsing (Query)
|
|
621
|
+
- 📖 **`browse_variables`**: 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.
|
|
622
|
+
|
|
623
|
+
#### Variable Management (Command)
|
|
624
|
+
- ✏️ **`manage_variable`**: 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.
|
|
625
625
|
|
|
626
626
|
### Work Items (2 CQRS tools)
|
|
627
627
|
Modern GraphQL API for issues, epics, tasks, and more. Requires USE_WORKITEMS=true (enabled by default). Uses CQRS pattern with action-based tools.
|
|
@@ -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,CAAC;wBACV,MAAM,KAAK,GAAG,IAAA,oBAAO,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;wBAEhC,OAAO,mBAAM,CAAC,GAAG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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,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC5C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