@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.
Files changed (47) hide show
  1. package/README.md +41 -10
  2. package/dist/src/config.d.ts +1 -0
  3. package/dist/src/config.js +2 -1
  4. package/dist/src/config.js.map +1 -1
  5. package/dist/src/entities/core/schema-readonly.d.ts +2 -2
  6. package/dist/src/entities/index.d.ts +1 -0
  7. package/dist/src/entities/index.js +1 -0
  8. package/dist/src/entities/index.js.map +1 -1
  9. package/dist/src/entities/labels/registry.js +57 -68
  10. package/dist/src/entities/labels/registry.js.map +1 -1
  11. package/dist/src/entities/labels/schema-readonly.d.ts +10 -9
  12. package/dist/src/entities/labels/schema-readonly.js +19 -11
  13. package/dist/src/entities/labels/schema-readonly.js.map +1 -1
  14. package/dist/src/entities/labels/schema.d.ts +9 -16
  15. package/dist/src/entities/labels/schema.js +24 -22
  16. package/dist/src/entities/labels/schema.js.map +1 -1
  17. package/dist/src/entities/utils.d.ts +5 -0
  18. package/dist/src/entities/utils.js +10 -0
  19. package/dist/src/entities/utils.js.map +1 -1
  20. package/dist/src/entities/variables/registry.js +61 -80
  21. package/dist/src/entities/variables/registry.js.map +1 -1
  22. package/dist/src/entities/variables/schema-readonly.d.ts +9 -9
  23. package/dist/src/entities/variables/schema-readonly.js +14 -11
  24. package/dist/src/entities/variables/schema-readonly.js.map +1 -1
  25. package/dist/src/entities/variables/schema.d.ts +8 -26
  26. package/dist/src/entities/variables/schema.js +20 -69
  27. package/dist/src/entities/variables/schema.js.map +1 -1
  28. package/dist/src/entities/webhooks/index.d.ts +7 -0
  29. package/dist/src/entities/webhooks/index.js +31 -0
  30. package/dist/src/entities/webhooks/index.js.map +1 -0
  31. package/dist/src/entities/webhooks/registry.d.ts +5 -0
  32. package/dist/src/entities/webhooks/registry.js +158 -0
  33. package/dist/src/entities/webhooks/registry.js.map +1 -0
  34. package/dist/src/entities/webhooks/schema-readonly.d.ts +12 -0
  35. package/dist/src/entities/webhooks/schema-readonly.js +17 -0
  36. package/dist/src/entities/webhooks/schema-readonly.js.map +1 -0
  37. package/dist/src/entities/webhooks/schema.d.ts +57 -0
  38. package/dist/src/entities/webhooks/schema.js +100 -0
  39. package/dist/src/entities/webhooks/schema.js.map +1 -0
  40. package/dist/src/registry-manager.js +10 -0
  41. package/dist/src/registry-manager.js.map +1 -1
  42. package/dist/src/services/ToolAvailability.js +6 -0
  43. package/dist/src/services/ToolAvailability.js.map +1 -1
  44. package/dist/structured-world-gitlab-mcp-6.6.0.tgz +0 -0
  45. package/dist/tsconfig.build.tsbuildinfo +1 -1
  46. package/package.json +1 -1
  47. package/dist/structured-world-gitlab-mcp-6.4.1.tgz +0 -0
package/README.md CHANGED
@@ -53,6 +53,7 @@ env = { "GITLAB_TOKEN" = "mytoken", "GITLAB_API_URL" = "https://gitlab.com" }
53
53
  "USE_MILESTONE": "false", // use milestone api?
54
54
  "USE_PIPELINE": "false", // use pipeline api?
55
55
  "USE_VARIABLES": "true", // use variables api?
56
+ "USE_WEBHOOKS": "true", // use webhooks api?
56
57
  "SKIP_TLS_VERIFY": "false" // skip SSL cert verification (dev only)
57
58
  }
58
59
  }
@@ -120,6 +121,8 @@ env = { "GITLAB_TOKEN" = "mytoken", "GITLAB_API_URL" = "https://gitlab.com" }
120
121
  "USE_PIPELINE",
121
122
  "-e",
122
123
  "USE_VARIABLES",
124
+ "-e",
125
+ "USE_WEBHOOKS",
123
126
  "ghcr.io/structured-world/gitlab-mcp:latest"
124
127
  ],
125
128
  "env": {
@@ -129,7 +132,8 @@ env = { "GITLAB_TOKEN" = "mytoken", "GITLAB_API_URL" = "https://gitlab.com" }
129
132
  "USE_GITLAB_WIKI": "true",
130
133
  "USE_MILESTONE": "true",
131
134
  "USE_PIPELINE": "true",
132
- "USE_VARIABLES": "true"
135
+ "USE_VARIABLES": "true",
136
+ "USE_WEBHOOKS": "true"
133
137
  }
