UNPKG

@seamapi/blueprint

Version:

Build tools for the Seam API using this blueprint.

84 lines (83 loc) 4.04 kB
import { z } from 'zod'; import type { Resource as BlueprintResource } from '../../lib/blueprint.js'; import { type SyntaxName } from './syntax.js'; export declare const ResourceSampleDefinitionSchema: z.ZodObject<{ title: z.ZodString; description: z.ZodString; resource_type: z.ZodString; properties: z.ZodRecord<z.ZodString, z.ZodType<import("../../lib/json.js").Json, z.ZodTypeDef, import("../../lib/json.js").Json>>; }, "strip", z.ZodTypeAny, { title: string; description: string; properties: Record<string, import("../../lib/json.js").Json>; resource_type: string; }, { title: string; description: string; properties: Record<string, import("../../lib/json.js").Json>; resource_type: string; }>; export type ResourceSampleDefinitionInput = z.input<typeof ResourceSampleDefinitionSchema>; export type ResourceSampleDefinition = z.output<typeof ResourceSampleDefinitionSchema>; export interface ResourceSampleContext { resource: Omit<BlueprintResource, 'resourceSamples'>; schemas: Record<string, unknown>; formatCode: (content: string, syntax: SyntaxName) => Promise<string>; } declare const ResourceSchema: z.ZodRecord<z.ZodEnum<["javascript", "python", "php", "ruby", "seam_cli", "go", "java", "csharp", "curl"]>, z.ZodObject<{ title: z.ZodString; resource_data: z.ZodString; resource_data_syntax: z.ZodEnum<["javascript", "json", "python", "php", "ruby", "bash", "go", "java", "csharp"]>; }, "strip", z.ZodTypeAny, { title: string; resource_data: string; resource_data_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash"; }, { title: string; resource_data: string; resource_data_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash"; }>>; export type Resource = z.infer<typeof ResourceSchema>; declare const ResourceSampleSchema: z.ZodObject<z.objectUtil.extendShape<{ title: z.ZodString; description: z.ZodString; resource_type: z.ZodString; properties: z.ZodRecord<z.ZodString, z.ZodType<import("../../lib/json.js").Json, z.ZodTypeDef, import("../../lib/json.js").Json>>; }, { resource: z.ZodRecord<z.ZodEnum<["javascript", "python", "php", "ruby", "seam_cli", "go", "java", "csharp", "curl"]>, z.ZodObject<{ title: z.ZodString; resource_data: z.ZodString; resource_data_syntax: z.ZodEnum<["javascript", "json", "python", "php", "ruby", "bash", "go", "java", "csharp"]>; }, "strip", z.ZodTypeAny, { title: string; resource_data: string; resource_data_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash"; }, { title: string; resource_data: string; resource_data_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash"; }>>; }>, "strip", z.ZodTypeAny, { title: string; description: string; properties: Record<string, import("../../lib/json.js").Json>; resource: Partial<Record<"ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl", { title: string; resource_data: string; resource_data_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash"; }>>; resource_type: string; }, { title: string; description: string; properties: Record<string, import("../../lib/json.js").Json>; resource: Partial<Record<"ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl", { title: string; resource_data: string; resource_data_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash"; }>>; resource_type: string; }>; export type ResourceSample = z.output<typeof ResourceSampleSchema>; export declare const createResourceSample: (resourceSampleDefinition: ResourceSampleDefinition, context: ResourceSampleContext) => Promise<ResourceSample>; export {};