import { z } from "zod"; /** * Zod schema for WordPress authentication methods. * * "cookie" is intentionally not offered here: the client can still be * constructed with `{ method: "cookie", nonce }` programmatically, but it * requires an already-established WordPress session nonce that neither the * setup wizard, the DXT installer, nor this schema has any way to obtain, * so it is not a genuinely configurable/supported mode end-to-end. */ declare const AuthMethodSchema: z.ZodEnum<{ "app-password": "app-password"; jwt: "jwt"; basic: "basic"; "api-key": "api-key"; }>; /** * Zod schema for URL validation with security checks. * * Uses the same `isDisallowedHostname`/escape-hatch policy as * `WordPressClient.validateAndSanitizeUrl` (`src/client/api.ts`) so the two * enforcement points can't drift apart — this schema previously only blocked * private/localhost hosts when `NODE_ENV=production`, while the client always * blocked them; both now default to blocking, overridable via * `ALLOW_PRIVATE_URLS=true` / `ALLOW_INSECURE_HTTP=true`. */ declare const UrlSchema: z.ZodString; /** * Zod schema for WordPress site configuration (multi-site config file) */ declare const SiteConfigSchema: z.ZodPipe, z.ZodDiscriminatedUnion<[z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"app-password">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_APP_PASSWORD: z.ZodString; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"basic">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_PASSWORD: z.ZodString; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"jwt">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_PASSWORD: z.ZodString; WORDPRESS_JWT_SECRET: z.ZodString; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"api-key">; WORDPRESS_API_KEY: z.ZodString; }, z.core.$strip>], "WORDPRESS_AUTH_METHOD">>; /** * Zod schema for site configuration with metadata */ declare const SiteSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; config: z.ZodPipe, z.ZodDiscriminatedUnion<[z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"app-password">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_APP_PASSWORD: z.ZodString; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"basic">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_PASSWORD: z.ZodString; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"jwt">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_PASSWORD: z.ZodString; WORDPRESS_JWT_SECRET: z.ZodString; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"api-key">; WORDPRESS_API_KEY: z.ZodString; }, z.core.$strip>], "WORDPRESS_AUTH_METHOD">>; }, z.core.$strip>; /** * Zod schema for multi-site configuration file */ declare const MultiSiteConfigSchema: z.ZodObject<{ sites: z.ZodArray, z.ZodDiscriminatedUnion<[z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"app-password">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_APP_PASSWORD: z.ZodString; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"basic">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_PASSWORD: z.ZodString; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"jwt">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_PASSWORD: z.ZodString; WORDPRESS_JWT_SECRET: z.ZodString; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"api-key">; WORDPRESS_API_KEY: z.ZodString; }, z.core.$strip>], "WORDPRESS_AUTH_METHOD">>; }, z.core.$strip>>; }, z.core.$strip>; declare const EnvironmentConfigSchema: z.ZodPipe, z.ZodDiscriminatedUnion<[z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"app-password">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_APP_PASSWORD: z.ZodString; NODE_ENV: z.ZodOptional>; DEBUG: z.ZodOptional; DISABLE_CACHE: z.ZodOptional; LOG_LEVEL: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"basic">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_PASSWORD: z.ZodString; NODE_ENV: z.ZodOptional>; DEBUG: z.ZodOptional; DISABLE_CACHE: z.ZodOptional; LOG_LEVEL: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"jwt">; WORDPRESS_USERNAME: z.ZodString; WORDPRESS_PASSWORD: z.ZodString; WORDPRESS_JWT_SECRET: z.ZodString; NODE_ENV: z.ZodOptional>; DEBUG: z.ZodOptional; DISABLE_CACHE: z.ZodOptional; LOG_LEVEL: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ WORDPRESS_SITE_URL: z.ZodString; WORDPRESS_AUTH_METHOD: z.ZodLiteral<"api-key">; WORDPRESS_API_KEY: z.ZodString; NODE_ENV: z.ZodOptional>; DEBUG: z.ZodOptional; DISABLE_CACHE: z.ZodOptional; LOG_LEVEL: z.ZodOptional>; }, z.core.$strip>], "WORDPRESS_AUTH_METHOD">>; /** * Zod schema for MCP configuration passed from client. Left as a loose, * fully-optional bag of fields (not discriminated) because it represents a * partial credential fragment that gets merged with process.env in * ServerConfiguration before the merged result is validated by * EnvironmentConfigSchema above — that merged validation is where an * incomplete credential set for the chosen method is actually caught. */ declare const McpConfigSchema: z.ZodOptional; wordpressUsername: z.ZodOptional; wordpressAppPassword: z.ZodOptional; wordpressPassword: z.ZodOptional; wordpressJwtSecret: z.ZodOptional; wordpressApiKey: z.ZodOptional; wordpressAuthMethod: z.ZodOptional>; }, z.core.$strip>>; /** * Type definitions derived from Zod schemas */ export type SiteConfigType = z.infer; export type SiteType = z.infer; export type MultiSiteConfigType = z.infer; export type EnvironmentConfigType = z.infer; export type McpConfigType = z.infer; /** * The credential shape WordPressClient's constructor expects, built from * whichever discriminated variant validation resolved to. Keeping this * next to the schema means the two can't drift independently — every * variant added above must be handled here too (the exhaustive switch * fails to compile otherwise). */ export interface ResolvedAuthConfig { method: "app-password" | "jwt" | "basic" | "api-key"; username?: string; password?: string; appPassword?: string; secret?: string; apiKey?: string; } export declare function buildAuthConfig(validated: SiteConfigType | EnvironmentConfigType): ResolvedAuthConfig; /** * Configuration validation utilities */ export declare class ConfigurationValidator { /** * Validate multi-site configuration from JSON file */ static validateMultiSiteConfig(config: unknown): MultiSiteConfigType; /** * Validate environment configuration for single-site mode */ static validateEnvironmentConfig(env: Record): EnvironmentConfigType; /** * Validate MCP configuration passed from client */ static validateMcpConfig(config: unknown): McpConfigType; /** * Validate a single site configuration */ static validateSiteConfig(config: unknown): SiteType; /** * Check if a configuration file structure is valid without throwing */ static isValidMultiSiteConfig(config: unknown): boolean; /** * Check if environment configuration is valid without throwing */ static isValidEnvironmentConfig(env: Record): boolean; /** * Get validation errors without throwing */ static getValidationErrors(schema: z.ZodSchema, data: unknown): string[]; } export { SiteConfigSchema, SiteSchema, MultiSiteConfigSchema, EnvironmentConfigSchema, McpConfigSchema, AuthMethodSchema, UrlSchema, }; //# sourceMappingURL=ConfigurationSchema.d.ts.map