CloudflareZone (schema/database.ts)

corsair · packages/cloudflare/schema/database.ts · typescript · Apache-2.0
database, tag:embed-classified

Zod schemas for Cloudflare resources such as zones, DNS records, worker scripts, routes, and rulesets, enabling type-safe API usage.

// Source: https://github.com/corsairdev/corsair | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from 'zod';

/** Zone account metadata from the API; extra keys allowed by Cloudflare. */
const ZoneAccountSchema = z.object({ id: z.string() }).loose().optional();

export const CloudflareZone = z.object({
	id: z.string(),
	name: z.string(),
	status: z.string().optional(),
	paused: z.boolean().optional(),
	type: z.string().optional(),
	account: ZoneAccountSchema,
	name_servers: z.array(z.string()).optional(),
	created_on: z.coerce.date().nullable().optional(),
	modified_on: z.coerce.date().nullable().optional(),
	activated_on: z.coerce.date().nullable().optional(),
});

e

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key