134
138
  }
135
139
  }
@@ -463,8 +467,9 @@ When OAuth is enabled, the following endpoints are available:
463
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.
464
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.
465
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.
466
- - `USE_VARIABLES`: When set to 'true', enables the CI/CD variables-related tools (list_variables, get_variable, create_variable, update_variable, delete_variable). Supports both project-level and group-level variables. By default, variables features are enabled.
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.
467
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
+ - `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.
468
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.
469
474
  - `SKIP_TLS_VERIFY`: When set to 'true', skips TLS certificate verification for all GitLab API requests (both REST and GraphQL). **WARNING**: This bypasses SSL certificate validation and should only be used for testing with self-signed certificates or trusted internal GitLab instances. Never use this in production environments.
470
475
  - `SSL_CERT_PATH`: Path to PEM certificate file for direct HTTPS/TLS termination. Requires `SSL_KEY_PATH` to also be set.
@@ -537,7 +542,7 @@ export GITLAB_TOOL_MANAGE_WORK_ITEM="Create and manage tickets for our sprint pl
537
542
 
538
543
  ## Tools 🛠️
539
544
 
540
- **58 Tools Available** - Organized by entity and functionality below.
545
+ **57 Tools Available** - Organized by entity and functionality below.
541
546
 
542
547
  ### Key Features:
543
548
  - **CQRS Pattern** - Consolidated action-based tools: `browse_*` for reads, `manage_*` for writes
@@ -609,14 +614,14 @@ Requires USE_FILES=true environment variable (enabled by default). Uses CQRS pat
609
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.
610
615
  - ✏️ **`manage_files`**: MANAGE repository files. Actions: "single" creates/updates one file, "batch" commits multiple files atomically, "upload" adds markdown attachments.
611
616
 
612
- ### CI/CD Variables (5 tools)
613
- 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
+
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.
614
622
 
615
- - 📖 **`list_variables`**: List all CI/CD variables for a project or group with their configuration and security settings
616
- - 📖 **`get_variable`**: Get a specific CI/CD variable by key from a project or group, optionally filtered by environment scope
617
- - ✏️ **`create_variable`**: Create a new CI/CD variable for automated deployments and pipeline configuration in a project or group
618
- - ✏️ **`update_variable`**: Update an existing CI/CD variable's value, security settings, or configuration in a project or group
619
- - ✏️ **`delete_variable`**: Remove a CI/CD variable from a project or group
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.
620
625
 
621
626
  ### Work Items (2 CQRS tools)
622
627
  Modern GraphQL API for issues, epics, tasks, and more. Requires USE_WORKITEMS=true (enabled by default). Uses CQRS pattern with action-based tools.
@@ -665,6 +670,32 @@ Requires USE_PIPELINE=true environment variable.
665
670
  - 📖 **`list_pipeline_jobs`**: List all jobs in a specific pipeline
666
671
  - 📖 **`list_pipeline_trigger_jobs`**: List all trigger jobs (bridges) in a specific pipeline that trigger downstream pipelines
667
672
 
673
+ ### Webhooks Management (2 tools)
674
+ Requires USE_WEBHOOKS=true environment variable (enabled by default). Supports both project and group webhooks. Group webhooks require GitLab Premium tier.
675
+
676
+ - 📖 **`list_webhooks`**: List all webhooks configured for a project or group. Shows webhook URLs, enabled event types, SSL settings, and delivery status. Group webhooks (Premium tier) are inherited by all child projects.
677
+ - ✏️ **`manage_webhook`**: Manage webhooks with full CRUD operations plus testing. Actions: "create" (add new webhook with URL and event types), "read" (get webhook details), "update" (modify URL, events, or settings), "delete" (remove webhook), "test" (trigger test delivery for specific event type). Test action sends actual HTTP request to configured URL. In read-only mode, only "read" action is allowed.
678
+
679
+ #### Supported Event Types
680
+ Webhooks can be configured to trigger on:
681
+ - **Push events** - Push to repository (with optional branch filter)
682
+ - **Tag push events** - New tag pushed
683
+ - **Merge request events** - MR created, updated, merged
684
+ - **Issue events** - Issue created, updated, closed (including confidential)
685
+ - **Note events** - Comments on issues, MRs, snippets (including confidential)
686
+ - **Pipeline events** - Pipeline status changes
687
+ - **Job events** - Build/job status changes
688
+ - **Wiki page events** - Wiki page created or updated
689
+ - **Deployment events** - Deployment triggered
690
+ - **Release events** - Release created
691
+ - **Milestone events** - Milestone created, updated, closed
692
+ - **Emoji events** - Emoji reactions added
693
+ - **Feature flag events** - Feature flag changes
694
+ - **Resource access token events** - Token created/revoked
695
+ - **Member events** - Member added/removed
696
+ - **Subgroup events** - Subgroup created/removed (group webhooks only)
697
+ - **Project events** - Project created/removed (group webhooks only)
698
+
668
699
  ## CLI Tools 🔧
669
700
 
670
701
  ### list-tools - Browse Available Tools
@@ -11,6 +11,7 @@ export declare const USE_LABELS: boolean;
11
11
  export declare const USE_MRS: boolean;
12
12
  export declare const USE_FILES: boolean;
13
13
  export declare const USE_VARIABLES: boolean;
14
+ export declare const USE_WEBHOOKS: boolean;
14
15
  export declare const HOST: string;
15
16
  export declare const PORT: string | number;
16
17
  export declare const SSL_CERT_PATH: string | undefined;
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.packageVersion = exports.packageName = exports.GITLAB_ALLOWED_PROJECT_IDS = exports.GITLAB_PROJECT_ID = exports.GITLAB_API_URL = exports.GITLAB_BASE_URL = exports.GITLAB_CA_CERT_PATH = exports.NODE_TLS_REJECT_UNAUTHORIZED = exports.HTTPS_PROXY = exports.HTTP_PROXY = exports.SKIP_TLS_VERIFY = exports.RATE_LIMIT_SESSION_MAX_REQUESTS = exports.RATE_LIMIT_SESSION_WINDOW_MS = exports.RATE_LIMIT_SESSION_ENABLED = exports.RATE_LIMIT_IP_MAX_REQUESTS = exports.RATE_LIMIT_IP_WINDOW_MS = exports.RATE_LIMIT_IP_ENABLED = exports.API_TIMEOUT_MS = exports.TRUST_PROXY = exports.SSL_PASSPHRASE = exports.SSL_CA_PATH = exports.SSL_KEY_PATH = exports.SSL_CERT_PATH = exports.PORT = exports.HOST = exports.USE_VARIABLES = exports.USE_FILES = exports.USE_MRS = exports.USE_LABELS = exports.USE_WORKITEMS = exports.USE_PIPELINE = exports.USE_MILESTONE = exports.USE_GITLAB_WIKI = exports.GITLAB_DENIED_TOOLS_REGEX = exports.GITLAB_READ_ONLY_MODE = exports.IS_OLD = exports.GITLAB_AUTH_COOKIE_PATH = exports.GITLAB_TOKEN = void 0;
36
+ exports.packageVersion = exports.packageName = exports.GITLAB_ALLOWED_PROJECT_IDS = exports.GITLAB_PROJECT_ID = exports.GITLAB_API_URL = exports.GITLAB_BASE_URL = exports.GITLAB_CA_CERT_PATH = exports.NODE_TLS_REJECT_UNAUTHORIZED = exports.HTTPS_PROXY = exports.HTTP_PROXY = exports.SKIP_TLS_VERIFY = exports.RATE_LIMIT_SESSION_MAX_REQUESTS = exports.RATE_LIMIT_SESSION_WINDOW_MS = exports.RATE_LIMIT_SESSION_ENABLED = exports.RATE_LIMIT_IP_MAX_REQUESTS = exports.RATE_LIMIT_IP_WINDOW_MS = exports.RATE_LIMIT_IP_ENABLED = exports.API_TIMEOUT_MS = exports.TRUST_PROXY = exports.SSL_PASSPHRASE = exports.SSL_CA_PATH = exports.SSL_KEY_PATH = exports.SSL_CERT_PATH = exports.PORT = exports.HOST = exports.USE_WEBHOOKS = exports.USE_VARIABLES = exports.USE_FILES = exports.USE_MRS = exports.USE_LABELS = exports.USE_WORKITEMS = exports.USE_PIPELINE = exports.USE_MILESTONE = exports.USE_GITLAB_WIKI = exports.GITLAB_DENIED_TOOLS_REGEX = exports.GITLAB_READ_ONLY_MODE = exports.IS_OLD = exports.GITLAB_AUTH_COOKIE_PATH = exports.GITLAB_TOKEN = void 0;
37
37
  exports.getEffectiveProjectId = getEffectiveProjectId;
38
38
  exports.getToolDescriptionOverrides = getToolDescriptionOverrides;
39
39
  const path = __importStar(require("path"));
@@ -54,6 +54,7 @@ exports.USE_LABELS = process.env.USE_LABELS !== "false";
54
54
  exports.USE_MRS = process.env.USE_MRS !== "false";
55
55
  exports.USE_FILES = process.env.USE_FILES !== "false";
56
56
  exports.USE_VARIABLES = process.env.USE_VARIABLES !== "false";
57
+ exports.USE_WEBHOOKS = process.env.USE_WEBHOOKS !== "false";
57
58
  exports.HOST = process.env.HOST ?? "0.0.0.0";
58
59
  exports.PORT = process.env.PORT ?? 3002;
59
60
  exports.SSL_CERT_PATH = process.env.SSL_CERT_PATH;
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,sDAcC;AAwBD,kEAgBC;AApJD,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,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,EAAE,CACxG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAGD,IAAI,WAAW,GAAG,YAAY,CAAC;AActB,kCAAW;AAbpB,IAAI,cAAc,GAAG,SAAS,CAAC;AAaT,wCAAc;AAXpC,IAAI,CAAC;IACH,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAGtE,CAAC;IACF,sBAAA,WAAW,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC;IAC9C,yBAAA,cAAc,GAAG,WAAW,CAAC,OAAO,IAAI,cAAc,CAAC;AACzD,CAAC;AAAC,MAAM,CAAC;AAET,CAAC;AASD,SAAgB,2BAA2B;IACzC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC5C,MAAM,MAAM,GAAG,cAAc,CAAC;IAG9B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YAGpC,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;YAE5D,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -109,13 +109,13 @@ export declare const BrowseCommitsSchema: z.ZodObject<{
109
109
  }, z.core.$strip>;
110
110
  export declare const BrowseEventsSchema: z.ZodObject<{
111
111
  action: z.ZodEnum<{
112
- user: "user";
113
112
  project: "project";
113
+ user: "user";
114
114
  }>;
115
115
  target_type: z.ZodOptional<z.ZodEnum<{
116
116
  milestone: "milestone";
117
- user: "user";
118
117
  project: "project";
118
+ user: "user";
119
119
  issue: "issue";
120
120
  merge_request: "merge_request";
121
121
  note: "note";
@@ -8,3 +8,4 @@ export * from "./labels";
8
8
  export * from "./mrs";
9
9
  export * from "./files";
10
10
  export * from "./variables";
11
+ export * from "./webhooks";
@@ -24,4 +24,5 @@ __exportStar(require("./labels"), exports);
24
24
  __exportStar(require("./mrs"), exports);
25
25
  __exportStar(require("./files"), exports);
26
26
  __exportStar(require("./variables"), exports);
27
+ __exportStar(require("./webhooks"), exports);
27
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B;AAC5B,2CAAyB;AACzB,wCAAsB;AACtB,0CAAwB;AACxB,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B;AAC5B,2CAAyB;AACzB,wCAAsB;AACtB,0CAAwB;AACxB,8CAA4B;AAC5B,6CAA2B"}
@@ -42,89 +42,78 @@ 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.labelsToolRegistry = new Map([
46
47
  [
47
- "list_labels",
48
+ "browse_labels",
48
49
  {
49
- name: "list_labels",
50
- description: "DISCOVER FIRST: Browse all existing labels in a project or group - RUN THIS BEFORE creating new labels! Use when: Choosing labels for issues/MRs, Understanding established taxonomy, Avoiding duplicate label creation. Returns label names, colors, descriptions, and priorities. Group labels are inherited by all projects. See also: create_label (only after checking existing labels).",
51
- inputSchema: z.toJSONSchema(schema_readonly_1.ListLabelsSchema),
50
+ name: "browse_labels",
51
+ description: 'BROWSE labels. Actions: "list" shows all labels in project/group with filtering, "get" retrieves single label details by ID or name.',
52
+ inputSchema: z.toJSONSchema(schema_readonly_1.BrowseLabelsSchema),
52
53
  handler: async (args) => {
53
- const options = schema_readonly_1.ListLabelsSchema.parse(args);
54
- const { namespace } = options;
55
- const entityType = namespace.includes("/") ? "projects" : "groups";
56
- return gitlab_api_1.gitlab.get(`${entityType}/${encodeURIComponent(namespace)}/labels`, {
57
- query: (0, gitlab_api_1.toQuery)(options, ["namespace"]),
58
- });
54
+ const input = schema_readonly_1.BrowseLabelsSchema.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, label_id: _labelId, ...rest } = input;
59
+ const query = (0, gitlab_api_1.toQuery)(rest, []);
60
+ return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/labels`, { query });
61
+ }
62
+ case "get": {
63
+ (0, utils_1.assertDefined)(input.label_id, "label_id");
64
+ const query = input.include_ancestor_groups
65
+ ? (0, gitlab_api_1.toQuery)({ include_ancestor_groups: input.include_ancestor_groups }, [])
66
+ : undefined;
67
+ return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/labels/${encodeURIComponent(input.label_id)}`, { query });
68
+ }
69
+ default:
70
+ throw new Error(`Unknown action: ${input.action}`);
71
+ }
59
72
  },
60
73
  },
61
74
  ],
62
75
  [
63
- "get_label",
76
+ "manage_label",
64
77
  {
65
- name: "get_label",
66
- description: "READ: Retrieve details of a specific label by ID or name. Use when: Getting full label information including color and description, Checking label usage statistics, Validating label properties. Works for both project-specific and group-inherited labels. See also: list_labels to browse all available labels first.",
67
- inputSchema: z.toJSONSchema(schema_readonly_1.GetLabelSchema),
78
+ name: "manage_label",
79
+ description: 'MANAGE labels. Actions: "create" adds new label (requires name and color), "update" modifies existing label, "delete" removes label permanently.',
80
+ inputSchema: z.toJSONSchema(schema_1.ManageLabelSchema),
68
81
  handler: async (args) => {
69
- const options = schema_readonly_1.GetLabelSchema.parse(args);
70
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
71
- return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/labels/${encodeURIComponent(options.label_id)}`);
72
- },
73
- },
74
- ],
75
- [
76
- "create_label",
77
- {
78
- name: "create_label",
79
- description: "CREATE CAREFULLY: Add a new label ONLY after running list_labels to check existing taxonomy! Use when: Existing labels do not fit your needs, Establishing new project taxonomy. AVOID: Creating duplicates of existing labels with slight variations. Requires name and color (hex format like #FF0000). Group labels automatically become available to all child projects. See also: list_labels (run first to discover existing labels).",
80
- inputSchema: z.toJSONSchema(schema_1.CreateLabelSchema),
81
- handler: async (args) => {
82
- const options = schema_1.CreateLabelSchema.parse(args);
83
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
84
- return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/labels`, {
85
- body: {
86
- name: options.name,
87
- color: options.color,
88
- description: options.description,
89
- priority: options.priority,
90
- },
91
- });
92
- },
93
- },
94
- ],
95
- [
96
- "update_label",
97
- {
98
- name: "update_label",
99
- description: "UPDATE: Modify label properties including name, color, description, or priority. Use when: Refining categorization system, Updating label appearance, Standardizing label naming. Changes apply immediately to all tagged items. Renaming updates all existing references automatically. See also: list_labels to understand current taxonomy before changes.",
100
- inputSchema: z.toJSONSchema(schema_1.UpdateLabelSchema),
101
- handler: async (args) => {
102
- const options = schema_1.UpdateLabelSchema.parse(args);
103
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
104
- const { namespace: _namespace, label_id, ...body } = options;
105
- return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/labels/${encodeURIComponent(label_id)}`, {
106
- body,
107
- });
108
- },
109
- },
110
- ],
111
- [
112
- "delete_label",
113
- {
114
- name: "delete_label",
115
- description: "DELETE: Remove a label permanently from project or group. Use when: Cleaning up unused labels, Reorganizing taxonomy. WARNING: Removes label from all issues and MRs without replacement. Consider updating items before deletion. Cannot be undone. See also: list_labels to check label usage before deletion.",
116
- inputSchema: z.toJSONSchema(schema_1.DeleteLabelSchema),
117
- handler: async (args) => {
118
- const options = schema_1.DeleteLabelSchema.parse(args);
119
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
120
- await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/labels/${encodeURIComponent(options.label_id)}`);
121
- return { success: true, message: "Label deleted successfully" };
82
+ const input = schema_1.ManageLabelSchema.parse(args);
83
+ const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
84
+ switch (input.action) {
85
+ case "create": {
86
+ (0, utils_1.assertDefined)(input.name, "name");
87
+ (0, utils_1.assertDefined)(input.color, "color");
88
+ return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/labels`, {
89
+ body: {
90
+ name: input.name,
91
+ color: input.color,
92
+ description: input.description,
93
+ priority: input.priority,
94
+ },
95
+ contentType: "json",
96
+ });
97
+ }
98
+ case "update": {
99
+ (0, utils_1.assertDefined)(input.label_id, "label_id");
100
+ const { action: _action, namespace: _namespace, label_id, name: _name, ...body } = input;
101
+ return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/labels/${encodeURIComponent(label_id)}`, { body, contentType: "json" });
102
+ }
103
+ case "delete": {
104
+ (0, utils_1.assertDefined)(input.label_id, "label_id");
105
+ await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/labels/${encodeURIComponent(input.label_id)}`);
106
+ return { deleted: true };
107
+ }
108
+ default:
109
+ throw new Error(`Unknown action: ${input.action}`);
110
+ }
122
111
  },
