gitlab-mcp-test 6.62.1
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/LICENSE +202 -0
- package/LICENSE.MIT +21 -0
- package/README.md +122 -0
- package/README.md.in +122 -0
- package/dist/generated/prisma/client.d.ts +13 -0
- package/dist/generated/prisma/client.js +46 -0
- package/dist/generated/prisma/client.js.map +1 -0
- package/dist/generated/prisma/commonInputTypes.d.ts +245 -0
- package/dist/generated/prisma/commonInputTypes.js +3 -0
- package/dist/generated/prisma/commonInputTypes.js.map +1 -0
- package/dist/generated/prisma/enums.d.ts +1 -0
- package/dist/generated/prisma/enums.js +3 -0
- package/dist/generated/prisma/enums.js.map +1 -0
- package/dist/generated/prisma/internal/class.d.ts +47 -0
- package/dist/generated/prisma/internal/class.js +75 -0
- package/dist/generated/prisma/internal/class.js.map +1 -0
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +714 -0
- package/dist/generated/prisma/internal/prismaNamespace.js +141 -0
- package/dist/generated/prisma/internal/prismaNamespace.js.map +1 -0
- package/dist/generated/prisma/models/AuthCodeFlowState.d.ts +513 -0
- package/dist/generated/prisma/models/AuthCodeFlowState.js +3 -0
- package/dist/generated/prisma/models/AuthCodeFlowState.js.map +1 -0
- package/dist/generated/prisma/models/AuthorizationCode.d.ts +641 -0
- package/dist/generated/prisma/models/AuthorizationCode.js +3 -0
- package/dist/generated/prisma/models/AuthorizationCode.js.map +1 -0
- package/dist/generated/prisma/models/DeviceFlowState.d.ts +603 -0
- package/dist/generated/prisma/models/DeviceFlowState.js +3 -0
- package/dist/generated/prisma/models/DeviceFlowState.js.map +1 -0
- package/dist/generated/prisma/models/McpSessionMapping.d.ts +438 -0
- package/dist/generated/prisma/models/McpSessionMapping.js +3 -0
- package/dist/generated/prisma/models/McpSessionMapping.js.map +1 -0
- package/dist/generated/prisma/models/OAuthSession.d.ts +1037 -0
- package/dist/generated/prisma/models/OAuthSession.js +3 -0
- package/dist/generated/prisma/models/OAuthSession.js.map +1 -0
- package/dist/generated/prisma/models.d.ts +6 -0
- package/dist/generated/prisma/models.js +3 -0
- package/dist/generated/prisma/models.js.map +1 -0
- package/dist/src/cli/docker/container-runtime.d.ts +4 -0
- package/dist/src/cli/docker/container-runtime.js +85 -0
- package/dist/src/cli/docker/container-runtime.js.map +1 -0
- package/dist/src/cli/docker/docker-command.d.ts +15 -0
- package/dist/src/cli/docker/docker-command.js +421 -0
- package/dist/src/cli/docker/docker-command.js.map +1 -0
- package/dist/src/cli/docker/docker-utils.d.ts +25 -0
- package/dist/src/cli/docker/docker-utils.js +386 -0
- package/dist/src/cli/docker/docker-utils.js.map +1 -0
- package/dist/src/cli/docker/index.d.ts +4 -0
- package/dist/src/cli/docker/index.js +24 -0
- package/dist/src/cli/docker/index.js.map +1 -0
- package/dist/src/cli/docker/types.d.ts +83 -0
- package/dist/src/cli/docker/types.js +21 -0
- package/dist/src/cli/docker/types.js.map +1 -0
- package/dist/src/cli/init/browser.d.ts +7 -0
- package/dist/src/cli/init/browser.js +27 -0
- package/dist/src/cli/init/browser.js.map +1 -0
- package/dist/src/cli/init/config-generator.d.ts +11 -0
- package/dist/src/cli/init/config-generator.js +87 -0
- package/dist/src/cli/init/config-generator.js.map +1 -0
- package/dist/src/cli/init/connection.d.ts +8 -0
- package/dist/src/cli/init/connection.js +118 -0
- package/dist/src/cli/init/connection.js.map +1 -0
- package/dist/src/cli/init/index.d.ts +4 -0
- package/dist/src/cli/init/index.js +32 -0
- package/dist/src/cli/init/index.js.map +1 -0
- package/dist/src/cli/init/types.d.ts +31 -0
- package/dist/src/cli/init/types.js +66 -0
- package/dist/src/cli/init/types.js.map +1 -0
- package/dist/src/cli/init/wizard.d.ts +1 -0
- package/dist/src/cli/init/wizard.js +283 -0
- package/dist/src/cli/init/wizard.js.map +1 -0
- package/dist/src/cli/inject-tool-refs.d.ts +35 -0
- package/dist/src/cli/inject-tool-refs.js +261 -0
- package/dist/src/cli/inject-tool-refs.js.map +1 -0
- package/dist/src/cli/install/backup.d.ts +4 -0
- package/dist/src/cli/install/backup.js +63 -0
- package/dist/src/cli/install/backup.js.map +1 -0
- package/dist/src/cli/install/detector.d.ts +10 -0
- package/dist/src/cli/install/detector.js +133 -0
- package/dist/src/cli/install/detector.js.map +1 -0
- package/dist/src/cli/install/index.d.ts +5 -0
- package/dist/src/cli/install/index.js +27 -0
- package/dist/src/cli/install/index.js.map +1 -0
- package/dist/src/cli/install/install-command.d.ts +19 -0
- package/dist/src/cli/install/install-command.js +300 -0
- package/dist/src/cli/install/install-command.js.map +1 -0
- package/dist/src/cli/install/installers.d.ts +12 -0
- package/dist/src/cli/install/installers.js +439 -0
- package/dist/src/cli/install/installers.js.map +1 -0
- package/dist/src/cli/install/types.d.ts +52 -0
- package/dist/src/cli/install/types.js +87 -0
- package/dist/src/cli/install/types.js.map +1 -0
- package/dist/src/cli/instances/index.d.ts +2 -0
- package/dist/src/cli/instances/index.js +7 -0
- package/dist/src/cli/instances/index.js.map +1 -0
- package/dist/src/cli/instances/instances-command.d.ts +6 -0
- package/dist/src/cli/instances/instances-command.js +351 -0
- package/dist/src/cli/instances/instances-command.js.map +1 -0
- package/dist/src/cli/list-tools.d.ts +2 -0
- package/dist/src/cli/list-tools.js +1431 -0
- package/dist/src/cli/list-tools.js.map +1 -0
- package/dist/src/cli/setup/discovery.d.ts +3 -0
- package/dist/src/cli/setup/discovery.js +71 -0
- package/dist/src/cli/setup/discovery.js.map +1 -0
- package/dist/src/cli/setup/flows/configure-existing.d.ts +2 -0
- package/dist/src/cli/setup/flows/configure-existing.js +211 -0
- package/dist/src/cli/setup/flows/configure-existing.js.map +1 -0
- package/dist/src/cli/setup/flows/local-setup.d.ts +2 -0
- package/dist/src/cli/setup/flows/local-setup.js +206 -0
- package/dist/src/cli/setup/flows/local-setup.js.map +1 -0
- package/dist/src/cli/setup/flows/server-setup.d.ts +2 -0
- package/dist/src/cli/setup/flows/server-setup.js +185 -0
- package/dist/src/cli/setup/flows/server-setup.js.map +1 -0
- package/dist/src/cli/setup/flows/tool-selection.d.ts +3 -0
- package/dist/src/cli/setup/flows/tool-selection.js +275 -0
- package/dist/src/cli/setup/flows/tool-selection.js.map +1 -0
- package/dist/src/cli/setup/index.d.ts +4 -0
- package/dist/src/cli/setup/index.js +29 -0
- package/dist/src/cli/setup/index.js.map +1 -0
- package/dist/src/cli/setup/presets.d.ts +7 -0
- package/dist/src/cli/setup/presets.js +261 -0
- package/dist/src/cli/setup/presets.js.map +1 -0
- package/dist/src/cli/setup/types.d.ts +68 -0
- package/dist/src/cli/setup/types.js +3 -0
- package/dist/src/cli/setup/types.js.map +1 -0
- package/dist/src/cli/setup/wizard.d.ts +4 -0
- package/dist/src/cli/setup/wizard.js +128 -0
- package/dist/src/cli/setup/wizard.js.map +1 -0
- package/dist/src/cli/utils/index.d.ts +1 -0
- package/dist/src/cli/utils/index.js +6 -0
- package/dist/src/cli/utils/index.js.map +1 -0
- package/dist/src/cli/utils/path-utils.d.ts +1 -0
- package/dist/src/cli/utils/path-utils.js +18 -0
- package/dist/src/cli/utils/path-utils.js.map +1 -0
- package/dist/src/cli-utils.d.ts +19 -0
- package/dist/src/cli-utils.js +183 -0
- package/dist/src/cli-utils.js.map +1 -0
- package/dist/src/config/index.d.ts +4 -0
- package/dist/src/config/index.js +19 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/instances-loader.d.ts +10 -0
- package/dist/src/config/instances-loader.js +294 -0
- package/dist/src/config/instances-loader.js.map +1 -0
- package/dist/src/config/instances-schema.d.ts +89 -0
- package/dist/src/config/instances-schema.js +196 -0
- package/dist/src/config/instances-schema.js.map +1 -0
- package/dist/src/config.d.ts +82 -0
- package/dist/src/config.js +379 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/dashboard/handler.d.ts +4 -0
- package/dist/src/dashboard/handler.js +37 -0
- package/dist/src/dashboard/handler.js.map +1 -0
- package/dist/src/dashboard/html-template.d.ts +2 -0
- package/dist/src/dashboard/html-template.js +443 -0
- package/dist/src/dashboard/html-template.js.map +1 -0
- package/dist/src/dashboard/index.d.ts +4 -0
- package/dist/src/dashboard/index.js +15 -0
- package/dist/src/dashboard/index.js.map +1 -0
- package/dist/src/dashboard/metrics.d.ts +79 -0
- package/dist/src/dashboard/metrics.js +194 -0
- package/dist/src/dashboard/metrics.js.map +1 -0
- package/dist/src/discovery/auto.d.ts +22 -0
- package/dist/src/discovery/auto.js +170 -0
- package/dist/src/discovery/auto.js.map +1 -0
- package/dist/src/discovery/git-remote.d.ts +19 -0
- package/dist/src/discovery/git-remote.js +197 -0
- package/dist/src/discovery/git-remote.js.map +1 -0
- package/dist/src/discovery/index.d.ts +3 -0
- package/dist/src/discovery/index.js +16 -0
- package/dist/src/discovery/index.js.map +1 -0
- package/dist/src/discovery/profile-matcher.d.ts +8 -0
- package/dist/src/discovery/profile-matcher.js +48 -0
- package/dist/src/discovery/profile-matcher.js.map +1 -0
- package/dist/src/entities/context/context-manager.d.ts +31 -0
- package/dist/src/entities/context/context-manager.js +352 -0
- package/dist/src/entities/context/context-manager.js.map +1 -0
- package/dist/src/entities/context/handlers.d.ts +11 -0
- package/dist/src/entities/context/handlers.js +67 -0
- package/dist/src/entities/context/handlers.js.map +1 -0
- package/dist/src/entities/context/index.d.ts +11 -0
- package/dist/src/entities/context/index.js +34 -0
- package/dist/src/entities/context/index.js.map +1 -0
- package/dist/src/entities/context/registry.d.ts +5 -0
- package/dist/src/entities/context/registry.js +66 -0
- package/dist/src/entities/context/registry.js.map +1 -0
- package/dist/src/entities/context/schema.d.ts +60 -0
- package/dist/src/entities/context/schema.js +61 -0
- package/dist/src/entities/context/schema.js.map +1 -0
- package/dist/src/entities/context/types.d.ts +112 -0
- package/dist/src/entities/context/types.js +3 -0
- package/dist/src/entities/context/types.js.map +1 -0
- package/dist/src/entities/context/whoami.d.ts +2 -0
- package/dist/src/entities/context/whoami.js +267 -0
- package/dist/src/entities/context/whoami.js.map +1 -0
- package/dist/src/entities/core/index.d.ts +7 -0
- package/dist/src/entities/core/index.js +31 -0
- package/dist/src/entities/core/index.js.map +1 -0
- package/dist/src/entities/core/registry.d.ts +5 -0
- package/dist/src/entities/core/registry.js +784 -0
- package/dist/src/entities/core/registry.js.map +1 -0
- package/dist/src/entities/core/schema-readonly.d.ts +268 -0
- package/dist/src/entities/core/schema-readonly.js +289 -0
- package/dist/src/entities/core/schema-readonly.js.map +1 -0
- package/dist/src/entities/core/schema.d.ts +116 -0
- package/dist/src/entities/core/schema.js +173 -0
- package/dist/src/entities/core/schema.js.map +1 -0
- package/dist/src/entities/files/index.d.ts +7 -0
- package/dist/src/entities/files/index.js +31 -0
- package/dist/src/entities/files/index.js.map +1 -0
- package/dist/src/entities/files/registry.d.ts +5 -0
- package/dist/src/entities/files/registry.js +267 -0
- package/dist/src/entities/files/registry.js.map +1 -0
- package/dist/src/entities/files/schema-readonly.d.ts +83 -0
- package/dist/src/entities/files/schema-readonly.js +64 -0
- package/dist/src/entities/files/schema-readonly.js.map +1 -0
- package/dist/src/entities/files/schema.d.ts +43 -0
- package/dist/src/entities/files/schema.js +54 -0
- package/dist/src/entities/files/schema.js.map +1 -0
- package/dist/src/entities/index.d.ts +17 -0
- package/dist/src/entities/index.js +34 -0
- package/dist/src/entities/index.js.map +1 -0
- package/dist/src/entities/integrations/index.d.ts +4 -0
- package/dist/src/entities/integrations/index.js +21 -0
- package/dist/src/entities/integrations/index.js.map +1 -0
- package/dist/src/entities/integrations/registry.d.ts +5 -0
- package/dist/src/entities/integrations/registry.js +127 -0
- package/dist/src/entities/integrations/registry.js.map +1 -0
- package/dist/src/entities/integrations/schema-readonly.d.ts +63 -0
- package/dist/src/entities/integrations/schema-readonly.js +22 -0
- package/dist/src/entities/integrations/schema-readonly.js.map +1 -0
- package/dist/src/entities/integrations/schema.d.ts +180 -0
- package/dist/src/entities/integrations/schema.js +106 -0
- package/dist/src/entities/integrations/schema.js.map +1 -0
- package/dist/src/entities/iterations/index.d.ts +2 -0
- package/dist/src/entities/iterations/index.js +19 -0
- package/dist/src/entities/iterations/index.js.map +1 -0
- package/dist/src/entities/iterations/registry.d.ts +5 -0
- package/dist/src/entities/iterations/registry.js +106 -0
- package/dist/src/entities/iterations/registry.js.map +1 -0
- package/dist/src/entities/iterations/schema-readonly.d.ts +21 -0
- package/dist/src/entities/iterations/schema-readonly.js +28 -0
- package/dist/src/entities/iterations/schema-readonly.js.map +1 -0
- package/dist/src/entities/labels/index.d.ts +7 -0
- package/dist/src/entities/labels/index.js +31 -0
- package/dist/src/entities/labels/index.js.map +1 -0
- package/dist/src/entities/labels/registry.d.ts +5 -0
- package/dist/src/entities/labels/registry.js +131 -0
- package/dist/src/entities/labels/registry.js.map +1 -0
- package/dist/src/entities/labels/schema-readonly.d.ts +16 -0
- package/dist/src/entities/labels/schema-readonly.js +28 -0
- package/dist/src/entities/labels/schema-readonly.js.map +1 -0
- package/dist/src/entities/labels/schema.d.ts +23 -0
- package/dist/src/entities/labels/schema.js +46 -0
- package/dist/src/entities/labels/schema.js.map +1 -0
- package/dist/src/entities/members/index.d.ts +3 -0
- package/dist/src/entities/members/index.js +25 -0
- package/dist/src/entities/members/index.js.map +1 -0
- package/dist/src/entities/members/registry.d.ts +5 -0
- package/dist/src/entities/members/registry.js +224 -0
- package/dist/src/entities/members/registry.js.map +1 -0
- package/dist/src/entities/members/schema-readonly.d.ts +53 -0
- package/dist/src/entities/members/schema-readonly.js +79 -0
- package/dist/src/entities/members/schema-readonly.js.map +1 -0
- package/dist/src/entities/members/schema.d.ts +40 -0
- package/dist/src/entities/members/schema.js +80 -0
- package/dist/src/entities/members/schema.js.map +1 -0
- package/dist/src/entities/milestones/index.d.ts +7 -0
- package/dist/src/entities/milestones/index.js +31 -0
- package/dist/src/entities/milestones/index.js.map +1 -0
- package/dist/src/entities/milestones/registry.d.ts +5 -0
- package/dist/src/entities/milestones/registry.js +150 -0
- package/dist/src/entities/milestones/registry.js.map +1 -0
- package/dist/src/entities/milestones/schema-readonly.d.ts +57 -0
- package/dist/src/entities/milestones/schema-readonly.js +81 -0
- package/dist/src/entities/milestones/schema-readonly.js.map +1 -0
- package/dist/src/entities/milestones/schema.d.ts +30 -0
- package/dist/src/entities/milestones/schema.js +47 -0
- package/dist/src/entities/milestones/schema.js.map +1 -0
- package/dist/src/entities/mrs/index.d.ts +7 -0
- package/dist/src/entities/mrs/index.js +31 -0
- package/dist/src/entities/mrs/index.js.map +1 -0
- package/dist/src/entities/mrs/registry.d.ts +22 -0
- package/dist/src/entities/mrs/registry.js +495 -0
- package/dist/src/entities/mrs/registry.js.map +1 -0
- package/dist/src/entities/mrs/schema-readonly.d.ts +135 -0
- package/dist/src/entities/mrs/schema-readonly.js +326 -0
- package/dist/src/entities/mrs/schema-readonly.js.map +1 -0
- package/dist/src/entities/mrs/schema.d.ts +339 -0
- package/dist/src/entities/mrs/schema.js +259 -0
- package/dist/src/entities/mrs/schema.js.map +1 -0
- package/dist/src/entities/pipelines/index.d.ts +7 -0
- package/dist/src/entities/pipelines/index.js +31 -0
- package/dist/src/entities/pipelines/index.js.map +1 -0
- package/dist/src/entities/pipelines/registry.d.ts +5 -0
- package/dist/src/entities/pipelines/registry.js +323 -0
- package/dist/src/entities/pipelines/registry.js.map +1 -0
- package/dist/src/entities/pipelines/schema-readonly.d.ts +239 -0
- package/dist/src/entities/pipelines/schema-readonly.js +278 -0
- package/dist/src/entities/pipelines/schema-readonly.js.map +1 -0
- package/dist/src/entities/pipelines/schema.d.ts +47 -0
- package/dist/src/entities/pipelines/schema.js +73 -0
- package/dist/src/entities/pipelines/schema.js.map +1 -0
- package/dist/src/entities/refs/index.d.ts +3 -0
- package/dist/src/entities/refs/index.js +25 -0
- package/dist/src/entities/refs/index.js.map +1 -0
- package/dist/src/entities/refs/registry.d.ts +5 -0
- package/dist/src/entities/refs/registry.js +233 -0
- package/dist/src/entities/refs/registry.js.map +1 -0
- package/dist/src/entities/refs/schema-readonly.d.ts +48 -0
- package/dist/src/entities/refs/schema-readonly.js +76 -0
- package/dist/src/entities/refs/schema-readonly.js.map +1 -0
- package/dist/src/entities/refs/schema.d.ts +85 -0
- package/dist/src/entities/refs/schema.js +149 -0
- package/dist/src/entities/refs/schema.js.map +1 -0
- package/dist/src/entities/releases/index.d.ts +3 -0
- package/dist/src/entities/releases/index.js +13 -0
- package/dist/src/entities/releases/index.js.map +1 -0
- package/dist/src/entities/releases/registry.d.ts +5 -0
- package/dist/src/entities/releases/registry.js +183 -0
- package/dist/src/entities/releases/registry.js.map +1 -0
- package/dist/src/entities/releases/schema-readonly.d.ts +28 -0
- package/dist/src/entities/releases/schema-readonly.js +56 -0
- package/dist/src/entities/releases/schema-readonly.js.map +1 -0
- package/dist/src/entities/releases/schema.d.ts +56 -0
- package/dist/src/entities/releases/schema.js +97 -0
- package/dist/src/entities/releases/schema.js.map +1 -0
- package/dist/src/entities/search/index.d.ts +2 -0
- package/dist/src/entities/search/index.js +24 -0
- package/dist/src/entities/search/index.js.map +1 -0
- package/dist/src/entities/search/registry.d.ts +5 -0
- package/dist/src/entities/search/registry.js +113 -0
- package/dist/src/entities/search/registry.js.map +1 -0
- package/dist/src/entities/search/schema-readonly.d.ts +228 -0
- package/dist/src/entities/search/schema-readonly.js +64 -0
- package/dist/src/entities/search/schema-readonly.js.map +1 -0
- package/dist/src/entities/shared.d.ts +291 -0
- package/dist/src/entities/shared.js +269 -0
- package/dist/src/entities/shared.js.map +1 -0
- package/dist/src/entities/snippets/index.d.ts +7 -0
- package/dist/src/entities/snippets/index.js +31 -0
- package/dist/src/entities/snippets/index.js.map +1 -0
- package/dist/src/entities/snippets/registry.d.ts +5 -0
- package/dist/src/entities/snippets/registry.js +200 -0
- package/dist/src/entities/snippets/registry.js.map +1 -0
- package/dist/src/entities/snippets/schema-readonly.d.ts +25 -0
- package/dist/src/entities/snippets/schema-readonly.js +45 -0
- package/dist/src/entities/snippets/schema-readonly.js.map +1 -0
- package/dist/src/entities/snippets/schema.d.ts +56 -0
- package/dist/src/entities/snippets/schema.js +89 -0
- package/dist/src/entities/snippets/schema.js.map +1 -0
- package/dist/src/entities/utils.d.ts +16 -0
- package/dist/src/entities/utils.js +57 -0
- package/dist/src/entities/utils.js.map +1 -0
- package/dist/src/entities/variables/index.d.ts +7 -0
- package/dist/src/entities/variables/index.js +31 -0
- package/dist/src/entities/variables/index.js.map +1 -0
- package/dist/src/entities/variables/registry.d.ts +5 -0
- package/dist/src/entities/variables/registry.js +140 -0
- package/dist/src/entities/variables/registry.js.map +1 -0
- package/dist/src/entities/variables/schema-readonly.d.ts +15 -0
- package/dist/src/entities/variables/schema-readonly.js +33 -0
- package/dist/src/entities/variables/schema-readonly.js.map +1 -0
- package/dist/src/entities/variables/schema.d.ts +41 -0
- package/dist/src/entities/variables/schema.js +92 -0
- package/dist/src/entities/variables/schema.js.map +1 -0
- package/dist/src/entities/webhooks/index.d.ts +4 -0
- package/dist/src/entities/webhooks/index.js +21 -0
- package/dist/src/entities/webhooks/index.js.map +1 -0
- package/dist/src/entities/webhooks/registry.d.ts +5 -0
- package/dist/src/entities/webhooks/registry.js +162 -0
- package/dist/src/entities/webhooks/registry.js.map +1 -0
- package/dist/src/entities/webhooks/schema-readonly.d.ts +22 -0
- package/dist/src/entities/webhooks/schema-readonly.js +25 -0
- package/dist/src/entities/webhooks/schema-readonly.js.map +1 -0
- package/dist/src/entities/webhooks/schema.d.ts +101 -0
- package/dist/src/entities/webhooks/schema.js +101 -0
- package/dist/src/entities/webhooks/schema.js.map +1 -0
- package/dist/src/entities/wiki/index.d.ts +7 -0
- package/dist/src/entities/wiki/index.js +31 -0
- package/dist/src/entities/wiki/index.js.map +1 -0
- package/dist/src/entities/wiki/registry.d.ts +5 -0
- package/dist/src/entities/wiki/registry.js +127 -0
- package/dist/src/entities/wiki/registry.js.map +1 -0
- package/dist/src/entities/wiki/schema-readonly.d.ts +22 -0
- package/dist/src/entities/wiki/schema-readonly.js +27 -0
- package/dist/src/entities/wiki/schema-readonly.js.map +1 -0
- package/dist/src/entities/wiki/schema.d.ts +30 -0
- package/dist/src/entities/wiki/schema.js +38 -0
- package/dist/src/entities/wiki/schema.js.map +1 -0
- package/dist/src/entities/workitems/index.d.ts +7 -0
- package/dist/src/entities/workitems/index.js +31 -0
- package/dist/src/entities/workitems/index.js.map +1 -0
- package/dist/src/entities/workitems/registry.d.ts +5 -0
- package/dist/src/entities/workitems/registry.js +725 -0
- package/dist/src/entities/workitems/registry.js.map +1 -0
- package/dist/src/entities/workitems/schema-readonly.d.ts +49 -0
- package/dist/src/entities/workitems/schema-readonly.js +87 -0
- package/dist/src/entities/workitems/schema-readonly.js.map +1 -0
- package/dist/src/entities/workitems/schema.d.ts +97 -0
- package/dist/src/entities/workitems/schema.js +187 -0
- package/dist/src/entities/workitems/schema.js.map +1 -0
- package/dist/src/graphql/DynamicWorkItemsQuery.d.ts +56 -0
- package/dist/src/graphql/DynamicWorkItemsQuery.js +190 -0
- package/dist/src/graphql/DynamicWorkItemsQuery.js.map +1 -0
- package/dist/src/graphql/client.d.ts +17 -0
- package/dist/src/graphql/client.js +56 -0
- package/dist/src/graphql/client.js.map +1 -0
- package/dist/src/graphql/index.d.ts +2 -0
- package/dist/src/graphql/index.js +21 -0
- package/dist/src/graphql/index.js.map +1 -0
- package/dist/src/graphql/workItems.d.ts +659 -0
- package/dist/src/graphql/workItems.js +1545 -0
- package/dist/src/graphql/workItems.js.map +1 -0
- package/dist/src/handlers.d.ts +2 -0
- package/dist/src/handlers.js +346 -0
- package/dist/src/handlers.js.map +1 -0
- package/dist/src/http-client.d.ts +1 -0
- package/dist/src/http-client.js +9 -0
- package/dist/src/http-client.js.map +1 -0
- package/dist/src/logger.d.ts +9 -0
- package/dist/src/logger.js +129 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/logging/access-log.d.ts +15 -0
- package/dist/src/logging/access-log.js +157 -0
- package/dist/src/logging/access-log.js.map +1 -0
- package/dist/src/logging/connection-tracker.d.ts +21 -0
- package/dist/src/logging/connection-tracker.js +106 -0
- package/dist/src/logging/connection-tracker.js.map +1 -0
- package/dist/src/logging/index.d.ts +5 -0
- package/dist/src/logging/index.js +27 -0
- package/dist/src/logging/index.js.map +1 -0
- package/dist/src/logging/request-tracker.d.ts +39 -0
- package/dist/src/logging/request-tracker.js +208 -0
- package/dist/src/logging/request-tracker.js.map +1 -0
- package/dist/src/logging/types.d.ts +55 -0
- package/dist/src/logging/types.js +5 -0
- package/dist/src/logging/types.js.map +1 -0
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.js +219 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/middleware/index.d.ts +2 -0
- package/dist/src/middleware/index.js +12 -0
- package/dist/src/middleware/index.js.map +1 -0
- package/dist/src/middleware/oauth-auth.d.ts +4 -0
- package/dist/src/middleware/oauth-auth.js +137 -0
- package/dist/src/middleware/oauth-auth.js.map +1 -0
- package/dist/src/middleware/rate-limiter.d.ts +11 -0
- package/dist/src/middleware/rate-limiter.js +183 -0
- package/dist/src/middleware/rate-limiter.js.map +1 -0
- package/dist/src/oauth/config.d.ts +25 -0
- package/dist/src/oauth/config.js +109 -0
- package/dist/src/oauth/config.js.map +1 -0
- package/dist/src/oauth/endpoints/authorize.d.ts +3 -0
- package/dist/src/oauth/endpoints/authorize.js +454 -0
- package/dist/src/oauth/endpoints/authorize.js.map +1 -0
- package/dist/src/oauth/endpoints/callback.d.ts +2 -0
- package/dist/src/oauth/endpoints/callback.js +134 -0
- package/dist/src/oauth/endpoints/callback.js.map +1 -0
- package/dist/src/oauth/endpoints/index.d.ts +5 -0
- package/dist/src/oauth/endpoints/index.js +19 -0
- package/dist/src/oauth/endpoints/index.js.map +1 -0
- package/dist/src/oauth/endpoints/metadata.d.ts +5 -0
- package/dist/src/oauth/endpoints/metadata.js +42 -0
- package/dist/src/oauth/endpoints/metadata.js.map +1 -0
- package/dist/src/oauth/endpoints/register.d.ts +15 -0
- package/dist/src/oauth/endpoints/register.js +85 -0
- package/dist/src/oauth/endpoints/register.js.map +1 -0
- package/dist/src/oauth/endpoints/token.d.ts +2 -0
- package/dist/src/oauth/endpoints/token.js +167 -0
- package/dist/src/oauth/endpoints/token.js.map +1 -0
- package/dist/src/oauth/gitlab-device-flow.d.ts +10 -0
- package/dist/src/oauth/gitlab-device-flow.js +215 -0
- package/dist/src/oauth/gitlab-device-flow.js.map +1 -0
- package/dist/src/oauth/index.d.ts +10 -0
- package/dist/src/oauth/index.js +69 -0
- package/dist/src/oauth/index.js.map +1 -0
- package/dist/src/oauth/session-store.d.ts +54 -0
- package/dist/src/oauth/session-store.js +311 -0
- package/dist/src/oauth/session-store.js.map +1 -0
- package/dist/src/oauth/storage/factory.d.ts +4 -0
- package/dist/src/oauth/storage/factory.js +73 -0
- package/dist/src/oauth/storage/factory.js.map +1 -0
- package/dist/src/oauth/storage/file.d.ts +48 -0
- package/dist/src/oauth/storage/file.js +307 -0
- package/dist/src/oauth/storage/file.js.map +1 -0
- package/dist/src/oauth/storage/index.d.ts +5 -0
- package/dist/src/oauth/storage/index.js +22 -0
- package/dist/src/oauth/storage/index.js.map +1 -0
- package/dist/src/oauth/storage/memory.d.ts +76 -0
- package/dist/src/oauth/storage/memory.js +280 -0
- package/dist/src/oauth/storage/memory.js.map +1 -0
- package/dist/src/oauth/storage/postgresql.d.ts +41 -0
- package/dist/src/oauth/storage/postgresql.js +444 -0
- package/dist/src/oauth/storage/postgresql.js.map +1 -0
- package/dist/src/oauth/storage/types.d.ts +66 -0
- package/dist/src/oauth/storage/types.js +5 -0
- package/dist/src/oauth/storage/types.js.map +1 -0
- package/dist/src/oauth/token-context.d.ts +10 -0
- package/dist/src/oauth/token-context.js +50 -0
- package/dist/src/oauth/token-context.js.map +1 -0
- package/dist/src/oauth/token-utils.d.ts +14 -0
- package/dist/src/oauth/token-utils.js +148 -0
- package/dist/src/oauth/token-utils.js.map +1 -0
- package/dist/src/oauth/types.d.ts +117 -0
- package/dist/src/oauth/types.js +3 -0
- package/dist/src/oauth/types.js.map +1 -0
- package/dist/src/profiles/applicator.d.ts +19 -0
- package/dist/src/profiles/applicator.js +256 -0
- package/dist/src/profiles/applicator.js.map +1 -0
- package/dist/src/profiles/builtin/admin.yaml +30 -0
- package/dist/src/profiles/builtin/ci.yaml +35 -0
- package/dist/src/profiles/builtin/code-reviewer.yaml +41 -0
- package/dist/src/profiles/builtin/developer.yaml +40 -0
- package/dist/src/profiles/builtin/devops.yaml +33 -0
- package/dist/src/profiles/builtin/full-access.yaml +29 -0
- package/dist/src/profiles/builtin/gitlab-com.yaml +40 -0
- package/dist/src/profiles/builtin/junior-dev.yaml +35 -0
- package/dist/src/profiles/builtin/pm.yaml +36 -0
- package/dist/src/profiles/builtin/readonly.yaml +33 -0
- package/dist/src/profiles/builtin/senior-dev.yaml +41 -0
- package/dist/src/profiles/builtin/team-lead.yaml +42 -0
- package/dist/src/profiles/index.d.ts +5 -0
- package/dist/src/profiles/index.js +34 -0
- package/dist/src/profiles/index.js.map +1 -0
- package/dist/src/profiles/loader.d.ts +32 -0
- package/dist/src/profiles/loader.js +319 -0
- package/dist/src/profiles/loader.js.map +1 -0
- package/dist/src/profiles/project-loader.d.ts +12 -0
- package/dist/src/profiles/project-loader.js +214 -0
- package/dist/src/profiles/project-loader.js.map +1 -0
- package/dist/src/profiles/scope-enforcer.d.ts +28 -0
- package/dist/src/profiles/scope-enforcer.js +236 -0
- package/dist/src/profiles/scope-enforcer.js.map +1 -0
- package/dist/src/profiles/types.d.ts +261 -0
- package/dist/src/profiles/types.js +153 -0
- package/dist/src/profiles/types.js.map +1 -0
- package/dist/src/registry-manager.d.ts +37 -0
- package/dist/src/registry-manager.js +488 -0
- package/dist/src/registry-manager.js.map +1 -0
- package/dist/src/server.d.ts +2 -0
- package/dist/src/server.js +624 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/services/ConnectionManager.d.ts +41 -0
- package/dist/src/services/ConnectionManager.js +438 -0
- package/dist/src/services/ConnectionManager.js.map +1 -0
- package/dist/src/services/GitLabVersionDetector.d.ts +52 -0
- package/dist/src/services/GitLabVersionDetector.js +215 -0
- package/dist/src/services/GitLabVersionDetector.js.map +1 -0
- package/dist/src/services/InstanceConnectionPool.d.ts +54 -0
- package/dist/src/services/InstanceConnectionPool.js +180 -0
- package/dist/src/services/InstanceConnectionPool.js.map +1 -0
- package/dist/src/services/InstanceRateLimiter.d.ts +35 -0
- package/dist/src/services/InstanceRateLimiter.js +131 -0
- package/dist/src/services/InstanceRateLimiter.js.map +1 -0
- package/dist/src/services/InstanceRegistry.d.ts +61 -0
- package/dist/src/services/InstanceRegistry.js +250 -0
- package/dist/src/services/InstanceRegistry.js.map +1 -0
- package/dist/src/services/NamespaceTierDetector.d.ts +9 -0
- package/dist/src/services/NamespaceTierDetector.js +249 -0
- package/dist/src/services/NamespaceTierDetector.js.map +1 -0
- package/dist/src/services/SchemaIntrospector.d.ts +39 -0
- package/dist/src/services/SchemaIntrospector.js +190 -0
- package/dist/src/services/SchemaIntrospector.js.map +1 -0
- package/dist/src/services/TokenScopeDetector.d.ts +35 -0
- package/dist/src/services/TokenScopeDetector.js +232 -0
- package/dist/src/services/TokenScopeDetector.js.map +1 -0
- package/dist/src/services/ToolAvailability.d.ts +32 -0
- package/dist/src/services/ToolAvailability.js +410 -0
- package/dist/src/services/ToolAvailability.js.map +1 -0
- package/dist/src/services/WidgetAvailability.d.ts +23 -0
- package/dist/src/services/WidgetAvailability.js +158 -0
- package/dist/src/services/WidgetAvailability.js.map +1 -0
- package/dist/src/session-manager.d.ts +19 -0
- package/dist/src/session-manager.js +131 -0
- package/dist/src/session-manager.js.map +1 -0
- package/dist/src/types.d.ts +28 -0
- package/dist/src/types.js +11 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/description-utils.d.ts +2 -0
- package/dist/src/utils/description-utils.js +25 -0
- package/dist/src/utils/description-utils.js.map +1 -0
- package/dist/src/utils/error-handler.d.ts +93 -0
- package/dist/src/utils/error-handler.js +597 -0
- package/dist/src/utils/error-handler.js.map +1 -0
- package/dist/src/utils/fetch.d.ts +13 -0
- package/dist/src/utils/fetch.js +539 -0
- package/dist/src/utils/fetch.js.map +1 -0
- package/dist/src/utils/gitlab-api.d.ts +24 -0
- package/dist/src/utils/gitlab-api.js +139 -0
- package/dist/src/utils/gitlab-api.js.map +1 -0
- package/dist/src/utils/idConversion.d.ts +81 -0
- package/dist/src/utils/idConversion.js +193 -0
- package/dist/src/utils/idConversion.js.map +1 -0
- package/dist/src/utils/namespace.d.ts +7 -0
- package/dist/src/utils/namespace.js +59 -0
- package/dist/src/utils/namespace.js.map +1 -0
- package/dist/src/utils/projectIdentifier.d.ts +9 -0
- package/dist/src/utils/projectIdentifier.js +59 -0
- package/dist/src/utils/projectIdentifier.js.map +1 -0
- package/dist/src/utils/request-logger.d.ts +24 -0
- package/dist/src/utils/request-logger.js +55 -0
- package/dist/src/utils/request-logger.js.map +1 -0
- package/dist/src/utils/schema-utils.d.ts +31 -0
- package/dist/src/utils/schema-utils.js +288 -0
- package/dist/src/utils/schema-utils.js.map +1 -0
- package/dist/src/utils/smart-user-search.d.ts +33 -0
- package/dist/src/utils/smart-user-search.js +142 -0
- package/dist/src/utils/smart-user-search.js.map +1 -0
- package/dist/src/utils/version.d.ts +1 -0
- package/dist/src/utils/version.js +14 -0
- package/dist/src/utils/version.js.map +1 -0
- package/dist/src/utils/workItemTypes.d.ts +6 -0
- package/dist/src/utils/workItemTypes.js +14 -0
- package/dist/src/utils/workItemTypes.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +511 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const SnippetFileSchema: z.ZodObject<{
|
|
3
|
+
file_path: z.ZodString;
|
|
4
|
+
content: z.ZodOptional<z.ZodString>;
|
|
5
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
create: "create";
|
|
7
|
+
update: "update";
|
|
8
|
+
delete: "delete";
|
|
9
|
+
move: "move";
|
|
10
|
+
}>>;
|
|
11
|
+
previous_path: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const ManageSnippetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
action: z.ZodLiteral<"create">;
|
|
15
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
title: z.ZodString;
|
|
17
|
+
description: z.ZodOptional<z.ZodString>;
|
|
18
|
+
visibility: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
|
|
19
|
+
public: "public";
|
|
20
|
+
internal: "internal";
|
|
21
|
+
private: "private";
|
|
22
|
+
}>>>>;
|
|
23
|
+
files: z.ZodArray<z.ZodObject<{
|
|
24
|
+
file_path: z.ZodString;
|
|
25
|
+
content: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
action: z.ZodLiteral<"update">;
|
|
29
|
+
id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
30
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
31
|
+
title: z.ZodOptional<z.ZodString>;
|
|
32
|
+
description: z.ZodOptional<z.ZodString>;
|
|
33
|
+
visibility: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
|
|
34
|
+
public: "public";
|
|
35
|
+
internal: "internal";
|
|
36
|
+
private: "private";
|
|
37
|
+
}>>>;
|
|
38
|
+
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
+
file_path: z.ZodString;
|
|
40
|
+
content: z.ZodOptional<z.ZodString>;
|
|
41
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
create: "create";
|
|
43
|
+
update: "update";
|
|
44
|
+
delete: "delete";
|
|
45
|
+
move: "move";
|
|
46
|
+
}>>;
|
|
47
|
+
previous_path: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>>>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
action: z.ZodLiteral<"delete">;
|
|
51
|
+
id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
52
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>], "action">;
|
|
54
|
+
export type ManageSnippetInput = z.infer<typeof ManageSnippetSchema>;
|
|
55
|
+
export type SnippetFile = z.infer<typeof SnippetFileSchema>;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManageSnippetSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const flexibleVisibility = zod_1.z.preprocess(val => {
|
|
7
|
+
if (typeof val === "string") {
|
|
8
|
+
const normalized = val.toLowerCase().trim();
|
|
9
|
+
if (["private", "priv"].includes(normalized)) {
|
|
10
|
+
return "private";
|
|
11
|
+
}
|
|
12
|
+
if (["internal", "intern"].includes(normalized)) {
|
|
13
|
+
return "internal";
|
|
14
|
+
}
|
|
15
|
+
if (["public", "pub"].includes(normalized)) {
|
|
16
|
+
return "public";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return val;
|
|
20
|
+
}, zod_1.z.enum(["private", "internal", "public"]));
|
|
21
|
+
const SnippetFileSchema = zod_1.z.object({
|
|
22
|
+
file_path: zod_1.z
|
|
23
|
+
.string()
|
|
24
|
+
.min(1)
|
|
25
|
+
.describe("The path/name of the file within the snippet. Can include subdirectories (e.g., 'src/main.py'). Must be unique within the snippet"),
|
|
26
|
+
content: zod_1.z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("The content of the file. Required for 'create' and 'update' actions. Can be empty string for placeholder files"),
|
|
30
|
+
action: zod_1.z
|
|
31
|
+
.enum(["create", "update", "delete", "move"])
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Action to perform on the file (only for update operations): 'create' adds a new file, 'update' modifies existing file, 'delete' removes file, 'move' renames file (requires previous_path)"),
|
|
34
|
+
previous_path: zod_1.z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Original file path when using 'move' action to rename a file. Must match an existing file in the snippet"),
|
|
38
|
+
});
|
|
39
|
+
const projectIdField = zod_1.z
|
|
40
|
+
.string()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("Project ID or URL-encoded path. Leave empty for personal snippets");
|
|
43
|
+
const CreateSnippetSchema = zod_1.z.object({
|
|
44
|
+
action: zod_1.z.literal("create").describe("Create a new snippet with one or more files"),
|
|
45
|
+
projectId: projectIdField.describe("Project ID or URL-encoded path to create a project snippet. Leave empty for personal snippet"),
|
|
46
|
+
title: zod_1.z
|
|
47
|
+
.string()
|
|
48
|
+
.min(1)
|
|
49
|
+
.max(255)
|
|
50
|
+
.describe("The title of the snippet. Displayed in snippet list and as page title. Max 255 chars"),
|
|
51
|
+
description: zod_1.z
|
|
52
|
+
.string()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("Optional description explaining the snippet purpose. Supports markdown"),
|
|
55
|
+
visibility: flexibleVisibility
|
|
56
|
+
.optional()
|
|
57
|
+
.default("private")
|
|
58
|
+
.describe("Visibility: 'private' (author only), 'internal' (authenticated users), 'public' (everyone). Defaults to 'private'"),
|
|
59
|
+
files: zod_1.z
|
|
60
|
+
.array(zod_1.z.object({
|
|
61
|
+
file_path: zod_1.z.string().min(1),
|
|
62
|
+
content: zod_1.z.string(),
|
|
63
|
+
}))
|
|
64
|
+
.min(1)
|
|
65
|
+
.describe("Array of files to include. At least one file required. Each needs file_path and content"),
|
|
66
|
+
});
|
|
67
|
+
const UpdateSnippetSchema = zod_1.z.object({
|
|
68
|
+
action: zod_1.z.literal("update").describe("Update an existing snippet metadata or files"),
|
|
69
|
+
id: utils_1.requiredId.describe("The ID of the snippet to update"),
|
|
70
|
+
projectId: projectIdField.describe("Project ID or URL-encoded path. Required for project snippets, leave empty for personal"),
|
|
71
|
+
title: zod_1.z.string().min(1).max(255).optional().describe("Update the snippet title. Max 255 chars"),
|
|
72
|
+
description: zod_1.z.string().optional().describe("Update the snippet description. Supports markdown"),
|
|
73
|
+
visibility: flexibleVisibility.optional().describe("Update the visibility level"),
|
|
74
|
+
files: zod_1.z
|
|
75
|
+
.array(SnippetFileSchema)
|
|
76
|
+
.optional()
|
|
77
|
+
.describe("Array of file operations. Each file must specify 'action': create/update/delete/move. Move requires previous_path"),
|
|
78
|
+
});
|
|
79
|
+
const DeleteSnippetSchema = zod_1.z.object({
|
|
80
|
+
action: zod_1.z.literal("delete").describe("Permanently delete a snippet"),
|
|
81
|
+
id: utils_1.requiredId.describe("The ID of the snippet to delete. This operation cannot be undone"),
|
|
82
|
+
projectId: projectIdField.describe("Project ID or URL-encoded path. Required for project snippets, leave empty for personal"),
|
|
83
|
+
});
|
|
84
|
+
exports.ManageSnippetSchema = zod_1.z.discriminatedUnion("action", [
|
|
85
|
+
CreateSnippetSchema,
|
|
86
|
+
UpdateSnippetSchema,
|
|
87
|
+
DeleteSnippetSchema,
|
|
88
|
+
]);
|
|
89
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/snippets/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAsC;AAWtC,MAAM,kBAAkB,GAAG,OAAC,CAAC,UAAU,CACrC,GAAG,CAAC,EAAE;IACJ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC5C,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7C,OAAO,SAAS,CAAC;QACnB,CAAC;QACD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ACP,mHAAmH,CACpH;CACJ,CAAC,CAAC;AAGH,MAAM,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACpE,EAAE,EAAE,kBAAU,CAAC,QAAQ,CAAC,kEAAkE,CAAC;IAC3F,SAAS,EAAE,cAAc,CAAC,QAAQ,CAChC,yFAAyF,CAC1F;CACF,CAAC,CAAC;AAGU,QAAA,mBAAmB,GAAG,OAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IAChE,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;CACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const GITLAB_DEFAULT_PER_PAGE = 20;
|
|
3
|
+
export declare const GITLAB_MAX_PER_PAGE = 100;
|
|
4
|
+
export declare function paginationFields(defaultPerPage?: number, maxPerPage?: number): {
|
|
5
|
+
per_page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
6
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
};
|
|
8
|
+
export declare const flexibleBoolean: z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>;
|
|
9
|
+
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>>>;
|
|
10
|
+
export declare const requiredId: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
|
|
11
|
+
export declare function assertDefined<T>(value: T | undefined, fieldName: string): asserts value is T;
|
|
12
|
+
export declare function validateScopeId(data: {
|
|
13
|
+
scope: "project" | "group";
|
|
14
|
+
projectId?: string;
|
|
15
|
+
groupId?: string;
|
|
16
|
+
}): boolean;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requiredId = exports.flexibleBooleanNullable = exports.flexibleBoolean = exports.GITLAB_MAX_PER_PAGE = exports.GITLAB_DEFAULT_PER_PAGE = void 0;
|
|
4
|
+
exports.paginationFields = paginationFields;
|
|
5
|
+
exports.assertDefined = assertDefined;
|
|
6
|
+
exports.validateScopeId = validateScopeId;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const DEFAULT_NULL = process.env.DEFAULT_NULL === "true";
|
|
9
|
+
exports.GITLAB_DEFAULT_PER_PAGE = 20;
|
|
10
|
+
exports.GITLAB_MAX_PER_PAGE = 100;
|
|
11
|
+
function paginationFields(defaultPerPage = exports.GITLAB_DEFAULT_PER_PAGE, maxPerPage = exports.GITLAB_MAX_PER_PAGE) {
|
|
12
|
+
if (defaultPerPage > maxPerPage) {
|
|
13
|
+
throw new Error(`Invalid pagination config: defaultPerPage (${defaultPerPage}) cannot exceed maxPerPage (${maxPerPage})`);
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
per_page: zod_1.z
|
|
17
|
+
.number()
|
|
18
|
+
.int()
|
|
19
|
+
.min(1)
|
|
20
|
+
.max(maxPerPage)
|
|
21
|
+
.optional()
|
|
22
|
+
.default(defaultPerPage)
|
|
23
|
+
.describe(`Number of items per page (default: ${defaultPerPage}, max: ${maxPerPage})`),
|
|
24
|
+
page: zod_1.z.number().int().min(1).optional().describe("Page number"),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
exports.flexibleBoolean = zod_1.z.preprocess(val => {
|
|
28
|
+
if (typeof val === "boolean") {
|
|
29
|
+
return val;
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const result = String(val).toLowerCase();
|
|
33
|
+
return ["true", "t", "1"].includes(result);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}, zod_1.z.boolean());
|
|
39
|
+
exports.flexibleBooleanNullable = DEFAULT_NULL
|
|
40
|
+
? exports.flexibleBoolean.nullable().default(null)
|
|
41
|
+
: exports.flexibleBoolean.nullable();
|
|
42
|
+
exports.requiredId = zod_1.z.preprocess(val => val ?? "", zod_1.z.coerce.string().min(1));
|
|
43
|
+
function assertDefined(value, fieldName) {
|
|
44
|
+
if (value === undefined) {
|
|
45
|
+
throw new Error(`${fieldName} is required but was not provided`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function validateScopeId(data) {
|
|
49
|
+
if (data.scope === "project") {
|
|
50
|
+
return !!data.projectId;
|
|
51
|
+
}
|
|
52
|
+
if (data.scope === "group") {
|
|
53
|
+
return !!data.groupId;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/entities/utils.ts"],"names":[],"mappings":";;;AAqCA,4CAoBC;AAuCD,sCAIC;AASD,0CAYC;AAzHD,6BAAwB;AAExB,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,MAAM,CAAC;AAM5C,QAAA,uBAAuB,GAAG,EAAE,CAAC;AAK7B,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAwBvC,SAAgB,gBAAgB,CAC9B,iBAAyB,+BAAuB,EAChD,aAAqB,2BAAmB;IAExC,IAAI,cAAc,GAAG,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,8CAA8C,cAAc,+BAA+B,UAAU,GAAG,CACzG,CAAC;IACJ,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,OAAC;aACR,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,UAAU,CAAC;aACf,QAAQ,EAAE;aACV,OAAO,CAAC,cAAc,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I,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IACD,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "../shared";
|
|
2
|
+
export * from "./schema-readonly";
|
|
3
|
+
export * from "./schema";
|
|
4
|
+
export * from "./registry";
|
|
5
|
+
import type { ToolDefinition } from "../../types";
|
|
6
|
+
export declare const variablesTools: ToolDefinition[];
|
|
7
|
+
export declare const variablesReadOnlyTools: string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.variablesReadOnlyTools = exports.variablesTools = void 0;
|
|
18
|
+
__exportStar(require("../shared"), exports);
|
|
19
|
+
__exportStar(require("./schema-readonly"), exports);
|
|
20
|
+
__exportStar(require("./schema"), exports);
|
|
21
|
+
__exportStar(require("./registry"), exports);
|
|
22
|
+
const registry_1 = require("./registry");
|
|
23
|
+
const isReadOnly = process.env.GITLAB_READONLY === "true";
|
|
24
|
+
const variablesToolsFromRegistry = (0, registry_1.getFilteredVariablesTools)(isReadOnly);
|
|
25
|
+
exports.variablesTools = variablesToolsFromRegistry.map((tool) => ({
|
|
26
|
+
name: tool.name,
|
|
27
|
+
description: tool.description,
|
|
28
|
+
inputSchema: tool.inputSchema,
|
|
29
|
+
}));
|
|
30
|
+
exports.variablesReadOnlyTools = (0, registry_1.getVariablesReadOnlyToolNames)();
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/entities/variables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,4CAA0B;AAG1B,oDAAkC;AAGlC,2CAAyB;AAGzB,6CAA2B;AAG3B,yCAAsF;AAItF,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,MAAM,CAAC;AAG1D,MAAM,0BAA0B,GAAG,IAAA,oCAAyB,EAAC,UAAU,CAAC,CAAC;AAG5D,QAAA,cAAc,GAAqB,0BAA0B,CAAC,GAAG,CAC5E,CAAC,IAAI,EAAkB,EAAE,CAAC,CAAC;IACzB,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,WAAW,EAAE,IAAI,CAAC,WAAW;IAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;CAC9B,CAAC,CACH,CAAC;AAGW,QAAA,sBAAsB,GAAG,IAAA,wCAA6B,GAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ToolRegistry, EnhancedToolDefinition } from "../../types";
|
|
2
|
+
export declare const variablesToolRegistry: ToolRegistry;
|
|
3
|
+
export declare function getVariablesReadOnlyToolNames(): string[];
|
|
4
|
+
export declare function getVariablesToolDefinitions(): EnhancedToolDefinition[];
|
|
5
|
+
export declare function getFilteredVariablesTools(readOnlyMode?: boolean): EnhancedToolDefinition[];
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.variablesToolRegistry = void 0;
|
|
37
|
+
exports.getVariablesReadOnlyToolNames = getVariablesReadOnlyToolNames;
|
|
38
|
+
exports.getVariablesToolDefinitions = getVariablesToolDefinitions;
|
|
39
|
+
exports.getFilteredVariablesTools = getFilteredVariablesTools;
|
|
40
|
+
const z = __importStar(require("zod"));
|
|
41
|
+
const schema_readonly_1 = require("./schema-readonly");
|
|
42
|
+
const schema_1 = require("./schema");
|
|
43
|
+
const gitlab_api_1 = require("../../utils/gitlab-api");
|
|
44
|
+
const namespace_1 = require("../../utils/namespace");
|
|
45
|
+
const config_1 = require("../../config");
|
|
46
|
+
exports.variablesToolRegistry = new Map([
|
|
47
|
+
[
|
|
48
|
+
"browse_variables",
|
|
49
|
+
{
|
|
50
|
+
name: "browse_variables",
|
|
51
|
+
description: "List and inspect CI/CD variables for projects or groups. Actions: list (all variables with pagination), get (single variable by key with environment scope filter). Related: manage_variable to create/update/delete.",
|
|
52
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseVariablesSchema),
|
|
53
|
+
gate: { envVar: "USE_VARIABLES", defaultValue: true },
|
|
54
|
+
handler: async (args) => {
|
|
55
|
+
const input = schema_readonly_1.BrowseVariablesSchema.parse(args);
|
|
56
|
+
if ((0, config_1.isActionDenied)("browse_variables", input.action)) {
|
|
57
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_variables tool`);
|
|
58
|
+
}
|
|
59
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
60
|
+
switch (input.action) {
|
|
61
|
+
case "list": {
|
|
62
|
+
const { action: _action, namespace: _namespace, ...rest } = input;
|
|
63
|
+
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
64
|
+
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/variables`, { query });
|
|
65
|
+
}
|
|
66
|
+
case "get": {
|
|
67
|
+
const query = {};
|
|
68
|
+
if (input.filter?.environment_scope) {
|
|
69
|
+
query["filter[environment_scope]"] = input.filter.environment_scope;
|
|
70
|
+
}
|
|
71
|
+
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/variables/${encodeURIComponent(input.key)}`, { query });
|
|
72
|
+
}
|
|
73
|
+
default:
|
|
74
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
[
|
|
80
|
+
"manage_variable",
|
|
81
|
+
{
|
|
82
|
+
name: "manage_variable",
|
|
83
|
+
description: "Create, update, or delete CI/CD variables with environment scoping. Actions: create (key + value, set scope/protection/masking), update (modify value or settings), delete (remove permanently). Related: browse_variables for discovery.",
|
|
84
|
+
inputSchema: z.toJSONSchema(schema_1.ManageVariableSchema),
|
|
85
|
+
gate: { envVar: "USE_VARIABLES", defaultValue: true },
|
|
86
|
+
handler: async (args) => {
|
|
87
|
+
const input = schema_1.ManageVariableSchema.parse(args);
|
|
88
|
+
if ((0, config_1.isActionDenied)("manage_variable", input.action)) {
|
|
89
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_variable tool`);
|
|
90
|
+
}
|
|
91
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
92
|
+
switch (input.action) {
|
|
93
|
+
case "create": {
|
|
94
|
+
const { action: _action, namespace: _namespace, ...body } = input;
|
|
95
|
+
return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/variables`, {
|
|
96
|
+
body,
|
|
97
|
+
contentType: "json",
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
case "update": {
|
|
101
|
+
const { action: _action, namespace: _namespace, key, filter, ...body } = input;
|
|
102
|
+
const query = {};
|
|
103
|
+
if (filter?.environment_scope) {
|
|
104
|
+
query["filter[environment_scope]"] = filter.environment_scope;
|
|
105
|
+
}
|
|
106
|
+
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/variables/${encodeURIComponent(key)}`, {
|
|
107
|
+
query,
|
|
108
|
+
body,
|
|
109
|
+
contentType: "json",
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
case "delete": {
|
|
113
|
+
const query = {};
|
|
114
|
+
if (input.filter?.environment_scope) {
|
|
115
|
+
query["filter[environment_scope]"] = input.filter.environment_scope;
|
|
116
|
+
}
|
|
117
|
+
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/variables/${encodeURIComponent(input.key)}`, { query });
|
|
118
|
+
return { deleted: true };
|
|
119
|
+
}
|
|
120
|
+
default:
|
|
121
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
]);
|
|
127
|
+
function getVariablesReadOnlyToolNames() {
|
|
128
|
+
return ["browse_variables"];
|
|
129
|
+
}
|
|
130
|
+
function getVariablesToolDefinitions() {
|
|
131
|
+
return Array.from(exports.variablesToolRegistry.values());
|
|
132
|
+
}
|
|
133
|
+
function getFilteredVariablesTools(readOnlyMode = false) {
|
|
134
|
+
if (readOnlyMode) {
|
|
135
|
+
const readOnlyNames = getVariablesReadOnlyToolNames();
|
|
136
|
+
return Array.from(exports.variablesToolRegistry.values()).filter(tool => readOnlyNames.includes(tool.name));
|
|
137
|
+
}
|
|
138
|
+
return getVariablesToolDefinitions();
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/variables/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8IA,sEAEC;AAKD,kEAEC;AAKD,8DAQC;AApKD,uCAAyB;AACzB,uDAA0D;AAC1D,qCAAgD;AAChD,uDAAyD;AACzD,qDAA+D;AAE/D,yCAA8C;AAQjC,QAAA,qBAAqB,GAAiB,IAAI,GAAG,CAAiC;IAKzF;QACE,kBAAkB;QAClB;YACE,IAAI,EAAE,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I,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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BrowseVariablesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
per_page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
action: z.ZodLiteral<"list">;
|
|
6
|
+
namespace: z.ZodString;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
action: z.ZodLiteral<"get">;
|
|
9
|
+
namespace: z.ZodString;
|
|
10
|
+
key: z.ZodString;
|
|
11
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
environment_scope: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>], "action">;
|
|
15
|
+
export type BrowseVariablesInput = z.infer<typeof BrowseVariablesSchema>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrowseVariablesSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const namespaceField = zod_1.z.string().describe("Namespace path (group or project)");
|
|
7
|
+
const filterField = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
environment_scope: zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe('The environment scope filter. Use "*" for all environments or specific environment name like "production".'),
|
|
13
|
+
})
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("Filter parameters for variable lookup");
|
|
16
|
+
const ListVariablesSchema = zod_1.z.object({
|
|
17
|
+
action: zod_1.z.literal("list").describe("List all CI/CD variables"),
|
|
18
|
+
namespace: namespaceField,
|
|
19
|
+
...(0, utils_1.paginationFields)(),
|
|
20
|
+
});
|
|
21
|
+
const GetVariableSchema = zod_1.z.object({
|
|
22
|
+
action: zod_1.z.literal("get").describe("Get a single CI/CD variable by key"),
|
|
23
|
+
namespace: namespaceField,
|
|
24
|
+
key: zod_1.z
|
|
25
|
+
.string()
|
|
26
|
+
.describe("The key of the CI/CD variable. Maximum 255 characters, alphanumeric and underscore only."),
|
|
27
|
+
filter: filterField,
|
|
28
|
+
});
|
|
29
|
+
exports.BrowseVariablesSchema = zod_1.z.discriminatedUnion("action", [
|
|
30
|
+
ListVariablesSchema,
|
|
31
|
+
GetVariableSchema,
|
|
32
|
+
]);
|
|
33
|
+
//# sourceMappingURL=schema-readonly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/variables/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA4C;AAU5C,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC;AAChF,MAAM,WAAW,GAAG,OAAC;KAClB,MAAM,CAAC;IACN,iBAAiB,EAAE,OAAC;SACjB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,4GAA4G,CAC7G;CACJ,CAAC;KACD,QAAQ,EAAE;KACV,QAAQ,CAAC,uCAAuC,CAAC,CAAC;AAGrD,MAAM,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IAC9D,SAAS,EAAE,cAAc;IACzB,GAAG,IAAA,wBAAgB,GAAE;CACtB,CAAC,CAAC;AAGH,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACvE,SAAS,EAAE,cAAc;IACzB,GAAG,EAAE,OAAC;SACH,MAAM,EAAE;SACR,QAAQ,CACP,0FAA0F,CAC3F;IACH,MAAM,EAAE,WAAW;CACpB,CAAC,CAAC;AAGU,QAAA,qBAAqB,GAAG,OAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IAClE,mBAAmB;IACnB,iBAAiB;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ManageVariableSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
action: z.ZodLiteral<"create">;
|
|
4
|
+
namespace: z.ZodString;
|
|
5
|
+
key: z.ZodString;
|
|
6
|
+
value: z.ZodString;
|
|
7
|
+
variable_type: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
|
|
8
|
+
file: "file";
|
|
9
|
+
env_var: "env_var";
|
|
10
|
+
}>>>;
|
|
11
|
+
environment_scope: z.ZodOptional<z.ZodString>;
|
|
12
|
+
protected: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
13
|
+
masked: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
14
|
+
raw: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
action: z.ZodLiteral<"update">;
|
|
18
|
+
namespace: z.ZodString;
|
|
19
|
+
key: z.ZodString;
|
|
20
|
+
value: z.ZodOptional<z.ZodString>;
|
|
21
|
+
variable_type: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
|
|
22
|
+
file: "file";
|
|
23
|
+
env_var: "env_var";
|
|
24
|
+
}>>>;
|
|
25
|
+
environment_scope: z.ZodOptional<z.ZodString>;
|
|
26
|
+
protected: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
27
|
+
masked: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
28
|
+
raw: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
29
|
+
description: z.ZodOptional<z.ZodString>;
|
|
30
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
environment_scope: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
action: z.ZodLiteral<"delete">;
|
|
35
|
+
namespace: z.ZodString;
|
|
36
|
+
key: z.ZodString;
|
|
37
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
environment_scope: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
}, z.core.$strip>], "action">;
|
|
41
|
+
export type ManageVariableInput = z.infer<typeof ManageVariableSchema>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManageVariableSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const flexibleVariableType = zod_1.z.preprocess(val => {
|
|
7
|
+
if (typeof val === "string") {
|
|
8
|
+
const normalized = val.toLowerCase().trim();
|
|
9
|
+
if (["env_var", "env", "environment", "var", "variable"].includes(normalized)) {
|
|
10
|
+
return "env_var";
|
|
11
|
+
}
|
|
12
|
+
if (["file", "file_var"].includes(normalized)) {
|
|
13
|
+
return "file";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return val;
|
|
17
|
+
}, zod_1.z.enum(["env_var", "file"]));
|
|
18
|
+
const namespaceField = zod_1.z.string().describe("Namespace path (group or project)");
|
|
19
|
+
const keyField = zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.describe("The key of the CI/CD variable. Maximum 255 characters, only alphanumeric and underscore characters allowed.");
|
|
22
|
+
const variableTypeField = flexibleVariableType
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('The type of variable: "env_var" for environment variables (default) or "file" for file variables.');
|
|
25
|
+
const environmentScopeField = zod_1.z
|
|
26
|
+
.string()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('The environment scope. Use "*" for all environments (default), or specify like "production", "staging".');
|
|
29
|
+
const protectedField = utils_1.flexibleBoolean
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Whether this variable is protected. Protected variables are only available to protected branches/tags.");
|
|
32
|
+
const maskedField = utils_1.flexibleBoolean
|
|
33
|
+
.optional()
|
|
34
|
+
.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.");
|
|
35
|
+
const rawField = utils_1.flexibleBoolean
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Whether variable expansion is disabled. When true, variables like $OTHER_VAR in the value will NOT be expanded.");
|
|
38
|
+
const descriptionField = zod_1.z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Optional description explaining the purpose of this variable (GitLab 16.2+).");
|
|
42
|
+
const filterField = zod_1.z
|
|
43
|
+
.object({
|
|
44
|
+
environment_scope: zod_1.z
|
|
45
|
+
.string()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Filter to specify which environment scope variant to update/delete when multiple variables exist with the same key."),
|
|
48
|
+
})
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Filter parameters to identify the specific variable");
|
|
51
|
+
const CreateVariableSchema = zod_1.z.object({
|
|
52
|
+
action: zod_1.z.literal("create").describe("Create a new CI/CD variable"),
|
|
53
|
+
namespace: namespaceField,
|
|
54
|
+
key: keyField,
|
|
55
|
+
value: zod_1.z
|
|
56
|
+
.string()
|
|
57
|
+
.describe("The value of the CI/CD variable. For file type variables, this is the file content."),
|
|
58
|
+
variable_type: variableTypeField,
|
|
59
|
+
environment_scope: environmentScopeField,
|
|
60
|
+
protected: protectedField,
|
|
61
|
+
masked: maskedField,
|
|
62
|
+
raw: rawField,
|
|
63
|
+
description: descriptionField,
|
|
64
|
+
});
|
|
65
|
+
const UpdateVariableSchema = zod_1.z.object({
|
|
66
|
+
action: zod_1.z.literal("update").describe("Update an existing CI/CD variable"),
|
|
67
|
+
namespace: namespaceField,
|
|
68
|
+
key: keyField,
|
|
69
|
+
value: zod_1.z
|
|
70
|
+
.string()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("The value of the CI/CD variable. For file type variables, this is the file content."),
|
|
73
|
+
variable_type: variableTypeField,
|
|
74
|
+
environment_scope: environmentScopeField,
|
|
75
|
+
protected: protectedField,
|
|
76
|
+
masked: maskedField,
|
|
77
|
+
raw: rawField,
|
|
78
|
+
description: descriptionField,
|
|
79
|
+
filter: filterField,
|
|
80
|
+
});
|
|
81
|
+
const DeleteVariableSchema = zod_1.z.object({
|
|
82
|
+
action: zod_1.z.literal("delete").describe("Delete a CI/CD variable"),
|
|
83
|
+
namespace: namespaceField,
|
|
84
|
+
key: keyField,
|
|
85
|
+
filter: filterField,
|
|
86
|
+
});
|
|
87
|
+
exports.ManageVariableSchema = zod_1.z.discriminatedUnion("action", [
|
|
88
|
+
CreateVariableSchema,
|
|
89
|
+
UpdateVariableSchema,
|
|
90
|
+
DeleteVariableSchema,
|
|
91
|
+
]);
|
|
92
|
+
//# sourceMappingURL=schema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