diff --git a/sdk-node/src/index.ts b/sdk-node/src/index.ts index e9f05e25..a0cd5683 100644 --- a/sdk-node/src/index.ts +++ b/sdk-node/src/index.ts @@ -23,8 +23,8 @@ export const masked = () => { }; export { - statusChangeSchema, - handleCustomerAuthSchema, + onStatusChangeInput, + handleCustomerAuthInput, ContextInput, } from "./types"; diff --git a/sdk-node/src/types.ts b/sdk-node/src/types.ts index 48adc9dd..94194d8d 100644 --- a/sdk-node/src/types.ts +++ b/sdk-node/src/types.ts @@ -27,20 +27,20 @@ export type FunctionInput = * ```ts * inferable.default.register({ * name: "onStatusChangeFn", - * schema: statusChangeSchema, + * schema: { + * input: onStatusChangeInput + * }, * func: (_input) => {}, * }); * ``` */ -export const statusChangeSchema = { - input: z.object({ - runId: z.string(), - status: z.enum(["pending", "running", "paused", "done", "failed"]), - result: z.object({}).passthrough().nullable().optional(), - summary: z.string().nullable().optional(), - metadata: z.record(z.string()).nullable().optional(), - }), -}; +export const onStatusChangeInput = z.object({ + runId: z.string(), + status: z.enum(["pending", "running", "paused", "done", "failed"]), + result: z.object({}).passthrough().nullable().optional(), + summary: z.string().nullable().optional(), + metadata: z.record(z.string()).nullable().optional(), +}); /** * Schema for handleCustomerAuth functions @@ -49,16 +49,16 @@ export const statusChangeSchema = { * ```ts * inferable.default.register({ * name: "handleCustomerAuth", - * schema: handleCustomerAuthSchema, + * schema: { + * input: handleCustomerAuthInput + * }, * func: (_input) => {}, * }); * ``` */ -export const handleCustomerAuthSchema = { - input: z.object({ - token: z.string(), - }), -}; +export const handleCustomerAuthInput = z.object({ + token: z.string(), +}); import type { JSONSchema4Type } from "json-schema";