@structured-world/gitlab-mcp 6.62.1 → 6.62.2
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 +1 -1
- package/dist/generated/prisma/client.js.map +1 -1
- package/dist/generated/prisma/internal/class.js +2 -2
- package/dist/generated/prisma/internal/class.js.map +1 -1
- package/dist/generated/prisma/internal/prismaNamespace.js +2 -2
- package/dist/src/cli/docker/container-runtime.d.ts +1 -1
- package/dist/src/cli/docker/container-runtime.js +14 -14
- package/dist/src/cli/docker/docker-command.d.ts +1 -1
- package/dist/src/cli/docker/docker-command.js +113 -113
- package/dist/src/cli/docker/docker-command.js.map +1 -1
- package/dist/src/cli/docker/docker-utils.d.ts +3 -3
- package/dist/src/cli/docker/docker-utils.js +74 -74
- package/dist/src/cli/docker/docker-utils.js.map +1 -1
- package/dist/src/cli/docker/index.d.ts +4 -4
- package/dist/src/cli/docker/types.d.ts +3 -3
- package/dist/src/cli/docker/types.js +5 -5
- package/dist/src/cli/init/browser.js +2 -2
- package/dist/src/cli/init/config-generator.d.ts +2 -2
- package/dist/src/cli/init/config-generator.js +22 -22
- package/dist/src/cli/init/connection.d.ts +1 -1
- package/dist/src/cli/init/connection.js +17 -17
- package/dist/src/cli/init/index.d.ts +4 -4
- package/dist/src/cli/init/types.d.ts +3 -3
- package/dist/src/cli/init/types.js +36 -36
- package/dist/src/cli/init/wizard.js +80 -80
- package/dist/src/cli/init/wizard.js.map +1 -1
- package/dist/src/cli/inject-tool-refs.js +47 -47
- package/dist/src/cli/inject-tool-refs.js.map +1 -1
- package/dist/src/cli/install/backup.d.ts +1 -1
- package/dist/src/cli/install/backup.js +3 -3
- package/dist/src/cli/install/detector.d.ts +2 -2
- package/dist/src/cli/install/detector.js +18 -18
- package/dist/src/cli/install/detector.js.map +1 -1
- package/dist/src/cli/install/index.d.ts +5 -5
- package/dist/src/cli/install/install-command.d.ts +2 -2
- package/dist/src/cli/install/install-command.js +68 -68
- package/dist/src/cli/install/install-command.js.map +1 -1
- package/dist/src/cli/install/installers.d.ts +2 -2
- package/dist/src/cli/install/installers.js +55 -55
- package/dist/src/cli/install/installers.js.map +1 -1
- package/dist/src/cli/install/types.d.ts +4 -4
- package/dist/src/cli/install/types.js +48 -48
- package/dist/src/cli/instances/index.d.ts +2 -2
- package/dist/src/cli/instances/instances-command.d.ts +1 -1
- package/dist/src/cli/instances/instances-command.js +65 -65
- package/dist/src/cli/instances/instances-command.js.map +1 -1
- package/dist/src/cli/list-tools.js +396 -396
- package/dist/src/cli/list-tools.js.map +1 -1
- package/dist/src/cli/setup/discovery.d.ts +1 -1
- package/dist/src/cli/setup/discovery.js +10 -10
- package/dist/src/cli/setup/discovery.js.map +1 -1
- package/dist/src/cli/setup/flows/configure-existing.d.ts +1 -1
- package/dist/src/cli/setup/flows/configure-existing.js +57 -57
- package/dist/src/cli/setup/flows/configure-existing.js.map +1 -1
- package/dist/src/cli/setup/flows/local-setup.d.ts +1 -1
- package/dist/src/cli/setup/flows/local-setup.js +51 -51
- package/dist/src/cli/setup/flows/local-setup.js.map +1 -1
- package/dist/src/cli/setup/flows/server-setup.d.ts +1 -1
- package/dist/src/cli/setup/flows/server-setup.js +50 -50
- package/dist/src/cli/setup/flows/server-setup.js.map +1 -1
- package/dist/src/cli/setup/flows/tool-selection.d.ts +1 -1
- package/dist/src/cli/setup/flows/tool-selection.js +94 -94
- package/dist/src/cli/setup/flows/tool-selection.js.map +1 -1
- package/dist/src/cli/setup/index.d.ts +4 -4
- package/dist/src/cli/setup/presets.d.ts +1 -1
- package/dist/src/cli/setup/presets.js +157 -157
- package/dist/src/cli/setup/presets.js.map +1 -1
- package/dist/src/cli/setup/types.d.ts +7 -7
- package/dist/src/cli/setup/wizard.d.ts +1 -1
- package/dist/src/cli/setup/wizard.js +25 -25
- package/dist/src/cli/utils/index.d.ts +1 -1
- package/dist/src/cli/utils/path-utils.js +3 -3
- package/dist/src/cli-utils.d.ts +2 -2
- package/dist/src/cli-utils.js +46 -46
- package/dist/src/config/index.d.ts +4 -4
- package/dist/src/config/instances-loader.d.ts +3 -3
- package/dist/src/config/instances-loader.js +53 -53
- package/dist/src/config/instances-loader.js.map +1 -1
- package/dist/src/config/instances-schema.d.ts +1 -1
- package/dist/src/config/instances-schema.js +33 -33
- package/dist/src/config/instances-schema.js.map +1 -1
- package/dist/src/config.d.ts +4 -4
- package/dist/src/config.js +89 -89
- package/dist/src/config.js.map +1 -1
- package/dist/src/dashboard/handler.d.ts +2 -2
- package/dist/src/dashboard/handler.js +7 -7
- package/dist/src/dashboard/html-template.d.ts +1 -1
- package/dist/src/dashboard/html-template.js +44 -44
- package/dist/src/dashboard/html-template.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +4 -4
- package/dist/src/dashboard/metrics.d.ts +3 -3
- package/dist/src/dashboard/metrics.js +42 -42
- package/dist/src/discovery/auto.d.ts +3 -3
- package/dist/src/discovery/auto.js +28 -28
- package/dist/src/discovery/git-remote.d.ts +2 -2
- package/dist/src/discovery/git-remote.js +18 -18
- package/dist/src/discovery/index.d.ts +3 -3
- package/dist/src/discovery/profile-matcher.d.ts +2 -2
- package/dist/src/discovery/profile-matcher.js +8 -8
- package/dist/src/discovery/profile-matcher.js.map +1 -1
- package/dist/src/entities/context/context-manager.d.ts +3 -3
- package/dist/src/entities/context/context-manager.js +34 -34
- package/dist/src/entities/context/context-manager.js.map +1 -1
- package/dist/src/entities/context/handlers.d.ts +2 -2
- package/dist/src/entities/context/handlers.js +8 -8
- package/dist/src/entities/context/index.d.ts +8 -8
- package/dist/src/entities/context/index.js +1 -1
- package/dist/src/entities/context/registry.d.ts +1 -1
- package/dist/src/entities/context/registry.js +4 -4
- package/dist/src/entities/context/schema.d.ts +1 -1
- package/dist/src/entities/context/schema.js +19 -19
- package/dist/src/entities/context/types.d.ts +9 -9
- package/dist/src/entities/context/whoami.d.ts +1 -1
- package/dist/src/entities/context/whoami.js +31 -31
- package/dist/src/entities/context/whoami.js.map +1 -1
- package/dist/src/entities/core/index.d.ts +5 -5
- package/dist/src/entities/core/index.js +1 -1
- package/dist/src/entities/core/registry.d.ts +1 -1
- package/dist/src/entities/core/registry.js +194 -194
- package/dist/src/entities/core/registry.js.map +1 -1
- package/dist/src/entities/core/schema-readonly.d.ts +1 -1
- package/dist/src/entities/core/schema-readonly.js +117 -117
- package/dist/src/entities/core/schema.d.ts +1 -1
- package/dist/src/entities/core/schema.js +67 -67
- package/dist/src/entities/files/index.d.ts +5 -5
- package/dist/src/entities/files/index.js +1 -1
- package/dist/src/entities/files/registry.d.ts +1 -1
- package/dist/src/entities/files/registry.js +45 -45
- package/dist/src/entities/files/registry.js.map +1 -1
- package/dist/src/entities/files/schema-readonly.d.ts +1 -1
- package/dist/src/entities/files/schema-readonly.js +13 -13
- package/dist/src/entities/files/schema.d.ts +1 -1
- package/dist/src/entities/files/schema.js +29 -29
- package/dist/src/entities/index.d.ts +17 -17
- package/dist/src/entities/integrations/index.d.ts +4 -4
- package/dist/src/entities/integrations/registry.d.ts +1 -1
- package/dist/src/entities/integrations/registry.js +17 -17
- package/dist/src/entities/integrations/registry.js.map +1 -1
- package/dist/src/entities/integrations/schema-readonly.d.ts +1 -1
- package/dist/src/entities/integrations/schema-readonly.js +5 -5
- package/dist/src/entities/integrations/schema.d.ts +1 -1
- package/dist/src/entities/integrations/schema.js +69 -69
- package/dist/src/entities/iterations/index.d.ts +2 -2
- package/dist/src/entities/iterations/registry.d.ts +1 -1
- package/dist/src/entities/iterations/registry.js +13 -13
- package/dist/src/entities/iterations/registry.js.map +1 -1
- package/dist/src/entities/iterations/schema-readonly.d.ts +1 -1
- package/dist/src/entities/iterations/schema-readonly.js +9 -9
- package/dist/src/entities/labels/index.d.ts +5 -5
- package/dist/src/entities/labels/index.js +1 -1
- package/dist/src/entities/labels/registry.d.ts +1 -1
- package/dist/src/entities/labels/registry.js +19 -19
- package/dist/src/entities/labels/registry.js.map +1 -1
- package/dist/src/entities/labels/schema-readonly.d.ts +1 -1
- package/dist/src/entities/labels/schema-readonly.js +8 -8
- package/dist/src/entities/labels/schema.d.ts +1 -1
- package/dist/src/entities/labels/schema.js +11 -11
- package/dist/src/entities/members/index.d.ts +3 -3
- package/dist/src/entities/members/registry.d.ts +1 -1
- package/dist/src/entities/members/registry.js +26 -26
- package/dist/src/entities/members/registry.js.map +1 -1
- package/dist/src/entities/members/schema-readonly.d.ts +1 -1
- package/dist/src/entities/members/schema-readonly.js +32 -32
- package/dist/src/entities/members/schema-readonly.js.map +1 -1
- package/dist/src/entities/members/schema.d.ts +1 -1
- package/dist/src/entities/members/schema.js +28 -28
- package/dist/src/entities/milestones/index.d.ts +5 -5
- package/dist/src/entities/milestones/index.js +1 -1
- package/dist/src/entities/milestones/registry.d.ts +1 -1
- package/dist/src/entities/milestones/registry.js +25 -25
- package/dist/src/entities/milestones/registry.js.map +1 -1
- package/dist/src/entities/milestones/schema-readonly.d.ts +2 -2
- package/dist/src/entities/milestones/schema-readonly.js +15 -15
- package/dist/src/entities/milestones/schema.d.ts +1 -1
- package/dist/src/entities/milestones/schema.js +16 -16
- package/dist/src/entities/milestones/schema.js.map +1 -1
- package/dist/src/entities/mrs/index.d.ts +5 -5
- package/dist/src/entities/mrs/index.js +1 -1
- package/dist/src/entities/mrs/registry.d.ts +1 -1
- package/dist/src/entities/mrs/registry.js +102 -102
- package/dist/src/entities/mrs/registry.js.map +1 -1
- package/dist/src/entities/mrs/schema-readonly.d.ts +1 -1
- package/dist/src/entities/mrs/schema-readonly.js +126 -126
- package/dist/src/entities/mrs/schema-readonly.js.map +1 -1
- package/dist/src/entities/mrs/schema.d.ts +1 -1
- package/dist/src/entities/mrs/schema.js +111 -111
- package/dist/src/entities/mrs/schema.js.map +1 -1
- package/dist/src/entities/pipelines/index.d.ts +5 -5
- package/dist/src/entities/pipelines/index.js +1 -1
- package/dist/src/entities/pipelines/registry.d.ts +1 -1
- package/dist/src/entities/pipelines/registry.js +45 -45
- package/dist/src/entities/pipelines/registry.js.map +1 -1
- package/dist/src/entities/pipelines/schema-readonly.d.ts +1 -1
- package/dist/src/entities/pipelines/schema-readonly.js +73 -73
- package/dist/src/entities/pipelines/schema.d.ts +1 -1
- package/dist/src/entities/pipelines/schema.js +21 -21
- package/dist/src/entities/refs/index.d.ts +3 -3
- package/dist/src/entities/refs/registry.d.ts +1 -1
- package/dist/src/entities/refs/registry.js +31 -31
- package/dist/src/entities/refs/registry.js.map +1 -1
- package/dist/src/entities/refs/schema-readonly.d.ts +1 -1
- package/dist/src/entities/refs/schema-readonly.js +21 -21
- package/dist/src/entities/refs/schema.d.ts +1 -1
- package/dist/src/entities/refs/schema.js +56 -56
- package/dist/src/entities/releases/index.d.ts +3 -3
- package/dist/src/entities/releases/registry.d.ts +1 -1
- package/dist/src/entities/releases/registry.js +21 -21
- package/dist/src/entities/releases/registry.js.map +1 -1
- package/dist/src/entities/releases/schema-readonly.d.ts +1 -1
- package/dist/src/entities/releases/schema-readonly.js +13 -13
- package/dist/src/entities/releases/schema.d.ts +1 -1
- package/dist/src/entities/releases/schema.js +21 -21
- package/dist/src/entities/search/index.d.ts +2 -2
- package/dist/src/entities/search/registry.d.ts +1 -1
- package/dist/src/entities/search/registry.js +13 -13
- package/dist/src/entities/search/schema-readonly.d.ts +1 -1
- package/dist/src/entities/search/schema-readonly.js +23 -23
- package/dist/src/entities/shared.d.ts +1 -1
- package/dist/src/entities/shared.js +5 -5
- package/dist/src/entities/snippets/index.d.ts +5 -5
- package/dist/src/entities/snippets/index.js +1 -1
- package/dist/src/entities/snippets/registry.d.ts +1 -1
- package/dist/src/entities/snippets/registry.js +24 -24
- package/dist/src/entities/snippets/registry.js.map +1 -1
- package/dist/src/entities/snippets/schema-readonly.d.ts +1 -1
- package/dist/src/entities/snippets/schema-readonly.js +11 -11
- package/dist/src/entities/snippets/schema.d.ts +1 -1
- package/dist/src/entities/snippets/schema.js +27 -27
- package/dist/src/entities/snippets/schema.js.map +1 -1
- package/dist/src/entities/utils.d.ts +2 -2
- package/dist/src/entities/utils.js +8 -8
- package/dist/src/entities/utils.js.map +1 -1
- package/dist/src/entities/variables/index.d.ts +5 -5
- package/dist/src/entities/variables/index.js +1 -1
- package/dist/src/entities/variables/registry.d.ts +1 -1
- package/dist/src/entities/variables/registry.js +22 -22
- package/dist/src/entities/variables/registry.js.map +1 -1
- package/dist/src/entities/variables/schema-readonly.d.ts +1 -1
- package/dist/src/entities/variables/schema-readonly.js +6 -6
- package/dist/src/entities/variables/schema.d.ts +1 -1
- package/dist/src/entities/variables/schema.js +21 -21
- package/dist/src/entities/variables/schema.js.map +1 -1
- package/dist/src/entities/webhooks/index.d.ts +4 -4
- package/dist/src/entities/webhooks/registry.d.ts +1 -1
- package/dist/src/entities/webhooks/registry.js +29 -29
- package/dist/src/entities/webhooks/registry.js.map +1 -1
- package/dist/src/entities/webhooks/schema-readonly.d.ts +1 -1
- package/dist/src/entities/webhooks/schema-readonly.js +9 -9
- package/dist/src/entities/webhooks/schema.d.ts +1 -1
- package/dist/src/entities/webhooks/schema.js +59 -59
- package/dist/src/entities/wiki/index.d.ts +5 -5
- package/dist/src/entities/wiki/index.js +1 -1
- package/dist/src/entities/wiki/registry.d.ts +1 -1
- package/dist/src/entities/wiki/registry.js +19 -19
- package/dist/src/entities/wiki/registry.js.map +1 -1
- package/dist/src/entities/wiki/schema-readonly.d.ts +1 -1
- package/dist/src/entities/wiki/schema-readonly.js +6 -6
- package/dist/src/entities/wiki/schema.d.ts +1 -1
- package/dist/src/entities/wiki/schema.js +12 -12
- package/dist/src/entities/workitems/index.d.ts +5 -5
- package/dist/src/entities/workitems/index.js +1 -1
- package/dist/src/entities/workitems/registry.d.ts +1 -1
- package/dist/src/entities/workitems/registry.js +101 -101
- package/dist/src/entities/workitems/registry.js.map +1 -1
- package/dist/src/entities/workitems/schema-readonly.d.ts +1 -1
- package/dist/src/entities/workitems/schema-readonly.js +27 -27
- package/dist/src/entities/workitems/schema-readonly.js.map +1 -1
- package/dist/src/entities/workitems/schema.d.ts +1 -1
- package/dist/src/entities/workitems/schema.js +58 -58
- package/dist/src/graphql/DynamicWorkItemsQuery.d.ts +2 -2
- package/dist/src/graphql/DynamicWorkItemsQuery.js +47 -47
- package/dist/src/graphql/DynamicWorkItemsQuery.js.map +1 -1
- package/dist/src/graphql/client.d.ts +1 -1
- package/dist/src/graphql/client.js +4 -4
- package/dist/src/graphql/client.js.map +1 -1
- package/dist/src/graphql/index.d.ts +2 -2
- package/dist/src/graphql/workItems.d.ts +38 -38
- package/dist/src/graphql/workItems.js +30 -30
- package/dist/src/handlers.d.ts +1 -1
- package/dist/src/handlers.js +55 -55
- package/dist/src/handlers.js.map +1 -1
- package/dist/src/http-client.js +3 -3
- package/dist/src/logger.js +25 -25
- package/dist/src/logging/access-log.d.ts +2 -2
- package/dist/src/logging/access-log.js +25 -25
- package/dist/src/logging/connection-tracker.d.ts +1 -1
- package/dist/src/logging/connection-tracker.js +3 -3
- package/dist/src/logging/index.d.ts +5 -5
- package/dist/src/logging/request-tracker.d.ts +3 -3
- package/dist/src/logging/request-tracker.js +4 -4
- package/dist/src/logging/types.d.ts +3 -3
- package/dist/src/logging/types.js +1 -1
- package/dist/src/main.js +28 -28
- package/dist/src/middleware/index.d.ts +2 -2
- package/dist/src/middleware/oauth-auth.d.ts +1 -1
- package/dist/src/middleware/oauth-auth.js +17 -17
- package/dist/src/middleware/rate-limiter.d.ts +1 -1
- package/dist/src/middleware/rate-limiter.js +32 -32
- package/dist/src/oauth/config.d.ts +1 -1
- package/dist/src/oauth/config.js +18 -18
- package/dist/src/oauth/config.js.map +1 -1
- package/dist/src/oauth/endpoints/authorize.d.ts +1 -1
- package/dist/src/oauth/endpoints/authorize.js +32 -32
- package/dist/src/oauth/endpoints/callback.d.ts +1 -1
- package/dist/src/oauth/endpoints/callback.js +26 -26
- package/dist/src/oauth/endpoints/index.d.ts +5 -5
- package/dist/src/oauth/endpoints/metadata.d.ts +1 -1
- package/dist/src/oauth/endpoints/metadata.js +12 -12
- package/dist/src/oauth/endpoints/register.d.ts +1 -1
- package/dist/src/oauth/endpoints/register.js +9 -9
- package/dist/src/oauth/endpoints/token.d.ts +1 -1
- package/dist/src/oauth/endpoints/token.js +28 -28
- package/dist/src/oauth/gitlab-device-flow.d.ts +2 -2
- package/dist/src/oauth/gitlab-device-flow.js +46 -46
- package/dist/src/oauth/gitlab-device-flow.js.map +1 -1
- package/dist/src/oauth/index.d.ts +10 -10
- package/dist/src/oauth/session-store.d.ts +2 -2
- package/dist/src/oauth/session-store.js +40 -40
- package/dist/src/oauth/session-store.js.map +1 -1
- package/dist/src/oauth/storage/factory.d.ts +2 -2
- package/dist/src/oauth/storage/factory.js +16 -16
- package/dist/src/oauth/storage/file.d.ts +2 -2
- package/dist/src/oauth/storage/file.js +22 -22
- package/dist/src/oauth/storage/file.js.map +1 -1
- package/dist/src/oauth/storage/index.d.ts +5 -5
- package/dist/src/oauth/storage/memory.d.ts +2 -2
- package/dist/src/oauth/storage/memory.js +18 -18
- package/dist/src/oauth/storage/memory.js.map +1 -1
- package/dist/src/oauth/storage/postgresql.d.ts +2 -2
- package/dist/src/oauth/storage/postgresql.js +11 -11
- package/dist/src/oauth/storage/postgresql.js.map +1 -1
- package/dist/src/oauth/storage/types.d.ts +3 -3
- package/dist/src/oauth/token-context.d.ts +1 -1
- package/dist/src/oauth/token-context.js +1 -1
- package/dist/src/oauth/token-utils.d.ts +1 -1
- package/dist/src/oauth/token-utils.js +20 -20
- package/dist/src/oauth/types.d.ts +3 -3
- package/dist/src/profiles/applicator.d.ts +1 -1
- package/dist/src/profiles/applicator.js +48 -48
- package/dist/src/profiles/index.d.ts +5 -5
- package/dist/src/profiles/loader.d.ts +3 -3
- package/dist/src/profiles/loader.js +25 -25
- package/dist/src/profiles/loader.js.map +1 -1
- package/dist/src/profiles/project-loader.d.ts +1 -1
- package/dist/src/profiles/project-loader.js +23 -23
- package/dist/src/profiles/project-loader.js.map +1 -1
- package/dist/src/profiles/scope-enforcer.d.ts +2 -2
- package/dist/src/profiles/scope-enforcer.js +25 -25
- package/dist/src/profiles/scope-enforcer.js.map +1 -1
- package/dist/src/profiles/types.d.ts +2 -2
- package/dist/src/profiles/types.js +50 -48
- package/dist/src/profiles/types.js.map +1 -1
- package/dist/src/registry-manager.d.ts +1 -1
- package/dist/src/registry-manager.js +64 -64
- package/dist/src/registry-manager.js.map +1 -1
- package/dist/src/server.js +136 -136
- package/dist/src/server.js.map +1 -1
- package/dist/src/services/ConnectionManager.d.ts +5 -5
- package/dist/src/services/ConnectionManager.js +45 -45
- package/dist/src/services/ConnectionManager.js.map +1 -1
- package/dist/src/services/GitLabVersionDetector.d.ts +2 -2
- package/dist/src/services/GitLabVersionDetector.js +45 -45
- package/dist/src/services/GitLabVersionDetector.js.map +1 -1
- package/dist/src/services/InstanceConnectionPool.d.ts +2 -2
- package/dist/src/services/InstanceConnectionPool.js +13 -13
- package/dist/src/services/InstanceConnectionPool.js.map +1 -1
- package/dist/src/services/InstanceRateLimiter.js +6 -6
- package/dist/src/services/InstanceRateLimiter.js.map +1 -1
- package/dist/src/services/InstanceRegistry.d.ts +4 -4
- package/dist/src/services/InstanceRegistry.js +23 -23
- package/dist/src/services/InstanceRegistry.js.map +1 -1
- package/dist/src/services/NamespaceTierDetector.d.ts +2 -2
- package/dist/src/services/NamespaceTierDetector.js +30 -30
- package/dist/src/services/NamespaceTierDetector.js.map +1 -1
- package/dist/src/services/SchemaIntrospector.d.ts +1 -1
- package/dist/src/services/SchemaIntrospector.js +42 -42
- package/dist/src/services/SchemaIntrospector.js.map +1 -1
- package/dist/src/services/TokenScopeDetector.d.ts +2 -2
- package/dist/src/services/TokenScopeDetector.js +80 -80
- package/dist/src/services/TokenScopeDetector.js.map +1 -1
- package/dist/src/services/ToolAvailability.d.ts +6 -6
- package/dist/src/services/ToolAvailability.js +122 -122
- package/dist/src/services/ToolAvailability.js.map +1 -1
- package/dist/src/services/WidgetAvailability.d.ts +2 -2
- package/dist/src/services/WidgetAvailability.js +34 -34
- package/dist/src/session-manager.d.ts +3 -2
- package/dist/src/session-manager.js +17 -14
- package/dist/src/session-manager.js.map +1 -1
- package/dist/src/types.js +4 -4
- package/dist/src/utils/description-utils.js +4 -4
- package/dist/src/utils/description-utils.js.map +1 -1
- package/dist/src/utils/error-handler.d.ts +9 -9
- package/dist/src/utils/error-handler.js +187 -187
- package/dist/src/utils/error-handler.js.map +1 -1
- package/dist/src/utils/fetch.js +85 -85
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/gitlab-api.d.ts +1 -1
- package/dist/src/utils/gitlab-api.js +24 -24
- package/dist/src/utils/idConversion.js +47 -47
- package/dist/src/utils/idConversion.js.map +1 -1
- package/dist/src/utils/namespace.d.ts +2 -2
- package/dist/src/utils/namespace.js +15 -15
- package/dist/src/utils/projectIdentifier.js +4 -4
- package/dist/src/utils/request-logger.d.ts +4 -4
- package/dist/src/utils/request-logger.js +5 -5
- package/dist/src/utils/schema-utils.js +24 -24
- package/dist/src/utils/schema-utils.js.map +1 -1
- package/dist/src/utils/smart-user-search.d.ts +1 -1
- package/dist/src/utils/smart-user-search.js +10 -10
- package/dist/src/utils/version.js +1 -1
- package/dist/structured-world-gitlab-mcp-6.62.2.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +18 -21
- package/dist/structured-world-gitlab-mcp-6.62.1.tgz +0 -0
|
@@ -6,7 +6,7 @@ const fetch_1 = require("./fetch");
|
|
|
6
6
|
const idConversion_1 = require("./idConversion");
|
|
7
7
|
function buildQueryString(params) {
|
|
8
8
|
if (!params)
|
|
9
|
-
return
|
|
9
|
+
return '';
|
|
10
10
|
const searchParams = new URLSearchParams();
|
|
11
11
|
for (const [key, value] of Object.entries(params)) {
|
|
12
12
|
if (value === undefined || value === null)
|
|
@@ -21,7 +21,7 @@ function buildQueryString(params) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
const str = searchParams.toString();
|
|
24
|
-
return str ? `?${str}` :
|
|
24
|
+
return str ? `?${str}` : '';
|
|
25
25
|
}
|
|
26
26
|
function encodeBody(body, contentType) {
|
|
27
27
|
if (!body) {
|
|
@@ -30,7 +30,7 @@ function encodeBody(body, contentType) {
|
|
|
30
30
|
if (body instanceof URLSearchParams) {
|
|
31
31
|
return {
|
|
32
32
|
body: body.toString(),
|
|
33
|
-
headers: {
|
|
33
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
if (body instanceof FormData) {
|
|
@@ -39,10 +39,10 @@ function encodeBody(body, contentType) {
|
|
|
39
39
|
headers: {},
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
if (contentType ===
|
|
42
|
+
if (contentType === 'json') {
|
|
43
43
|
return {
|
|
44
44
|
body: JSON.stringify(body),
|
|
45
|
-
headers: {
|
|
45
|
+
headers: { 'Content-Type': 'application/json' },
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
const params = new URLSearchParams();
|
|
@@ -53,18 +53,18 @@ function encodeBody(body, contentType) {
|
|
|
53
53
|
}
|
|
54
54
|
return {
|
|
55
55
|
body: params.toString(),
|
|
56
|
-
headers: {
|
|
56
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
async function request(method, path, options = {}) {
|
|
60
|
-
const baseUrl = process.env.GITLAB_API_URL ??
|
|
60
|
+
const baseUrl = process.env.GITLAB_API_URL ?? 'https://gitlab.com';
|
|
61
61
|
const queryString = buildQueryString(options.query);
|
|
62
62
|
const url = `${baseUrl}/api/v4/${path}${queryString}`;
|
|
63
|
-
const { body, headers } = encodeBody(options.body, options.contentType ??
|
|
63
|
+
const { body, headers } = encodeBody(options.body, options.contentType ?? 'form');
|
|
64
64
|
const hasBody = !!body;
|
|
65
65
|
const hasHeaders = Object.keys(headers).length > 0;
|
|
66
66
|
let response;
|
|
67
|
-
if (method ===
|
|
67
|
+
if (method === 'GET' && !hasBody && !hasHeaders) {
|
|
68
68
|
response = await (0, fetch_1.enhancedFetch)(url);
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
@@ -76,21 +76,21 @@ async function request(method, path, options = {}) {
|
|
|
76
76
|
response = await (0, fetch_1.enhancedFetch)(url, fetchOptions);
|
|
77
77
|
}
|
|
78
78
|
if (!response.ok) {
|
|
79
|
-
let errorDetails =
|
|
79
|
+
let errorDetails = '';
|
|
80
80
|
try {
|
|
81
|
-
if (typeof response.text ===
|
|
81
|
+
if (typeof response.text === 'function') {
|
|
82
82
|
const text = await response.text();
|
|
83
83
|
if (text.trim()) {
|
|
84
84
|
const errorResponse = JSON.parse(text);
|
|
85
85
|
const parts = [];
|
|
86
86
|
if (errorResponse.message) {
|
|
87
|
-
if (typeof errorResponse.message ===
|
|
87
|
+
if (typeof errorResponse.message === 'string') {
|
|
88
88
|
parts.push(errorResponse.message);
|
|
89
89
|
}
|
|
90
|
-
else if (typeof errorResponse.message ===
|
|
91
|
-
|
|
90
|
+
else if (typeof errorResponse.message === 'object' &&
|
|
91
|
+
'value' in errorResponse.message &&
|
|
92
92
|
Array.isArray(errorResponse.message.value)) {
|
|
93
|
-
parts.push(errorResponse.message.value.join(
|
|
93
|
+
parts.push(errorResponse.message.value.join(', '));
|
|
94
94
|
}
|
|
95
95
|
else {
|
|
96
96
|
parts.push(JSON.stringify(errorResponse.message));
|
|
@@ -99,13 +99,13 @@ async function request(method, path, options = {}) {
|
|
|
99
99
|
if (errorResponse.error) {
|
|
100
100
|
parts.push(errorResponse.error);
|
|
101
101
|
}
|
|
102
|
-
errorDetails = parts.join(
|
|
102
|
+
errorDetails = parts.join(' - ');
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
catch {
|
|
107
107
|
}
|
|
108
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}${errorDetails ? ` - ${errorDetails}` :
|
|
108
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}${errorDetails ? ` - ${errorDetails}` : ''}`);
|
|
109
109
|
}
|
|
110
110
|
if (response.status === 204) {
|
|
111
111
|
return undefined;
|
|
@@ -114,16 +114,16 @@ async function request(method, path, options = {}) {
|
|
|
114
114
|
return options.rawResponse ? data : (0, idConversion_1.cleanGidsFromObject)(data);
|
|
115
115
|
}
|
|
116
116
|
exports.gitlab = {
|
|
117
|
-
get: (path, options) => request(
|
|
118
|
-
post: (path, options) => request(
|
|
119
|
-
put: (path, options) => request(
|
|
120
|
-
delete: (path, options) => request(
|
|
121
|
-
patch: (path, options) => request(
|
|
117
|
+
get: (path, options) => request('GET', path, options),
|
|
118
|
+
post: (path, options) => request('POST', path, options),
|
|
119
|
+
put: (path, options) => request('PUT', path, options),
|
|
120
|
+
delete: (path, options) => request('DELETE', path, options),
|
|
121
|
+
patch: (path, options) => request('PATCH', path, options),
|
|
122
122
|
};
|
|
123
123
|
exports.paths = {
|
|
124
124
|
encode: (path) => encodeURIComponent(path),
|
|
125
|
-
project: (id) => `projects/${typeof id ===
|
|
126
|
-
group: (id) => `groups/${typeof id ===
|
|
125
|
+
project: (id) => `projects/${typeof id === 'number' ? id : encodeURIComponent(id)}`,
|
|
126
|
+
group: (id) => `groups/${typeof id === 'number' ? id : encodeURIComponent(id)}`,
|
|
127
127
|
namespace: (path, entityType) => `${entityType}/${encodeURIComponent(path)}`,
|
|
128
128
|
};
|
|
129
129
|
function toQuery(options, exclude = []) {
|
|
@@ -9,48 +9,48 @@ exports.cleanGidsFromObject = cleanGidsFromObject;
|
|
|
9
9
|
exports.cleanWorkItemResponse = cleanWorkItemResponse;
|
|
10
10
|
exports.convertTypeNamesToGids = convertTypeNamesToGids;
|
|
11
11
|
const GID_PREFIXES = {
|
|
12
|
-
WorkItem:
|
|
13
|
-
User:
|
|
14
|
-
Project:
|
|
15
|
-
Group:
|
|
16
|
-
Label:
|
|
17
|
-
Milestone:
|
|
18
|
-
Iteration:
|
|
19
|
-
MergeRequest:
|
|
20
|
-
Pipeline:
|
|
21
|
-
Job:
|
|
22
|
-
Variable:
|
|
23
|
-
Wiki:
|
|
24
|
-
Note:
|
|
25
|
-
Discussion:
|
|
26
|
-
Timelog:
|
|
12
|
+
WorkItem: 'gid://gitlab/WorkItem/',
|
|
13
|
+
User: 'gid://gitlab/User/',
|
|
14
|
+
Project: 'gid://gitlab/Project/',
|
|
15
|
+
Group: 'gid://gitlab/Group/',
|
|
16
|
+
Label: 'gid://gitlab/ProjectLabel/',
|
|
17
|
+
Milestone: 'gid://gitlab/Milestone/',
|
|
18
|
+
Iteration: 'gid://gitlab/Iteration/',
|
|
19
|
+
MergeRequest: 'gid://gitlab/MergeRequest/',
|
|
20
|
+
Pipeline: 'gid://gitlab/Ci::Pipeline/',
|
|
21
|
+
Job: 'gid://gitlab/Ci::Build/',
|
|
22
|
+
Variable: 'gid://gitlab/Ci::Variable/',
|
|
23
|
+
Wiki: 'gid://gitlab/Wiki/',
|
|
24
|
+
Note: 'gid://gitlab/Note/',
|
|
25
|
+
Discussion: 'gid://gitlab/Discussion/',
|
|
26
|
+
Timelog: 'gid://gitlab/Timelog/',
|
|
27
27
|
};
|
|
28
28
|
function extractSimpleId(gid) {
|
|
29
|
-
if (!gid || typeof gid !==
|
|
29
|
+
if (!gid || typeof gid !== 'string') {
|
|
30
30
|
return gid;
|
|
31
31
|
}
|
|
32
|
-
if (gid.startsWith(
|
|
33
|
-
const parts = gid.split(
|
|
32
|
+
if (gid.startsWith('gid://gitlab/')) {
|
|
33
|
+
const parts = gid.split('/');
|
|
34
34
|
return parts[parts.length - 1];
|
|
35
35
|
}
|
|
36
36
|
return gid;
|
|
37
37
|
}
|
|
38
38
|
function normalizeWorkItemGid(gid) {
|
|
39
|
-
if (!gid || typeof gid !==
|
|
39
|
+
if (!gid || typeof gid !== 'string') {
|
|
40
40
|
return gid;
|
|
41
41
|
}
|
|
42
|
-
const legacyTypes = [
|
|
42
|
+
const legacyTypes = ['Issue', 'Epic', 'Task', 'Incident', 'TestCase', 'Requirement'];
|
|
43
43
|
for (const type of legacyTypes) {
|
|
44
44
|
const prefix = `gid://gitlab/${type}/`;
|
|
45
45
|
if (gid.startsWith(prefix)) {
|
|
46
|
-
return gid.replace(prefix,
|
|
46
|
+
return gid.replace(prefix, 'gid://gitlab/WorkItem/');
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
return gid;
|
|
50
50
|
}
|
|
51
51
|
function toGid(id, entityType) {
|
|
52
|
-
if (id.startsWith(
|
|
53
|
-
if (entityType ===
|
|
52
|
+
if (id.startsWith('gid://gitlab/')) {
|
|
53
|
+
if (entityType === 'WorkItem') {
|
|
54
54
|
return normalizeWorkItemGid(id);
|
|
55
55
|
}
|
|
56
56
|
return id;
|
|
@@ -58,25 +58,25 @@ function toGid(id, entityType) {
|
|
|
58
58
|
return GID_PREFIXES[entityType] + id;
|
|
59
59
|
}
|
|
60
60
|
function toGids(ids, entityType) {
|
|
61
|
-
return ids.map(id => toGid(id, entityType));
|
|
61
|
+
return ids.map((id) => toGid(id, entityType));
|
|
62
62
|
}
|
|
63
63
|
function extractSimpleIds(gids) {
|
|
64
|
-
return gids.map(gid => extractSimpleId(gid));
|
|
64
|
+
return gids.map((gid) => extractSimpleId(gid));
|
|
65
65
|
}
|
|
66
66
|
function cleanGidsFromObject(obj) {
|
|
67
|
-
if (!obj || typeof obj !==
|
|
67
|
+
if (!obj || typeof obj !== 'object') {
|
|
68
68
|
return obj;
|
|
69
69
|
}
|
|
70
70
|
if (Array.isArray(obj)) {
|
|
71
|
-
const cleanedArray = obj.map(item => cleanGidsFromObject(item));
|
|
71
|
+
const cleanedArray = obj.map((item) => cleanGidsFromObject(item));
|
|
72
72
|
return cleanedArray;
|
|
73
73
|
}
|
|
74
74
|
const cleaned = {};
|
|
75
75
|
for (const [key, value] of Object.entries(obj)) {
|
|
76
|
-
if (typeof value ===
|
|
76
|
+
if (typeof value === 'string' && value.startsWith('gid://gitlab/')) {
|
|
77
77
|
cleaned[key] = extractSimpleId(value);
|
|
78
78
|
}
|
|
79
|
-
else if (typeof value ===
|
|
79
|
+
else if (typeof value === 'object' && value !== null) {
|
|
80
80
|
cleaned[key] = cleanGidsFromObject(value);
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
@@ -89,12 +89,12 @@ function normalizeLinkType(linkType) {
|
|
|
89
89
|
if (!linkType)
|
|
90
90
|
return linkType;
|
|
91
91
|
const mapping = {
|
|
92
|
-
is_blocked_by:
|
|
93
|
-
blocks:
|
|
94
|
-
related:
|
|
95
|
-
BLOCKED_BY:
|
|
96
|
-
BLOCKS:
|
|
97
|
-
RELATED:
|
|
92
|
+
is_blocked_by: 'BLOCKED_BY',
|
|
93
|
+
blocks: 'BLOCKS',
|
|
94
|
+
related: 'RELATED',
|
|
95
|
+
BLOCKED_BY: 'BLOCKED_BY',
|
|
96
|
+
BLOCKS: 'BLOCKS',
|
|
97
|
+
RELATED: 'RELATED',
|
|
98
98
|
};
|
|
99
99
|
return mapping[linkType] ?? linkType;
|
|
100
100
|
}
|
|
@@ -106,7 +106,7 @@ function cleanWorkItemResponse(workItem) {
|
|
|
106
106
|
id: extractSimpleId(workItem.id),
|
|
107
107
|
};
|
|
108
108
|
if (workItem.workItemType) {
|
|
109
|
-
if (typeof workItem.workItemType ===
|
|
109
|
+
if (typeof workItem.workItemType === 'string') {
|
|
110
110
|
result.workItemType = workItem.workItemType;
|
|
111
111
|
}
|
|
112
112
|
else if (workItem.workItemType.name) {
|
|
@@ -122,40 +122,40 @@ function cleanWorkItemResponse(workItem) {
|
|
|
122
122
|
if (workItem.widgets) {
|
|
123
123
|
result.widgets = workItem.widgets.map((widget) => {
|
|
124
124
|
const cleanedWidget = { ...widget };
|
|
125
|
-
if (widget.type ===
|
|
125
|
+
if (widget.type === 'ASSIGNEES' && widget.assignees?.nodes) {
|
|
126
126
|
cleanedWidget.assignees = {
|
|
127
127
|
...widget.assignees,
|
|
128
|
-
nodes: widget.assignees.nodes.map(assignee => ({
|
|
128
|
+
nodes: widget.assignees.nodes.map((assignee) => ({
|
|
129
129
|
...assignee,
|
|
130
130
|
id: extractSimpleId(assignee.id),
|
|
131
131
|
})),
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
if (widget.type ===
|
|
134
|
+
if (widget.type === 'LABELS' && widget.labels?.nodes) {
|
|
135
135
|
cleanedWidget.labels = {
|
|
136
136
|
...widget.labels,
|
|
137
|
-
nodes: widget.labels.nodes.map(label => ({
|
|
137
|
+
nodes: widget.labels.nodes.map((label) => ({
|
|
138
138
|
...label,
|
|
139
139
|
id: extractSimpleId(label.id),
|
|
140
140
|
})),
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
if (widget.type ===
|
|
143
|
+
if (widget.type === 'MILESTONE' && widget.milestone?.id) {
|
|
144
144
|
cleanedWidget.milestone = {
|
|
145
145
|
...widget.milestone,
|
|
146
146
|
id: extractSimpleId(widget.milestone.id),
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
if (widget.type ===
|
|
149
|
+
if (widget.type === 'HIERARCHY' && widget.parent?.id) {
|
|
150
150
|
cleanedWidget.parent = {
|
|
151
151
|
...widget.parent,
|
|
152
152
|
id: extractSimpleId(widget.parent.id),
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
if (widget.type ===
|
|
155
|
+
if (widget.type === 'LINKED_ITEMS' && widget.linkedItems?.nodes) {
|
|
156
156
|
cleanedWidget.linkedItems = {
|
|
157
157
|
...widget.linkedItems,
|
|
158
|
-
nodes: widget.linkedItems.nodes.map(node => ({
|
|
158
|
+
nodes: widget.linkedItems.nodes.map((node) => ({
|
|
159
159
|
...node,
|
|
160
160
|
linkType: normalizeLinkType(node.linkType),
|
|
161
161
|
workItem: node.workItem
|
|
@@ -176,16 +176,16 @@ async function convertTypeNamesToGids(typeNames, namespacePath, getWorkItemTypes
|
|
|
176
176
|
const workItemTypes = await getWorkItemTypes(namespacePath);
|
|
177
177
|
const resolvedTypes = [];
|
|
178
178
|
for (const typeName of typeNames) {
|
|
179
|
-
const workItemTypeObj = workItemTypes.find(t => t.name.toUpperCase() === typeName.toUpperCase());
|
|
179
|
+
const workItemTypeObj = workItemTypes.find((t) => t.name.toUpperCase() === typeName.toUpperCase());
|
|
180
180
|
if (workItemTypeObj) {
|
|
181
181
|
resolvedTypes.push(workItemTypeObj.id);
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
184
|
-
console.warn(`Work item type "${typeName}" not found in namespace "${namespacePath}". Available types: ${workItemTypes.map(t => t.name).join(
|
|
184
|
+
console.warn(`Work item type "${typeName}" not found in namespace "${namespacePath}". Available types: ${workItemTypes.map((t) => t.name).join(', ')}`);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
if (resolvedTypes.length === 0) {
|
|
188
|
-
console.warn(
|
|
188
|
+
console.warn('No valid work item types found for filtering. Using no type filter.');
|
|
189
189
|
return [];
|
|
190
190
|
}
|
|
191
191
|
return resolvedTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idConversion.js","sourceRoot":"","sources":["../../../src/utils/idConversion.ts"],"names":[],"mappings":";;AAiFA,0CASC;AAYD,oDAgBC;AAQD,sBASC;AAQD,wBAEC;AAOD,4CAEC;AAOD,kDAuBC;AA0BD,sDAyFC;AASD,wDAkCC;AA9RD,MAAM,YAAY,GAAG;IACnB,QAAQ,EAAE,wBAAwB;IAClC,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,uBAAuB;IAChC,KAAK,EAAE,qBAAqB;IAC5B,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE,yBAAyB;IACpC,SAAS,EAAE,yBAAyB;IACpC,YAAY,EAAE,4BAA4B;IAC1C,QAAQ,EAAE,4BAA4B;IACtC,GAAG,EAAE,yBAAyB;IAC9B,QAAQ,EAAE,4BAA4B;IACtC,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,oBAAoB;IAC1B,UAAU,EAAE,0BAA0B;IACtC,OAAO,EAAE,uBAAuB;CACxB,CAAC;AASX,SAAgB,eAAe,CAAC,GAAW;IACzC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undefined;
|
|
2
2
|
export declare function isLikelyProjectPath(namespacePath: string): boolean;
|
|
3
|
-
export declare function detectNamespaceType(namespacePath: string): Promise<
|
|
3
|
+
export declare function detectNamespaceType(namespacePath: string): Promise<'project' | 'group'>;
|
|
4
4
|
export declare function resolveNamespaceForAPI(namespacePath: string): Promise<{
|
|
5
|
-
entityType:
|
|
5
|
+
entityType: 'projects' | 'groups';
|
|
6
6
|
encodedPath: string;
|
|
7
7
|
}>;
|
|
@@ -9,38 +9,38 @@ function extractNamespaceFromPath(projectPath) {
|
|
|
9
9
|
if (!projectPath) {
|
|
10
10
|
return undefined;
|
|
11
11
|
}
|
|
12
|
-
const pathParts = projectPath.split(
|
|
12
|
+
const pathParts = projectPath.split('/');
|
|
13
13
|
if (pathParts.length === 1) {
|
|
14
14
|
return projectPath;
|
|
15
15
|
}
|
|
16
|
-
return pathParts.slice(0, -1).join(
|
|
16
|
+
return pathParts.slice(0, -1).join('/');
|
|
17
17
|
}
|
|
18
18
|
function isLikelyProjectPath(namespacePath) {
|
|
19
|
-
return namespacePath.includes(
|
|
19
|
+
return namespacePath.includes('/');
|
|
20
20
|
}
|
|
21
21
|
async function detectNamespaceType(namespacePath) {
|
|
22
22
|
if (isLikelyProjectPath(namespacePath)) {
|
|
23
|
-
const isProject = await verifyNamespaceType(namespacePath,
|
|
23
|
+
const isProject = await verifyNamespaceType(namespacePath, 'project');
|
|
24
24
|
if (isProject)
|
|
25
|
-
return
|
|
26
|
-
const isGroup = await verifyNamespaceType(namespacePath,
|
|
25
|
+
return 'project';
|
|
26
|
+
const isGroup = await verifyNamespaceType(namespacePath, 'group');
|
|
27
27
|
if (isGroup)
|
|
28
|
-
return
|
|
29
|
-
return
|
|
28
|
+
return 'group';
|
|
29
|
+
return 'project';
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
const isGroup = await verifyNamespaceType(namespacePath,
|
|
32
|
+
const isGroup = await verifyNamespaceType(namespacePath, 'group');
|
|
33
33
|
if (isGroup)
|
|
34
|
-
return
|
|
35
|
-
const isProject = await verifyNamespaceType(namespacePath,
|
|
34
|
+
return 'group';
|
|
35
|
+
const isProject = await verifyNamespaceType(namespacePath, 'project');
|
|
36
36
|
if (isProject)
|
|
37
|
-
return
|
|
38
|
-
return
|
|
37
|
+
return 'project';
|
|
38
|
+
return 'group';
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
async function verifyNamespaceType(namespacePath, type) {
|
|
42
42
|
try {
|
|
43
|
-
const entityType = type ===
|
|
43
|
+
const entityType = type === 'project' ? 'projects' : 'groups';
|
|
44
44
|
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${encodeURIComponent(namespacePath)}`;
|
|
45
45
|
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
46
46
|
return response.ok;
|
|
@@ -52,7 +52,7 @@ async function verifyNamespaceType(namespacePath, type) {
|
|
|
52
52
|
async function resolveNamespaceForAPI(namespacePath) {
|
|
53
53
|
const namespaceType = await detectNamespaceType(namespacePath);
|
|
54
54
|
return {
|
|
55
|
-
entityType: namespaceType ===
|
|
55
|
+
entityType: namespaceType === 'project' ? 'projects' : 'groups',
|
|
56
56
|
encodedPath: encodeURIComponent(namespacePath),
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -40,19 +40,19 @@ function normalizeProjectId(projectId) {
|
|
|
40
40
|
return safeEncodeProjectId(projectId);
|
|
41
41
|
}
|
|
42
42
|
function validateProjectIdentifier(input) {
|
|
43
|
-
if (!input || typeof input !==
|
|
44
|
-
return
|
|
43
|
+
if (!input || typeof input !== 'string') {
|
|
44
|
+
return 'Project identifier is required and must be a string';
|
|
45
45
|
}
|
|
46
46
|
const trimmed = input.trim();
|
|
47
47
|
if (trimmed.length === 0) {
|
|
48
|
-
return
|
|
48
|
+
return 'Project identifier cannot be empty';
|
|
49
49
|
}
|
|
50
50
|
if (isNumericId(trimmed)) {
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
53
|
const decoded = isUrlEncoded(trimmed) ? decodeURIComponent(trimmed) : trimmed;
|
|
54
54
|
if (!/^[a-zA-Z0-9\-_./]+$/.test(decoded)) {
|
|
55
|
-
return
|
|
55
|
+
return 'Invalid project identifier format. Use numeric ID or namespace/project path.';
|
|
56
56
|
}
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Request, Response } from
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
2
|
export interface RequestContext {
|
|
3
3
|
requestId: string;
|
|
4
4
|
ip: string;
|
|
@@ -11,7 +11,7 @@ export interface RequestContext {
|
|
|
11
11
|
mcpSessionId?: string;
|
|
12
12
|
}
|
|
13
13
|
export interface RateLimitInfo {
|
|
14
|
-
type:
|
|
14
|
+
type: 'ip' | 'session';
|
|
15
15
|
key: string;
|
|
16
16
|
used: number;
|
|
17
17
|
limit: number;
|
|
@@ -20,5 +20,5 @@ export interface RateLimitInfo {
|
|
|
20
20
|
export declare function getIpAddress(req: Request): string;
|
|
21
21
|
export declare function truncateId(id: string | undefined): string | undefined;
|
|
22
22
|
export declare function getRequestContext(req: Request, res: Response): RequestContext;
|
|
23
|
-
export declare function getMinimalRequestContext(req: Request): Pick<RequestContext,
|
|
24
|
-
export declare function buildRateLimitInfo(type:
|
|
23
|
+
export declare function getMinimalRequestContext(req: Request): Pick<RequestContext, 'requestId' | 'ip' | 'method' | 'path' | 'userAgent'>;
|
|
24
|
+
export declare function buildRateLimitInfo(type: 'ip' | 'session', key: string, used: number, limit: number, resetAt: number): RateLimitInfo;
|
|
@@ -10,7 +10,7 @@ function generateRequestId() {
|
|
|
10
10
|
return (0, crypto_1.randomUUID)().substring(0, 8);
|
|
11
11
|
}
|
|
12
12
|
function getIpAddress(req) {
|
|
13
|
-
return req.ip ?? req.socket?.remoteAddress ??
|
|
13
|
+
return req.ip ?? req.socket?.remoteAddress ?? 'unknown';
|
|
14
14
|
}
|
|
15
15
|
const logger_1 = require("../logger");
|
|
16
16
|
function truncateId(id) {
|
|
@@ -19,14 +19,14 @@ function truncateId(id) {
|
|
|
19
19
|
return (0, logger_1.truncateId)(id);
|
|
20
20
|
}
|
|
21
21
|
function getRequestContext(req, res) {
|
|
22
|
-
const mcpSessionId = req.headers[
|
|
22
|
+
const mcpSessionId = req.headers['mcp-session-id'];
|
|
23
23
|
const oauthSessionId = res.locals.oauthSessionId;
|
|
24
24
|
return {
|
|
25
25
|
requestId: generateRequestId(),
|
|
26
26
|
ip: getIpAddress(req),
|
|
27
27
|
method: req.method,
|
|
28
28
|
path: req.path,
|
|
29
|
-
userAgent: req.headers[
|
|
29
|
+
userAgent: req.headers['user-agent'],
|
|
30
30
|
hasOAuthSession: !!oauthSessionId,
|
|
31
31
|
hasMcpSessionHeader: !!mcpSessionId,
|
|
32
32
|
oauthSessionId: truncateId(oauthSessionId),
|
|
@@ -39,14 +39,14 @@ function getMinimalRequestContext(req) {
|
|
|
39
39
|
ip: getIpAddress(req),
|
|
40
40
|
method: req.method,
|
|
41
41
|
path: req.path,
|
|
42
|
-
userAgent: req.headers[
|
|
42
|
+
userAgent: req.headers['user-agent'],
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
function buildRateLimitInfo(type, key, used, limit, resetAt) {
|
|
46
46
|
const resetInSec = Math.max(0, Math.ceil((resetAt - Date.now()) / 1000));
|
|
47
47
|
return {
|
|
48
48
|
type,
|
|
49
|
-
key: type ===
|
|
49
|
+
key: type === 'session' ? (truncateId(key) ?? key) : key,
|
|
50
50
|
used,
|
|
51
51
|
limit,
|
|
52
52
|
resetInSec,
|