@bluefly/openstandardagents 0.4.6 → 0.4.8
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/.version.json +3 -3
- package/CHANGELOG.md +16 -0
- package/README.md +1 -0
- package/dist/.version.json +3 -3
- package/dist/adapters/mcp/converter.js +4 -3
- package/dist/adapters/npm/adapter.js +2 -1
- package/dist/adapters/openai-agents/adapter.js +1 -1
- package/dist/cli/commands/config.command.d.ts +7 -0
- package/dist/cli/commands/config.command.js +92 -0
- package/dist/cli/commands/migrate.command.js +1 -1
- package/dist/cli/commands/sign.command.d.ts +3 -0
- package/dist/cli/commands/sign.command.js +42 -0
- package/dist/cli/commands/skills.command.js +4 -6
- package/dist/config/cli-config.d.ts +33 -0
- package/dist/config/cli-config.js +107 -0
- package/dist/mcp-server/index.js +0 -0
- package/dist/package.json +8 -9
- package/dist/services/governance/cedar-provider.js +2 -1
- package/dist/services/release-automation/base-crud.service.d.ts +93 -0
- package/dist/services/release-automation/base-crud.service.js +68 -0
- package/dist/services/release-automation/generate-changelog.d.ts +7 -0
- package/dist/services/release-automation/generate-changelog.js +288 -0
- package/dist/services/release-automation/increment-dev-tag.d.ts +7 -0
- package/dist/services/release-automation/increment-dev-tag.js +160 -0
- package/dist/services/release-automation/index.d.ts +12 -0
- package/dist/services/release-automation/index.js +12 -0
- package/dist/services/release-automation/merge-request.service.d.ts +119 -0
- package/dist/services/release-automation/merge-request.service.js +212 -0
- package/dist/services/release-automation/milestone.service.d.ts +104 -0
- package/dist/services/release-automation/milestone.service.js +207 -0
- package/dist/services/release-automation/release-agent.service.d.ts +39 -0
- package/dist/services/release-automation/release-agent.service.js +43 -0
- package/dist/services/release-automation/release-buttons.d.ts +7 -0
- package/dist/services/release-automation/release-buttons.js +207 -0
- package/dist/services/release-automation/release.service.d.ts +118 -0
- package/dist/services/release-automation/release.service.js +207 -0
- package/dist/services/release-automation/schemas/release.schema.d.ts +299 -0
- package/dist/services/release-automation/schemas/release.schema.js +272 -0
- package/dist/services/release-automation/tag.service.d.ts +99 -0
- package/dist/services/release-automation/tag.service.js +183 -0
- package/dist/services/release-automation/webhook.service.d.ts +37 -0
- package/dist/services/release-automation/webhook.service.js +187 -0
- package/dist/skills/test-skill/README.md +36 -0
- package/dist/skills/test-skill/SKILL.md +31 -0
- package/dist/skills/test-skill/index.d.ts +31 -0
- package/dist/skills/test-skill/install.js +44 -0
- package/dist/skills/test-skill/package.json +36 -0
- package/dist/spec/reference/reference-agents/compliance-auditor/manifest.ossa.yaml +1 -1
- package/dist/spec/reference/reference-agents/doc-agent/manifest.ossa.yaml +1 -1
- package/dist/spec/reference/reference-agents/mr-reviewer/manifest.ossa.yaml +1 -1
- package/dist/spec/reference/reference-agents/ossa-validator-v0.3/manifest.ossa.yaml +1 -1
- package/dist/spec/reference/reference-agents/pipeline-fixer/manifest.ossa.yaml +1 -1
- package/dist/spec/reference/reference-agents/release-orchestrator/manifest.ossa.yaml +1 -1
- package/dist/spec/uadp/README.md +393 -0
- package/dist/spec/uadp/openapi.yaml +387 -0
- package/dist/spec/uadp/schemas/uadp-agents-response.schema.json +68 -0
- package/dist/spec/uadp/schemas/uadp-federation-response.schema.json +46 -0
- package/dist/spec/uadp/schemas/uadp-manifest.schema.json +82 -0
- package/dist/spec/uadp/schemas/uadp-skills-response.schema.json +72 -0
- package/dist/spec/v0.4/agent-card.schema.json +1 -1
- package/dist/spec/v0.4/agent.schema.json +15 -15
- package/dist/spec/v0.4/extensions/a2a/a2a.schema.json +1 -1
- package/dist/spec/v0.4/extensions/ag2/ag2.schema.json +1 -1
- package/dist/spec/v0.4/extensions/crewai/crewai.schema.json +1 -1
- package/dist/spec/v0.4/extensions/kagent/kagent.schema.json +1 -1
- package/dist/spec/v0.4/extensions/langchain/langchain.schema.json +1 -1
- package/dist/spec/v0.4/extensions/langgraph/langgraph.schema.json +1 -1
- package/dist/spec/v0.4/extensions/mcp/mcp.schema.json +1 -1
- package/dist/spec/v0.5/agent-card.schema.json +477 -0
- package/dist/spec/v0.5/agent.schema.json +1556 -0
- package/dist/spec/v0.5/conformance/profiles/baseline.json +19 -0
- package/dist/spec/v0.5/conformance/profiles/enterprise.json +20 -0
- package/dist/spec/v0.5/extensions/a2a/README.md +193 -0
- package/dist/spec/v0.5/extensions/a2a/a2a.schema.json +77 -0
- package/dist/spec/v0.5/extensions/ag2/ag2.schema.json +277 -0
- package/dist/spec/v0.5/extensions/cognition/cognition.schema.json +94 -0
- package/dist/spec/v0.5/extensions/cognition/thought-node.schema.json +80 -0
- package/dist/spec/v0.5/extensions/crewai/crewai.schema.json +256 -0
- package/dist/spec/v0.5/extensions/drupal/drupal.schema.json +318 -0
- package/dist/spec/v0.5/extensions/evals/evals.schema.json +597 -0
- package/dist/spec/v0.5/extensions/governance/governance-extension.yaml +161 -0
- package/dist/spec/v0.5/extensions/identity/identity.schema.json +302 -0
- package/dist/spec/v0.5/extensions/kagent/README.md +315 -0
- package/dist/spec/v0.5/extensions/kagent/kagent.schema.json +624 -0
- package/dist/spec/v0.5/extensions/langchain/langchain.schema.json +243 -0
- package/dist/spec/v0.5/extensions/langgraph/langgraph.schema.json +211 -0
- package/dist/spec/v0.5/extensions/mcp/README.md +276 -0
- package/dist/spec/v0.5/extensions/mcp/mcp.schema.json +84 -0
- package/dist/spec/v0.5/extensions/memory/memory.schema.json +7 -0
- package/dist/spec/v0.5/extensions/team/team.schema.json +304 -0
- package/dist/spec/v0.5/extensions/token-efficiency/token-efficiency.schema.json +47 -0
- package/dist/spec/v0.5/mcp.schema.json +1 -0
- package/dist/spec/v0.5/skill.schema.json +1 -0
- package/dist/spec/v0.5/validator.schema.json +282 -0
- package/dist/validation/error-codes.js +1 -1
- package/examples/a2a/agent-handoff.ossa.yaml +1 -1
- package/examples/a2a/service-discovery.ossa.yaml +1 -1
- package/examples/adapters/drupal-eca-mapping.yaml +1 -1
- package/examples/adapters/drupal-eca-task.yaml +1 -1
- package/examples/adapters/drupal-flowdrop-mapping.yaml +1 -1
- package/examples/adapters/drupal-maestro-mapping.yaml +1 -1
- package/examples/adapters/mistral-agent.yaml +1 -1
- package/examples/adapters/symfony-messenger-task.yaml +1 -1
- package/examples/adapters/symfony-messenger-workflow.yaml +1 -1
- package/examples/adk-integration/code-review-workflow.yml +1 -1
- package/examples/adk-integration/customer-support.yml +1 -1
- package/examples/adk-integration/data-pipeline.yml +1 -1
- package/examples/advanced/reasoning-agent.yaml +1 -1
- package/examples/advanced/workflows/hybrid-model-strategy.yaml +1 -1
- package/examples/agent-manifests/critics/critic-agent.yaml +1 -1
- package/examples/agent-manifests/governors/governor-agent.yaml +1 -1
- package/examples/agent-manifests/integrators/integrator-agent.yaml +1 -1
- package/examples/agent-manifests/judges/judge-agent.yaml +1 -1
- package/examples/agent-manifests/monitors/monitor-agent.yaml +1 -1
- package/examples/agent-manifests/orchestrators/orchestrator-agent.yaml +1 -1
- package/examples/agent-manifests/sample-compliant-agent.yaml +1 -1
- package/examples/agent-manifests/workers/worker-agent.yaml +1 -1
- package/examples/agent-taxonomy-example.ossa.yaml +1 -1
- package/examples/agents/01-customer-support-bot/agent.ossa.yaml +1 -1
- package/examples/agents/02-code-review-agent/agent.ossa.yaml +1 -1
- package/examples/agents/03-data-analysis-agent/agent.ossa.yaml +1 -1
- package/examples/agents/04-content-moderator/agent.ossa.yaml +1 -1
- package/examples/agents/05-sales-assistant/agent.ossa.yaml +1 -1
- package/examples/agents/06-devops-agent/agent.ossa.yaml +1 -1
- package/examples/agents/07-research-assistant/agent.ossa.yaml +1 -1
- package/examples/agents/08-email-triage-agent/agent.ossa.yaml +1 -1
- package/examples/agents/09-security-scanner/agent.ossa.yaml +1 -1
- package/examples/agents/10-meeting-assistant/agent.ossa.yaml +1 -1
- package/examples/agents/architecture-healer-enterprise.yaml +1 -1
- package/examples/agents/dependency-healer-npm.yaml +1 -1
- package/examples/agents/spec-healer-openapi.yaml +1 -1
- package/examples/agents/wiki-healer-production.yaml +1 -1
- package/examples/agents-md/monorepo-agent.ossa.yaml +1 -1
- package/examples/agentscope/react-assistant/README.md +111 -0
- package/examples/agentscope/react-assistant/agent.ossa.yaml +132 -0
- package/examples/agentscope/react-assistant/skills/code-analysis/SKILL.md +18 -0
- package/examples/agentscope/react-assistant/skills/question-answering/SKILL.md +18 -0
- package/examples/autonomous-evolution/self-evolving-agent.ossa.yaml +1 -1
- package/examples/bridges/.gitlab-ci.yml +2 -2
- package/examples/build-once-use-everywhere/agent.ossa.yaml +1 -1
- package/examples/claude-code/code-reviewer.ossa.yaml +1 -1
- package/examples/claude-code/ossa-validator.ossa.yaml +1 -1
- package/examples/common_npm/agent-router.ossa.yaml +1 -1
- package/examples/contracts/data-consumer.ossa.yaml +1 -1
- package/examples/contracts/data-producer-v2.ossa.yaml +1 -1
- package/examples/contracts/data-producer.ossa.yaml +1 -1
- package/examples/drupal/QUICKSTART.md +17 -3
- package/examples/drupal/ai_agents_agentscope/README.md +62 -0
- package/examples/drupal/ai_agents_agentscope/ai_agents_agentscope.info.yml +13 -0
- package/examples/drupal/ai_agents_agentscope/ai_agents_agentscope.services.yml +4 -0
- package/examples/drupal/ai_agents_agentscope/config/install/ai_agents_agentscope.settings.yml +3 -0
- package/examples/drupal/ai_agents_agentscope/config/schema/ai_agents_agentscope.schema.yml +14 -0
- package/examples/drupal/ai_agents_agentscope/src/AgentScopeRuntime.php +11 -0
- package/examples/drupal/ai_agents_agentscope/src/Plugin/AiAgent/AgentScopeAgent.php +10 -0
- package/examples/drupal/ai_agents_agentscope/src/Plugin/AiProvider/AgentScopeProvider.php +217 -0
- package/examples/drupal/ai_agents_agentscope/src/Plugin/Derivative/AgentScopeDeriver.php +10 -0
- package/examples/drupal/ai_agents_agentscope/src/Service/AgentScopeAdapter.php +9 -0
- package/examples/drupal/content-moderator.ossa.yaml +1 -1
- package/examples/drupal/gitlab-ml-recommender.ossa.yaml +1 -1
- package/examples/export/langchain/production-agent-with-memory/agent.ossa.yaml +1 -1
- package/examples/export/langchain/production-agent-with-tools/agent.ossa.yaml +1 -1
- package/examples/extensions/agents-md-advanced.yml +1 -1
- package/examples/extensions/agents-md-basic.yml +1 -1
- package/examples/extensions/agents-md-sync.yml +1 -1
- package/examples/extensions/agents-md-v1.yml +1 -1
- package/examples/extensions/drupal-v1.yml +1 -1
- package/examples/extensions/encryption-multi-provider.yaml +4 -4
- package/examples/extensions/kagent-v1.yml +1 -1
- package/examples/extensions/knowledge-sources.yaml +1 -1
- package/examples/extensions/mcp-full-featured.yaml +1 -1
- package/examples/getting-started/01-minimal-agent.ossa.yaml +1 -1
- package/examples/getting-started/02-agent-with-tools.ossa.yaml +1 -1
- package/examples/getting-started/03-agent-with-safety.ossa.yaml +1 -1
- package/examples/getting-started/04-agent-with-messaging.ossa.yaml +1 -1
- package/examples/getting-started/05-workflow-composition.ossa.yaml +1 -1
- package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
- package/examples/gitlab-agents/daily-code-scan/.gitlab-ci.yml +2 -2
- package/examples/gitlab-agents/duo-comment-responder/.gitlab-ci.yml +2 -2
- package/examples/gitlab-agents/mr-reviewer/.gitlab-ci.yml +2 -2
- package/examples/gitlab-agents/pipeline-auto-fix/.gitlab-ci.yml +2 -2
- package/examples/gitlab-agents/pre-commit-quality-check/.gitlab-ci.yml +2 -2
- package/examples/gitlab-agents/pre-push-validation/.gitlab-ci.yml +2 -2
- package/examples/hierarchical-agent.ossa.yaml +1 -1
- package/examples/infrastructure/token-rotation/manifest.ossa.yaml +1 -1
- package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +1 -1
- package/examples/kagent/compliance-validator.ossa.yaml +1 -1
- package/examples/kagent/cost-optimizer.ossa.yaml +1 -1
- package/examples/kagent/documentation-agent.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter-v1.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter.ossa.yaml +1 -1
- package/examples/kagent/security-scanner.ossa.yaml +1 -1
- package/examples/knowledge-graph/drupal-agent-with-kg.ossa.yaml +1 -1
- package/examples/mcp/browser-puppeteer.ossa.yaml +1 -1
- package/examples/mcp/database-mcp.ossa.yaml +1 -1
- package/examples/mcp/filesystem-mcp.ossa.yaml +1 -1
- package/examples/messaging/dependency-healer.ossa.yaml +1 -1
- package/examples/messaging/incident-responder.ossa.yaml +1 -1
- package/examples/messaging/routing-rules.ossa.yaml +1 -1
- package/examples/messaging/security-scanner.ossa.yaml +1 -1
- package/examples/migration-guides/from-langchain-to-ossa.yaml +4 -4
- package/examples/migrations/langchain/01-python-react-agent-after.ossa.yaml +1 -1
- package/examples/migrations/langchain/02-typescript-conversational-after.ossa.yaml +1 -1
- package/examples/migrations/langchain/03-sequential-chain-after.ossa.yaml +1 -1
- package/examples/migrations/langchain/04-config-based-after.ossa.yaml +1 -1
- package/examples/migrations/swarm-to-ossa/after-handoffs.ossa.yaml +6 -6
- package/examples/migrations/swarm-to-ossa/after-triage-agent.ossa.yaml +3 -3
- package/examples/mr-reviewer-with-governance.ossa.yaml +1 -1
- package/examples/multi-agent/conditional-router.ossa.yaml +1 -1
- package/examples/multi-agent/parallel-execution.ossa.yaml +1 -1
- package/examples/multi-agent/sequential-pipeline.ossa.yaml +1 -1
- package/examples/multi-agent-research-workflow.ossa.yaml +1 -1
- package/examples/multi-platform/single-manifest/agent.ossa.yaml +1 -1
- package/examples/observability/activity-stream-full.yaml +1 -1
- package/examples/openai/basic-agent.ossa.yaml +1 -1
- package/examples/ossa-templates/01-code-assistant.ossa.yaml +1 -1
- package/examples/ossa-templates/02-security-scanner.ossa.yaml +1 -1
- package/examples/ossa-templates/03-ci-pipeline.ossa.yaml +1 -1
- package/examples/ossa-templates/04-code-reviewer.ossa.yaml +1 -1
- package/examples/ossa-templates/05-doc-generator.ossa.yaml +1 -1
- package/examples/ossa-templates/06-compliance-validator.ossa.yaml +1 -1
- package/examples/ossa-templates/07-workflow-orchestrator.ossa.yaml +1 -1
- package/examples/ossa-templates/08-content-writer.ossa.yaml +1 -1
- package/examples/ossa-templates/09-test-generator.ossa.yaml +1 -1
- package/examples/ossa-templates/10-data-transformer.ossa.yaml +1 -1
- package/examples/ossa-templates/11-react-performance-expert.ossa.yaml +1 -1
- package/examples/ossa-templates/12-typescript-type-safety-expert.ossa.yaml +1 -1
- package/examples/ossa-templates/13-accessibility-champion.ossa.yaml +1 -1
- package/examples/ossa-templates/14-security-hardening-agent.ossa.yaml +1 -1
- package/examples/pipeline-agent.ossa.yaml +1 -1
- package/examples/production/document-analyzer-openai.yml +1 -1
- package/examples/production-ready/01-customer-support-bot/agent.ossa.yaml +1 -1
- package/examples/production-ready/02-code-review-agent/agent.ossa.yaml +1 -1
- package/examples/production-ready/03-data-analysis-agent/agent.ossa.yaml +1 -1
- package/examples/production-ready/04-content-moderator/agent.ossa.yaml +1 -1
- package/examples/production-ready/05-sales-assistant/agent.ossa.yaml +1 -1
- package/examples/production-ready/06-devops-agent/agent.ossa.yaml +1 -1
- package/examples/production-ready/07-research-assistant/agent.ossa.yaml +1 -1
- package/examples/production-ready/08-email-triage-agent/agent.ossa.yaml +1 -1
- package/examples/production-ready/09-security-scanner/agent.ossa.yaml +1 -1
- package/examples/production-ready/10-meeting-assistant/agent.ossa.yaml +1 -1
- package/examples/quickstart/support-agent.ossa.yaml +1 -1
- package/examples/real-world/gitlab-cicd-optimizer.ossa.yaml +1 -1
- package/examples/real-world/rag-documentation-assistant.ossa.yaml +1 -1
- package/examples/registry/agents/code-reviewer/agent.yaml +1 -1
- package/examples/registry/agents/security-scanner/agent.yaml +1 -1
- package/examples/runtime-adapters/bedrock-claude-example.ossa.yaml +1 -1
- package/examples/schema/reusable-components.yaml +1 -1
- package/examples/showcase/ci-pipeline.ossa.yaml +1 -1
- package/examples/showcase/code-assistant.ossa.yaml +1 -1
- package/examples/showcase/code-reviewer.ossa.yaml +1 -1
- package/examples/showcase/compliance-checker.ossa.yaml +1 -1
- package/examples/showcase/compliance-validator.ossa.yaml +1 -1
- package/examples/showcase/content-writer.ossa.yaml +1 -1
- package/examples/showcase/customer-support.ossa.yaml +1 -1
- package/examples/showcase/data-processing-pipeline.ossa.yaml +1 -1
- package/examples/showcase/data-transformer.ossa.yaml +1 -1
- package/examples/showcase/doc-generator.ossa.yaml +1 -1
- package/examples/showcase/full-power-agent.ossa.yaml +1 -1
- package/examples/showcase/security-scanner-enhanced.ossa.yaml +1 -1
- package/examples/showcase/security-scanner.ossa.yaml +1 -1
- package/examples/showcase/team-leader.ossa.yaml +1 -1
- package/examples/showcase/test-generator.ossa.yaml +1 -1
- package/examples/showcase/workflow-orchestrator.ossa.yaml +1 -1
- package/examples/skills-example.ossa.yaml +1 -1
- package/examples/swarm-agent.ossa.yaml +1 -1
- package/examples/tasks/batch-email-sender.yaml +1 -1
- package/examples/tasks/data-transform.yaml +1 -1
- package/examples/tasks/publish-content.yaml +1 -1
- package/examples/team-agent.ossa.yaml +1 -1
- package/examples/templates/ossa-compliance.yaml +1 -1
- package/examples/unified/security-scanner.ossa.yaml +1 -1
- package/examples/workflows/batch-email-campaign.yaml +1 -1
- package/examples/workflows/content-review-publish.yaml +1 -1
- package/examples/workflows/simple-etl.yaml +1 -1
- package/package.json +6 -7
- package/spec/reference/reference-agents/compliance-auditor/manifest.ossa.yaml +1 -1
- package/spec/reference/reference-agents/doc-agent/manifest.ossa.yaml +1 -1
- package/spec/reference/reference-agents/mr-reviewer/manifest.ossa.yaml +1 -1
- package/spec/reference/reference-agents/ossa-validator-v0.3/manifest.ossa.yaml +1 -1
- package/spec/reference/reference-agents/pipeline-fixer/manifest.ossa.yaml +1 -1
- package/spec/reference/reference-agents/release-orchestrator/manifest.ossa.yaml +1 -1
- package/spec/v0.4/agent-card.schema.json +1 -1
- package/spec/v0.4/agent.schema.json +84 -15
- package/spec/v0.4/extensions/a2a/a2a.schema.json +1 -1
- package/spec/v0.4/extensions/ag2/ag2.schema.json +1 -1
- package/spec/v0.4/extensions/crewai/crewai.schema.json +1 -1
- package/spec/v0.4/extensions/kagent/kagent.schema.json +1 -1
- package/spec/v0.4/extensions/langchain/langchain.schema.json +1 -1
- package/spec/v0.4/extensions/langgraph/langgraph.schema.json +1 -1
- package/spec/v0.4/extensions/mcp/mcp.schema.json +1 -1
- package/templates/agent-types/claude-agent.ossa.yaml +1 -1
- package/templates/agent-types/kagent.ossa.yaml +1 -1
- package/templates/agent-types/langchain-agent.ossa.yaml +1 -1
- package/templates/agent-types/openapi-agent.ossa.yaml +1 -1
- package/templates/agent-types/swarm-agents.ossa.yaml +1 -1
- package/templates/ci-cd/gitlab-ci.deploy.yml +2 -2
- package/templates/validators/capability-compatibility.ossa.yaml +1 -1
- package/templates/validators/coordination-consistency.ossa.yaml +1 -1
- package/templates/validators/pattern-requirements.ossa.yaml +1 -1
- package/templates/validators/transport-compatibility.ossa.yaml +1 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge Request CRUD Service
|
|
3
|
+
* Implements full CRUD operations for merge requests
|
|
4
|
+
*/
|
|
5
|
+
import { Gitlab } from '@gitbeaker/rest';
|
|
6
|
+
import { MergeRequestSchema, CreateMergeRequestRequestSchema, UpdateMergeRequestRequestSchema, } from './schemas/release.schema.js';
|
|
7
|
+
import { BaseCrudService } from './base-crud.service.js';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
/**
|
|
10
|
+
* Merge Request Filter Input
|
|
11
|
+
*/
|
|
12
|
+
const MergeRequestFilterSchema = z.object({
|
|
13
|
+
state: z.enum(['opened', 'closed', 'merged', 'locked']).optional(),
|
|
14
|
+
page: z.number().int().positive().default(1),
|
|
15
|
+
perPage: z.number().int().positive().min(1).max(100).default(20),
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Merge Request Service - CRUD operations
|
|
19
|
+
*/
|
|
20
|
+
export class MergeRequestService extends BaseCrudService {
|
|
21
|
+
createSchema = CreateMergeRequestRequestSchema;
|
|
22
|
+
updateSchema = UpdateMergeRequestRequestSchema;
|
|
23
|
+
filterSchema = MergeRequestFilterSchema;
|
|
24
|
+
entitySchema = MergeRequestSchema;
|
|
25
|
+
gitlab;
|
|
26
|
+
projectId;
|
|
27
|
+
constructor(gitlabToken, projectId = process.env.CI_PROJECT_ID || '') {
|
|
28
|
+
super();
|
|
29
|
+
this.gitlab = new Gitlab({ token: gitlabToken });
|
|
30
|
+
this.projectId = projectId;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a new merge request
|
|
34
|
+
*/
|
|
35
|
+
async create(input) {
|
|
36
|
+
try {
|
|
37
|
+
const validated = this.validateCreate(input);
|
|
38
|
+
const mr = await this.gitlab.MergeRequests.create(this.projectId, validated.sourceBranch, validated.targetBranch, validated.title, {
|
|
39
|
+
description: validated.description,
|
|
40
|
+
labels: validated.labels.join(','),
|
|
41
|
+
milestoneId: validated.milestoneId,
|
|
42
|
+
});
|
|
43
|
+
const approvals = await this.getApprovals(mr.iid);
|
|
44
|
+
const result = {
|
|
45
|
+
id: mr.iid,
|
|
46
|
+
title: String(mr.title),
|
|
47
|
+
description: String(mr.description || ''),
|
|
48
|
+
sourceBranch: String(mr.sourceBranch),
|
|
49
|
+
targetBranch: String(mr.targetBranch),
|
|
50
|
+
state: mr.state,
|
|
51
|
+
mergeStatus: mr.mergeStatus,
|
|
52
|
+
createdAt: String(mr.createdAt),
|
|
53
|
+
updatedAt: String(mr.updatedAt),
|
|
54
|
+
mergedAt: mr.mergedAt ? String(mr.mergedAt) : null,
|
|
55
|
+
labels: Array.isArray(mr.labels)
|
|
56
|
+
? mr.labels.map((l) => typeof l === 'string' ? l : String(l))
|
|
57
|
+
: [],
|
|
58
|
+
approvals,
|
|
59
|
+
};
|
|
60
|
+
return this.validateEntity(result);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
this.handleValidationError(error);
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Read merge request by ID
|
|
69
|
+
*/
|
|
70
|
+
async read(id) {
|
|
71
|
+
this.validateId(id);
|
|
72
|
+
try {
|
|
73
|
+
const mr = await this.gitlab.MergeRequests.show(this.projectId, Number(id));
|
|
74
|
+
const approvals = await this.getApprovals(mr.iid);
|
|
75
|
+
const result = {
|
|
76
|
+
id: mr.iid,
|
|
77
|
+
title: String(mr.title),
|
|
78
|
+
description: String(mr.description || ''),
|
|
79
|
+
sourceBranch: String(mr.sourceBranch),
|
|
80
|
+
targetBranch: String(mr.targetBranch),
|
|
81
|
+
state: mr.state,
|
|
82
|
+
mergeStatus: mr.mergeStatus,
|
|
83
|
+
createdAt: String(mr.createdAt),
|
|
84
|
+
updatedAt: String(mr.updatedAt),
|
|
85
|
+
mergedAt: mr.mergedAt ? String(mr.mergedAt) : null,
|
|
86
|
+
labels: Array.isArray(mr.labels)
|
|
87
|
+
? mr.labels.map((l) => typeof l === 'string' ? l : String(l))
|
|
88
|
+
: [],
|
|
89
|
+
approvals,
|
|
90
|
+
};
|
|
91
|
+
return this.validateEntity(result);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (error &&
|
|
95
|
+
typeof error === 'object' &&
|
|
96
|
+
'response' in error &&
|
|
97
|
+
error.response.status === 404) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Update merge request
|
|
105
|
+
*/
|
|
106
|
+
async update(id, input) {
|
|
107
|
+
this.validateId(id);
|
|
108
|
+
const validated = this.validateUpdate(input);
|
|
109
|
+
const existing = await this.read(id);
|
|
110
|
+
if (!existing) {
|
|
111
|
+
this.throwNotFound('MergeRequest', id);
|
|
112
|
+
}
|
|
113
|
+
const updated = await this.gitlab.MergeRequests.edit(this.projectId, Number(id), {
|
|
114
|
+
title: validated.title,
|
|
115
|
+
description: validated.description,
|
|
116
|
+
stateEvent: validated.state,
|
|
117
|
+
labels: validated.labels?.join(','),
|
|
118
|
+
});
|
|
119
|
+
const approvals = await this.getApprovals(updated.iid);
|
|
120
|
+
const result = {
|
|
121
|
+
id: updated.iid,
|
|
122
|
+
title: String(updated.title),
|
|
123
|
+
description: String(updated.description || ''),
|
|
124
|
+
sourceBranch: String(updated.sourceBranch),
|
|
125
|
+
targetBranch: String(updated.targetBranch),
|
|
126
|
+
state: updated.state,
|
|
127
|
+
mergeStatus: updated.mergeStatus,
|
|
128
|
+
createdAt: String(updated.createdAt),
|
|
129
|
+
updatedAt: String(updated.updatedAt),
|
|
130
|
+
mergedAt: updated.mergedAt ? String(updated.mergedAt) : null,
|
|
131
|
+
labels: Array.isArray(updated.labels)
|
|
132
|
+
? updated.labels.map((l) => typeof l === 'string' ? l : String(l))
|
|
133
|
+
: [],
|
|
134
|
+
approvals,
|
|
135
|
+
};
|
|
136
|
+
return this.validateEntity(result);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Delete merge request
|
|
140
|
+
*/
|
|
141
|
+
async delete(id) {
|
|
142
|
+
this.validateId(id);
|
|
143
|
+
const existing = await this.read(id);
|
|
144
|
+
if (!existing) {
|
|
145
|
+
this.throwNotFound('MergeRequest', id);
|
|
146
|
+
}
|
|
147
|
+
await this.gitlab.MergeRequests.remove(this.projectId, Number(id));
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* List merge requests with filtering and pagination
|
|
151
|
+
*/
|
|
152
|
+
async list(filters) {
|
|
153
|
+
const validatedFilters = this.validateFilter(filters || {});
|
|
154
|
+
try {
|
|
155
|
+
const mrs = await this.gitlab.MergeRequests.all({
|
|
156
|
+
projectId: this.projectId,
|
|
157
|
+
state: validatedFilters.state,
|
|
158
|
+
perPage: validatedFilters.perPage,
|
|
159
|
+
page: validatedFilters.page,
|
|
160
|
+
});
|
|
161
|
+
const items = await Promise.all(mrs.map(async (mr) => {
|
|
162
|
+
const approvals = await this.getApprovals(mr.iid);
|
|
163
|
+
return this.validateEntity({
|
|
164
|
+
id: mr.iid,
|
|
165
|
+
title: String(mr.title),
|
|
166
|
+
description: String(mr.description || ''),
|
|
167
|
+
sourceBranch: String(mr.sourceBranch),
|
|
168
|
+
targetBranch: String(mr.targetBranch),
|
|
169
|
+
state: mr.state,
|
|
170
|
+
mergeStatus: mr.mergeStatus,
|
|
171
|
+
createdAt: String(mr.createdAt),
|
|
172
|
+
updatedAt: String(mr.updatedAt),
|
|
173
|
+
mergedAt: mr.mergedAt ? String(mr.mergedAt) : null,
|
|
174
|
+
labels: Array.isArray(mr.labels)
|
|
175
|
+
? mr.labels.map((l) => typeof l === 'string' ? l : String(l))
|
|
176
|
+
: [],
|
|
177
|
+
approvals,
|
|
178
|
+
});
|
|
179
|
+
}));
|
|
180
|
+
// Note: GitLab API doesn't always return total
|
|
181
|
+
const total = items.length >= validatedFilters.perPage
|
|
182
|
+
? items.length + validatedFilters.perPage
|
|
183
|
+
: items.length;
|
|
184
|
+
return {
|
|
185
|
+
items,
|
|
186
|
+
pagination: this.calculatePagination(total, validatedFilters.page, validatedFilters.perPage),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
throw new Error(`Failed to list merge requests: ${error}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Helper: Get merge request approvals
|
|
195
|
+
*/
|
|
196
|
+
async getApprovals(mrId) {
|
|
197
|
+
try {
|
|
198
|
+
const mr = await this.gitlab.MergeRequests.show(this.projectId, mrId);
|
|
199
|
+
// GitLab API may include approval info in MR object
|
|
200
|
+
const approvalsRequired = mr.approvalsRequired || 0;
|
|
201
|
+
const approvalsLeft = mr.approvalsLeft || 0;
|
|
202
|
+
return {
|
|
203
|
+
required: approvalsRequired,
|
|
204
|
+
received: approvalsRequired - approvalsLeft,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return { required: 0, received: 0 };
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=merge-request.service.js.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milestone CRUD Service
|
|
3
|
+
* Implements full CRUD operations for milestones
|
|
4
|
+
*/
|
|
5
|
+
import { type Milestone, type CreateMilestoneRequest, type UpdateMilestoneRequest } from './schemas/release.schema.js';
|
|
6
|
+
import { BaseCrudService } from './base-crud.service.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Milestone Filter Input
|
|
10
|
+
*/
|
|
11
|
+
declare const MilestoneFilterSchema: z.ZodObject<{
|
|
12
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
active: "active";
|
|
14
|
+
closed: "closed";
|
|
15
|
+
}>>;
|
|
16
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
perPage: z.ZodDefault<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
type MilestoneFilter = z.infer<typeof MilestoneFilterSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* Milestone Service - CRUD operations
|
|
22
|
+
*/
|
|
23
|
+
export declare class MilestoneService extends BaseCrudService<Milestone, CreateMilestoneRequest, UpdateMilestoneRequest, MilestoneFilter> {
|
|
24
|
+
protected createSchema: z.ZodObject<{
|
|
25
|
+
title: z.ZodString;
|
|
26
|
+
description: z.ZodOptional<z.ZodString>;
|
|
27
|
+
dueDate: z.ZodOptional<z.ZodString>;
|
|
28
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
protected updateSchema: z.ZodObject<{
|
|
31
|
+
title: z.ZodOptional<z.ZodString>;
|
|
32
|
+
description: z.ZodOptional<z.ZodString>;
|
|
33
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
34
|
+
active: "active";
|
|
35
|
+
closed: "closed";
|
|
36
|
+
}>>;
|
|
37
|
+
dueDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
protected filterSchema: z.ZodObject<{
|
|
41
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
active: "active";
|
|
43
|
+
closed: "closed";
|
|
44
|
+
}>>;
|
|
45
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
46
|
+
perPage: z.ZodDefault<z.ZodNumber>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
protected entitySchema: z.ZodObject<{
|
|
49
|
+
id: z.ZodNumber;
|
|
50
|
+
title: z.ZodString;
|
|
51
|
+
description: z.ZodOptional<z.ZodString>;
|
|
52
|
+
state: z.ZodEnum<{
|
|
53
|
+
active: "active";
|
|
54
|
+
closed: "closed";
|
|
55
|
+
}>;
|
|
56
|
+
dueDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
|
+
startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
+
createdAt: z.ZodString;
|
|
59
|
+
updatedAt: z.ZodString;
|
|
60
|
+
statistics: z.ZodDefault<z.ZodObject<{
|
|
61
|
+
totalIssues: z.ZodDefault<z.ZodNumber>;
|
|
62
|
+
closedIssues: z.ZodDefault<z.ZodNumber>;
|
|
63
|
+
openIssues: z.ZodDefault<z.ZodNumber>;
|
|
64
|
+
completionPercentage: z.ZodDefault<z.ZodNumber>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
private gitlab;
|
|
68
|
+
private projectId;
|
|
69
|
+
constructor(gitlabToken: string, projectId?: string | number);
|
|
70
|
+
/**
|
|
71
|
+
* Create a new milestone
|
|
72
|
+
*/
|
|
73
|
+
create(input: CreateMilestoneRequest): Promise<Milestone>;
|
|
74
|
+
/**
|
|
75
|
+
* Read milestone by ID
|
|
76
|
+
*/
|
|
77
|
+
read(id: string | number): Promise<Milestone | null>;
|
|
78
|
+
/**
|
|
79
|
+
* Update milestone
|
|
80
|
+
*/
|
|
81
|
+
update(id: string | number, input: UpdateMilestoneRequest): Promise<Milestone>;
|
|
82
|
+
/**
|
|
83
|
+
* Delete milestone
|
|
84
|
+
*/
|
|
85
|
+
delete(id: string | number): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* List milestones with filtering and pagination
|
|
88
|
+
*/
|
|
89
|
+
list(filters?: MilestoneFilter): Promise<{
|
|
90
|
+
items: Milestone[];
|
|
91
|
+
pagination: {
|
|
92
|
+
page: number;
|
|
93
|
+
perPage: number;
|
|
94
|
+
total: number;
|
|
95
|
+
totalPages: number;
|
|
96
|
+
};
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Helper: Get milestone statistics
|
|
100
|
+
*/
|
|
101
|
+
private getMilestoneStatistics;
|
|
102
|
+
}
|
|
103
|
+
export {};
|
|
104
|
+
//# sourceMappingURL=milestone.service.d.ts.map
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milestone CRUD Service
|
|
3
|
+
* Implements full CRUD operations for milestones
|
|
4
|
+
*/
|
|
5
|
+
import { Gitlab } from '@gitbeaker/rest';
|
|
6
|
+
import { MilestoneSchema, CreateMilestoneRequestSchema, UpdateMilestoneRequestSchema, } from './schemas/release.schema.js';
|
|
7
|
+
import { BaseCrudService } from './base-crud.service.js';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
/**
|
|
10
|
+
* Milestone Filter Input
|
|
11
|
+
*/
|
|
12
|
+
const MilestoneFilterSchema = z.object({
|
|
13
|
+
state: z.enum(['active', 'closed']).optional(),
|
|
14
|
+
page: z.number().int().positive().default(1),
|
|
15
|
+
perPage: z.number().int().positive().min(1).max(100).default(20),
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Milestone Service - CRUD operations
|
|
19
|
+
*/
|
|
20
|
+
export class MilestoneService extends BaseCrudService {
|
|
21
|
+
createSchema = CreateMilestoneRequestSchema;
|
|
22
|
+
updateSchema = UpdateMilestoneRequestSchema;
|
|
23
|
+
filterSchema = MilestoneFilterSchema;
|
|
24
|
+
entitySchema = MilestoneSchema;
|
|
25
|
+
gitlab;
|
|
26
|
+
projectId;
|
|
27
|
+
constructor(gitlabToken, projectId = process.env.CI_PROJECT_ID || '') {
|
|
28
|
+
super();
|
|
29
|
+
this.gitlab = new Gitlab({ token: gitlabToken });
|
|
30
|
+
this.projectId = projectId;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a new milestone
|
|
34
|
+
*/
|
|
35
|
+
async create(input) {
|
|
36
|
+
try {
|
|
37
|
+
const validated = this.validateCreate(input);
|
|
38
|
+
const milestone = await this.gitlab.ProjectMilestones.create(this.projectId, validated.title, {
|
|
39
|
+
description: validated.description,
|
|
40
|
+
dueDate: validated.dueDate,
|
|
41
|
+
startDate: validated.startDate,
|
|
42
|
+
});
|
|
43
|
+
const statistics = await this.getMilestoneStatistics(milestone.id);
|
|
44
|
+
const result = {
|
|
45
|
+
id: milestone.id,
|
|
46
|
+
title: String(milestone.title),
|
|
47
|
+
description: String(milestone.description || ''),
|
|
48
|
+
state: milestone.state,
|
|
49
|
+
dueDate: milestone.dueDate ? String(milestone.dueDate) : null,
|
|
50
|
+
startDate: milestone.startDate ? String(milestone.startDate) : null,
|
|
51
|
+
createdAt: String(milestone.createdAt),
|
|
52
|
+
updatedAt: String(milestone.updatedAt),
|
|
53
|
+
statistics,
|
|
54
|
+
};
|
|
55
|
+
return this.validateEntity(result);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
this.handleValidationError(error);
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Read milestone by ID
|
|
64
|
+
*/
|
|
65
|
+
async read(id) {
|
|
66
|
+
this.validateId(id);
|
|
67
|
+
try {
|
|
68
|
+
const milestone = await this.gitlab.ProjectMilestones.show(this.projectId, Number(id));
|
|
69
|
+
const statistics = await this.getMilestoneStatistics(milestone.id);
|
|
70
|
+
const result = {
|
|
71
|
+
id: milestone.id,
|
|
72
|
+
title: String(milestone.title),
|
|
73
|
+
description: String(milestone.description || ''),
|
|
74
|
+
state: milestone.state,
|
|
75
|
+
dueDate: milestone.dueDate ? String(milestone.dueDate) : null,
|
|
76
|
+
startDate: milestone.startDate ? String(milestone.startDate) : null,
|
|
77
|
+
createdAt: String(milestone.createdAt),
|
|
78
|
+
updatedAt: String(milestone.updatedAt),
|
|
79
|
+
statistics,
|
|
80
|
+
};
|
|
81
|
+
return this.validateEntity(result);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (error &&
|
|
85
|
+
typeof error === 'object' &&
|
|
86
|
+
'response' in error &&
|
|
87
|
+
error.response.status === 404) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Update milestone
|
|
95
|
+
*/
|
|
96
|
+
async update(id, input) {
|
|
97
|
+
this.validateId(id);
|
|
98
|
+
const validated = this.validateUpdate(input);
|
|
99
|
+
const existing = await this.read(id);
|
|
100
|
+
if (!existing) {
|
|
101
|
+
this.throwNotFound('Milestone', id);
|
|
102
|
+
}
|
|
103
|
+
const updateParams = {};
|
|
104
|
+
if (validated.title)
|
|
105
|
+
updateParams.title = validated.title;
|
|
106
|
+
if (validated.description)
|
|
107
|
+
updateParams.description = validated.description;
|
|
108
|
+
if (validated.state === 'closed')
|
|
109
|
+
updateParams.stateEvent = 'close';
|
|
110
|
+
if (validated.state === 'active')
|
|
111
|
+
updateParams.stateEvent = 'activate';
|
|
112
|
+
if (validated.dueDate)
|
|
113
|
+
updateParams.dueDate = validated.dueDate;
|
|
114
|
+
if (validated.startDate)
|
|
115
|
+
updateParams.startDate = validated.startDate;
|
|
116
|
+
const updated = await this.gitlab.ProjectMilestones.edit(this.projectId, Number(id), updateParams);
|
|
117
|
+
const statistics = await this.getMilestoneStatistics(updated.id);
|
|
118
|
+
const result = {
|
|
119
|
+
id: updated.id,
|
|
120
|
+
title: String(updated.title),
|
|
121
|
+
description: String(updated.description || ''),
|
|
122
|
+
state: updated.state,
|
|
123
|
+
dueDate: updated.dueDate ? String(updated.dueDate) : null,
|
|
124
|
+
startDate: updated.startDate ? String(updated.startDate) : null,
|
|
125
|
+
createdAt: String(updated.createdAt),
|
|
126
|
+
updatedAt: String(updated.updatedAt),
|
|
127
|
+
statistics,
|
|
128
|
+
};
|
|
129
|
+
return this.validateEntity(result);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Delete milestone
|
|
133
|
+
*/
|
|
134
|
+
async delete(id) {
|
|
135
|
+
this.validateId(id);
|
|
136
|
+
const existing = await this.read(id);
|
|
137
|
+
if (!existing) {
|
|
138
|
+
this.throwNotFound('Milestone', id);
|
|
139
|
+
}
|
|
140
|
+
await this.gitlab.ProjectMilestones.remove(this.projectId, Number(id));
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* List milestones with filtering and pagination
|
|
144
|
+
*/
|
|
145
|
+
async list(filters) {
|
|
146
|
+
const validatedFilters = this.validateFilter(filters || {});
|
|
147
|
+
try {
|
|
148
|
+
const milestones = await this.gitlab.ProjectMilestones.all(this.projectId, {
|
|
149
|
+
state: validatedFilters.state,
|
|
150
|
+
perPage: validatedFilters.perPage,
|
|
151
|
+
page: validatedFilters.page,
|
|
152
|
+
});
|
|
153
|
+
const items = await Promise.all(milestones.map(async (m) => {
|
|
154
|
+
const statistics = await this.getMilestoneStatistics(m.id);
|
|
155
|
+
return this.validateEntity({
|
|
156
|
+
id: m.id,
|
|
157
|
+
title: m.title,
|
|
158
|
+
description: m.description || '',
|
|
159
|
+
state: m.state,
|
|
160
|
+
dueDate: m.dueDate || null,
|
|
161
|
+
startDate: m.startDate || null,
|
|
162
|
+
createdAt: m.createdAt,
|
|
163
|
+
updatedAt: m.updatedAt,
|
|
164
|
+
statistics,
|
|
165
|
+
});
|
|
166
|
+
}));
|
|
167
|
+
// Note: GitLab API doesn't always return total, so we estimate
|
|
168
|
+
const total = items.length >= validatedFilters.perPage
|
|
169
|
+
? items.length + validatedFilters.perPage
|
|
170
|
+
: items.length;
|
|
171
|
+
return {
|
|
172
|
+
items,
|
|
173
|
+
pagination: this.calculatePagination(total, validatedFilters.page, validatedFilters.perPage),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
throw new Error(`Failed to list milestones: ${error}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Helper: Get milestone statistics
|
|
182
|
+
*/
|
|
183
|
+
async getMilestoneStatistics(milestoneId) {
|
|
184
|
+
try {
|
|
185
|
+
const milestone = await this.gitlab.ProjectMilestones.show(this.projectId, milestoneId);
|
|
186
|
+
const totalIssues = milestone.totalIssuesCount || 0;
|
|
187
|
+
const closedIssues = milestone.closedIssuesCount || 0;
|
|
188
|
+
const openIssues = totalIssues - closedIssues;
|
|
189
|
+
const completionPercentage = totalIssues > 0 ? (closedIssues / totalIssues) * 100 : 0;
|
|
190
|
+
return {
|
|
191
|
+
totalIssues: Number(totalIssues),
|
|
192
|
+
closedIssues: Number(closedIssues),
|
|
193
|
+
openIssues: Number(openIssues),
|
|
194
|
+
completionPercentage: Math.round(completionPercentage * 100) / 100,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
return {
|
|
199
|
+
totalIssues: 0,
|
|
200
|
+
closedIssues: 0,
|
|
201
|
+
openIssues: 0,
|
|
202
|
+
completionPercentage: 0,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=milestone.service.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release Agent Service
|
|
3
|
+
*
|
|
4
|
+
* Agent-based release automation integrating semantic-release and Keep a Changelog.
|
|
5
|
+
* FOLLOWS DRY: Single source of truth - OpenAPI spec drives types.
|
|
6
|
+
* FOLLOWS API-FIRST: OpenAPI spec defined FIRST, then implementation.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
declare const ReleaseAnalysisRequestSchema: z.ZodObject<{
|
|
10
|
+
branch: z.ZodString;
|
|
11
|
+
fromTag: z.ZodOptional<z.ZodString>;
|
|
12
|
+
toCommit: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
13
|
+
dryRun: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export interface ReleaseAnalysisResult {
|
|
16
|
+
releaseNeeded: boolean;
|
|
17
|
+
releaseType?: 'major' | 'minor' | 'patch' | 'prerelease';
|
|
18
|
+
currentVersion: string;
|
|
19
|
+
nextVersion?: string;
|
|
20
|
+
commits: Array<{
|
|
21
|
+
hash: string;
|
|
22
|
+
type: string;
|
|
23
|
+
scope?: string;
|
|
24
|
+
subject: string;
|
|
25
|
+
breaking: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export declare class ReleaseAgentService {
|
|
29
|
+
private rootDir;
|
|
30
|
+
constructor(rootDir?: string);
|
|
31
|
+
analyzeRelease(request: z.infer<typeof ReleaseAnalysisRequestSchema>): Promise<ReleaseAnalysisResult>;
|
|
32
|
+
validateChangelog(changelogPath?: string): Promise<{
|
|
33
|
+
valid: boolean;
|
|
34
|
+
errors: string[];
|
|
35
|
+
warnings: string[];
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=release-agent.service.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release Agent Service
|
|
3
|
+
*
|
|
4
|
+
* Agent-based release automation integrating semantic-release and Keep a Changelog.
|
|
5
|
+
* FOLLOWS DRY: Single source of truth - OpenAPI spec drives types.
|
|
6
|
+
* FOLLOWS API-FIRST: OpenAPI spec defined FIRST, then implementation.
|
|
7
|
+
*/
|
|
8
|
+
import { execSync } from 'child_process';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { getVersion } from '../../utils/version.js';
|
|
11
|
+
const ReleaseAnalysisRequestSchema = z.object({
|
|
12
|
+
branch: z.string().min(1),
|
|
13
|
+
fromTag: z.string().optional(),
|
|
14
|
+
toCommit: z.string().optional().default('HEAD'),
|
|
15
|
+
dryRun: z.boolean().optional().default(false),
|
|
16
|
+
});
|
|
17
|
+
export class ReleaseAgentService {
|
|
18
|
+
rootDir;
|
|
19
|
+
constructor(rootDir = process.cwd()) {
|
|
20
|
+
this.rootDir = rootDir;
|
|
21
|
+
}
|
|
22
|
+
async analyzeRelease(request) {
|
|
23
|
+
return {
|
|
24
|
+
releaseNeeded: false,
|
|
25
|
+
currentVersion: getVersion(),
|
|
26
|
+
commits: [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
async validateChangelog(changelogPath = 'CHANGELOG.md') {
|
|
30
|
+
try {
|
|
31
|
+
execSync(`npx keep-a-changelog validate ${changelogPath} --url https://github.com/blueflyio/openstandardagents`, { encoding: 'utf-8', cwd: this.rootDir });
|
|
32
|
+
return { valid: true, errors: [], warnings: [] };
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return {
|
|
36
|
+
valid: false,
|
|
37
|
+
errors: [String(error) || 'Changelog validation failed'],
|
|
38
|
+
warnings: [],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=release-agent.service.js.map
|