Skip to main content
Glama
yjiace

AlibabaCloud DevOps MCP Server

by yjiace
sprint.ts3.43 kB
import { z } from "zod"; import { yunxiaoRequest, buildUrl } from "../../common/utils.js"; import { SprintInfoSchema } from "./types.js"; // Create Sprint Response Schema const CreateSprintResponseSchema = z.object({ id: z.string().describe("Created sprint ID"), }); export async function getSprintFunc( organizationId: string, projectId: string, id: string ): Promise<z.infer<typeof SprintInfoSchema>> { const url = `/oapi/v1/projex/organizations/${organizationId}/projects/${projectId}/sprints/${id}`; const response = await yunxiaoRequest(url, { method: "GET", }); return SprintInfoSchema.parse(response); } export async function listSprintsFunc( organizationId: string, id: string, status?: string[], page?: number, perPage?: number ): Promise<z.infer<typeof SprintInfoSchema>[]> { const baseUrl = `/oapi/v1/projex/organizations/${organizationId}/projects/${id}/sprints`; const queryParams: Record<string, string | number | undefined> = {}; if (status !== undefined && status.length > 0) { queryParams.status = status.join(','); } if (page !== undefined) { queryParams.page = page; } if (perPage !== undefined) { queryParams.perPage = perPage; } const url = buildUrl(baseUrl, queryParams); const response = await yunxiaoRequest(url, { method: "GET", }); if (!Array.isArray(response)) { return []; } return response.map(sprint => SprintInfoSchema.parse(sprint)); } export async function createSprintFunc( organizationId: string, projectId: string, name: string, owners: string[], startDate?: string, endDate?: string, description?: string, capacityHours?: number, operatorId?: string ): Promise<{ id: string }> { const url = `/oapi/v1/projex/organizations/${organizationId}/projects/${projectId}/sprints`; const requestBody: Record<string, any> = { name, owners, }; if (startDate !== undefined) { requestBody.startDate = startDate; } if (endDate !== undefined) { requestBody.endDate = endDate; } if (description !== undefined) { requestBody.description = description; } if (capacityHours !== undefined) { requestBody.capacityHours = capacityHours; } if (operatorId !== undefined) { requestBody.operatorId = operatorId; } const response = await yunxiaoRequest(url, { method: "POST", body: requestBody, }); return CreateSprintResponseSchema.parse(response); } export async function updateSprintFunc( organizationId: string, projectId: string, id: string, name: string, owners?: string[], startDate?: string, endDate?: string, description?: string, capacityHours?: number, operatorId?: string ): Promise<void> { const url = `/oapi/v1/projex/organizations/${organizationId}/projects/${projectId}/sprints/${id}`; const requestBody: Record<string, any> = { name, }; if (owners !== undefined) { requestBody.owners = owners; } if (startDate !== undefined) { requestBody.startDate = startDate; } if (endDate !== undefined) { requestBody.endDate = endDate; } if (description !== undefined) { requestBody.description = description; } if (capacityHours !== undefined) { requestBody.capacityHours = capacityHours; } if (operatorId !== undefined) { requestBody.operatorId = operatorId; } await yunxiaoRequest(url, { method: "PUT", body: requestBody, }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yjiace/alibabacloud-devops-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server