diff --git a/bun.lockb b/bun.lockb index 39b7498..cf5c2b3 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/server/__internals/procedure.ts b/src/server/__internals/procedure.ts index d669b34..d797a39 100644 --- a/src/server/__internals/procedure.ts +++ b/src/server/__internals/procedure.ts @@ -65,7 +65,7 @@ export class Procedure { return new Procedure([...this.middlewares, fn as any]) } - input = >( + input = | Record[]>( schema: z.ZodSchema ) => ({ query: ( diff --git a/src/server/__internals/types.ts b/src/server/__internals/types.ts index d29c54c..c127c78 100644 --- a/src/server/__internals/types.ts +++ b/src/server/__internals/types.ts @@ -15,14 +15,14 @@ export type Middleware = ({ c: Context<{ Bindings: Bindings; Variables: Variables }> }) => Promise -export type QueryOperation, ZodInput = never> = { +export type QueryOperation | Record[], ZodInput = never> = { type: "query" schema?: z.ZodType handler: ({ ctx, c, input }: { ctx: Ctx; c: Context; input: ZodInput }) => Promise> middlewares: Middleware[] } -export type MutationOperation, ZodInput = never> = { +export type MutationOperation | Record[], ZodInput = never> = { type: "mutation" schema?: z.ZodType handler: ({ ctx, c }: { ctx: Input; c: Context; input: ZodInput }) => Promise>