123
112
  },
124
113
  ],
125
114
  ]);
126
115
  function getLabelsReadOnlyToolNames() {
127
- return ["list_labels", "get_label"];
116
+ return ["browse_labels"];
128
117
  }
129
118
  function getLabelsToolDefinitions() {
130
119
  return Array.from(exports.labelsToolRegistry.values());
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/labels/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GA,gEAEC;AAED,4DAEC;AAED,wDAQC;AA1HD,uCAAyB;AACzB,uDAAqE;AACrE,qCAAmF;AACnF,uDAAyD;AACzD,qDAA+D;AAMlD,QAAA,kBAAkB,GAAiB,IAAI,GAAG,CAAiC;IACtF;QACE,aAAa;QACb;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EACT,+XAA+X;YACjY,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,kCAAgB,CAAC;YAC7C,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;gBAC/B,MAAM,OAAO,GAAG,kCAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC7C,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;gBAC9B,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;gBAEnE,OAAO,mBAAM,CAAC,GAAG,CAAC,GAAG,UAAU,IAAI,kBAAkB,CAAC,SAAS,CAAC,SAAS,EAAE;oBACzE,KAAK,EAAE,IAAA,oBAAO,EAAC,OAAO,EAAE,CAAC,WAAW,CAAC,CAAC;iBACvC,CAAC,CAAC;YACL,CAAC;SACF;KACF;IACD;QACE,WAAW;QACX;YACE,IAAI,EAAE,WAAW;YACjB,WAAW,EACT,2TAA2T;YAC7T,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,gCAAc,CAAC;YAC3C,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;gBAC/B,MAAM,OAAO,GAAG,gCAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAA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,CAAC,CAAC;AACjD,CAAC;AAKD,SAAgB,sBAAsB,CAAC,eAAwB,KAAK;IAClE,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,aAAa,GAAG,0BAA0B,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC,IAAI,CAAC,0BAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAC3D,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;IACD,OAAO,wBAAwB,EAAE,CAAC;AACpC,CAAC"}
@@ -1,14 +1,15 @@
1
1
  import { z } from "zod";
2
- export declare const ListLabelsSchema: z.ZodObject<{
2
+ export declare const BrowseLabelsSchema: z.ZodObject<{
3
+ action: z.ZodEnum<{
4
+ list: "list";
5
+ get: "get";
6
+ }>;
3
7
  namespace: z.ZodString;
4
- with_counts: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
5
- include_ancestor_groups: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
8
+ label_id: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
6
9
  search: z.ZodOptional<z.ZodString>;
7
- }, z.core.$strip>;
8
- export declare const GetLabelSchema: z.ZodObject<{
9
- namespace: z.ZodString;
10
- label_id: z.ZodUnion<readonly [z.ZodCoercedString<unknown>, z.ZodString]>;
10
+ with_counts: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
11
11
  include_ancestor_groups: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
12
+ per_page: z.ZodOptional<z.ZodNumber>;
13
+ page: z.ZodOptional<z.ZodNumber>;
12
14
  }, z.core.$strip>;
13
- export type ListLabelsOptions = z.infer<typeof ListLabelsSchema>;
14
- export type GetLabelOptions = z.infer<typeof GetLabelSchema>;
15
+ export type BrowseLabelsInput = z.infer<typeof BrowseLabelsSchema>;
@@ -1,19 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetLabelSchema = exports.ListLabelsSchema = void 0;
3
+ exports.BrowseLabelsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const utils_1 = require("../utils");
6
- exports.ListLabelsSchema = zod_1.z.object({
7
- namespace: zod_1.z.string().describe("Namespace path (group or project) to list labels from"),
6
+ exports.BrowseLabelsSchema = zod_1.z
7
+ .object({
8
+ action: zod_1.z.enum(["list", "get"]).describe("Action to perform"),
9
+ namespace: zod_1.z.string().describe("Namespace path (group or project)"),
10
+ label_id: utils_1.requiredId
11
+ .optional()
12
+ .describe("The ID or title of the label. Required for 'get' action."),
13
+ search: zod_1.z.string().optional().describe("For 'list': keyword to filter labels by"),
8
14
  with_counts: utils_1.flexibleBoolean
9
15
  .optional()
10
- .describe("Whether or not to include issue and merge request counts"),
11
- include_ancestor_groups: utils_1.flexibleBoolean.optional().describe("Include ancestor groups"),
12
- search: zod_1.z.string().optional().describe("Keyword to filter labels by"),
13
- });
14
- exports.GetLabelSchema = zod_1.z.object({
15
- namespace: zod_1.z.string().describe("Namespace path (group or project) containing the label"),
16
- label_id: zod_1.z.union([zod_1.z.coerce.string(), zod_1.z.string()]).describe("The ID or title of the label"),
17
- include_ancestor_groups: utils_1.flexibleBoolean.optional().describe("Include ancestor groups"),
16
+ .describe("For 'list': include issue and merge request counts"),
17
+ include_ancestor_groups: utils_1.flexibleBoolean
18
+ .optional()
19
+ .describe("Include ancestor groups when listing or getting labels"),
20
+ per_page: zod_1.z.number().optional().describe("Number of items per page"),
21
+ page: zod_1.z.number().optional().describe("Page number"),
22
+ })
23
+ .refine(data => data.action !== "get" || data.label_id !== undefined, {
24
+ message: "label_id is required for 'get' action",
25
+ path: ["label_id"],
18
26
  });
19
27
  //# sourceMappingURL=schema-readonly.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA2C;AAK9B,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IACvF,WAAW,EAAE,uBAAe;SACzB,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,uBAAuB,EAAE,uBAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACvF,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;CACtE,CAAC,CAAC;AAEU,QAAA,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;IACxF,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC3F,uBAAuB,EAAE,uBAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CACxF,CAAC,CAAC"}
1
+ {"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAuD;AAS1C,QAAA,kBAAkB,GAAG,OAAC;KAChC,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,QAAQ,EAAE,kBAAU;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IAEvE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IACjF,WAAW,EAAE,uBAAe;SACzB,QAAQ,EAAE;SACV,QAAQ,CAAC,oDAAoD,CAAC;IACjE,uBAAuB,EAAE,uBAAe;SACrC,QAAQ,EAAE;SACV,QAAQ,CAAC,wDAAwD,CAAC;IAErE,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,QAAQ,KAAK,SAAS,EAAE;IACpE,OAAO,EAAE,uCAAuC;IAChD,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC,CAAC"}
@@ -1,23 +1,16 @@
1
1
  import { z } from "zod";
2
- export declare const CreateLabelSchema: z.ZodObject<{
2
+ export declare const ManageLabelSchema: z.ZodObject<{
3
+ action: z.ZodEnum<{
4
+ create: "create";
5
+ update: "update";
6
+ delete: "delete";
7
+ }>;
3
8
  namespace: z.ZodString;
4
- name: z.ZodString;
5
- color: z.ZodString;
6
- description: z.ZodOptional<z.ZodString>;
7
- priority: z.ZodOptional<z.ZodNumber>;
8
- }, z.core.$strip>;
9
- export declare const UpdateLabelSchema: z.ZodObject<{
10
- namespace: z.ZodString;
11
- label_id: z.ZodUnion<readonly [z.ZodCoercedString<unknown>, z.ZodString]>;
9
+ label_id: z.ZodOptional<z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>>;
10
+ name: z.ZodOptional<z.ZodString>;
12
11
  new_name: z.ZodOptional<z.ZodString>;
13
12
  color: z.ZodOptional<z.ZodString>;
14
13
  description: z.ZodOptional<z.ZodString>;
15
14
  priority: z.ZodOptional<z.ZodNumber>;
16
15
  }, z.core.$strip>;
17
- export declare const DeleteLabelSchema: z.ZodObject<{
18
- namespace: z.ZodString;
19
- label_id: z.ZodUnion<readonly [z.ZodCoercedString<unknown>, z.ZodString]>;
20
- }, z.core.$strip>;
21
- export type CreateLabelOptions = z.infer<typeof CreateLabelSchema>;
22
- export type UpdateLabelOptions = z.infer<typeof UpdateLabelSchema>;
23
- export type DeleteLabelOptions = z.infer<typeof DeleteLabelSchema>;
16
+ export type ManageLabelInput = z.infer<typeof ManageLabelSchema>;
@@ -1,35 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeleteLabelSchema = exports.UpdateLabelSchema = exports.CreateLabelSchema = void 0;
3
+ exports.ManageLabelSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.CreateLabelSchema = zod_1.z.object({
6
- namespace: zod_1.z.string().describe("Namespace path (group or project) to create label in"),
7
- name: zod_1.z.string().describe("The name of the label"),
8
- color: zod_1.z
9
- .string()
10
- .describe("The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names"),
11
- description: zod_1.z.string().optional().describe("The description of the label"),
12
- priority: zod_1.z
13
- .number()
5
+ const utils_1 = require("../utils");
6
+ exports.ManageLabelSchema = zod_1.z
7
+ .object({
8
+ action: zod_1.z.enum(["create", "update", "delete"]).describe("Action to perform"),
9
+ namespace: zod_1.z.string().describe("Namespace path (group or project)"),
10
+ label_id: utils_1.requiredId
14
11
  .optional()
15
- .describe("The priority of the label. Must be greater or equal than zero or null to remove the priority"),
16
- });
17
- exports.UpdateLabelSchema = zod_1.z.object({
18
- namespace: zod_1.z.string().describe("Namespace path (group or project) containing the label"),
19
- label_id: zod_1.z.union([zod_1.z.coerce.string(), zod_1.z.string()]).describe("The ID or title of the label"),
20
- new_name: zod_1.z.string().optional().describe("The new name of the label"),
12
+ .describe("The ID or title of the label. Required for 'update' and 'delete' actions."),
13
+ name: zod_1.z.string().optional().describe("The name of the label. Required for 'create' action."),
14
+ new_name: zod_1.z.string().optional().describe("For 'update': the new name of the label"),
21
15
  color: zod_1.z
22
16
  .string()
23
17
  .optional()
24
- .describe("The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names"),
18
+ .describe("The color of the label in 6-digit hex notation with leading '#' (e.g. #FFAABB) or CSS color name. Required for 'create' action."),
25
19
  description: zod_1.z.string().optional().describe("The description of the label"),
26
20
  priority: zod_1.z
27
21
  .number()
28
22
  .optional()
29
- .describe("The priority of the label. Must be greater or equal than zero or null to remove the priority"),
30
- });
31
- exports.DeleteLabelSchema = zod_1.z.object({
32
- namespace: zod_1.z.string().describe("Namespace path (group or project) containing the label"),
33
- label_id: zod_1.z.union([zod_1.z.coerce.string(), zod_1.z.string()]).describe("The ID or title of the label"),
23
+ .describe("The priority of the label. Must be greater or equal than zero or null to remove the priority."),
24
+ })
25
+ .refine(data => data.action === "create" || data.label_id !== undefined, {
26
+ message: "label_id is required for 'update' and 'delete' actions",
27
+ path: ["label_id"],
28
+ })
29
+ .refine(data => data.action !== "create" || data.name !== undefined, {
30
+ message: "name is required for 'create' action",
31
+ path: ["name"],
32
+ })
33
+ .refine(data => data.action !== "create" || data.color !== undefined, {
34
+ message: "color is required for 'create' action",
35
+ path: ["color"],
34
36
  });
35
37
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/labels/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAKX,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IACtF,IAAI,EAAE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CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;IACnE,OAAO,EAAE,sCAAsC;IAC/C,IAAI,EAAE,CAAC,MAAM,CAAC;CACf,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"}
@@ -3,3 +3,8 @@ export declare const flexibleBoolean: z.ZodPipe<z.ZodTransform<boolean, unknown>
3
3
  export declare const flexibleBooleanNullable: z.ZodNullable<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>> | z.ZodDefault<z.ZodNullable<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>>;
4
4
  export declare const requiredId: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
5
5
  export declare function assertDefined<T>(value: T | undefined, fieldName: string): asserts value is T;
6
+ export declare function validateScopeId(data: {
7
+ scope: "project" | "group";
8
+ projectId?: string;
9
+ groupId?: string;
10
+ }): boolean;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.requiredId = exports.flexibleBooleanNullable = exports.flexibleBoolean = void 0;
4
4
  exports.assertDefined = assertDefined;
5
+ exports.validateScopeId = validateScopeId;
5
6
  const zod_1 = require("zod");
6
7
  const DEFAULT_NULL = process.env.DEFAULT_NULL === "true";
7
8
  exports.flexibleBoolean = zod_1.z.preprocess(val => {
@@ -26,4 +27,13 @@ function assertDefined(value, fieldName) {
26
27
  throw new Error(`${fieldName} is required but was not provided`);
27
28
  }
28
29
  }
30
+ function validateScopeId(data) {
31
+ if (data.scope === "project") {
32
+ return !!data.projectId;
33
+ }
34
+ if (data.scope === "group") {
35
+ return !!data.groupId;
36
+ }
37
+ return true;
38
+ }
29
39
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/entities/utils.ts"],"names":[],"mappings":";;;AA0CA,sCAIC;AA9CD,6BAAwB;AAExB,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,MAAM,CAAC;AAE5C,QAAA,eAAe,GAAG,OAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;IAChD,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,MAAM,GAAG,OAAO,CAAC;IACrB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAEH,QAAA,uBAAuB,GAAG,YAAY;IACjD,CAAC,CAAC,uBAAe,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC1C,CAAC,CAAC,uBAAe,CAAC,QAAQ,EAAE,CAAC;AAOlB,QAAA,UAAU,GAAG,OAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAgBnF,SAAgB,aAAa,CAAI,KAAoB,EAAE,SAAiB;IACtE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,mCAAmC,CAAC,CAAC;IACnE,CAAC;AACH,CA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