import { z } from 'zod';
export const ROADMAP_DEFAULT_PAGE_SIZE = 100;
export var RoadmapItemStatus;
(function (RoadmapItemStatus) {
    RoadmapItemStatus["BACKLOG"] = "Backlog";
    RoadmapItemStatus["BUILDING"] = "Building";
    RoadmapItemStatus["SHIPPED"] = "Shipped";
    RoadmapItemStatus["CANCELED"] = "Canceled";
})(RoadmapItemStatus || (RoadmapItemStatus = {}));
export var RoadmapItemPriority;
(function (RoadmapItemPriority) {
    RoadmapItemPriority["URGENT"] = "Urgent";
    RoadmapItemPriority["HIGH"] = "High";
    RoadmapItemPriority["MEDIUM"] = "Medium";
    RoadmapItemPriority["LOW"] = "Low";
    RoadmapItemPriority["NO_PRIORITY"] = "No priority";
})(RoadmapItemPriority || (RoadmapItemPriority = {}));
const githubIssueUrlSchema = z
    .string()
    .regex(/^https:\/\/github\.com\/lightdash\/lightdash\/issues\/\d+\/?$/, 'Expected a public lightdash/lightdash issue URL');
const githubPullRequestUrlSchema = z
    .string()
    .regex(/^https:\/\/github\.com\/lightdash\/lightdash\/pull\/\d+\/?$/, 'Expected a public lightdash/lightdash pull request URL');
export const RoadmapItemSchema = z
    .object({
    ticketId: z.string().min(1).max(255),
    title: z.string().min(1),
    description: z.string().nullable(),
    status: z.nativeEnum(RoadmapItemStatus),
    priority: z.nativeEnum(RoadmapItemPriority),
    createdAt: z.string().datetime({ offset: true }),
    updatedAt: z.string().datetime({ offset: true }),
    issueUrl: githubIssueUrlSchema.nullable(),
    pullRequestUrl: githubPullRequestUrlSchema.nullable(),
})
    .strict();
export const RoadmapQuerySchema = z
    .object({
    page: z.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
    pageSize: z
        .number()
        .int()
        .min(1)
        .max(ROADMAP_DEFAULT_PAGE_SIZE)
        .optional(),
})
    .strict();
export const RoadmapPaginationSchema = z
    .object({
    page: z.number().int().min(1).max(Number.MAX_SAFE_INTEGER),
    pageSize: z.number().int().min(1).max(100),
    totalIssues: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
    totalPages: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
})
    .strict();
const roadmapCountSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
export const RoadmapFacetsSchema = z
    .object({
    statusCounts: z
        .object({
        [RoadmapItemStatus.BACKLOG]: roadmapCountSchema,
        [RoadmapItemStatus.BUILDING]: roadmapCountSchema,
        [RoadmapItemStatus.SHIPPED]: roadmapCountSchema,
        [RoadmapItemStatus.CANCELED]: roadmapCountSchema,
    })
        .strict(),
    priorityCounts: z
        .object({
        [RoadmapItemPriority.URGENT]: roadmapCountSchema,
        [RoadmapItemPriority.HIGH]: roadmapCountSchema,
        [RoadmapItemPriority.MEDIUM]: roadmapCountSchema,
        [RoadmapItemPriority.LOW]: roadmapCountSchema,
        [RoadmapItemPriority.NO_PRIORITY]: roadmapCountSchema,
    })
        .strict(),
})
    .strict();
export const RoadmapResponseSchema = z
    .object({
    status: z.literal('ok'),
    results: z.array(RoadmapItemSchema),
    pagination: RoadmapPaginationSchema,
    facets: RoadmapFacetsSchema,
})
    .strict();
//# sourceMappingURL=roadmap.js.map