/** * Assembles a plugin-typed client: a transport `Client` whose resource slots * are bound to the plugin's compiled schemas and registered filter routes. * Consumed by `plugin.getClient()`. */ import { z } from "zod"; import { Client } from "../client"; import { Opportunities } from "./opportunities"; import type { PluginRoutes, ResourceName } from "../../extensions/types"; import type { Plugin, PluginSchemasInput } from "../../extensions/define-plugin"; import type { ClientConfig } from "../config"; import type { AuthMethod } from "../auth"; import type { OpportunityBase } from "../../types"; /** Item type projected from the plugin's compiled schema for a model. */ type ResolvedItemType = z.infer["schemas"]["Opportunity"]["commonSchema"]> & OpportunityBase; /** * A `Client` whose resource slots carry the plugin's item and filter types: * `search({ filters })` autocompletes the registered filter names and * responses parse with the plugin's schema by default. * * The default resource slots are `Omit`ted (not intersected) — an intersection * would let `Client`'s looser default `opportunities` signature win call * resolution and erase the plugin's filter typing. */ export type BuiltClient = Omit & { opportunities: Opportunities>; }; /** * Builds a client from a plugin: constructs the transport `Client`, then * overlays each resource slot with a plugin-bound instance (the plugin's * compiled schema as the default parse schema, its routes for filter * classification). */ export declare function buildClientForPlugin(plugin: Plugin, config?: ClientConfig & { auth?: AuthMethod; }): BuiltClient; export {}; //# sourceMappingURL=builder.d.ts.map