/** * Extended ExtractorVersions client with Zod schema support. * * Allows passing Zod schemas in the `config.schema` field for the * `create()` method. The Zod schema is automatically converted to * JSON Schema before sending to the API. * * @example * ```typescript * import { ExtendClient, extendDate, extendCurrency } from "extend-ai"; * import { z } from "zod"; * * const client = new ExtendClient({ token: "..." }); * * const version = await client.extractorVersions.create("ex_abc123", { * releaseType: "minor", * description: "Added currency field", * config: { * schema: z.object({ * vendor: z.string().nullable(), * invoice_date: extendDate(), * total: extendCurrency(), * }), * }, * }); * ``` */ import { z } from "zod"; import { ExtractorVersionsClient as GeneratedExtractorVersionsClient } from "../../../api/resources/extractorVersions/client/Client"; import * as Extend from "../../../api"; import * as core from "../../../core"; import { TypedExtractConfig } from "../../schema/configConversion"; /** * Extractor version create request with a typed Zod schema in config. */ export interface TypedExtractorVersionsCreateRequest extends Omit { /** The configuration for this version of the extractor, with a Zod schema. */ config: TypedExtractConfig; } export declare class ExtractorVersionsClient extends GeneratedExtractorVersionsClient { /** * Publish a new version of an existing extractor. * * Accepts a Zod schema in `config.schema` which will be automatically * converted to JSON Schema before sending to the API. * * @example * ```typescript * // With Zod schema * const version = await client.extractorVersions.create("ex_abc123", { * releaseType: "minor", * config: { * schema: z.object({ * vendor: z.string().nullable(), * total: extendCurrency(), * }), * }, * }); * * // With JSON Schema (standard) * const version = await client.extractorVersions.create("ex_abc123", { * releaseType: "minor", * config: { * schema: { type: "object", properties: { vendor: { type: "string" } } }, * }, * }); * ``` */ create(extractorId: string, request: TypedExtractorVersionsCreateRequest, requestOptions?: GeneratedExtractorVersionsClient.RequestOptions): core.HttpResponsePromise; create(extractorId: string, request: Extend.ExtractorVersionsCreateRequest, requestOptions?: GeneratedExtractorVersionsClient.RequestOptions): core.HttpResponsePromise; /** * Converts a potentially typed create request to the standard API request format. */ private convertCreateRequest; }