@tailor-platform/function-types
v0.10.2
Published
TypeScript types for Tailor Platform Function service
Readme
@tailor-platform/function-types
Deprecated. These types are now built into @tailor-platform/sdk, which exposes the same tailor.* / tailordb.* runtime surface plus typed wrappers you can import directly instead of relying on ambient globals. New projects should use @tailor-platform/sdk instead of this package; existing projects should migrate using the steps below.
This package will no longer receive updates for new runtime APIs, while @tailor-platform/sdk will keep gaining new runtime APIs.
Migrating to @tailor-platform/sdk
Add
@tailor-platform/sdkand remove this package:npm i -D @tailor-platform/sdk npm uninstall @tailor-platform/function-typesIf your project already depends on
@tailor-platform/sdk(e.g. fortailor.config.ts, resolvers, or workflows), you can skip the install step.Update
tsconfig.jsonto load the runtime globals from the SDK instead:{ "compilerOptions": { - "types": ["@tailor-platform/function-types"] + "types": ["@tailor-platform/sdk/runtime/globals"] } }No other code changes are required. The global
tailor.*andtailordb.*identifiers keep the same names and shapes (including the legacy capitalizedTailordb.Client, which@tailor-platform/sdkalso keeps around for compatibility with this package).
Prefer typed imports over ambient globals (optional)
Instead of relying on the ambient tailor / tailordb globals, @tailor-platform/sdk/runtime exposes the same APIs as regular imports, which is easier to trace and doesn't require the tsconfig.json types change above:
import { iconv, secretmanager, idp, workflow, context, authconnection, aigateway, file } from "@tailor-platform/sdk/runtime";
const secret = await secretmanager.getSecret("my-vault", "API_KEY");
const gateway = await aigateway.get("my-aigateway");Legacy usage (this package)
npm i -D @tailor-platform/function-types{
"compilerOptions": {
"types": ["@tailor-platform/function-types"]
}
}