@mintlify/validation
Version:
Validates mint.json files
61 lines (60 loc) • 2.77 kB
JavaScript
import { themes } from '@mintlify/models';
import { layouts } from '@mintlify/models/dist/mintconfig/layout.js';
import { roundedOptions } from '@mintlify/models/dist/mintconfig/rounded.js';
import { z } from 'zod';
import { analyticsSchema } from './analytics.js';
import { anchorSchema, topAnchorSchema } from './anchors.js';
import { apiSchema, openApiSchema } from './apiReference.js';
import { backgroundSchema } from './background.js';
import { codeBlockSchema, ctaButtonSchema, eyebrowSchema, feedbackSchema, isWhiteLabeledSchema, logoSchema, metadataSchema, modeToggleSchema, nameSchema, redirectsSchema, searchSchema, } from './basics.js';
import { colorsSchema } from './colors.js';
import { faviconSchema } from './favicon.js';
import { fontSchema } from './font.js';
import { footerSchema, footerSocialsSchema } from './footer.js';
import { integrationsSchema } from './integrations.js';
import { navigationSchema } from './navigation.js';
import { seoSchema } from './seo.js';
import { sidebarSchema } from './sidebar.js';
import { primaryTabSchema, tabsSchema } from './tabs.js';
import { topbarSchema } from './topbar.js';
import { versionsSchema } from './versions.js';
export const mintConfigSchema = z.object({
$schema: z.string().url().optional().default('https://mintlify.com/schema.json'),
mintlify: z.string().optional(),
name: nameSchema,
logo: logoSchema.optional(),
theme: z.enum(themes).optional(),
layout: z.enum(layouts).optional(),
favicon: faviconSchema,
openapi: openApiSchema.optional(),
topbar: topbarSchema.optional(),
sidebar: sidebarSchema.optional(),
rounded: z.enum(roundedOptions).optional(),
api: apiSchema.optional(),
modeToggle: modeToggleSchema.optional(),
versions: versionsSchema.optional(),
metadata: metadataSchema.optional(),
codeBlock: codeBlockSchema.optional(),
colors: colorsSchema,
eyebrow: eyebrowSchema.optional(),
topbarCtaButton: ctaButtonSchema.optional(),
topbarLinks: ctaButtonSchema.array().optional(),
navigation: navigationSchema,
primaryTab: primaryTabSchema.optional(),
topAnchor: topAnchorSchema.optional(),
anchors: anchorSchema.array().optional(),
tabs: tabsSchema.optional(),
footer: footerSchema.optional(),
background: backgroundSchema.optional(),
backgroundImage: z.string().optional(),
font: fontSchema.optional(),
feedback: feedbackSchema.optional(),
analytics: analyticsSchema.optional(),
integrations: integrationsSchema.optional(),
isWhiteLabeled: isWhiteLabeledSchema.optional(),
search: searchSchema.optional(),
redirects: redirectsSchema.optional(),
seo: seoSchema.optional(),
// deprecated
footerSocials: footerSocialsSchema.optional(),
});