TINYFISH_DOMAIN_TYPES (endpoints/types.ts)

corsair · packages/tinyfish/endpoints/types.ts · typescript · Apache-2.0
ai

Zod schemas and constants defining TinyFish API request/response types and error codes.

// 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';

/** Search, Fetch and Research accept the same three result domains. */
// Const assertion keeps the domain tuple. A string[] would be wider, not
// stricter.
export const TINYFISH_DOMAIN_TYPES = ['web', 'news', 'research_paper'] as const;
const DomainTypeSchema = z.enum(TINYFISH_DOMAIN_TYPES);

export const TINYFISH_RUN_STATUSES = [
	'PENDING',
	'RUNNING',
	'COMPLETED',
	'FAILED',
	'CANCELLED',
	// Const assertion keeps this tuple literal. A wider array type would not be stricter.
] as const;
const RunStatusSchema = z.enum(TINYFISH_RUN_STATUSES);

const Termi

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

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

Get a free API key