@seamapi/blueprint
Version:
Build tools for the Seam API using this blueprint.
157 lines (156 loc) • 7.58 kB
TypeScript
import { z } from 'zod';
import type { Endpoint } from '../../lib/blueprint.js';
import { type SyntaxName } from './syntax.js';
export declare const CodeSampleDefinitionSchema: z.ZodObject<{
title: z.ZodString;
description: z.ZodString;
request: z.ZodObject<{
path: z.ZodString;
parameters: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../lib/json.js").Json, z.ZodTypeDef, import("../../lib/json.js").Json>>>>;
}, "strip", z.ZodTypeAny, {
path: string;
parameters: Record<string, import("../../lib/json.js").Json>;
}, {
path: string;
parameters?: Record<string, import("../../lib/json.js").Json> | undefined;
}>;
response: z.ZodObject<{
body: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<import("../../lib/json.js").Json, z.ZodTypeDef, import("../../lib/json.js").Json>>>;
}, "strip", z.ZodTypeAny, {
body: Record<string, import("../../lib/json.js").Json> | null;
}, {
body: Record<string, import("../../lib/json.js").Json> | null;
}>;
}, "strip", z.ZodTypeAny, {
title: string;
description: string;
request: {
path: string;
parameters: Record<string, import("../../lib/json.js").Json>;
};
response: {
body: Record<string, import("../../lib/json.js").Json> | null;
};
}, {
title: string;
description: string;
request: {
path: string;
parameters?: Record<string, import("../../lib/json.js").Json> | undefined;
};
response: {
body: Record<string, import("../../lib/json.js").Json> | null;
};
}>;
export type CodeSampleDefinitionInput = z.input<typeof CodeSampleDefinitionSchema>;
export type CodeSampleDefinition = z.output<typeof CodeSampleDefinitionSchema>;
declare const CodeSchema: z.ZodRecord<z.ZodEnum<["javascript", "python", "php", "ruby", "seam_cli", "go", "java", "csharp", "curl"]>, z.ZodObject<{
title: z.ZodString;
sdkName: z.ZodEnum<["javascript", "python", "php", "ruby", "seam_cli", "go", "java", "csharp", "curl"]>;
request: z.ZodString;
response: z.ZodString;
request_syntax: z.ZodEnum<["javascript", "json", "python", "php", "ruby", "bash", "go", "java", "csharp"]>;
response_syntax: z.ZodEnum<["javascript", "json", "python", "php", "ruby", "bash", "go", "java", "csharp"]>;
}, "strip", z.ZodTypeAny, {
title: string;
sdkName: "ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl";
request: string;
response: string;
request_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
response_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
}, {
title: string;
sdkName: "ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl";
request: string;
response: string;
request_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
response_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
}>>;
export type Code = z.infer<typeof CodeSchema>;
declare const CodeSampleSchema: z.ZodObject<z.objectUtil.extendShape<{
title: z.ZodString;
description: z.ZodString;
request: z.ZodObject<{
path: z.ZodString;
parameters: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../lib/json.js").Json, z.ZodTypeDef, import("../../lib/json.js").Json>>>>;
}, "strip", z.ZodTypeAny, {
path: string;
parameters: Record<string, import("../../lib/json.js").Json>;
}, {
path: string;
parameters?: Record<string, import("../../lib/json.js").Json> | undefined;
}>;
response: z.ZodObject<{
body: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<import("../../lib/json.js").Json, z.ZodTypeDef, import("../../lib/json.js").Json>>>;
}, "strip", z.ZodTypeAny, {
body: Record<string, import("../../lib/json.js").Json> | null;
}, {
body: Record<string, import("../../lib/json.js").Json> | null;
}>;
}, {
code: z.ZodRecord<z.ZodEnum<["javascript", "python", "php", "ruby", "seam_cli", "go", "java", "csharp", "curl"]>, z.ZodObject<{
title: z.ZodString;
sdkName: z.ZodEnum<["javascript", "python", "php", "ruby", "seam_cli", "go", "java", "csharp", "curl"]>;
request: z.ZodString;
response: z.ZodString;
request_syntax: z.ZodEnum<["javascript", "json", "python", "php", "ruby", "bash", "go", "java", "csharp"]>;
response_syntax: z.ZodEnum<["javascript", "json", "python", "php", "ruby", "bash", "go", "java", "csharp"]>;
}, "strip", z.ZodTypeAny, {
title: string;
sdkName: "ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl";
request: string;
response: string;
request_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
response_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
}, {
title: string;
sdkName: "ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl";
request: string;
response: string;
request_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
response_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
}>>;
}>, "strip", z.ZodTypeAny, {
code: Partial<Record<"ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl", {
title: string;
sdkName: "ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl";
request: string;
response: string;
request_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
response_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
}>>;
title: string;
description: string;
request: {
path: string;
parameters: Record<string, import("../../lib/json.js").Json>;
};
response: {
body: Record<string, import("../../lib/json.js").Json> | null;
};
}, {
code: Partial<Record<"ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl", {
title: string;
sdkName: "ruby" | "javascript" | "python" | "php" | "seam_cli" | "go" | "java" | "csharp" | "curl";
request: string;
response: string;
request_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
response_syntax: "ruby" | "json" | "javascript" | "python" | "php" | "go" | "java" | "csharp" | "bash";
}>>;
title: string;
description: string;
request: {
path: string;
parameters?: Record<string, import("../../lib/json.js").Json> | undefined;
};
response: {
body: Record<string, import("../../lib/json.js").Json> | null;
};
}>;
export type CodeSample = z.output<typeof CodeSampleSchema>;
export interface CodeSampleContext {
endpoint: Omit<Endpoint, 'codeSamples'>;
formatCode: (content: string, syntax: SyntaxName) => Promise<string>;
}
export declare const createCodeSample: (codeSampleDefinition: CodeSampleDefinition, context: CodeSampleContext) => Promise<CodeSample>;
export {};