better-convex 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aggregate/index.d.ts +388 -0
- package/dist/aggregate/index.js +37 -0
- package/dist/{auth-client → auth/client}/index.js +1 -1
- package/dist/auth/http/index.d.ts +63 -0
- package/dist/auth/http/index.js +429 -0
- package/dist/auth/index.d.ts +19001 -185
- package/dist/auth/index.js +373 -686
- package/dist/{auth-nextjs → auth/nextjs}/index.d.ts +3 -4
- package/dist/{auth-nextjs → auth/nextjs}/index.js +3 -5
- package/dist/{caller-factory-B1FvYSKr.js → caller-factory-Dmgv8MLS.js} +15 -12
- package/dist/cli.mjs +2601 -13
- package/dist/codegen-Cz1idI3-.mjs +969 -0
- package/dist/{create-schema-orm-DplxTtYj.js → create-schema-orm-69VF4CFV.js} +4 -3
- package/dist/crpc/index.d.ts +2 -2
- package/dist/crpc/index.js +3 -3
- package/dist/{http-types-BRLY10NX.d.ts → http-types-BCf2wCgp.d.ts} +25 -25
- package/dist/meta-utils-DDVYp9Xf.js +117 -0
- package/dist/orm/index.d.ts +4 -3012
- package/dist/orm/index.js +9631 -2
- package/dist/{index-BQkhP2ny.d.ts → procedure-caller-CcjtUFvL.d.ts} +211 -74
- package/dist/query-context-BDSis9rT.js +1518 -0
- package/dist/query-context-DGExXZIV.d.ts +42 -0
- package/dist/react/index.d.ts +31 -35
- package/dist/react/index.js +145 -58
- package/dist/rsc/index.d.ts +4 -7
- package/dist/rsc/index.js +14 -10
- package/dist/runtime-B9xQFY8W.js +2280 -0
- package/dist/server/index.d.ts +3 -4
- package/dist/server/index.js +384 -10
- package/dist/{types-o-5rYcTr.d.ts → types-CIBGEYXq.d.ts} +4 -3
- package/dist/types-DgwvxKbT.d.ts +4 -0
- package/dist/watcher.mjs +8 -8
- package/dist/where-clause-compiler-CRP-i1Qa.d.ts +3463 -0
- package/package.json +14 -10
- package/dist/codegen-DkpPBVPn.mjs +0 -189
- package/dist/context-utils-DSuX99Da.d.ts +0 -17
- package/dist/meta-utils-DCpLSBWB.js +0 -41
- package/dist/orm-CleikBIV.js +0 -8820
- /package/dist/{auth-client → auth/client}/index.d.ts +0 -0
- /package/dist/{auth-config → auth/config}/index.d.ts +0 -0
- /package/dist/{auth-config → auth/config}/index.js +0 -0
- /package/dist/{create-schema-DhWXOhnU.js → create-schema-BdZOL6ns.js} +0 -0
- /package/dist/{customFunctions-C1okqCzL.js → customFunctions-CZnCwoR3.js} +0 -0
- /package/dist/{error-BZUhlhYz.js → error-Be4OcwwD.js} +0 -0
- /package/dist/{query-options-BL1Q0X7q.js → query-options-B0c1b6pZ.js} +0 -0
- /package/dist/{transformer-CTNSPjwp.js → transformer-Dh0w2py0.js} +0 -0
- /package/dist/{types-jftzhhuc.d.ts → types-DwGkkq2s.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as HttpProcedure, D as ProcedureMeta, G as DataTransformerOptions, N as MiddlewareBuilder, O as AnyMiddleware, P as MiddlewareFunction, Q as getTransformer, R as Overwrite$1, S as HttpMethod, V as UnsetMarker, c as InferHttpInput, d as CRPCHttpRouter, j as IntersectIfDefined, l as InferHttpOutput, p as HttpRouterRecord, w as HttpProcedureBuilderDef, x as HttpHandlerOpts } from "./http-types-
|
|
2
|
-
import * as convex_server30 from "convex/server";
|
|
3
|
-
import { ActionBuilder, ArgsArrayToObject, DefaultFunctionArgs, FunctionReference, FunctionReturnType, FunctionVisibility, GenericActionCtx, GenericDataModel, GenericDatabaseReader, GenericMutationCtx, GenericQueryCtx, MutationBuilder, QueryBuilder, RegisteredAction, RegisteredMutation, RegisteredQuery, SchemaDefinition, TableNamesInDataModel } from "convex/server";
|
|
1
|
+
import { C as HttpProcedure, D as ProcedureMeta, G as DataTransformerOptions, N as MiddlewareBuilder, O as AnyMiddleware, P as MiddlewareFunction, Q as getTransformer, R as Overwrite$1, S as HttpMethod, V as UnsetMarker, c as InferHttpInput, d as CRPCHttpRouter, j as IntersectIfDefined, l as InferHttpOutput, p as HttpRouterRecord, w as HttpProcedureBuilderDef, x as HttpHandlerOpts } from "./http-types-BCf2wCgp.js";
|
|
4
2
|
import { ConvexError, GenericId, GenericValidator, Infer, ObjectType, OptionalProperty, PropertyValidators, VAny, VArray, VBoolean, VBytes, VFloat64, VId, VInt64, VLiteral, VNull, VObject, VOptional, VRecord, VString, VUnion, Validator, v } from "convex/values";
|
|
3
|
+
import * as convex_server0 from "convex/server";
|
|
4
|
+
import { ActionBuilder, ArgsArrayToObject, DefaultFunctionArgs, FunctionReference, FunctionReturnType, FunctionVisibility, GenericActionCtx, GenericDataModel, GenericDatabaseReader, GenericMutationCtx, GenericQueryCtx, MutationBuilder, QueryBuilder, RegisteredAction, RegisteredMutation, RegisteredQuery, SchemaDefinition, TableNamesInDataModel } from "convex/server";
|
|
5
5
|
import * as z$1 from "zod/v4";
|
|
6
6
|
import * as zCore from "zod/v4/core";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -591,44 +591,44 @@ declare function handleHttpError(error: unknown): Response;
|
|
|
591
591
|
*/
|
|
592
592
|
interface HttpProcedureBuilder<TInitialCtx, TCtx, TInput extends UnsetMarker | z.ZodTypeAny = UnsetMarker, TOutput extends UnsetMarker | z.ZodTypeAny = UnsetMarker, TParams extends UnsetMarker | z.ZodTypeAny = UnsetMarker, TQuery extends UnsetMarker | z.ZodTypeAny = UnsetMarker, TMeta extends ProcedureMeta = ProcedureMeta, TMethod extends HttpMethod = HttpMethod, TForm extends UnsetMarker | z.ZodTypeAny = UnsetMarker> {
|
|
593
593
|
_def: HttpProcedureBuilderDef<TCtx, TInput, TOutput, TParams, TQuery, TMeta, TMethod, TForm>;
|
|
594
|
-
/** Add middleware to the procedure */
|
|
595
|
-
use<$ContextOverridesOut extends object>(middlewareOrBuilder: MiddlewareFunction<TCtx, TMeta, UnsetMarker, $ContextOverridesOut, unknown> | MiddlewareBuilder<TInitialCtx, TMeta, $ContextOverridesOut, unknown>): HttpProcedureBuilder<TInitialCtx, Overwrite$1<TCtx, $ContextOverridesOut>, TInput, TOutput, TParams, TQuery, TMeta, TMethod, TForm>;
|
|
596
|
-
/** Set procedure metadata (shallow merged when chained) */
|
|
597
|
-
meta(value: TMeta): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, TMethod, TForm>;
|
|
598
|
-
/** Define the route path and HTTP method */
|
|
599
|
-
route<M extends HttpMethod>(path: string, method: M): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, M, TForm>;
|
|
600
|
-
/** GET endpoint (Hono-style) */
|
|
601
|
-
get(path: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, 'GET', TForm>;
|
|
602
|
-
/** POST endpoint (Hono-style) */
|
|
603
|
-
post(path: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, 'POST', TForm>;
|
|
604
|
-
/** PUT endpoint (Hono-style) */
|
|
605
|
-
put(path: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, 'PUT', TForm>;
|
|
606
|
-
/** PATCH endpoint (Hono-style) */
|
|
607
|
-
patch(path: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, 'PATCH', TForm>;
|
|
608
594
|
/** DELETE endpoint (Hono-style) */
|
|
609
595
|
delete(path: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, 'DELETE', TForm>;
|
|
610
|
-
/** Define path parameter schema (for :param in path) */
|
|
611
|
-
params<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TSchema, TQuery, TMeta, TMethod, TForm>;
|
|
612
|
-
/** Define query parameter schema (?key=value) */
|
|
613
|
-
searchParams<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TSchema, TMeta, TMethod, TForm>;
|
|
614
|
-
/** Define request body schema (for POST/PUT/PATCH) */
|
|
615
|
-
input<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TSchema, TOutput, TParams, TQuery, TMeta, TMethod, TForm>;
|
|
616
|
-
/** Define response schema */
|
|
617
|
-
output<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TSchema, TParams, TQuery, TMeta, TMethod, TForm>;
|
|
618
596
|
/** Define form data schema (for multipart/form-data uploads) */
|
|
619
597
|
form<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, TMethod, TSchema>;
|
|
598
|
+
/** GET endpoint (Hono-style) */
|
|
599
|
+
get(path: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, 'GET', TForm>;
|
|
600
|
+
/** Define request body schema (for POST/PUT/PATCH) */
|
|
601
|
+
input<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TSchema, TOutput, TParams, TQuery, TMeta, TMethod, TForm>;
|
|
602
|
+
/** Set procedure metadata (shallow merged when chained) */
|
|
603
|
+
meta(value: TMeta): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, TMethod, TForm>;
|
|
620
604
|
/**
|
|
621
|
-
* Define the handler for
|
|
605
|
+
* Define the handler for POST/PUT/PATCH/DELETE endpoints (maps to useMutation on client).
|
|
622
606
|
* Handler receives Hono Context `c` for Response helpers (c.json, c.body, c.text).
|
|
623
607
|
* Return Response for custom responses, or plain object for auto JSON serialization.
|
|
624
608
|
*/
|
|
625
|
-
|
|
609
|
+
mutation<TResult>(handler: (opts: HttpHandlerOpts<TCtx, TInput, TParams, TQuery, TForm>) => Promise<Response | (TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult)>): HttpProcedure<TInput, TOutput, TParams, TQuery, TMethod, TForm>;
|
|
610
|
+
/** Define response schema */
|
|
611
|
+
output<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TSchema, TParams, TQuery, TMeta, TMethod, TForm>;
|
|
612
|
+
/** Define path parameter schema (for :param in path) */
|
|
613
|
+
params<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TSchema, TQuery, TMeta, TMethod, TForm>;
|
|
614
|
+
/** PATCH endpoint (Hono-style) */
|
|
615
|
+
patch(path: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, 'PATCH', TForm>;
|
|
616
|
+
/** POST endpoint (Hono-style) */
|
|
617
|
+
post(path: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, 'POST', TForm>;
|
|
618
|
+
/** PUT endpoint (Hono-style) */
|
|
619
|
+
put(path: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, 'PUT', TForm>;
|
|
626
620
|
/**
|
|
627
|
-
* Define the handler for
|
|
621
|
+
* Define the handler for GET endpoints (maps to useQuery on client).
|
|
628
622
|
* Handler receives Hono Context `c` for Response helpers (c.json, c.body, c.text).
|
|
629
623
|
* Return Response for custom responses, or plain object for auto JSON serialization.
|
|
630
624
|
*/
|
|
631
|
-
|
|
625
|
+
query<TResult>(handler: (opts: HttpHandlerOpts<TCtx, TInput, TParams, TQuery, TForm>) => Promise<Response | (TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult)>): HttpProcedure<TInput, TOutput, TParams, TQuery, TMethod, TForm>;
|
|
626
|
+
/** Define the route path and HTTP method */
|
|
627
|
+
route<M extends HttpMethod>(path: string, method: M): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, M, TForm>;
|
|
628
|
+
/** Define query parameter schema (?key=value) */
|
|
629
|
+
searchParams<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TSchema, TMeta, TMethod, TForm>;
|
|
630
|
+
/** Add middleware to the procedure */
|
|
631
|
+
use<$ContextOverridesOut extends object>(middlewareOrBuilder: MiddlewareFunction<TCtx, TMeta, UnsetMarker, $ContextOverridesOut, unknown> | MiddlewareBuilder<TInitialCtx, TMeta, $ContextOverridesOut, unknown>): HttpProcedureBuilder<TInitialCtx, Overwrite$1<TCtx, $ContextOverridesOut>, TInput, TOutput, TParams, TQuery, TMeta, TMethod, TForm>;
|
|
632
632
|
}
|
|
633
633
|
/**
|
|
634
634
|
* Create initial HttpProcedureBuilder
|
|
@@ -652,15 +652,39 @@ declare const paginatedSchemaForTypes: z.ZodObject<{
|
|
|
652
652
|
}, z.core.$strip>;
|
|
653
653
|
/** Paginated schema type - both cursor and limit are required after .paginated() */
|
|
654
654
|
type PaginatedInputSchema = typeof paginatedSchemaForTypes;
|
|
655
|
+
/** Paginated schema type for external callers - both fields are optional due defaults. */
|
|
656
|
+
declare const paginatedSchemaForClientTypes: z.ZodObject<{
|
|
657
|
+
cursor: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
658
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
659
|
+
}, z.core.$strip>;
|
|
660
|
+
type PaginatedClientInputSchema = typeof paginatedSchemaForClientTypes;
|
|
655
661
|
/**
|
|
656
662
|
* Infer input type from ZodObject schema (for handlers)
|
|
657
663
|
*/
|
|
658
664
|
type InferInput<T> = T extends UnsetMarker ? Record<string, never> : T extends z.ZodObject<any> ? z.infer<T> : never;
|
|
665
|
+
/**
|
|
666
|
+
* Infer raw client input before defaults/transforms.
|
|
667
|
+
* Used for generated API arg typing.
|
|
668
|
+
*/
|
|
669
|
+
type InferClientInput<T> = T extends UnsetMarker ? Record<string, never> : T extends z.ZodObject<any> ? z.input<T> : never;
|
|
659
670
|
/**
|
|
660
671
|
* Infer input type for middleware (returns unknown for UnsetMarker, matching tRPC)
|
|
661
672
|
* Middleware before .input() receives unknown input
|
|
662
673
|
*/
|
|
663
674
|
type InferMiddlewareInput<T> = T extends UnsetMarker ? unknown : T extends z.ZodObject<any> ? z.infer<T> : unknown;
|
|
675
|
+
/**
|
|
676
|
+
* Static-only type hint attached to cRPC exports.
|
|
677
|
+
*
|
|
678
|
+
* Convex validators can widen unsupported types (like Date) to `any`.
|
|
679
|
+
* Codegen can read this hint from `typeof import(...).fn` to recover precise
|
|
680
|
+
* TypeScript input/output types for generated client API refs.
|
|
681
|
+
*/
|
|
682
|
+
type CRPCFunctionTypeHint<TArgs, TReturns> = {
|
|
683
|
+
readonly __betterConvexTypeHint?: {
|
|
684
|
+
readonly args: TArgs;
|
|
685
|
+
readonly returns: TReturns;
|
|
686
|
+
};
|
|
687
|
+
};
|
|
664
688
|
/** Base config shape for function builders */
|
|
665
689
|
type FunctionBuilderConfig = {
|
|
666
690
|
/** Base function builder (query, mutation, or action from Convex) */base: unknown; /** Internal function builder (internalQuery, etc.) */
|
|
@@ -751,7 +775,7 @@ declare class ProcedureBuilder<TBaseCtx, _TContext, TContextOverrides extends Un
|
|
|
751
775
|
protected _meta(value: TMeta): ProcedureBuilderDef<TMeta>;
|
|
752
776
|
/** Merge all input schemas into one */
|
|
753
777
|
protected _getMergedInput(): Record<string, any> | undefined;
|
|
754
|
-
protected _createFunction(handler: any, baseFunction: any, customFn: typeof zCustomQuery | typeof zCustomMutation | typeof zCustomAction, fnType: 'query' | 'mutation' | 'action'):
|
|
778
|
+
protected _createFunction(handler: any, baseFunction: any, customFn: typeof zCustomQuery | typeof zCustomMutation | typeof zCustomAction, fnType: 'query' | 'mutation' | 'action'): convex_server0.RegisteredMutation<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
755
779
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
756
780
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
757
781
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -759,9 +783,9 @@ declare class ProcedureBuilder<TBaseCtx, _TContext, TContextOverrides extends Un
|
|
|
759
783
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
760
784
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T ? T extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
761
785
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
762
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T extends Record<string, never> ? [{}] : [T] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T, {}>] : [
|
|
786
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T extends Record<string, never> ? [{}] : [T] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_1 ? T_1 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_1 extends void ? Promise<any> : [T_1] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_1> extends infer T_2 ? T_2 extends z.core.output<T_1> ? T_2 extends null ? void | T_2 | undefined : T_2 : never : never> | (z.core.output<T_1> extends infer T_3 ? T_3 extends z.core.output<T_1> ? T_3 extends null ? void | T_3 | undefined : T_3 : never : never) : [T_1] extends [{
|
|
763
787
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
764
|
-
}] ? Promise<z.core.$InferObjectOutput<T_1, {}> extends infer T_4 ? T_4 extends z.core.$InferObjectOutput<T_1, {}> ? T_4 extends null ? void | T_4 | undefined : T_4 : never : never> | (z.core.$InferObjectOutput<T_1, {}> extends infer T_5 ? T_5 extends z.core.$InferObjectOutput<T_1, {}> ? T_5 extends null ? void | T_5 | undefined : T_5 : never : never) : any : never : never> |
|
|
788
|
+
}] ? Promise<z.core.$InferObjectOutput<T_1, {}> extends infer T_4 ? T_4 extends z.core.$InferObjectOutput<T_1, {}> ? T_4 extends null ? void | T_4 | undefined : T_4 : never : never> | (z.core.$InferObjectOutput<T_1, {}> extends infer T_5 ? T_5 extends z.core.$InferObjectOutput<T_1, {}> ? T_5 extends null ? void | T_5 | undefined : T_5 : never : never) : any : never : never> | convex_server0.RegisteredQuery<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
765
789
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
766
790
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
767
791
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -769,9 +793,9 @@ declare class ProcedureBuilder<TBaseCtx, _TContext, TContextOverrides extends Un
|
|
|
769
793
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
770
794
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_6 ? T_6 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
771
795
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
772
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_6 extends Record<string, never> ? [{}] : [T_6] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_6, {}>] : [
|
|
796
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_6 extends Record<string, never> ? [{}] : [T_6] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_6, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_7 ? T_7 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_7 extends void ? Promise<any> : [T_7] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_7> extends infer T_8 ? T_8 extends z.core.output<T_7> ? T_8 extends null ? void | T_8 | undefined : T_8 : never : never> | (z.core.output<T_7> extends infer T_9 ? T_9 extends z.core.output<T_7> ? T_9 extends null ? void | T_9 | undefined : T_9 : never : never) : [T_7] extends [{
|
|
773
797
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
774
|
-
}] ? Promise<z.core.$InferObjectOutput<T_7, {}> extends infer T_10 ? T_10 extends z.core.$InferObjectOutput<T_7, {}> ? T_10 extends null ? void | T_10 | undefined : T_10 : never : never> | (z.core.$InferObjectOutput<T_7, {}> extends infer T_11 ? T_11 extends z.core.$InferObjectOutput<T_7, {}> ? T_11 extends null ? void | T_11 | undefined : T_11 : never : never) : any : never : never> |
|
|
798
|
+
}] ? Promise<z.core.$InferObjectOutput<T_7, {}> extends infer T_10 ? T_10 extends z.core.$InferObjectOutput<T_7, {}> ? T_10 extends null ? void | T_10 | undefined : T_10 : never : never> | (z.core.$InferObjectOutput<T_7, {}> extends infer T_11 ? T_11 extends z.core.$InferObjectOutput<T_7, {}> ? T_11 extends null ? void | T_11 | undefined : T_11 : never : never) : any : never : never> | convex_server0.RegisteredAction<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
775
799
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
776
800
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
777
801
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -779,7 +803,7 @@ declare class ProcedureBuilder<TBaseCtx, _TContext, TContextOverrides extends Un
|
|
|
779
803
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
780
804
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_12 ? T_12 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
781
805
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
782
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_12 extends Record<string, never> ? [{}] : [T_12] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_12, {}>] : [
|
|
806
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_12 extends Record<string, never> ? [{}] : [T_12] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_12, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_13 ? T_13 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_13 extends void ? Promise<any> : [T_13] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_13> extends infer T_14 ? T_14 extends z.core.output<T_13> ? T_14 extends null ? void | T_14 | undefined : T_14 : never : never> | (z.core.output<T_13> extends infer T_15 ? T_15 extends z.core.output<T_13> ? T_15 extends null ? void | T_15 | undefined : T_15 : never : never) : [T_13] extends [{
|
|
783
807
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
784
808
|
}] ? Promise<z.core.$InferObjectOutput<T_13, {}> extends infer T_16 ? T_16 extends z.core.$InferObjectOutput<T_13, {}> ? T_16 extends null ? void | T_16 | undefined : T_16 : never : never> | (z.core.$InferObjectOutput<T_13, {}> extends infer T_17 ? T_17 extends z.core.$InferObjectOutput<T_13, {}> ? T_17 extends null ? void | T_17 | undefined : T_17 : never : never) : any : never : never>;
|
|
785
809
|
}
|
|
@@ -787,18 +811,18 @@ declare class ProcedureBuilder<TBaseCtx, _TContext, TContextOverrides extends Un
|
|
|
787
811
|
* Query-specific procedure builder
|
|
788
812
|
* Only exposes .query() and .internalQuery() methods
|
|
789
813
|
*/
|
|
790
|
-
declare class QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides extends UnsetMarker | object = UnsetMarker, TInput extends UnsetMarker | z.ZodObject<any> = UnsetMarker, TOutput extends UnsetMarker | z.ZodTypeAny = UnsetMarker, TMeta extends object = object> extends ProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta> {
|
|
814
|
+
declare class QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides extends UnsetMarker | object = UnsetMarker, TInput extends UnsetMarker | z.ZodObject<any> = UnsetMarker, TClientInput extends UnsetMarker | z.ZodObject<any> = TInput, TOutput extends UnsetMarker | z.ZodTypeAny = UnsetMarker, TMeta extends object = object> extends ProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta> {
|
|
791
815
|
/**
|
|
792
816
|
* Add middleware that transforms the context
|
|
793
817
|
* Middleware receives typed input if called after .input(), unknown otherwise
|
|
794
818
|
* $ContextOverridesOut is inferred from next()
|
|
795
819
|
*/
|
|
796
820
|
use<$ContextOverridesOut extends object>(middlewareOrBuilder: MiddlewareFunction<Overwrite$1<TContext, TContextOverrides>, TMeta, TContextOverrides, $ContextOverridesOut, InferMiddlewareInput<TInput>> | MiddlewareBuilder<any, // Allow reusable middleware with any context
|
|
797
|
-
TMeta, $ContextOverridesOut, InferMiddlewareInput<TInput>>): QueryProcedureBuilder<TBaseCtx, TContext, Overwrite$1<TContextOverrides, $ContextOverridesOut>, TInput, TOutput, TMeta>;
|
|
821
|
+
TMeta, $ContextOverridesOut, InferMiddlewareInput<TInput>>): QueryProcedureBuilder<TBaseCtx, TContext, Overwrite$1<TContextOverrides, $ContextOverridesOut>, TInput, TClientInput, TOutput, TMeta>;
|
|
798
822
|
/** Set procedure metadata (shallow merged when chained) */
|
|
799
|
-
meta(value: TMeta): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
|
|
823
|
+
meta(value: TMeta): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TClientInput, TOutput, TMeta>;
|
|
800
824
|
/** Define input schema (chainable - schemas are merged) */
|
|
801
|
-
input<TNewInput extends z.ZodObject<any>>(schema: TNewInput): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, IntersectIfDefined<TInput, TNewInput>, TOutput, TMeta>;
|
|
825
|
+
input<TNewInput extends z.ZodObject<any>>(schema: TNewInput): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, IntersectIfDefined<TInput, TNewInput>, IntersectIfDefined<TClientInput, TNewInput>, TOutput, TMeta>;
|
|
802
826
|
/**
|
|
803
827
|
* Add pagination input (chainable before .query())
|
|
804
828
|
*
|
|
@@ -811,18 +835,18 @@ declare class QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides extend
|
|
|
811
835
|
paginated<TItem extends z.ZodTypeAny>(opts: {
|
|
812
836
|
limit: number;
|
|
813
837
|
item: TItem;
|
|
814
|
-
}): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, IntersectIfDefined<TInput, PaginatedInputSchema>, z.ZodObject<{
|
|
838
|
+
}): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, IntersectIfDefined<TInput, PaginatedInputSchema>, IntersectIfDefined<TClientInput, PaginatedClientInputSchema>, z.ZodObject<{
|
|
815
839
|
continueCursor: z.ZodUnion<[z.ZodString, z.ZodNull]>;
|
|
816
840
|
isDone: z.ZodBoolean;
|
|
817
841
|
page: z.ZodArray<TItem>;
|
|
818
842
|
}>, TMeta>;
|
|
819
843
|
/** Define output schema */
|
|
820
|
-
output<TNewOutput extends z.ZodTypeAny>(schema: TNewOutput): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TNewOutput, TMeta>;
|
|
844
|
+
output<TNewOutput extends z.ZodTypeAny>(schema: TNewOutput): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TClientInput, TNewOutput, TMeta>;
|
|
821
845
|
/** Create a query */
|
|
822
846
|
query<TResult>(handler: (opts: {
|
|
823
847
|
ctx: Overwrite$1<TContext, TContextOverrides>;
|
|
824
848
|
input: InferInput<TInput>;
|
|
825
|
-
}) => Promise<TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>):
|
|
849
|
+
}) => Promise<TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>): (convex_server0.RegisteredMutation<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
826
850
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
827
851
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
828
852
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -830,9 +854,9 @@ declare class QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides extend
|
|
|
830
854
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
831
855
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T ? T extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
832
856
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
833
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T extends Record<string, never> ? [{}] : [T] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T, {}>] : [
|
|
857
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T extends Record<string, never> ? [{}] : [T] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_1 ? T_1 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_1 extends void ? Promise<any> : [T_1] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_1> extends infer T_2 ? T_2 extends z.core.output<T_1> ? T_2 extends null ? void | T_2 | undefined : T_2 : never : never> | (z.core.output<T_1> extends infer T_3 ? T_3 extends z.core.output<T_1> ? T_3 extends null ? void | T_3 | undefined : T_3 : never : never) : [T_1] extends [{
|
|
834
858
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
835
|
-
}] ? Promise<z.core.$InferObjectOutput<T_1, {}> extends infer T_4 ? T_4 extends z.core.$InferObjectOutput<T_1, {}> ? T_4 extends null ? void | T_4 | undefined : T_4 : never : never> | (z.core.$InferObjectOutput<T_1, {}> extends infer T_5 ? T_5 extends z.core.$InferObjectOutput<T_1, {}> ? T_5 extends null ? void | T_5 | undefined : T_5 : never : never) : any : never : never> |
|
|
859
|
+
}] ? Promise<z.core.$InferObjectOutput<T_1, {}> extends infer T_4 ? T_4 extends z.core.$InferObjectOutput<T_1, {}> ? T_4 extends null ? void | T_4 | undefined : T_4 : never : never> | (z.core.$InferObjectOutput<T_1, {}> extends infer T_5 ? T_5 extends z.core.$InferObjectOutput<T_1, {}> ? T_5 extends null ? void | T_5 | undefined : T_5 : never : never) : any : never : never> | convex_server0.RegisteredQuery<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
836
860
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
837
861
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
838
862
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -840,9 +864,9 @@ declare class QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides extend
|
|
|
840
864
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
841
865
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_6 ? T_6 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
842
866
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
843
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_6 extends Record<string, never> ? [{}] : [T_6] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_6, {}>] : [
|
|
867
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_6 extends Record<string, never> ? [{}] : [T_6] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_6, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_7 ? T_7 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_7 extends void ? Promise<any> : [T_7] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_7> extends infer T_8 ? T_8 extends z.core.output<T_7> ? T_8 extends null ? void | T_8 | undefined : T_8 : never : never> | (z.core.output<T_7> extends infer T_9 ? T_9 extends z.core.output<T_7> ? T_9 extends null ? void | T_9 | undefined : T_9 : never : never) : [T_7] extends [{
|
|
844
868
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
845
|
-
}] ? Promise<z.core.$InferObjectOutput<T_7, {}> extends infer T_10 ? T_10 extends z.core.$InferObjectOutput<T_7, {}> ? T_10 extends null ? void | T_10 | undefined : T_10 : never : never> | (z.core.$InferObjectOutput<T_7, {}> extends infer T_11 ? T_11 extends z.core.$InferObjectOutput<T_7, {}> ? T_11 extends null ? void | T_11 | undefined : T_11 : never : never) : any : never : never> |
|
|
869
|
+
}] ? Promise<z.core.$InferObjectOutput<T_7, {}> extends infer T_10 ? T_10 extends z.core.$InferObjectOutput<T_7, {}> ? T_10 extends null ? void | T_10 | undefined : T_10 : never : never> | (z.core.$InferObjectOutput<T_7, {}> extends infer T_11 ? T_11 extends z.core.$InferObjectOutput<T_7, {}> ? T_11 extends null ? void | T_11 | undefined : T_11 : never : never) : any : never : never> | convex_server0.RegisteredAction<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
846
870
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
847
871
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
848
872
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -850,11 +874,11 @@ declare class QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides extend
|
|
|
850
874
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
851
875
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_12 ? T_12 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
852
876
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
853
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_12 extends Record<string, never> ? [{}] : [T_12] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_12, {}>] : [
|
|
877
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_12 extends Record<string, never> ? [{}] : [T_12] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_12, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_13 ? T_13 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_13 extends void ? Promise<any> : [T_13] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_13> extends infer T_14 ? T_14 extends z.core.output<T_13> ? T_14 extends null ? void | T_14 | undefined : T_14 : never : never> | (z.core.output<T_13> extends infer T_15 ? T_15 extends z.core.output<T_13> ? T_15 extends null ? void | T_15 | undefined : T_15 : never : never) : [T_13] extends [{
|
|
854
878
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
855
|
-
}] ? Promise<z.core.$InferObjectOutput<T_13, {}> extends infer T_16 ? T_16 extends z.core.$InferObjectOutput<T_13, {}> ? T_16 extends null ? void | T_16 | undefined : T_16 : never : never> | (z.core.$InferObjectOutput<T_13, {}> extends infer T_17 ? T_17 extends z.core.$InferObjectOutput<T_13, {}> ? T_17 extends null ? void | T_17 | undefined : T_17 : never : never) : any : never : never>;
|
|
879
|
+
}] ? Promise<z.core.$InferObjectOutput<T_13, {}> extends infer T_16 ? T_16 extends z.core.$InferObjectOutput<T_13, {}> ? T_16 extends null ? void | T_16 | undefined : T_16 : never : never> | (z.core.$InferObjectOutput<T_13, {}> extends infer T_17 ? T_17 extends z.core.$InferObjectOutput<T_13, {}> ? T_17 extends null ? void | T_17 | undefined : T_17 : never : never) : any : never : never>) & CRPCFunctionTypeHint<InferClientInput<TClientInput>, TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>;
|
|
856
880
|
/** Mark as internal - returns chainable builder using internal function */
|
|
857
|
-
internal(): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
|
|
881
|
+
internal(): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TClientInput, TOutput, TMeta>;
|
|
858
882
|
}
|
|
859
883
|
/**
|
|
860
884
|
* Mutation-specific procedure builder
|
|
@@ -878,7 +902,7 @@ declare class MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides ext
|
|
|
878
902
|
mutation<TResult>(handler: (opts: {
|
|
879
903
|
ctx: Overwrite$1<TContext, TContextOverrides>;
|
|
880
904
|
input: InferInput<TInput>;
|
|
881
|
-
}) => Promise<TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>):
|
|
905
|
+
}) => Promise<TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>): (convex_server0.RegisteredMutation<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
882
906
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
883
907
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
884
908
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -886,9 +910,9 @@ declare class MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides ext
|
|
|
886
910
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
887
911
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T ? T extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
888
912
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
889
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T extends Record<string, never> ? [{}] : [T] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T, {}>] : [
|
|
913
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T extends Record<string, never> ? [{}] : [T] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_1 ? T_1 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_1 extends void ? Promise<any> : [T_1] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_1> extends infer T_2 ? T_2 extends z.core.output<T_1> ? T_2 extends null ? void | T_2 | undefined : T_2 : never : never> | (z.core.output<T_1> extends infer T_3 ? T_3 extends z.core.output<T_1> ? T_3 extends null ? void | T_3 | undefined : T_3 : never : never) : [T_1] extends [{
|
|
890
914
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
891
|
-
}] ? Promise<z.core.$InferObjectOutput<T_1, {}> extends infer T_4 ? T_4 extends z.core.$InferObjectOutput<T_1, {}> ? T_4 extends null ? void | T_4 | undefined : T_4 : never : never> | (z.core.$InferObjectOutput<T_1, {}> extends infer T_5 ? T_5 extends z.core.$InferObjectOutput<T_1, {}> ? T_5 extends null ? void | T_5 | undefined : T_5 : never : never) : any : never : never> |
|
|
915
|
+
}] ? Promise<z.core.$InferObjectOutput<T_1, {}> extends infer T_4 ? T_4 extends z.core.$InferObjectOutput<T_1, {}> ? T_4 extends null ? void | T_4 | undefined : T_4 : never : never> | (z.core.$InferObjectOutput<T_1, {}> extends infer T_5 ? T_5 extends z.core.$InferObjectOutput<T_1, {}> ? T_5 extends null ? void | T_5 | undefined : T_5 : never : never) : any : never : never> | convex_server0.RegisteredQuery<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
892
916
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
893
917
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
894
918
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -896,9 +920,9 @@ declare class MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides ext
|
|
|
896
920
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
897
921
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_6 ? T_6 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
898
922
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
899
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_6 extends Record<string, never> ? [{}] : [T_6] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_6, {}>] : [
|
|
923
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_6 extends Record<string, never> ? [{}] : [T_6] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_6, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_7 ? T_7 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_7 extends void ? Promise<any> : [T_7] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_7> extends infer T_8 ? T_8 extends z.core.output<T_7> ? T_8 extends null ? void | T_8 | undefined : T_8 : never : never> | (z.core.output<T_7> extends infer T_9 ? T_9 extends z.core.output<T_7> ? T_9 extends null ? void | T_9 | undefined : T_9 : never : never) : [T_7] extends [{
|
|
900
924
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
901
|
-
}] ? Promise<z.core.$InferObjectOutput<T_7, {}> extends infer T_10 ? T_10 extends z.core.$InferObjectOutput<T_7, {}> ? T_10 extends null ? void | T_10 | undefined : T_10 : never : never> | (z.core.$InferObjectOutput<T_7, {}> extends infer T_11 ? T_11 extends z.core.$InferObjectOutput<T_7, {}> ? T_11 extends null ? void | T_11 | undefined : T_11 : never : never) : any : never : never> |
|
|
925
|
+
}] ? Promise<z.core.$InferObjectOutput<T_7, {}> extends infer T_10 ? T_10 extends z.core.$InferObjectOutput<T_7, {}> ? T_10 extends null ? void | T_10 | undefined : T_10 : never : never> | (z.core.$InferObjectOutput<T_7, {}> extends infer T_11 ? T_11 extends z.core.$InferObjectOutput<T_7, {}> ? T_11 extends null ? void | T_11 | undefined : T_11 : never : never) : any : never : never> | convex_server0.RegisteredAction<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
902
926
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
903
927
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
904
928
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -906,9 +930,9 @@ declare class MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides ext
|
|
|
906
930
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
907
931
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_12 ? T_12 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
908
932
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
909
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_12 extends Record<string, never> ? [{}] : [T_12] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_12, {}>] : [
|
|
933
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_12 extends Record<string, never> ? [{}] : [T_12] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_12, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_13 ? T_13 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_13 extends void ? Promise<any> : [T_13] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_13> extends infer T_14 ? T_14 extends z.core.output<T_13> ? T_14 extends null ? void | T_14 | undefined : T_14 : never : never> | (z.core.output<T_13> extends infer T_15 ? T_15 extends z.core.output<T_13> ? T_15 extends null ? void | T_15 | undefined : T_15 : never : never) : [T_13] extends [{
|
|
910
934
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
911
|
-
}] ? Promise<z.core.$InferObjectOutput<T_13, {}> extends infer T_16 ? T_16 extends z.core.$InferObjectOutput<T_13, {}> ? T_16 extends null ? void | T_16 | undefined : T_16 : never : never> | (z.core.$InferObjectOutput<T_13, {}> extends infer T_17 ? T_17 extends z.core.$InferObjectOutput<T_13, {}> ? T_17 extends null ? void | T_17 | undefined : T_17 : never : never) : any : never : never>;
|
|
935
|
+
}] ? Promise<z.core.$InferObjectOutput<T_13, {}> extends infer T_16 ? T_16 extends z.core.$InferObjectOutput<T_13, {}> ? T_16 extends null ? void | T_16 | undefined : T_16 : never : never> | (z.core.$InferObjectOutput<T_13, {}> extends infer T_17 ? T_17 extends z.core.$InferObjectOutput<T_13, {}> ? T_17 extends null ? void | T_17 | undefined : T_17 : never : never) : any : never : never>) & CRPCFunctionTypeHint<InferClientInput<TInput>, TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>;
|
|
912
936
|
/** Mark as internal - returns chainable builder using internal function */
|
|
913
937
|
internal(): MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
|
|
914
938
|
}
|
|
@@ -930,7 +954,7 @@ declare class ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides exten
|
|
|
930
954
|
action<TResult>(handler: (opts: {
|
|
931
955
|
ctx: Overwrite$1<TContext, TContextOverrides>;
|
|
932
956
|
input: InferInput<TInput>;
|
|
933
|
-
}) => Promise<TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>):
|
|
957
|
+
}) => Promise<TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>): (convex_server0.RegisteredMutation<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
934
958
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
935
959
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
936
960
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -938,9 +962,9 @@ declare class ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides exten
|
|
|
938
962
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
939
963
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T ? T extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
940
964
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
941
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T extends Record<string, never> ? [{}] : [T] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T, {}>] : [
|
|
965
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T extends Record<string, never> ? [{}] : [T] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_1 ? T_1 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_1 extends void ? Promise<any> : [T_1] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_1> extends infer T_2 ? T_2 extends z.core.output<T_1> ? T_2 extends null ? void | T_2 | undefined : T_2 : never : never> | (z.core.output<T_1> extends infer T_3 ? T_3 extends z.core.output<T_1> ? T_3 extends null ? void | T_3 | undefined : T_3 : never : never) : [T_1] extends [{
|
|
942
966
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
943
|
-
}] ? Promise<z.core.$InferObjectOutput<T_1, {}> extends infer T_4 ? T_4 extends z.core.$InferObjectOutput<T_1, {}> ? T_4 extends null ? void | T_4 | undefined : T_4 : never : never> | (z.core.$InferObjectOutput<T_1, {}> extends infer T_5 ? T_5 extends z.core.$InferObjectOutput<T_1, {}> ? T_5 extends null ? void | T_5 | undefined : T_5 : never : never) : any : never : never> |
|
|
967
|
+
}] ? Promise<z.core.$InferObjectOutput<T_1, {}> extends infer T_4 ? T_4 extends z.core.$InferObjectOutput<T_1, {}> ? T_4 extends null ? void | T_4 | undefined : T_4 : never : never> | (z.core.$InferObjectOutput<T_1, {}> extends infer T_5 ? T_5 extends z.core.$InferObjectOutput<T_1, {}> ? T_5 extends null ? void | T_5 | undefined : T_5 : never : never) : any : never : never> | convex_server0.RegisteredQuery<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
944
968
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
945
969
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
946
970
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -948,9 +972,9 @@ declare class ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides exten
|
|
|
948
972
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
949
973
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_6 ? T_6 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
950
974
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
951
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_6 extends Record<string, never> ? [{}] : [T_6] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_6, {}>] : [
|
|
975
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_6 extends Record<string, never> ? [{}] : [T_6] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_6, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_7 ? T_7 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_7 extends void ? Promise<any> : [T_7] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_7> extends infer T_8 ? T_8 extends z.core.output<T_7> ? T_8 extends null ? void | T_8 | undefined : T_8 : never : never> | (z.core.output<T_7> extends infer T_9 ? T_9 extends z.core.output<T_7> ? T_9 extends null ? void | T_9 | undefined : T_9 : never : never) : [T_7] extends [{
|
|
952
976
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
953
|
-
}] ? Promise<z.core.$InferObjectOutput<T_7, {}> extends infer T_10 ? T_10 extends z.core.$InferObjectOutput<T_7, {}> ? T_10 extends null ? void | T_10 | undefined : T_10 : never : never> | (z.core.$InferObjectOutput<T_7, {}> extends infer T_11 ? T_11 extends z.core.$InferObjectOutput<T_7, {}> ? T_11 extends null ? void | T_11 | undefined : T_11 : never : never) : any : never : never> |
|
|
977
|
+
}] ? Promise<z.core.$InferObjectOutput<T_7, {}> extends infer T_10 ? T_10 extends z.core.$InferObjectOutput<T_7, {}> ? T_10 extends null ? void | T_10 | undefined : T_10 : never : never> | (z.core.$InferObjectOutput<T_7, {}> extends infer T_11 ? T_11 extends z.core.$InferObjectOutput<T_7, {}> ? T_11 extends null ? void | T_11 | undefined : T_11 : never : never) : any : never : never> | convex_server0.RegisteredAction<convex_server0.FunctionVisibility, convex_server0.ArgsArrayToObject<[TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
954
978
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
955
979
|
}>, z.core.$strip> ? TShape : Record<string, never>] extends [z.core.$ZodObject<any, z.core.$ZodObjectConfig>] ? [z.core.input<z.core.$ZodObject<any, z.core.$ZodObjectConfig> & (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
956
980
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -958,15 +982,15 @@ declare class ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides exten
|
|
|
958
982
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
959
983
|
}>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_12 ? T_12 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
|
|
960
984
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
961
|
-
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_12 extends Record<string, never> ? [{}] : [T_12] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_12, {}>] : [
|
|
985
|
+
}>, z.core.$strip> ? TShape : Record<string, never>) ? T_12 extends Record<string, never> ? [{}] : [T_12] extends [Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>] ? [z.core.$InferObjectInput<T_12, {}>] : [convex_server0.DefaultFunctionArgs] : never : never>, (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) extends infer T_13 ? T_13 extends (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? TOutput : never) ? T_13 extends void ? Promise<any> : [T_13] extends [z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>] ? Promise<z.core.output<T_13> extends infer T_14 ? T_14 extends z.core.output<T_13> ? T_14 extends null ? void | T_14 | undefined : T_14 : never : never> | (z.core.output<T_13> extends infer T_15 ? T_15 extends z.core.output<T_13> ? T_15 extends null ? void | T_15 | undefined : T_15 : never : never) : [T_13] extends [{
|
|
962
986
|
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
963
|
-
}] ? Promise<z.core.$InferObjectOutput<T_13, {}> extends infer T_16 ? T_16 extends z.core.$InferObjectOutput<T_13, {}> ? T_16 extends null ? void | T_16 | undefined : T_16 : never : never> | (z.core.$InferObjectOutput<T_13, {}> extends infer T_17 ? T_17 extends z.core.$InferObjectOutput<T_13, {}> ? T_17 extends null ? void | T_17 | undefined : T_17 : never : never) : any : never : never>;
|
|
987
|
+
}] ? Promise<z.core.$InferObjectOutput<T_13, {}> extends infer T_16 ? T_16 extends z.core.$InferObjectOutput<T_13, {}> ? T_16 extends null ? void | T_16 | undefined : T_16 : never : never> | (z.core.$InferObjectOutput<T_13, {}> extends infer T_17 ? T_17 extends z.core.$InferObjectOutput<T_13, {}> ? T_17 extends null ? void | T_17 | undefined : T_17 : never : never) : any : never : never>) & CRPCFunctionTypeHint<InferClientInput<TInput>, TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>;
|
|
964
988
|
/** Mark as internal - returns chainable builder using internal function */
|
|
965
989
|
internal(): ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
|
|
966
990
|
}
|
|
967
991
|
/** Return type for create() */
|
|
968
992
|
type CRPCInstance<_DataModel extends GenericDataModel, TQueryCtx, TMutationCtx, TActionCtx, THttpActionCtx, TMeta extends object = object> = {
|
|
969
|
-
query: QueryProcedureBuilder<TQueryCtx, TQueryCtx, UnsetMarker, UnsetMarker, UnsetMarker, TMeta>;
|
|
993
|
+
query: QueryProcedureBuilder<TQueryCtx, TQueryCtx, UnsetMarker, UnsetMarker, UnsetMarker, UnsetMarker, TMeta>;
|
|
970
994
|
mutation: MutationProcedureBuilder<TMutationCtx, TMutationCtx, UnsetMarker, UnsetMarker, UnsetMarker, TMeta>;
|
|
971
995
|
action: ActionProcedureBuilder<TActionCtx, TActionCtx, UnsetMarker, UnsetMarker, UnsetMarker, TMeta>;
|
|
972
996
|
httpAction: HttpProcedureBuilder<THttpActionCtx, THttpActionCtx, UnsetMarker, UnsetMarker, UnsetMarker, UnsetMarker, TMeta, HttpMethod>; /** Create reusable middleware - defaults to query context, override with generic */
|
|
@@ -1058,6 +1082,25 @@ declare const initCRPC: {
|
|
|
1058
1082
|
object>;
|
|
1059
1083
|
};
|
|
1060
1084
|
//#endregion
|
|
1085
|
+
//#region src/server/api-entry.d.ts
|
|
1086
|
+
type ApiFunctionType = 'query' | 'mutation' | 'action';
|
|
1087
|
+
type InferArgsFromExport<TExport> = TExport extends CRPCFunctionTypeHint<infer TArgs, any> ? TArgs : TExport extends FunctionReference<any, any, infer TArgs, any> ? TArgs : TExport extends RegisteredQuery<any, infer TArgs, any> | RegisteredMutation<any, infer TArgs, any> | RegisteredAction<any, infer TArgs, any> ? TArgs : never;
|
|
1088
|
+
type InferReturnFromExport<TExport> = TExport extends CRPCFunctionTypeHint<any, infer TReturn> ? Awaited<TReturn> : TExport extends FunctionReference<any, any, any, infer TReturn> ? Awaited<TReturn> : TExport extends RegisteredQuery<any, any, infer TReturn> | RegisteredMutation<any, any, infer TReturn> | RegisteredAction<any, any, infer TReturn> ? Awaited<TReturn> : never;
|
|
1089
|
+
type CoerceArgs<TArgs> = TArgs extends DefaultFunctionArgs ? TArgs : TArgs extends Record<string, any> ? TArgs : Record<string, never>;
|
|
1090
|
+
type ApiFunctionRefFromExport<TType extends ApiFunctionType, TExport> = FunctionReference<TType, 'public', CoerceArgs<InferArgsFromExport<TExport>>, InferReturnFromExport<TExport>>;
|
|
1091
|
+
type ApiFunctionLeafMeta = {
|
|
1092
|
+
type: ApiFunctionType;
|
|
1093
|
+
auth?: 'required' | 'optional';
|
|
1094
|
+
[key: string]: unknown;
|
|
1095
|
+
};
|
|
1096
|
+
/**
|
|
1097
|
+
* Build a generated API leaf from a Convex FunctionReference name.
|
|
1098
|
+
* Returns a plain FunctionReference-compatible object with attached cRPC metadata.
|
|
1099
|
+
*/
|
|
1100
|
+
declare function createApiLeaf<TType extends ApiFunctionType, TExport, TMeta extends ApiFunctionLeafMeta = ApiFunctionLeafMeta>(fn: unknown, meta: TMeta): ApiFunctionRefFromExport<TType, TExport> & TMeta & {
|
|
1101
|
+
functionRef: ApiFunctionRefFromExport<TType, TExport>;
|
|
1102
|
+
};
|
|
1103
|
+
//#endregion
|
|
1061
1104
|
//#region src/server/caller.d.ts
|
|
1062
1105
|
/** Metadata for a single function */
|
|
1063
1106
|
type FnMeta = {
|
|
@@ -1066,7 +1109,7 @@ type FnMeta = {
|
|
|
1066
1109
|
};
|
|
1067
1110
|
/** Metadata for all functions in a module */
|
|
1068
1111
|
type ModuleMeta = Record<string, FnMeta>;
|
|
1069
|
-
/** Metadata for all modules - from generated `@convex/
|
|
1112
|
+
/** Metadata for all modules - from generated `@convex/api` */
|
|
1070
1113
|
type CallerMeta = Record<string, ModuleMeta>;
|
|
1071
1114
|
/** Options for individual caller function calls */
|
|
1072
1115
|
type CallerOpts = {
|
|
@@ -1084,7 +1127,7 @@ type CreateCallerOptions = {
|
|
|
1084
1127
|
transformer?: DataTransformerOptions;
|
|
1085
1128
|
};
|
|
1086
1129
|
type ServerCallerFn<TApi, K extends keyof TApi> = TApi[K] extends FunctionReference<infer T, 'public'> ? T extends 'query' | 'mutation' | 'action' ? keyof TApi[K]['_args'] extends never ? <Opts extends CallerOpts | undefined = undefined>(args?: EmptyObject, opts?: Opts) => Promise<CallerReturn<FunctionReturnType<TApi[K]>, Opts>> : EmptyObject extends TApi[K]['_args'] ? <Opts extends CallerOpts | undefined = undefined>(args?: TApi[K]['_args'], opts?: Opts) => Promise<CallerReturn<FunctionReturnType<TApi[K]>, Opts>> : <Opts extends CallerOpts | undefined = undefined>(args: TApi[K]['_args'], opts?: Opts) => Promise<CallerReturn<FunctionReturnType<TApi[K]>, Opts>> : never : ServerCaller<TApi[K]>;
|
|
1087
|
-
type ServerCaller<TApi> = { [K in keyof TApi]: ServerCallerFn<TApi, K> };
|
|
1130
|
+
type ServerCaller<TApi> = { [K in keyof TApi as K extends string ? K extends `_${string}` ? never : K extends 'http' ? never : K : K]: ServerCallerFn<TApi, K> };
|
|
1088
1131
|
/**
|
|
1089
1132
|
* Create a server caller for direct data fetching without React Query.
|
|
1090
1133
|
*
|
|
@@ -1157,8 +1200,7 @@ type AuthOptions = {
|
|
|
1157
1200
|
type CreateCallerFactoryOptions<TApi> = {
|
|
1158
1201
|
/** Your Convex API object. */api: TApi; /** Convex site URL (must end in `.convex.site`). */
|
|
1159
1202
|
convexSiteUrl: string; /** Auth options. Pass to enable authenticated calls with JWT caching. */
|
|
1160
|
-
auth?: AuthOptions; /**
|
|
1161
|
-
meta: CallerMeta; /** Optional wire transformer for request/response payloads (always composed with Date). */
|
|
1203
|
+
auth?: AuthOptions; /** Optional wire transformer for request/response payloads (always composed with Date). */
|
|
1162
1204
|
transformer?: DataTransformerOptions;
|
|
1163
1205
|
};
|
|
1164
1206
|
type ConvexContext<TApi> = {
|
|
@@ -1173,6 +1215,20 @@ declare function createCallerFactory<TApi extends Record<string, unknown>>(opts:
|
|
|
1173
1215
|
createCaller: (ctxFn: () => Promise<ConvexContext<TApi>>) => LazyCaller<TApi>;
|
|
1174
1216
|
};
|
|
1175
1217
|
//#endregion
|
|
1218
|
+
//#region src/server/context-utils.d.ts
|
|
1219
|
+
type GenericCtx<DataModel extends GenericDataModel = GenericDataModel> = GenericQueryCtx<DataModel> | GenericMutationCtx<DataModel> | GenericActionCtx<DataModel>;
|
|
1220
|
+
type RunMutationCtx<DataModel extends GenericDataModel> = (GenericMutationCtx<DataModel> | GenericActionCtx<DataModel>) & {
|
|
1221
|
+
runMutation: GenericMutationCtx<DataModel>['runMutation'];
|
|
1222
|
+
};
|
|
1223
|
+
declare const isQueryCtx: <DataModel extends GenericDataModel>(ctx: GenericCtx<DataModel>) => ctx is GenericQueryCtx<DataModel>;
|
|
1224
|
+
declare const isMutationCtx: <DataModel extends GenericDataModel>(ctx: GenericCtx<DataModel>) => ctx is GenericMutationCtx<DataModel>;
|
|
1225
|
+
declare const isActionCtx: <DataModel extends GenericDataModel>(ctx: GenericCtx<DataModel>) => ctx is GenericActionCtx<DataModel>;
|
|
1226
|
+
declare const isRunMutationCtx: <DataModel extends GenericDataModel>(ctx: GenericCtx<DataModel>) => ctx is RunMutationCtx<DataModel>;
|
|
1227
|
+
declare const requireQueryCtx: <DataModel extends GenericDataModel>(ctx: GenericCtx<DataModel>) => GenericQueryCtx<DataModel>;
|
|
1228
|
+
declare const requireMutationCtx: <DataModel extends GenericDataModel>(ctx: GenericCtx<DataModel>) => GenericMutationCtx<DataModel>;
|
|
1229
|
+
declare const requireActionCtx: <DataModel extends GenericDataModel>(ctx: GenericCtx<DataModel>) => GenericActionCtx<DataModel>;
|
|
1230
|
+
declare const requireRunMutationCtx: <DataModel extends GenericDataModel>(ctx: GenericCtx<DataModel>) => RunMutationCtx<DataModel>;
|
|
1231
|
+
//#endregion
|
|
1176
1232
|
//#region src/server/env.d.ts
|
|
1177
1233
|
type CreateEnvOptions<TSchema extends z.ZodObject<z.ZodRawShape>> = {
|
|
1178
1234
|
cache?: boolean;
|
|
@@ -1274,7 +1330,7 @@ declare function isCRPCError(error: unknown): error is CRPCError;
|
|
|
1274
1330
|
* ```ts
|
|
1275
1331
|
* import type { WithHttpRouter } from 'better-convex/server';
|
|
1276
1332
|
*
|
|
1277
|
-
* export type AppRouter = WithHttpRouter<typeof api, typeof
|
|
1333
|
+
* export type AppRouter = WithHttpRouter<typeof api, typeof httpRouter>;
|
|
1278
1334
|
* export type ApiInputs = inferApiInputs<AppRouter>;
|
|
1279
1335
|
* // ApiInputs['http']['todos']['create'] works
|
|
1280
1336
|
* ```
|
|
@@ -1284,6 +1340,7 @@ type WithHttpRouter<TApi, TRouter> = TApi & {
|
|
|
1284
1340
|
};
|
|
1285
1341
|
/** Helper to unwrap optional/nullable types for inference */
|
|
1286
1342
|
type UnwrapOptional<T> = T extends undefined ? never : NonNullable<T>;
|
|
1343
|
+
type PublicApiKey<K> = K extends string ? K extends `_${string}` ? never : K : K;
|
|
1287
1344
|
/** Recursive output inference that handles optional properties */
|
|
1288
1345
|
type InferOutputsRecursive<T> = T extends FunctionReference<infer _T, 'public'> ? FunctionReturnType<T> : T extends HttpProcedure ? InferHttpOutput<T> : T extends CRPCHttpRouter<infer R> ? inferApiOutputs<R> : T extends HttpRouterRecord ? inferApiOutputs<T> : inferApiOutputs<T>;
|
|
1289
1346
|
/**
|
|
@@ -1295,14 +1352,14 @@ type InferOutputsRecursive<T> = T extends FunctionReference<infer _T, 'public'>
|
|
|
1295
1352
|
* import { api } from '@convex/api';
|
|
1296
1353
|
* import type { inferApiOutputs } from 'better-convex/server';
|
|
1297
1354
|
*
|
|
1298
|
-
* type AppRouter = typeof api & { http?: typeof
|
|
1355
|
+
* type AppRouter = typeof api & { http?: typeof httpRouter };
|
|
1299
1356
|
* type ApiOutputs = inferApiOutputs<AppRouter>;
|
|
1300
1357
|
*
|
|
1301
1358
|
* type LinkData = ApiOutputs['scraper']['scrapeLink'];
|
|
1302
1359
|
* type TodoList = ApiOutputs['http']['todos']['list'];
|
|
1303
1360
|
* ```
|
|
1304
1361
|
*/
|
|
1305
|
-
type inferApiOutputs<TApi> = { [K in keyof TApi]-?: InferOutputsRecursive<UnwrapOptional<TApi[K]>> };
|
|
1362
|
+
type inferApiOutputs<TApi> = { [K in keyof TApi as PublicApiKey<K>]-?: InferOutputsRecursive<UnwrapOptional<TApi[K]>> };
|
|
1306
1363
|
/** Recursive input inference that handles optional properties */
|
|
1307
1364
|
type InferInputsRecursive<T> = T extends FunctionReference<infer _T, 'public'> ? T['_args'] : T extends HttpProcedure ? InferHttpInput<T> : T extends CRPCHttpRouter<infer R> ? inferApiInputs<R> : T extends HttpRouterRecord ? inferApiInputs<T> : inferApiInputs<T>;
|
|
1308
1365
|
/**
|
|
@@ -1314,13 +1371,93 @@ type InferInputsRecursive<T> = T extends FunctionReference<infer _T, 'public'> ?
|
|
|
1314
1371
|
* import { api } from '@convex/api';
|
|
1315
1372
|
* import type { inferApiInputs } from 'better-convex/server';
|
|
1316
1373
|
*
|
|
1317
|
-
* type AppRouter = typeof api & { http?: typeof
|
|
1374
|
+
* type AppRouter = typeof api & { http?: typeof httpRouter };
|
|
1318
1375
|
* type ApiInputs = inferApiInputs<AppRouter>;
|
|
1319
1376
|
*
|
|
1320
1377
|
* type ScrapeLinkInput = ApiInputs['scraper']['scrapeLink'];
|
|
1321
1378
|
* type CreateTodoInput = ApiInputs['http']['todos']['create'];
|
|
1322
1379
|
* ```
|
|
1323
1380
|
*/
|
|
1324
|
-
type inferApiInputs<TApi> = { [K in keyof TApi]-?: InferInputsRecursive<UnwrapOptional<TApi[K]>> };
|
|
1381
|
+
type inferApiInputs<TApi> = { [K in keyof TApi as PublicApiKey<K>]-?: InferInputsRecursive<UnwrapOptional<TApi[K]>> };
|
|
1382
|
+
//#endregion
|
|
1383
|
+
//#region src/server/procedure-caller.d.ts
|
|
1384
|
+
type ProcedureType = 'query' | 'mutation' | 'action';
|
|
1385
|
+
type CallerContextType = 'query' | 'mutation';
|
|
1386
|
+
type RecordLike = Record<string, unknown>;
|
|
1387
|
+
type ProcedureTree = RecordLike;
|
|
1388
|
+
type ProcedureDefinition<TType extends ProcedureType, TProcedure> = Readonly<{
|
|
1389
|
+
_type: TType;
|
|
1390
|
+
__procedure?: TProcedure;
|
|
1391
|
+
}>;
|
|
1392
|
+
type ProcedureHandlerType<TProcedure> = NonNullable<TProcedure extends {
|
|
1393
|
+
_handler?: infer THandler;
|
|
1394
|
+
} ? THandler : never>;
|
|
1395
|
+
type ProcedureTypeHintInput<TProcedure> = TProcedure extends {
|
|
1396
|
+
__betterConvexTypeHint?: {
|
|
1397
|
+
args: infer TArgs;
|
|
1398
|
+
};
|
|
1399
|
+
} ? TArgs : never;
|
|
1400
|
+
type ProcedureTypeHintOutput<TProcedure> = TProcedure extends {
|
|
1401
|
+
__betterConvexTypeHint?: {
|
|
1402
|
+
returns: infer TReturns;
|
|
1403
|
+
};
|
|
1404
|
+
} ? TReturns : never;
|
|
1405
|
+
type InferredHandlerInput<TProcedure> = ProcedureHandlerType<TProcedure> extends ((ctx: unknown, input: infer TInput, ...rest: any[]) => unknown) ? TInput : Record<string, never>;
|
|
1406
|
+
type InferredHandlerOutput<TProcedure> = ProcedureHandlerType<TProcedure> extends ((...args: any[]) => infer TResult) ? Awaited<TResult> : never;
|
|
1407
|
+
type ProcedureInput<TProcedure> = [ProcedureTypeHintInput<TProcedure>] extends [never] ? InferredHandlerInput<TProcedure> : ProcedureTypeHintInput<TProcedure>;
|
|
1408
|
+
type ProcedureOutput<TProcedure> = [ProcedureTypeHintOutput<TProcedure>] extends [never] ? InferredHandlerOutput<TProcedure> : ProcedureTypeHintOutput<TProcedure>;
|
|
1409
|
+
type ProcedureCallable<TProcedure> = keyof ProcedureInput<TProcedure> extends never ? (input?: EmptyObject) => Promise<ProcedureOutput<TProcedure>> : EmptyObject extends ProcedureInput<TProcedure> ? (input?: ProcedureInput<TProcedure>) => Promise<ProcedureOutput<TProcedure>> : (input: ProcedureInput<TProcedure>) => Promise<ProcedureOutput<TProcedure>>;
|
|
1410
|
+
type SchedulableProcedureType = Exclude<ProcedureType, 'query'>;
|
|
1411
|
+
type AllowedProcedureType<TCtxType extends CallerContextType> = TCtxType extends 'query' ? 'query' : 'query' | 'mutation';
|
|
1412
|
+
type CallerKey<TValue, TCtxType extends CallerContextType, TKey extends PropertyKey> = TValue extends ProcedureDefinition<infer TType, any> ? TType extends AllowedProcedureType<TCtxType> ? TKey : never : TValue extends RecordLike ? TKey : never;
|
|
1413
|
+
type ProcedureCaller<TApi, TCtxType extends CallerContextType> = TApi extends RecordLike ? { [K in keyof TApi as CallerKey<TApi[K], TCtxType, K>]: TApi[K] extends ProcedureDefinition<any, infer TProcedure> ? ProcedureCallable<TProcedure> : TApi[K] extends RecordLike ? ProcedureCaller<TApi[K], TCtxType> : never } : never;
|
|
1414
|
+
type CallerForContext<TApi, TCtx, TQueryCtx, TMutationCtx> = TCtx extends TMutationCtx ? ProcedureCaller<TApi, 'mutation'> : TCtx extends TQueryCtx ? ProcedureCaller<TApi, 'query'> : never;
|
|
1415
|
+
type UnionToIntersection<TUnion> = (TUnion extends unknown ? (value: TUnion) => void : never) extends ((value: infer TIntersection) => void) ? TIntersection : never;
|
|
1416
|
+
type Simplify<TObject> = { [K in keyof TObject]: TObject[K] } & {};
|
|
1417
|
+
type SimplifyDeep<TObject> = TObject extends Record<string, unknown> ? Simplify<{ [K in keyof TObject]: SimplifyDeep<TObject[K]> }> : TObject;
|
|
1418
|
+
type SplitPath<TPath extends string> = TPath extends `${infer THead}.${infer TRest}` ? [THead, ...SplitPath<TRest>] : TPath extends '' ? [] : [TPath];
|
|
1419
|
+
type BuildPathShape<TSegments extends string[], TValue> = TSegments extends [infer THead extends string, ...infer TRest extends string[]] ? { [K in THead]: TRest['length'] extends 0 ? TValue : BuildPathShape<TRest, TValue> } : never;
|
|
1420
|
+
type ResolverOutput<TResolver> = TResolver extends ((...args: any[]) => infer TResult) ? Awaited<TResult> : never;
|
|
1421
|
+
type RegistryEntryToPathShape<TPath extends string, TEntry, TAllowed extends ProcedureType> = TEntry extends readonly [infer TType extends ProcedureType, infer TResolver] ? TType extends TAllowed ? BuildPathShape<SplitPath<TPath>, ProcedureCallable<ResolverOutput<Extract<TResolver, (...args: any[]) => unknown>>>> : {} : {};
|
|
1422
|
+
type GeneratedProcedureRegistryEntry<TType extends ProcedureType = ProcedureType, TResolver extends (...args: any[]) => unknown = (...args: any[]) => unknown> = readonly [TType, TResolver];
|
|
1423
|
+
type GeneratedProcedureRegistry = Record<string, GeneratedProcedureRegistryEntry>;
|
|
1424
|
+
type ProcedureCallerFromRegistryByAllowedTypes<TRegistry extends GeneratedProcedureRegistry, TAllowed extends ProcedureType> = SimplifyDeep<UnionToIntersection<{ [K in keyof TRegistry & string]: RegistryEntryToPathShape<K, TRegistry[K], TAllowed> }[keyof TRegistry & string]>>;
|
|
1425
|
+
type ProcedureCallerFromRegistry<TRegistry extends GeneratedProcedureRegistry, TCtxType extends CallerContextType> = TCtxType extends 'query' ? ProcedureCallerFromRegistryByAllowedTypes<TRegistry, 'query'> : ProcedureCallerFromRegistryByAllowedTypes<TRegistry, 'query' | 'mutation'>;
|
|
1426
|
+
type ProcedureActionCallerFromRegistry<TRegistry extends GeneratedProcedureRegistry> = ProcedureCallerFromRegistryByAllowedTypes<TRegistry, 'action'>;
|
|
1427
|
+
type ProcedureSchedulableCallerFromRegistry<TRegistry extends GeneratedProcedureRegistry> = ProcedureCallerFromRegistryByAllowedTypes<TRegistry, SchedulableProcedureType>;
|
|
1428
|
+
type ProcedureScheduleCallerFromRegistry<TRegistry extends GeneratedProcedureRegistry> = {
|
|
1429
|
+
after: (delayMs: number) => ProcedureSchedulableCallerFromRegistry<TRegistry>;
|
|
1430
|
+
at: (timestamp: number | Date) => ProcedureSchedulableCallerFromRegistry<TRegistry>;
|
|
1431
|
+
now: ProcedureSchedulableCallerFromRegistry<TRegistry>;
|
|
1432
|
+
cancel: (id: string) => Promise<void>;
|
|
1433
|
+
};
|
|
1434
|
+
type ProcedureMutationCallerWithSchedule<TRegistry extends GeneratedProcedureRegistry> = SimplifyDeep<ProcedureCallerFromRegistryByAllowedTypes<TRegistry, 'query' | 'mutation'> & {
|
|
1435
|
+
schedule: ProcedureScheduleCallerFromRegistry<TRegistry>;
|
|
1436
|
+
}>;
|
|
1437
|
+
type ProcedureActionCallerWithNamespaces<TRegistry extends GeneratedProcedureRegistry> = SimplifyDeep<ProcedureCallerFromRegistryByAllowedTypes<TRegistry, 'query' | 'mutation'> & {
|
|
1438
|
+
actions: ProcedureActionCallerFromRegistry<TRegistry>;
|
|
1439
|
+
schedule: ProcedureScheduleCallerFromRegistry<TRegistry>;
|
|
1440
|
+
}>;
|
|
1441
|
+
type RegistryCallerForContext<TRegistry extends GeneratedProcedureRegistry, TCtx, TQueryCtx, TMutationCtx, TActionCtx = never> = TCtx extends TMutationCtx ? ProcedureMutationCallerWithSchedule<TRegistry> : TCtx extends TActionCtx ? ProcedureActionCallerWithNamespaces<TRegistry> : TCtx extends TQueryCtx ? ProcedureCallerFromRegistry<TRegistry, 'query'> : never;
|
|
1442
|
+
type RegistryHandlerForContext<TRegistry extends GeneratedProcedureRegistry, TCtx, TQueryCtx, TMutationCtx> = TCtx extends TMutationCtx ? ProcedureCallerFromRegistry<TRegistry, 'mutation'> : TCtx extends TQueryCtx ? ProcedureCallerFromRegistry<TRegistry, 'query'> : never;
|
|
1443
|
+
type CreateProcedureCallerFactoryOptions<TApi extends ProcedureTree> = {
|
|
1444
|
+
api: TApi;
|
|
1445
|
+
resolver: (path: string[]) => Promise<unknown> | unknown;
|
|
1446
|
+
};
|
|
1447
|
+
type AnyProcedureFunctionReference = FunctionReference<'query' | 'mutation' | 'action', any, any, any>;
|
|
1448
|
+
type ProcedureTypeFromFunctionReference<TFunctionReference extends AnyProcedureFunctionReference> = TFunctionReference extends FunctionReference<infer TProcedureType, any, any, any> ? TProcedureType extends ProcedureType ? TProcedureType : never : never;
|
|
1449
|
+
type ProcedureFromFunctionReference<TFunctionReference extends AnyProcedureFunctionReference> = CRPCFunctionTypeHint<TFunctionReference['_args'], FunctionReturnType<TFunctionReference>> & {
|
|
1450
|
+
_crpcMeta?: {
|
|
1451
|
+
type?: ProcedureTypeFromFunctionReference<TFunctionReference>;
|
|
1452
|
+
};
|
|
1453
|
+
_handler?: (ctx: unknown, input: TFunctionReference['_args']) => FunctionReturnType<TFunctionReference> | Promise<FunctionReturnType<TFunctionReference>>;
|
|
1454
|
+
};
|
|
1455
|
+
type ProcedureResolverFromFunctionReference<TFunctionReference extends AnyProcedureFunctionReference> = () => ProcedureFromFunctionReference<TFunctionReference> | Promise<ProcedureFromFunctionReference<TFunctionReference>>;
|
|
1456
|
+
declare function typedProcedureResolver<TFunctionReference extends AnyProcedureFunctionReference>(functionReference: TFunctionReference, resolver: () => unknown | Promise<unknown>): ProcedureResolverFromFunctionReference<TFunctionReference>;
|
|
1457
|
+
declare function defineProcedure<TType extends ProcedureType, TProcedure>(type: TType): ProcedureDefinition<TType, TProcedure>;
|
|
1458
|
+
declare function createProcedureCallerFactory<TQueryCtx, TMutationCtx, TApi extends ProcedureTree>(opts: CreateProcedureCallerFactoryOptions<TApi>): <TCtx extends TQueryCtx | TMutationCtx>(ctx: TCtx) => CallerForContext<TApi, TCtx, TQueryCtx, TMutationCtx>;
|
|
1459
|
+
declare function createProcedureHandlerFactory<TQueryCtx, TMutationCtx, TApi extends ProcedureTree>(opts: CreateProcedureCallerFactoryOptions<TApi>): <TCtx extends TQueryCtx | TMutationCtx>(ctx: TCtx) => CallerForContext<TApi, TCtx, TQueryCtx, TMutationCtx>;
|
|
1460
|
+
declare function createGenericCallerFactory<TQueryCtx, TMutationCtx, TRegistry extends GeneratedProcedureRegistry, TActionCtx = never>(registry: TRegistry): <TCtx extends TQueryCtx | TMutationCtx | TActionCtx>(ctx: TCtx) => RegistryCallerForContext<TRegistry, TCtx, TQueryCtx, TMutationCtx, TActionCtx>;
|
|
1461
|
+
declare function createGenericHandlerFactory<TQueryCtx, TMutationCtx, TRegistry extends GeneratedProcedureRegistry>(registry: TRegistry): <TCtx extends TQueryCtx | TMutationCtx>(ctx: TCtx) => RegistryHandlerForContext<TRegistry, TCtx, TQueryCtx, TMutationCtx>;
|
|
1325
1462
|
//#endregion
|
|
1326
|
-
export {
|
|
1463
|
+
export { QueryProcedureBuilder as $, GenericCtx as A, ConvexContext as B, CRPC_ERROR_CODE_TO_HTTP as C, zodToConvex as Ct, toCRPCError as D, isCRPCError as E, isRunMutationCtx as F, CallerOpts as G, LazyCaller as H, requireActionCtx as I, createApiLeaf as J, ServerCaller as K, requireMutationCtx as L, isActionCtx as M, isMutationCtx as N, CreateEnvOptions as O, isQueryCtx as P, ProcedureBuilder as Q, requireQueryCtx as R, CRPC_ERROR_CODES_BY_KEY as S, zodOutputToConvexFields as St, getHTTPStatusCodeFromError as T, createLazyCaller as U, createCallerFactory as V, CallerMeta as W, CRPCFunctionTypeHint as X, ActionProcedureBuilder as Y, MutationProcedureBuilder as Z, WithHttpRouter as _, zCustomAction as _t, ProcedureCaller as a, handleHttpError as at, CRPCError as b, zid as bt, ProcedureFromFunctionReference as c, ConvexValidatorFromZodOutput as ct, createGenericCallerFactory as d, Zid as dt, createMiddlewareFactory as et, createGenericHandlerFactory as f, ZodFromValidatorBase as ft, typedProcedureResolver as g, withSystemFields as gt, defineProcedure as h, convexToZodFields as ht, ProcedureActionCallerFromRegistry as i, extractPathParams as it, RunMutationCtx as j, createEnv as k, ProcedureSchedulableCallerFromRegistry as l, CustomBuilder as lt, createProcedureHandlerFactory as m, convexToZod as mt, GeneratedProcedureRegistry as n, HttpProcedureBuilder as nt, ProcedureCallerFromRegistry as o, matchPathParams as ot, createProcedureCallerFactory as p, ZodValidatorFromConvex as pt, createServerCaller as q, GeneratedProcedureRegistryEntry as r, createHttpProcedureBuilder as rt, ProcedureDefinition as s, ConvexValidatorFromZod as st, CreateProcedureCallerFactoryOptions as t, initCRPC as tt, ProcedureScheduleCallerFromRegistry as u, ZCustomCtx as ut, inferApiInputs as v, zCustomMutation as vt, getCRPCErrorFromUnknown as w, zodToConvexFields as wt, CRPCErrorCode as x, zodOutputToConvex as xt, inferApiOutputs as y, zCustomQuery as yt, requireRunMutationCtx as z };
|