101 lines
4.8 KiB
JavaScript
101 lines
4.8 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.PaginatedTasksResponseSchema = exports.TaskResponseSchema = exports.TaskQuerySchema = exports.ApplyTemplateSchema = exports.CreateTemplateFromTaskSchema = exports.DuplicateTaskSchema = exports.BulkDeleteTasksSchema = exports.BulkUpdateTasksSchema = exports.BulkCreateTasksSchema = exports.UpdateTaskSchema = exports.CreateTaskSchema = exports.TaskBaseSchema = exports.TaskComplexitySchema = exports.TaskTypeSchema = exports.TaskPrioritySchema = void 0;
|
|
const zod_1 = require("zod");
|
|
// Enum schemas
|
|
exports.TaskPrioritySchema = zod_1.z.enum(['lowest', 'low', 'medium', 'high', 'highest']);
|
|
exports.TaskTypeSchema = zod_1.z.enum(['feature', 'bug', 'enhancement', 'research', 'maintenance']);
|
|
exports.TaskComplexitySchema = zod_1.z.enum(['trivial', 'minor', 'major', 'critical']);
|
|
// Base task schema
|
|
exports.TaskBaseSchema = zod_1.z.object({
|
|
title: zod_1.z.string().min(1).max(255),
|
|
description: zod_1.z.string().optional(),
|
|
status: zod_1.z.string().uuid().optional(),
|
|
priority: exports.TaskPrioritySchema.default('medium'),
|
|
task_type: exports.TaskTypeSchema.optional(),
|
|
complexity: exports.TaskComplexitySchema.optional(),
|
|
story_points: zod_1.z.number().int().min(1).max(21).optional(),
|
|
project: zod_1.z.string().uuid(),
|
|
parent_task: zod_1.z.string().uuid().optional(),
|
|
epic: zod_1.z.string().uuid().optional(),
|
|
assigned_to: zod_1.z.string().uuid().optional(),
|
|
ai_agent_assigned: zod_1.z.string().max(255).optional(),
|
|
reviewer: zod_1.z.string().uuid().optional(),
|
|
estimated_hours: zod_1.z.number().positive().optional(),
|
|
progress_percentage: zod_1.z.number().int().min(0).max(100).default(0),
|
|
start_date: zod_1.z.string().optional(),
|
|
due_date: zod_1.z.string().optional(),
|
|
task_master_id: zod_1.z.string().max(255).optional(),
|
|
github_issue_url: zod_1.z.string().url().optional(),
|
|
bmad_story_id: zod_1.z.string().max(255).optional(),
|
|
external_refs: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
ai_generated: zod_1.z.boolean().default(false),
|
|
ai_context: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
auto_status_updates: zod_1.z.boolean().default(false),
|
|
acceptance_criteria: zod_1.z.string().optional(),
|
|
definition_of_done: zod_1.z.string().optional(),
|
|
notes: zod_1.z.string().optional(),
|
|
});
|
|
// Create task schema
|
|
exports.CreateTaskSchema = exports.TaskBaseSchema;
|
|
// Update task schema (all fields optional)
|
|
exports.UpdateTaskSchema = exports.TaskBaseSchema.partial();
|
|
// Bulk operation schemas
|
|
exports.BulkCreateTasksSchema = zod_1.z.object({
|
|
tasks: zod_1.z.array(exports.CreateTaskSchema).min(1).max(100),
|
|
});
|
|
exports.BulkUpdateTasksSchema = zod_1.z.object({
|
|
ids: zod_1.z.array(zod_1.z.string().uuid()).min(1).max(100),
|
|
updates: exports.UpdateTaskSchema,
|
|
});
|
|
exports.BulkDeleteTasksSchema = zod_1.z.object({
|
|
ids: zod_1.z.array(zod_1.z.string().uuid()).min(1).max(100),
|
|
});
|
|
// Task duplication schema
|
|
exports.DuplicateTaskSchema = zod_1.z.object({
|
|
taskId: zod_1.z.string().uuid(),
|
|
includeSubtasks: zod_1.z.boolean().default(false),
|
|
includeAttachments: zod_1.z.boolean().default(false),
|
|
includeComments: zod_1.z.boolean().default(false),
|
|
overrides: exports.UpdateTaskSchema.optional(),
|
|
});
|
|
// Task template schemas
|
|
exports.CreateTemplateFromTaskSchema = zod_1.z.object({
|
|
taskId: zod_1.z.string().uuid(),
|
|
templateName: zod_1.z.string().min(1).max(255),
|
|
templateDescription: zod_1.z.string().optional(),
|
|
excludeFields: zod_1.z.array(zod_1.z.string()).optional(),
|
|
});
|
|
exports.ApplyTemplateSchema = zod_1.z.object({
|
|
templateId: zod_1.z.string().uuid(),
|
|
projectId: zod_1.z.string().uuid(),
|
|
overrides: exports.UpdateTaskSchema.optional(),
|
|
});
|
|
// Query parameter schemas
|
|
exports.TaskQuerySchema = zod_1.z.object({
|
|
page: zod_1.z.coerce.number().int().positive().default(1),
|
|
limit: zod_1.z.coerce.number().int().min(1).max(100).default(20),
|
|
sort: zod_1.z.string().optional(),
|
|
filter: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
search: zod_1.z.string().optional(),
|
|
fields: zod_1.z.array(zod_1.z.string()).optional(),
|
|
});
|
|
// Response schemas
|
|
exports.TaskResponseSchema = exports.TaskBaseSchema.extend({
|
|
id: zod_1.z.string().uuid(),
|
|
created_by: zod_1.z.string().uuid().optional(),
|
|
created_at: zod_1.z.string(),
|
|
updated_at: zod_1.z.string(),
|
|
actual_hours: zod_1.z.number().optional(),
|
|
completed_at: zod_1.z.string().optional(),
|
|
});
|
|
exports.PaginatedTasksResponseSchema = zod_1.z.object({
|
|
data: zod_1.z.array(exports.TaskResponseSchema),
|
|
meta: zod_1.z.object({
|
|
total: zod_1.z.number(),
|
|
page: zod_1.z.number(),
|
|
limit: zod_1.z.number(),
|
|
totalPages: zod_1.z.number(),
|
|
}),
|
|
});
|
|
//# sourceMappingURL=task.validator.js.map
|