Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

1.1 KB
Raw Blame
import { z } from "../openapi";

const repositoryRef = {
  repositoryOwner: z.string().min(1).max(100),
  repositoryName: z.string().min(1).max(100),
};

export const verifyGitHubBody = z.object({
  projectId: z.string().min(1),
  ...repositoryRef,
});

export const createGitHubBody = z.object(repositoryRef);

export const updateGitHubBody = z.object({
  isActive: z.boolean().optional(),
  commentTaskLinkOnGitHubIssue: z.boolean().optional(),
});

export const repositoryPageQuery = z.object({
  installationPage: z
    .string()
    .regex(/^[1-9][0-9]{0,5}$/)
    .default("1")
    .transform(Number),
  repositoryPage: z
    .string()
    .regex(/^[1-9][0-9]{0,5}$/)
    .default("1")
    .transform(Number),
  search: z.string().trim().max(100).optional().openapi({
    description:
      "Case-insensitive match on the repository full name or description. When set, one request scans up to 10 pages of 100 repositories across installations and returns every match it finds, with `nextPage` set to resume the scan.",
  }),
});

export const importGitHubBody = z.object({
  projectId: z.string().min(1).max(128),
  runId: z.string().min(1).max(128).optional(),
});