@structured-world/gitlab-mcp 5.2.0 → 5.3.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/dist/entities/core/registry.js +9 -4
- package/dist/entities/core/registry.js.map +1 -1
- package/dist/entities/core/schema-readonly.d.ts +6 -3
- package/dist/entities/core/schema-readonly.js +5 -0
- package/dist/entities/core/schema-readonly.js.map +1 -1
- package/dist/entities/files/registry.js +6 -5
- package/dist/entities/files/registry.js.map +1 -1
- package/dist/entities/mrs/registry.js +9 -8
- package/dist/entities/mrs/registry.js.map +1 -1
- package/dist/entities/pipelines/registry.js +30 -25
- package/dist/entities/pipelines/registry.js.map +1 -1
- package/dist/entities/workitems/schema-readonly.d.ts +1 -1
- package/dist/structured-world-gitlab-mcp-5.3.0.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/projectIdentifier.d.ts +9 -0
- package/dist/utils/projectIdentifier.js +59 -0
- package/dist/utils/projectIdentifier.js.map +1 -0
- package/package.json +1 -1
- package/dist/structured-world-gitlab-mcp-5.2.0.tgz +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ProjectIdentifier {
|
|
2
|
+
identifier: string;
|
|
3
|
+
isNumericId: boolean;
|
|
4
|
+
originalValue: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function processProjectIdentifier(input: string): ProjectIdentifier;
|
|
7
|
+
export declare function safeEncodeProjectId(projectId: string): string;
|
|
8
|
+
export declare function normalizeProjectId(projectId: string): string;
|
|
9
|
+
export declare function validateProjectIdentifier(input: string): string | null;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processProjectIdentifier = processProjectIdentifier;
|
|
4
|
+
exports.safeEncodeProjectId = safeEncodeProjectId;
|
|
5
|
+
exports.normalizeProjectId = normalizeProjectId;
|
|
6
|
+
exports.validateProjectIdentifier = validateProjectIdentifier;
|
|
7
|
+
function isUrlEncoded(str) {
|
|
8
|
+
return /%[0-9A-Fa-f]{2}/.test(str);
|
|
9
|
+
}
|
|
10
|
+
function isNumericId(str) {
|
|
11
|
+
return /^\d+$/.test(str.trim());
|
|
12
|
+
}
|
|
13
|
+
function processProjectIdentifier(input) {
|
|
14
|
+
const trimmedInput = input.trim();
|
|
15
|
+
if (isNumericId(trimmedInput)) {
|
|
16
|
+
return {
|
|
17
|
+
identifier: trimmedInput,
|
|
18
|
+
isNumericId: true,
|
|
19
|
+
originalValue: input,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
let identifier;
|
|
23
|
+
if (isUrlEncoded(trimmedInput)) {
|
|
24
|
+
identifier = trimmedInput;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
identifier = encodeURIComponent(trimmedInput);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
identifier,
|
|
31
|
+
isNumericId: false,
|
|
32
|
+
originalValue: input,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function safeEncodeProjectId(projectId) {
|
|
36
|
+
const processed = processProjectIdentifier(projectId);
|
|
37
|
+
return processed.identifier;
|
|
38
|
+
}
|
|
39
|
+
function normalizeProjectId(projectId) {
|
|
40
|
+
return safeEncodeProjectId(projectId);
|
|
41
|
+
}
|
|
42
|
+
function validateProjectIdentifier(input) {
|
|
43
|
+
if (!input || typeof input !== "string") {
|
|
44
|
+
return "Project identifier is required and must be a string";
|
|
45
|
+
}
|
|
46
|
+
const trimmed = input.trim();
|
|
47
|
+
if (trimmed.length === 0) {
|
|
48
|
+
return "Project identifier cannot be empty";
|
|
49
|
+
}
|
|
50
|
+
if (isNumericId(trimmed)) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const decoded = isUrlEncoded(trimmed) ? decodeURIComponent(trimmed) : trimmed;
|
|
54
|
+
if (!/^[a-zA-Z0-9\-_./]+$/.test(decoded)) {
|
|
55
|
+
return "Invalid project identifier format. Use numeric ID or namespace/project path.";
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=projectIdentifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectIdentifier.js","sourceRoot":"","sources":["../../src/utils/projectIdentifier.ts"],"names":[],"mappings":";;AAuCA,4DA4BC;AAOD,kDAGC;AAMD,gDAEC;AAMD,8DAwBC;AA/FD,SAAS,YAAY,CAAC,GAAW;IAE/B,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC;AAKD,SAAS,WAAW,CAAC,GAAW;IAC9B,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;AAClC,CAAC;AASD,SAAgB,wBAAwB,CAAC,KAAa;IACpD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAGlC,IAAI,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,OAAO;YACL,UAAU,EAAE,YAAY;YACxB,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,KAAK;SACrB,CAAC;IACJ,CAAC;IAGD,IAAI,UAAkB,CAAC;IAEvB,IAAI,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC;QAE/B,UAAU,GAAG,YAAY,CAAC;IAC5B,CAAC;SAAM,CAAC;QAEN,UAAU,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC;IAED,OAAO;QACL,UAAU;QACV,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,KAAK;KACrB,CAAC;AACJ,CAAC;AAOD,SAAgB,mBAAmB,CAAC,SAAiB;IACnD,MAAM,SAAS,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACtD,OAAO,SAAS,CAAC,UAAU,CAAC;AAC9B,CAAC;AAMD,SAAgB,kBAAkB,CAAC,SAAiB;IAClD,OAA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