All files / src/entities/wiki schema-readonly.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 323x 3x 3x     3x             3x           3x                          
import { z } from "zod";
import { PaginationOptionsSchema } from "../shared";
import { flexibleBoolean } from "../utils";
 
// Read-only wiki operation schemas
export const ListWikiPagesSchema = z
  .object({
    namespace: z.string().describe("Namespace path (group or project) to list wiki pages from"),
    with_content: flexibleBoolean.optional().describe("Include content of the wiki pages"),
  })
  .merge(PaginationOptionsSchema);
 
export const GetWikiPageSchema = z.object({
  namespace: z.string().describe("Namespace path (group or project) containing the wiki page"),
  slug: z.string().describe("URL-encoded slug of the wiki page"),
});
 
// Define wiki response schemas
export const GitLabWikiPageSchema = z.object({
  title: z.string(),
  slug: z.string(),
  format: z.string(),
  content: z.string().optional(),
  created_at: z.string().optional(),
  updated_at: z.string().optional(),
});
 
// Type exports
export type ListWikiPagesOptions = z.infer<typeof ListWikiPagesSchema>;
export type GetWikiPageOptions = z.infer<typeof GetWikiPageSchema>;
export type GitLabWikiPage = z.infer<typeof GitLabWikiPageSchema>;