Web Page Content Schemas (variables/web-page.ts)

giselle · integration, Integration / API, web-page, schema, zod, variable, content

Zod definitions for web page variable states (fetching, fetched, failed) and content references used in the protocol.

// Source: https://github.com/mperkins0155/giselle | License: Apache-2.0 | Copyright 2024 ROUTE06, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { createIdGenerator } from "@giselles-ai/utils";
import * as z from "zod/v4";
import { FileId } from "./file";

export const WebPageId = createIdGenerator("wbpg");
export type WebPageId = z.infer<typeof WebPageId.schema>;

const WebPageBase = z.object({
	id: WebPageId.schema,
	url: z.url(),
	status: z.string(),
});

export const FetchingWebPage = WebPageBase.extend({
	status: z.literal("fetching"),
});
export type FetchingWebPage = z.infer<typeof FetchingWebPage>;

const FetchedWebPage = WebPageBase.extend({
	status: z.literal("fetched"),
	favicon: z.string(),
	title: z.string(),
	fileId: FileId.schema,
});
export typ

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

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

Get a free API key