kitcn 0.12.17 → 0.12.19

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.
Files changed (38) hide show
  1. package/dist/aggregate/index.d.ts +1 -1
  2. package/dist/{api-entry-BckXqaLb.js → api-entry-BMCQSsCw.js} +6 -1
  3. package/dist/auth/client/index.js +82 -1
  4. package/dist/auth/generated/index.d.ts +1 -1
  5. package/dist/auth/index.d.ts +13 -13
  6. package/dist/auth/index.js +1 -1
  7. package/dist/auth/nextjs/index.d.ts +1 -1
  8. package/dist/auth/start/index.d.ts +7 -1
  9. package/dist/auth/start/index.js +37 -0
  10. package/dist/{auth-store-Cljlmdmi.js → auth-store-C0iMu34r.js} +53 -1
  11. package/dist/{backend-core-Rv9NorIW.mjs → backend-core-C0uwGXLx.mjs} +202 -167
  12. package/dist/{builder-CBdG5W6A.js → builder-Cb6gloDB.js} +161 -6
  13. package/dist/cli.mjs +1 -1
  14. package/dist/{context-utils-HPC5nXzx.d.ts → context-utils-BvWW0Ilq.d.ts} +8 -1
  15. package/dist/crpc/index.d.ts +2 -2
  16. package/dist/{generated-contract-disabled-Dzx2IRId.d.ts → generated-contract-disabled-UsFjh8jz.d.ts} +30 -30
  17. package/dist/{http-types-BS63Nsug.d.ts → http-types-BLFA9zS7.d.ts} +2 -1
  18. package/dist/{middleware-C2qTZ3V7.js → middleware-DkIhQXwg.js} +1 -1
  19. package/dist/{middleware-CU0mDiRs.d.ts → middleware-nS_qXecO.d.ts} +1 -1
  20. package/dist/orm/index.d.ts +1 -1
  21. package/dist/plugins/index.d.ts +1 -1
  22. package/dist/plugins/index.js +1 -1
  23. package/dist/{procedure-caller-MWcxhQDv.js → procedure-caller-AjLfkHyF.js} +1 -1
  24. package/dist/{procedure-caller-C15h5Iel.d.ts → procedure-name-D-fDCBlo.d.ts} +33 -131
  25. package/dist/ratelimit/index.d.ts +2 -2
  26. package/dist/ratelimit/index.js +3 -3
  27. package/dist/react/index.js +7 -2
  28. package/dist/rsc/index.d.ts +3 -3
  29. package/dist/server/index.d.ts +5 -5
  30. package/dist/server/index.js +4 -4
  31. package/dist/{types-DrB2VeNb.d.ts → types-C6pQrnzD.d.ts} +1 -1
  32. package/dist/{types-BqUIoMfT.d.ts → types-a-RHmrDZ.d.ts} +9 -1
  33. package/dist/watcher.mjs +12 -9
  34. package/dist/{where-clause-compiler-DdjN63Io.d.ts → where-clause-compiler-CuH2JNxb.d.ts} +12 -12
  35. package/package.json +1 -1
  36. package/skills/convex/SKILL.md +8 -4
  37. package/skills/convex/references/features/auth-organizations.md +7 -2
  38. package/skills/convex/references/features/react.md +18 -3
@@ -1,8 +1,7 @@
1
1
  import { t as VRequired } from "./validators-vzRKjBJC.js";
2
- import { C as HttpProcedure, D as ProcedureMeta, R as getTransformer, S as HttpMethod, c as InferHttpInput, d as CRPCHttpRouter, j as DataTransformerOptions, l as InferHttpOutput, p as HttpRouterRecord, w as HttpProcedureBuilderDef, x as HttpHandlerOpts } from "./http-types-BS63Nsug.js";
3
- import { d as Overwrite$1, i as IntersectIfDefined, m as UnsetMarker, o as MiddlewareBuilder, s as MiddlewareFunction, t as AnyMiddleware } from "./types-BqUIoMfT.js";
4
- import { ConvexError, GenericId, GenericValidator, ObjectType, OptionalProperty, PropertyValidators, VAny, VArray, VBoolean, VBytes, VFloat64, VId, VInt64, VLiteral, VNull, VObject, VOptional, VRecord, VString, VUnion, Validator } from "convex/values";
5
- import * as convex_server0 from "convex/server";
2
+ import { C as HttpProcedure, D as ProcedureMeta, R as getTransformer, S as HttpMethod, c as InferHttpInput, d as CRPCHttpRouter, j as DataTransformerOptions, l as InferHttpOutput, p as HttpRouterRecord, w as HttpProcedureBuilderDef, x as HttpHandlerOpts } from "./http-types-BLFA9zS7.js";
3
+ import { g as UnsetMarker, i as IntersectIfDefined, o as MiddlewareBuilder, p as Overwrite$1, s as MiddlewareFunction, t as AnyMiddleware } from "./types-a-RHmrDZ.js";
4
+ import { ConvexError, GenericId, GenericValidator, ObjectType, OptionalProperty, PropertyValidators, VAny, VArray, VBoolean, VBytes, VFloat64, VId, VInt64, VLiteral, VNull, VObject, VOptional, VRecord, VString, VUnion, Validator, Value as Value$1 } from "convex/values";
6
5
  import { ActionBuilder, ArgsArrayToObject, DefaultFunctionArgs, FunctionReference, FunctionReturnType, FunctionVisibility, GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx, MutationBuilder, QueryBuilder, RegisteredAction, RegisteredMutation, RegisteredQuery, TableNamesInDataModel } from "convex/server";
7
6
  import { z } from "zod";
8
7
  import * as z$1 from "zod/v4";
@@ -593,6 +592,8 @@ interface HttpProcedureBuilder<TInitialCtx, TCtx, TInput extends UnsetMarker | z
593
592
  * Return Response for custom responses, or plain object for auto JSON serialization.
594
593
  */
595
594
  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>;
595
+ /** Set a server-only procedure name for middleware/logging */
596
+ name(value: string): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TOutput, TParams, TQuery, TMeta, TMethod, TForm>;
596
597
  /** Define response schema */
597
598
  output<TSchema extends z.ZodTypeAny>(schema: TSchema): HttpProcedureBuilder<TInitialCtx, TCtx, TInput, TSchema, TParams, TQuery, TMeta, TMethod, TForm>;
598
599
  /** Define path parameter schema (for :param in path) */
@@ -736,6 +737,7 @@ type ProcedureBuilderDef<TMeta = object> = {
736
737
  inputSchemas: Record<string, any>[];
737
738
  outputSchema?: z.ZodTypeAny;
738
739
  meta?: TMeta;
740
+ procedureName?: string;
739
741
  functionConfig: InternalFunctionConfig; /** Whether this procedure uses internal function (not exposed to clients) */
740
742
  isInternal?: boolean;
741
743
  };
@@ -760,39 +762,11 @@ declare class ProcedureBuilder<TBaseCtx, _TContext, TContextOverrides extends Un
760
762
  protected _output<TNewOutput extends z.ZodTypeAny>(schema: TNewOutput): ProcedureBuilderDef<TMeta>;
761
763
  /** Set procedure metadata (shallow merged when chained) - to be overridden by subclasses */
762
764
  protected _meta(value: TMeta): ProcedureBuilderDef<TMeta>;
765
+ /** Set server-only procedure name for middleware/logging */
766
+ protected _name(value: string): ProcedureBuilderDef<TMeta>;
763
767
  /** Merge all input schemas into one */
764
768
  protected _getMergedInput(): Record<string, any> | undefined;
765
- 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<{
766
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
767
- }>, 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<{
768
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
769
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
770
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
771
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T ? T extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
772
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
773
- }>, 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 [{
774
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
775
- }] ? 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<{
776
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
777
- }>, 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<{
778
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
779
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
780
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
781
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_6 ? T_6 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
782
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
783
- }>, 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 [{
784
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
785
- }] ? 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<{
786
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
787
- }>, 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<{
788
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
789
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
790
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
791
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_12 ? T_12 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
792
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
793
- }>, 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 [{
794
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
795
- }] ? 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>;
769
+ protected _createFunction(handler: any, baseFunction: any, customFn: typeof zCustomQuery | typeof zCustomMutation | typeof zCustomAction, fnType: 'query' | 'mutation' | 'action'): Record<string, unknown>;
796
770
  }
797
771
  /**
798
772
  * Query-specific procedure builder
@@ -808,6 +782,8 @@ declare class QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides extend
808
782
  TMeta, $ContextOverridesOut, InferMiddlewareInput<TInput>>): QueryProcedureBuilder<TBaseCtx, TContext, Overwrite$1<TContextOverrides, $ContextOverridesOut>, TInput, TClientInput, TOutput, TMeta>;
809
783
  /** Set procedure metadata (shallow merged when chained) */
810
784
  meta(value: TMeta): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TClientInput, TOutput, TMeta>;
785
+ /** Set a server-only procedure name for middleware/logging */
786
+ name(value: string): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TClientInput, TOutput, TMeta>;
811
787
  /** Define input schema (chainable - schemas are merged) */
812
788
  input<TNewInput extends z.ZodObject<any>>(schema: TNewInput): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, IntersectIfDefined<TInput, TNewInput>, IntersectIfDefined<TClientInput, TNewInput>, TOutput, TMeta>;
813
789
  /**
@@ -833,37 +809,7 @@ declare class QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides extend
833
809
  query<TResult>(handler: (opts: {
834
810
  ctx: Overwrite$1<TContext, TContextOverrides>;
835
811
  input: InferInput<TInput>;
836
- }) => 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<{
837
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
838
- }>, 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<{
839
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
840
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
841
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
842
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T ? T extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
843
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
844
- }>, 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 [{
845
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
846
- }] ? 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<{
847
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
848
- }>, 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<{
849
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
850
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
851
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
852
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_6 ? T_6 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
853
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
854
- }>, 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 [{
855
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
856
- }] ? 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<{
857
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
858
- }>, 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<{
859
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
860
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
861
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
862
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_12 ? T_12 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
863
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
864
- }>, 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 [{
865
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
866
- }] ? 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>;
812
+ }) => Promise<TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>): Record<string, unknown> & CRPCFunctionTypeHint<InferClientInput<TClientInput>, TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>;
867
813
  /** Mark as internal - returns chainable builder using internal function */
868
814
  internal(): QueryProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TClientInput, TOutput, TMeta>;
869
815
  }
@@ -881,6 +827,8 @@ declare class MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides ext
881
827
  TMeta, $ContextOverridesOut, InferMiddlewareInput<TInput>>): MutationProcedureBuilder<TBaseCtx, TContext, Overwrite$1<TContextOverrides, $ContextOverridesOut>, TInput, TOutput, TMeta>;
882
828
  /** Set procedure metadata (shallow merged when chained) */
883
829
  meta(value: TMeta): MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
830
+ /** Set a server-only procedure name for middleware/logging */
831
+ name(value: string): MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
884
832
  /** Define input schema (chainable - schemas are merged) */
885
833
  input<TNewInput extends z.ZodObject<any>>(schema: TNewInput): MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides, IntersectIfDefined<TInput, TNewInput>, TOutput, TMeta>;
886
834
  /** Define output schema */
@@ -889,37 +837,7 @@ declare class MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides ext
889
837
  mutation<TResult>(handler: (opts: {
890
838
  ctx: Overwrite$1<TContext, TContextOverrides>;
891
839
  input: InferInput<TInput>;
892
- }) => 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<{
893
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
894
- }>, 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<{
895
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
896
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
897
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
898
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T ? T extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
899
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
900
- }>, 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 [{
901
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
902
- }] ? 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<{
903
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
904
- }>, 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<{
905
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
906
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
907
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
908
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_6 ? T_6 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
909
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
910
- }>, 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 [{
911
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
912
- }] ? 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<{
913
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
914
- }>, 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<{
915
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
916
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
917
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
918
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_12 ? T_12 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
919
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
920
- }>, 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 [{
921
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
922
- }] ? 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>;
840
+ }) => Promise<TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>): Record<string, unknown> & CRPCFunctionTypeHint<InferClientInput<TInput>, TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>;
923
841
  /** Mark as internal - returns chainable builder using internal function */
924
842
  internal(): MutationProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
925
843
  }
@@ -933,6 +851,8 @@ declare class ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides exten
933
851
  TMeta, $ContextOverridesOut, InferMiddlewareInput<TInput>>): ActionProcedureBuilder<TBaseCtx, TContext, Overwrite$1<TContextOverrides, $ContextOverridesOut>, TInput, TOutput, TMeta>;
934
852
  /** Set procedure metadata (shallow merged when chained) */
935
853
  meta(value: TMeta): ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
854
+ /** Set a server-only procedure name for middleware/logging */
855
+ name(value: string): ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
936
856
  /** Define input schema (chainable - schemas are merged) */
937
857
  input<TNewInput extends z.ZodObject<any>>(schema: TNewInput): ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides, IntersectIfDefined<TInput, TNewInput>, TOutput, TMeta>;
938
858
  /** Define output schema */
@@ -941,37 +861,7 @@ declare class ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides exten
941
861
  action<TResult>(handler: (opts: {
942
862
  ctx: Overwrite$1<TContext, TContextOverrides>;
943
863
  input: InferInput<TInput>;
944
- }) => 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<{
945
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
946
- }>, 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<{
947
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
948
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
949
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
950
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T ? T extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
951
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
952
- }>, 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 [{
953
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
954
- }] ? 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<{
955
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
956
- }>, 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<{
957
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
958
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
959
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
960
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_6 ? T_6 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
961
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
962
- }>, 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 [{
963
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
964
- }] ? 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<{
965
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
966
- }>, 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<{
967
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
968
- }>, z.core.$strip> ? TShape : Record<string, never>)>] : (TInput extends z.ZodObject<infer TShape extends Readonly<{
969
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
970
- }>, z.core.$strip> ? TShape : Record<string, never>) extends infer T_12 ? T_12 extends (TInput extends z.ZodObject<infer TShape extends Readonly<{
971
- [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
972
- }>, 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 [{
973
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
974
- }] ? 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>;
864
+ }) => Promise<TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>): Record<string, unknown> & CRPCFunctionTypeHint<InferClientInput<TInput>, TOutput extends z.ZodTypeAny ? z.infer<TOutput> : TResult>;
975
865
  /** Mark as internal - returns chainable builder using internal function */
976
866
  internal(): ActionProcedureBuilder<TBaseCtx, TContext, TContextOverrides, TInput, TOutput, TMeta>;
977
867
  }
@@ -1250,10 +1140,11 @@ declare const CRPC_ERROR_CODES_BY_KEY: {
1250
1140
  type CRPCErrorCode = keyof typeof CRPC_ERROR_CODES_BY_KEY;
1251
1141
  /** Map error codes to HTTP status codes */
1252
1142
  declare const CRPC_ERROR_CODE_TO_HTTP: Record<CRPCErrorCode, number>;
1253
- type CRPCErrorData = {
1143
+ type CRPCErrorBaseData = {
1254
1144
  code: CRPCErrorCode;
1255
1145
  message: string;
1256
1146
  };
1147
+ type CRPCErrorData<TData extends Record<string, Value$1 | undefined> = Record<string, never>> = CRPCErrorBaseData & TData;
1257
1148
  /**
1258
1149
  * tRPC-style error extending ConvexError
1259
1150
  *
@@ -1266,13 +1157,14 @@ type CRPCErrorData = {
1266
1157
  * });
1267
1158
  * ```
1268
1159
  */
1269
- declare class CRPCError extends ConvexError<CRPCErrorData> {
1160
+ declare class CRPCError<TData extends Record<string, Value$1 | undefined> = Record<string, never>> extends ConvexError<CRPCErrorData<TData>> {
1270
1161
  readonly code: CRPCErrorCode;
1271
1162
  readonly cause?: Error;
1272
1163
  constructor(opts: {
1273
1164
  code: CRPCErrorCode;
1274
1165
  message?: string;
1275
1166
  cause?: unknown;
1167
+ data?: TData;
1276
1168
  });
1277
1169
  }
1278
1170
  /**
@@ -1464,4 +1356,14 @@ type GeneratedRegistrySource<TCallerRegistry extends GeneratedProcedureRegistry,
1464
1356
  type GeneratedRegistryRuntimeResult<TQueryCtx, TMutationCtx, TCallerRegistry extends GeneratedProcedureRegistry, TActionCtx, THandlerRegistry extends GeneratedProcedureRegistry | undefined> = THandlerRegistry extends GeneratedProcedureRegistry ? GeneratedRegistryRuntimeWithHandler<TQueryCtx, TMutationCtx, TCallerRegistry, Exclude<THandlerRegistry, undefined>, TActionCtx> : GeneratedRegistryRuntime<TQueryCtx, TMutationCtx, TCallerRegistry, TActionCtx>;
1465
1357
  declare function createGeneratedRegistryRuntime<TQueryCtx, TMutationCtx, TCallerRegistry extends GeneratedProcedureRegistry, TActionCtx = never, THandlerRegistry extends GeneratedProcedureRegistry | undefined = undefined>(createRegistryOrRegistry: GeneratedRegistrySource<TCallerRegistry, THandlerRegistry>): GeneratedRegistryRuntimeResult<TQueryCtx, TMutationCtx, TCallerRegistry, TActionCtx, THandlerRegistry>;
1466
1358
  //#endregion
1467
- export { initCRPC as $, getCRPCErrorFromUnknown as A, CallerMeta as B, WithHttpRouter as C, CRPCErrorCode as D, CRPCError as E, createEnv as F, createGeneratedFunctionReference as G, ServerCaller as H, ConvexContext as I, CRPCFunctionTypeHint as J, getGeneratedValue as K, createCallerFactory as L, isCRPCError as M, toCRPCError as N, CRPC_ERROR_CODES_BY_KEY as O, CreateEnvOptions as P, createMiddlewareFactory as Q, LazyCaller as R, typedProcedureResolver as S, zodToConvexFields as St, inferApiOutputs as T, createServerCaller as U, CallerOpts as V, createApiLeaf as W, ProcedureBuilder as X, MutationProcedureBuilder as Y, QueryProcedureBuilder as Z, createGenericHandlerFactory as _, zCustomQuery as _t, GeneratedRegistryCallerForContext as a, ConvexValidatorFromZod as at, defineProcedure as b, zodOutputToConvexFields as bt, ProcedureActionCallerFromRegistry as c, ZCustomCtx as ct, ProcedureDefinition as d, ZodValidatorFromConvex as dt, HttpProcedureBuilder as et, ProcedureFromFunctionReference as f, convexToZod as ft, createGenericCallerFactory as g, zCustomMutation as gt, createGeneratedRegistryRuntime as h, zCustomAction as ht, GeneratedRegistryCallerFactory as i, matchPathParams as it, getHTTPStatusCodeFromError as j, CRPC_ERROR_CODE_TO_HTTP as k, ProcedureCaller as l, Zid as lt, ProcedureScheduleCallerFromRegistry as m, withSystemFields as mt, GeneratedProcedureRegistry as n, extractPathParams as nt, GeneratedRegistryHandlerFactory as o, ConvexValidatorFromZodOutput as ot, ProcedureSchedulableCallerFromRegistry as p, convexToZodFields as pt, ActionProcedureBuilder as q, GeneratedProcedureRegistryEntry as r, handleHttpError as rt, GeneratedRegistryHandlerForContext as s, CustomBuilder as st, CreateProcedureCallerFactoryOptions as t, createHttpProcedureBuilder as tt, ProcedureCallerFromRegistry as u, ZodFromValidatorBase as ut, createProcedureCallerFactory as v, zid as vt, inferApiInputs as w, getGeneratedFunctionReference as x, zodToConvex as xt, createProcedureHandlerFactory as y, zodOutputToConvex as yt, createLazyCaller as z };
1359
+ //#region src/server/procedure-name.d.ts
1360
+ type ProcedureNameEntry = {
1361
+ column: number;
1362
+ line: number;
1363
+ name: string;
1364
+ };
1365
+ type ProcedureNameLookup = Record<string, ProcedureNameEntry[]>;
1366
+ declare function registerProcedureNameLookup(lookup: ProcedureNameLookup, functionsDirHint: string): void;
1367
+ declare function inferProcedureNameFromCallsite(): string | undefined;
1368
+ //#endregion
1369
+ export { CRPCFunctionTypeHint as $, CRPCError as A, createEnv as B, createProcedureHandlerFactory as C, zid as Ct, WithHttpRouter as D, zodToConvexFields as Dt, typedProcedureResolver as E, zodToConvex as Et, getCRPCErrorFromUnknown as F, CallerMeta as G, createCallerFactory as H, getHTTPStatusCodeFromError as I, createServerCaller as J, CallerOpts as K, isCRPCError as L, CRPCErrorData as M, CRPC_ERROR_CODES_BY_KEY as N, inferApiInputs as O, CRPC_ERROR_CODE_TO_HTTP as P, ActionProcedureBuilder as Q, toCRPCError as R, createProcedureCallerFactory as S, zCustomQuery as St, getGeneratedFunctionReference as T, zodOutputToConvexFields as Tt, LazyCaller as U, ConvexContext as V, createLazyCaller as W, createGeneratedFunctionReference as X, createApiLeaf as Y, getGeneratedValue as Z, ProcedureSchedulableCallerFromRegistry as _, convexToZod as _t, CreateProcedureCallerFactoryOptions as a, HttpProcedureBuilder as at, createGenericCallerFactory as b, zCustomAction as bt, GeneratedRegistryCallerFactory as c, handleHttpError as ct, GeneratedRegistryHandlerForContext as d, ConvexValidatorFromZodOutput as dt, MutationProcedureBuilder as et, ProcedureActionCallerFromRegistry as f, CustomBuilder as ft, ProcedureFromFunctionReference as g, ZodValidatorFromConvex as gt, ProcedureDefinition as h, ZodFromValidatorBase as ht, registerProcedureNameLookup as i, initCRPC as it, CRPCErrorCode as j, inferApiOutputs as k, GeneratedRegistryCallerForContext as l, matchPathParams as lt, ProcedureCallerFromRegistry as m, Zid as mt, ProcedureNameLookup as n, QueryProcedureBuilder as nt, GeneratedProcedureRegistry as o, createHttpProcedureBuilder as ot, ProcedureCaller as p, ZCustomCtx as pt, ServerCaller as q, inferProcedureNameFromCallsite as r, createMiddlewareFactory as rt, GeneratedProcedureRegistryEntry as s, extractPathParams as st, ProcedureNameEntry as t, ProcedureBuilder as tt, GeneratedRegistryHandlerFactory as u, ConvexValidatorFromZod as ut, ProcedureScheduleCallerFromRegistry as v, convexToZodFields as vt, defineProcedure as w, zodOutputToConvex as wt, createGenericHandlerFactory as x, zCustomMutation as xt, createGeneratedRegistryRuntime as y, withSystemFields as yt, CreateEnvOptions as z };
@@ -1,5 +1,5 @@
1
- import { o as MiddlewareBuilder } from "../types-BqUIoMfT.js";
2
- import { t as Plugin } from "../middleware-CU0mDiRs.js";
1
+ import { o as MiddlewareBuilder } from "../types-a-RHmrDZ.js";
2
+ import { t as Plugin } from "../middleware-nS_qXecO.js";
3
3
  import * as convex_server0 from "convex/server";
4
4
 
5
5
  //#region src/ratelimit/duration.d.ts
@@ -1,6 +1,6 @@
1
- import { l as requireMutationCtx } from "../api-entry-BckXqaLb.js";
2
- import { h as CRPCError } from "../builder-CBdG5W6A.js";
3
- import { t as definePlugin } from "../middleware-C2qTZ3V7.js";
1
+ import { u as requireMutationCtx } from "../api-entry-BMCQSsCw.js";
2
+ import { _ as CRPCError } from "../builder-Cb6gloDB.js";
3
+ import { t as definePlugin } from "../middleware-DkIhQXwg.js";
4
4
  import { v } from "convex/values";
5
5
  import { mutationGeneric, queryGeneric } from "convex/server";
6
6
 
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { C as defaultIsUnauthorized, S as CRPCClientError, _ as useConvexAuthBridge, a as ConvexProviderWithAuth, b as useMaybeAuth, c as MaybeUnauthenticated, d as isSessionSyncGraceActive, f as useAuth, g as useAuthValue, h as useAuthStore, i as ConvexAuthBridge, l as Unauthenticated, m as useAuthState, n as AuthProvider, o as FetchAccessTokenContext, p as useAuthGuard, r as Authenticated, s as MaybeAuthenticated, t as AUTH_SESSION_SYNC_GRACE_MS, u as decodeJwtExp, v as useFetchAccessToken, w as isCRPCClientError, x as useSafeConvexAuth, y as useIsAuth } from "../auth-store-Cljlmdmi.js";
2
+ import { D as CRPCClientError, E as writeAuthSessionFallbackToken, O as defaultIsUnauthorized, S as clearAuthSessionFallback, T as writeAuthSessionFallbackData, _ as useConvexAuthBridge, a as ConvexProviderWithAuth, b as useMaybeAuth, c as MaybeUnauthenticated, d as isSessionSyncGraceActive, f as useAuth, g as useAuthValue, h as useAuthStore, i as ConvexAuthBridge, k as isCRPCClientError, l as Unauthenticated, m as useAuthState, n as AuthProvider, o as FetchAccessTokenContext, p as useAuthGuard, r as Authenticated, s as MaybeAuthenticated, t as AUTH_SESSION_SYNC_GRACE_MS, u as decodeJwtExp, v as useFetchAccessToken, x as useSafeConvexAuth, y as useIsAuth } from "../auth-store-C0iMu34r.js";
3
3
  import { ConvexProvider, ConvexReactClient, ConvexReactClient as ConvexReactClient$1, useAction, useConvex, useMutation } from "convex/react";
4
4
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -1386,6 +1386,7 @@ const seedReturnedToken = (store, value) => {
1386
1386
  store.set("token", token);
1387
1387
  store.set("expiresAt", decodeJwtExp(token));
1388
1388
  store.set("sessionSyncGraceUntil", Date.now() + AUTH_SESSION_SYNC_GRACE_MS);
1389
+ if (decodeJwtExp(token) === null) writeAuthSessionFallbackToken(token);
1389
1390
  };
1390
1391
  const syncSessionAtom = (authClient, sessionData) => {
1391
1392
  const sessionAtom = authClient.$store?.atoms?.session;
@@ -1406,7 +1407,10 @@ const hydrateReturnedSession = async (authClient, value) => {
1406
1407
  credentials: "omit",
1407
1408
  headers: { Authorization: `Bearer ${token}` }
1408
1409
  } });
1409
- if (session?.data) syncSessionAtom(authClient, session.data);
1410
+ if (session?.data) {
1411
+ syncSessionAtom(authClient, session.data);
1412
+ writeAuthSessionFallbackData(session.data);
1413
+ }
1410
1414
  };
1411
1415
  const withDisabledSessionSignal = (args) => {
1412
1416
  const record = args && typeof args === "object" ? args : {};
@@ -1455,6 +1459,7 @@ function createAuthMutations(authClient) {
1455
1459
  authStoreApi.set("token", null);
1456
1460
  authStoreApi.set("expiresAt", null);
1457
1461
  authStoreApi.set("sessionSyncGraceUntil", null);
1462
+ clearAuthSessionFallback();
1458
1463
  await convexQueryClient?.resetAuthQueries();
1459
1464
  return res;
1460
1465
  }
@@ -1,7 +1,7 @@
1
1
  import { n as DeepPartial, o as Simplify, r as DistributiveOmit } from "../types-BTb_4BaU.js";
2
- import { C as HttpProcedure, d as CRPCHttpRouter, j as DataTransformerOptions, p as HttpRouterRecord } from "../http-types-BS63Nsug.js";
3
- import { m as UnsetMarker } from "../types-BqUIoMfT.js";
4
- import { A as HttpInputArgs, C as ReservedMutationOptions$1, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, o as ConvexActionKey, p as ExtractPaginatedItem, s as ConvexInfiniteQueryMeta, u as ConvexQueryKey, w as ReservedQueryOptions$1, y as MutationVariables } from "../types-DrB2VeNb.js";
2
+ import { C as HttpProcedure, d as CRPCHttpRouter, j as DataTransformerOptions, p as HttpRouterRecord } from "../http-types-BLFA9zS7.js";
3
+ import { g as UnsetMarker } from "../types-a-RHmrDZ.js";
4
+ import { A as HttpInputArgs, C as ReservedMutationOptions$1, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, o as ConvexActionKey, p as ExtractPaginatedItem, s as ConvexInfiniteQueryMeta, u as ConvexQueryKey, w as ReservedQueryOptions$1, y as MutationVariables } from "../types-C6pQrnzD.js";
5
5
  import { FunctionArgs, FunctionReference, FunctionReturnType } from "convex/server";
6
6
  import { z } from "zod";
7
7
  import { DefaultError, QueryFilters, SkipToken, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
@@ -1,5 +1,5 @@
1
- import { $ as initCRPC, A as getCRPCErrorFromUnknown, B as CallerMeta, C as WithHttpRouter, D as CRPCErrorCode, E as CRPCError, F as createEnv, G as createGeneratedFunctionReference, H as ServerCaller, I as ConvexContext, J as CRPCFunctionTypeHint, K as getGeneratedValue, L as createCallerFactory, M as isCRPCError, N as toCRPCError, O as CRPC_ERROR_CODES_BY_KEY, P as CreateEnvOptions, Q as createMiddlewareFactory, R as LazyCaller, S as typedProcedureResolver, St as zodToConvexFields, T as inferApiOutputs, U as createServerCaller, V as CallerOpts, W as createApiLeaf, X as ProcedureBuilder, Y as MutationProcedureBuilder, Z as QueryProcedureBuilder, _ as createGenericHandlerFactory, _t as zCustomQuery, a as GeneratedRegistryCallerForContext, at as ConvexValidatorFromZod, b as defineProcedure, bt as zodOutputToConvexFields, c as ProcedureActionCallerFromRegistry, ct as ZCustomCtx, d as ProcedureDefinition, dt as ZodValidatorFromConvex, et as HttpProcedureBuilder, f as ProcedureFromFunctionReference, ft as convexToZod, g as createGenericCallerFactory, gt as zCustomMutation, h as createGeneratedRegistryRuntime, ht as zCustomAction, i as GeneratedRegistryCallerFactory, it as matchPathParams, j as getHTTPStatusCodeFromError, k as CRPC_ERROR_CODE_TO_HTTP, l as ProcedureCaller, lt as Zid, m as ProcedureScheduleCallerFromRegistry, mt as withSystemFields, n as GeneratedProcedureRegistry, nt as extractPathParams, o as GeneratedRegistryHandlerFactory, ot as ConvexValidatorFromZodOutput, p as ProcedureSchedulableCallerFromRegistry, pt as convexToZodFields, q as ActionProcedureBuilder, r as GeneratedProcedureRegistryEntry, rt as handleHttpError, s as GeneratedRegistryHandlerForContext, st as CustomBuilder, t as CreateProcedureCallerFactoryOptions, tt as createHttpProcedureBuilder, u as ProcedureCallerFromRegistry, ut as ZodFromValidatorBase, v as createProcedureCallerFactory, vt as zid, w as inferApiInputs, x as getGeneratedFunctionReference, xt as zodToConvex, y as createProcedureHandlerFactory, yt as zodOutputToConvex, z as createLazyCaller } from "../procedure-caller-C15h5Iel.js";
2
- import { C as HttpProcedure, D as ProcedureMeta, E as InferHttpInput, S as HttpMethod, T as HttpRouteDefinition, _ as extractRouteMap, b as HttpActionHandler, d as CRPCHttpRouter, f as HttpRouterDef, g as createHttpRouterFactory, h as createHttpRouter, m as HttpRouterWithHono, p as HttpRouterRecord, v as CRPCHonoHandler, w as HttpProcedureBuilderDef, x as HttpHandlerOpts, y as HttpActionConstructor } from "../http-types-BS63Nsug.js";
3
- import { a as MergeZodObjects, c as MiddlewareMarker, d as Overwrite, f as ResolveIfSet, i as IntersectIfDefined, l as MiddlewareNext, m as UnsetMarker, n as AnyMiddlewareBuilder, o as MiddlewareBuilder, p as Simplify, r as GetRawInputFn, s as MiddlewareFunction, t as AnyMiddleware, u as MiddlewareResult } from "../types-BqUIoMfT.js";
4
- import { a as isQueryCtx, c as requireMutationCtx, i as isMutationCtx, l as requireQueryCtx, n as RunMutationCtx, o as isRunMutationCtx, r as isActionCtx, s as requireActionCtx, t as GenericCtx, u as requireRunMutationCtx } from "../context-utils-HPC5nXzx.js";
5
- export { ActionProcedureBuilder, AnyMiddleware, AnyMiddlewareBuilder, CRPCError, CRPCErrorCode, CRPCFunctionTypeHint, CRPCHonoHandler, CRPCHttpRouter, CRPC_ERROR_CODES_BY_KEY, CRPC_ERROR_CODE_TO_HTTP, CallerMeta, CallerOpts, ConvexContext, ConvexValidatorFromZod, ConvexValidatorFromZodOutput, CreateEnvOptions, CreateProcedureCallerFactoryOptions, CustomBuilder, GeneratedProcedureRegistry, GeneratedProcedureRegistryEntry, GeneratedRegistryCallerFactory, GeneratedRegistryCallerForContext, GeneratedRegistryHandlerFactory, GeneratedRegistryHandlerForContext, GenericCtx, GetRawInputFn, HttpActionConstructor, HttpActionHandler, HttpHandlerOpts, HttpMethod, HttpProcedure, HttpProcedureBuilder, HttpProcedureBuilderDef, HttpRouteDefinition, HttpRouterDef, HttpRouterRecord, HttpRouterWithHono, InferHttpInput, IntersectIfDefined, LazyCaller, MergeZodObjects, MiddlewareBuilder, MiddlewareFunction, MiddlewareMarker, MiddlewareNext, MiddlewareResult, MutationProcedureBuilder, Overwrite, ProcedureActionCallerFromRegistry, ProcedureBuilder, ProcedureCaller, ProcedureCallerFromRegistry, ProcedureDefinition, ProcedureFromFunctionReference, ProcedureMeta, ProcedureSchedulableCallerFromRegistry, ProcedureScheduleCallerFromRegistry, QueryProcedureBuilder, ResolveIfSet, RunMutationCtx, ServerCaller, Simplify, UnsetMarker, WithHttpRouter, ZCustomCtx, Zid, ZodFromValidatorBase, ZodValidatorFromConvex, convexToZod, convexToZodFields, createApiLeaf, createCallerFactory, createEnv, createGeneratedFunctionReference, createGeneratedRegistryRuntime, createGenericCallerFactory, createGenericHandlerFactory, createHttpProcedureBuilder, createHttpRouter, createHttpRouterFactory, createLazyCaller, createMiddlewareFactory, createProcedureCallerFactory, createProcedureHandlerFactory, createServerCaller, defineProcedure, extractPathParams, extractRouteMap, getCRPCErrorFromUnknown, getGeneratedFunctionReference, getGeneratedValue, getHTTPStatusCodeFromError, handleHttpError, inferApiInputs, inferApiOutputs, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, matchPathParams, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
1
+ import { $ as CRPCFunctionTypeHint, A as CRPCError, B as createEnv, C as createProcedureHandlerFactory, Ct as zid, D as WithHttpRouter, Dt as zodToConvexFields, E as typedProcedureResolver, Et as zodToConvex, F as getCRPCErrorFromUnknown, G as CallerMeta, H as createCallerFactory, I as getHTTPStatusCodeFromError, J as createServerCaller, K as CallerOpts, L as isCRPCError, M as CRPCErrorData, N as CRPC_ERROR_CODES_BY_KEY, O as inferApiInputs, P as CRPC_ERROR_CODE_TO_HTTP, Q as ActionProcedureBuilder, R as toCRPCError, S as createProcedureCallerFactory, St as zCustomQuery, T as getGeneratedFunctionReference, Tt as zodOutputToConvexFields, U as LazyCaller, V as ConvexContext, W as createLazyCaller, X as createGeneratedFunctionReference, Y as createApiLeaf, Z as getGeneratedValue, _ as ProcedureSchedulableCallerFromRegistry, _t as convexToZod, a as CreateProcedureCallerFactoryOptions, at as HttpProcedureBuilder, b as createGenericCallerFactory, bt as zCustomAction, c as GeneratedRegistryCallerFactory, ct as handleHttpError, d as GeneratedRegistryHandlerForContext, dt as ConvexValidatorFromZodOutput, et as MutationProcedureBuilder, f as ProcedureActionCallerFromRegistry, ft as CustomBuilder, g as ProcedureFromFunctionReference, gt as ZodValidatorFromConvex, h as ProcedureDefinition, ht as ZodFromValidatorBase, i as registerProcedureNameLookup, it as initCRPC, j as CRPCErrorCode, k as inferApiOutputs, l as GeneratedRegistryCallerForContext, lt as matchPathParams, m as ProcedureCallerFromRegistry, mt as Zid, n as ProcedureNameLookup, nt as QueryProcedureBuilder, o as GeneratedProcedureRegistry, ot as createHttpProcedureBuilder, p as ProcedureCaller, pt as ZCustomCtx, q as ServerCaller, r as inferProcedureNameFromCallsite, rt as createMiddlewareFactory, s as GeneratedProcedureRegistryEntry, st as extractPathParams, t as ProcedureNameEntry, tt as ProcedureBuilder, u as GeneratedRegistryHandlerFactory, ut as ConvexValidatorFromZod, v as ProcedureScheduleCallerFromRegistry, vt as convexToZodFields, w as defineProcedure, wt as zodOutputToConvex, x as createGenericHandlerFactory, xt as zCustomMutation, y as createGeneratedRegistryRuntime, yt as withSystemFields, z as CreateEnvOptions } from "../procedure-name-D-fDCBlo.js";
2
+ import { C as HttpProcedure, D as ProcedureMeta, E as InferHttpInput, S as HttpMethod, T as HttpRouteDefinition, _ as extractRouteMap, b as HttpActionHandler, d as CRPCHttpRouter, f as HttpRouterDef, g as createHttpRouterFactory, h as createHttpRouter, m as HttpRouterWithHono, p as HttpRouterRecord, v as CRPCHonoHandler, w as HttpProcedureBuilderDef, x as HttpHandlerOpts, y as HttpActionConstructor } from "../http-types-BLFA9zS7.js";
3
+ import { a as MergeZodObjects, c as MiddlewareMarker, d as MiddlewareProcedureType, f as MiddlewareResult, g as UnsetMarker, h as Simplify, i as IntersectIfDefined, l as MiddlewareNext, m as ResolveIfSet, n as AnyMiddlewareBuilder, o as MiddlewareBuilder, p as Overwrite, r as GetRawInputFn, s as MiddlewareFunction, t as AnyMiddleware, u as MiddlewareProcedureInfo } from "../types-a-RHmrDZ.js";
4
+ import { a as isMutationCtx, c as isSchedulerCtx, d as requireQueryCtx, f as requireRunMutationCtx, i as isActionCtx, l as requireActionCtx, n as RunMutationCtx, o as isQueryCtx, p as requireSchedulerCtx, r as SchedulerCtx, s as isRunMutationCtx, t as GenericCtx, u as requireMutationCtx } from "../context-utils-BvWW0Ilq.js";
5
+ export { ActionProcedureBuilder, AnyMiddleware, AnyMiddlewareBuilder, CRPCError, CRPCErrorCode, CRPCErrorData, CRPCFunctionTypeHint, CRPCHonoHandler, CRPCHttpRouter, CRPC_ERROR_CODES_BY_KEY, CRPC_ERROR_CODE_TO_HTTP, CallerMeta, CallerOpts, ConvexContext, ConvexValidatorFromZod, ConvexValidatorFromZodOutput, CreateEnvOptions, CreateProcedureCallerFactoryOptions, CustomBuilder, GeneratedProcedureRegistry, GeneratedProcedureRegistryEntry, GeneratedRegistryCallerFactory, GeneratedRegistryCallerForContext, GeneratedRegistryHandlerFactory, GeneratedRegistryHandlerForContext, GenericCtx, GetRawInputFn, HttpActionConstructor, HttpActionHandler, HttpHandlerOpts, HttpMethod, HttpProcedure, HttpProcedureBuilder, HttpProcedureBuilderDef, HttpRouteDefinition, HttpRouterDef, HttpRouterRecord, HttpRouterWithHono, InferHttpInput, IntersectIfDefined, LazyCaller, MergeZodObjects, MiddlewareBuilder, MiddlewareFunction, MiddlewareMarker, MiddlewareNext, MiddlewareProcedureInfo, MiddlewareProcedureType, MiddlewareResult, MutationProcedureBuilder, Overwrite, ProcedureActionCallerFromRegistry, ProcedureBuilder, ProcedureCaller, ProcedureCallerFromRegistry, ProcedureDefinition, ProcedureFromFunctionReference, ProcedureMeta, ProcedureNameEntry, ProcedureNameLookup, ProcedureSchedulableCallerFromRegistry, ProcedureScheduleCallerFromRegistry, QueryProcedureBuilder, ResolveIfSet, RunMutationCtx, SchedulerCtx, ServerCaller, Simplify, UnsetMarker, WithHttpRouter, ZCustomCtx, Zid, ZodFromValidatorBase, ZodValidatorFromConvex, convexToZod, convexToZodFields, createApiLeaf, createCallerFactory, createEnv, createGeneratedFunctionReference, createGeneratedRegistryRuntime, createGenericCallerFactory, createGenericHandlerFactory, createHttpProcedureBuilder, createHttpRouter, createHttpRouterFactory, createLazyCaller, createMiddlewareFactory, createProcedureCallerFactory, createProcedureHandlerFactory, createServerCaller, defineProcedure, extractPathParams, extractRouteMap, getCRPCErrorFromUnknown, getGeneratedFunctionReference, getGeneratedValue, getHTTPStatusCodeFromError, handleHttpError, inferApiInputs, inferApiOutputs, inferProcedureNameFromCallsite, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, isSchedulerCtx, matchPathParams, registerProcedureNameLookup, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, requireSchedulerCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
@@ -1,6 +1,6 @@
1
- import { a as isMutationCtx, c as requireActionCtx, d as requireRunMutationCtx, i as isActionCtx, l as requireMutationCtx, n as createGeneratedFunctionReference, o as isQueryCtx, r as getGeneratedValue, s as isRunMutationCtx, t as createApiLeaf, u as requireQueryCtx } from "../api-entry-BckXqaLb.js";
1
+ import { a as isMutationCtx, c as isSchedulerCtx, d as requireQueryCtx, f as requireRunMutationCtx, i as isActionCtx, l as requireActionCtx, n as createGeneratedFunctionReference, o as isQueryCtx, p as requireSchedulerCtx, r as getGeneratedValue, s as isRunMutationCtx, t as createApiLeaf, u as requireMutationCtx } from "../api-entry-BMCQSsCw.js";
2
2
  import { n as createLazyCaller, r as createServerCaller, t as createCallerFactory } from "../caller-factory-cTXNvYdz.js";
3
- import { A as zodOutputToConvexFields, C as convexToZodFields, D as zCustomQuery, E as zCustomMutation, M as zodToConvexFields, O as zid, S as convexToZod, T as zCustomAction, _ as CRPC_ERROR_CODE_TO_HTTP, a as createMiddlewareFactory, b as isCRPCError, c as createHttpRouter, d as createHttpProcedureBuilder, f as extractPathParams, g as CRPC_ERROR_CODES_BY_KEY, h as CRPCError, i as QueryProcedureBuilder, j as zodToConvex, k as zodOutputToConvex, l as createHttpRouterFactory, m as matchPathParams, n as MutationProcedureBuilder, o as initCRPC, p as handleHttpError, r as ProcedureBuilder, s as HttpRouterWithHono, t as ActionProcedureBuilder, u as extractRouteMap, v as getCRPCErrorFromUnknown, w as withSystemFields, x as toCRPCError, y as getHTTPStatusCodeFromError } from "../builder-CBdG5W6A.js";
4
- import { a as createProcedureHandlerFactory, c as typedProcedureResolver, i as createProcedureCallerFactory, l as createEnv, n as createGenericCallerFactory, o as defineProcedure, r as createGenericHandlerFactory, s as getGeneratedFunctionReference, t as createGeneratedRegistryRuntime } from "../procedure-caller-MWcxhQDv.js";
3
+ import { A as zid, C as toCRPCError, D as zCustomAction, E as withSystemFields, M as zodOutputToConvexFields, N as zodToConvex, O as zCustomMutation, P as zodToConvexFields, S as isCRPCError, T as convexToZodFields, _ as CRPCError, a as createMiddlewareFactory, b as getCRPCErrorFromUnknown, c as registerProcedureNameLookup, d as createHttpRouterFactory, f as extractRouteMap, g as matchPathParams, h as handleHttpError, i as QueryProcedureBuilder, j as zodOutputToConvex, k as zCustomQuery, l as HttpRouterWithHono, m as extractPathParams, n as MutationProcedureBuilder, o as initCRPC, p as createHttpProcedureBuilder, r as ProcedureBuilder, s as inferProcedureNameFromCallsite, t as ActionProcedureBuilder, u as createHttpRouter, v as CRPC_ERROR_CODES_BY_KEY, w as convexToZod, x as getHTTPStatusCodeFromError, y as CRPC_ERROR_CODE_TO_HTTP } from "../builder-Cb6gloDB.js";
4
+ import { a as createProcedureHandlerFactory, c as typedProcedureResolver, i as createProcedureCallerFactory, l as createEnv, n as createGenericCallerFactory, o as defineProcedure, r as createGenericHandlerFactory, s as getGeneratedFunctionReference, t as createGeneratedRegistryRuntime } from "../procedure-caller-AjLfkHyF.js";
5
5
 
6
- export { ActionProcedureBuilder, CRPCError, CRPC_ERROR_CODES_BY_KEY, CRPC_ERROR_CODE_TO_HTTP, HttpRouterWithHono, MutationProcedureBuilder, ProcedureBuilder, QueryProcedureBuilder, convexToZod, convexToZodFields, createApiLeaf, createCallerFactory, createEnv, createGeneratedFunctionReference, createGeneratedRegistryRuntime, createGenericCallerFactory, createGenericHandlerFactory, createHttpProcedureBuilder, createHttpRouter, createHttpRouterFactory, createLazyCaller, createMiddlewareFactory, createProcedureCallerFactory, createProcedureHandlerFactory, createServerCaller, defineProcedure, extractPathParams, extractRouteMap, getCRPCErrorFromUnknown, getGeneratedFunctionReference, getGeneratedValue, getHTTPStatusCodeFromError, handleHttpError, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, matchPathParams, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
6
+ export { ActionProcedureBuilder, CRPCError, CRPC_ERROR_CODES_BY_KEY, CRPC_ERROR_CODE_TO_HTTP, HttpRouterWithHono, MutationProcedureBuilder, ProcedureBuilder, QueryProcedureBuilder, convexToZod, convexToZodFields, createApiLeaf, createCallerFactory, createEnv, createGeneratedFunctionReference, createGeneratedRegistryRuntime, createGenericCallerFactory, createGenericHandlerFactory, createHttpProcedureBuilder, createHttpRouter, createHttpRouterFactory, createLazyCaller, createMiddlewareFactory, createProcedureCallerFactory, createProcedureHandlerFactory, createServerCaller, defineProcedure, extractPathParams, extractRouteMap, getCRPCErrorFromUnknown, getGeneratedFunctionReference, getGeneratedValue, getHTTPStatusCodeFromError, handleHttpError, inferProcedureNameFromCallsite, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, isSchedulerCtx, matchPathParams, registerProcedureNameLookup, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, requireSchedulerCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
@@ -1,4 +1,4 @@
1
- import { O as CombinedDataTransformer, n as HttpClientError } from "./http-types-BS63Nsug.js";
1
+ import { O as CombinedDataTransformer, n as HttpClientError } from "./http-types-BLFA9zS7.js";
2
2
  import { FunctionArgs, FunctionReference, FunctionReturnType } from "convex/server";
3
3
 
4
4
  //#region src/crpc/http-client.d.ts
@@ -9,6 +9,13 @@ type UnsetMarker = {
9
9
  type MiddlewareMarker = {
10
10
  readonly __brand: 'MiddlewareMarker';
11
11
  };
12
+ type MiddlewareProcedureType = 'query' | 'mutation' | 'action' | 'httpAction';
13
+ type MiddlewareProcedureInfo = {
14
+ readonly type: MiddlewareProcedureType;
15
+ readonly name?: string;
16
+ readonly method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
17
+ readonly path?: string;
18
+ };
12
19
  /** Flatten intersection types for better IDE display */
13
20
  type Simplify<T> = { [K in keyof T]: T[K] } & {};
14
21
  /**
@@ -68,6 +75,7 @@ type MiddlewareNext<TContext, TContextOverridesIn> = <TNextContext extends objec
68
75
  type MiddlewareFunction<TContext, TMeta, TContextOverridesIn, $ContextOverridesOut, TInputOut = unknown> = (opts: {
69
76
  ctx: CurrentMiddlewareContext<TContext, TContextOverridesIn>;
70
77
  meta: TMeta;
78
+ procedure: MiddlewareProcedureInfo;
71
79
  input: TInputOut;
72
80
  getRawInput: GetRawInputFn;
73
81
  next: MiddlewareNext<TContext, TContextOverridesIn>;
@@ -90,4 +98,4 @@ type MiddlewareBuilder<TContext, TMeta, $ContextOverridesOut, TInputOut = unknow
90
98
  /** Type-erased middleware builder for runtime */
91
99
  type AnyMiddlewareBuilder = MiddlewareBuilder<any, any, any, any>;
92
100
  //#endregion
93
- export { MergeZodObjects as a, MiddlewareMarker as c, Overwrite as d, ResolveIfSet as f, IntersectIfDefined as i, MiddlewareNext as l, UnsetMarker as m, AnyMiddlewareBuilder as n, MiddlewareBuilder as o, Simplify as p, GetRawInputFn as r, MiddlewareFunction as s, AnyMiddleware as t, MiddlewareResult as u };
101
+ export { MergeZodObjects as a, MiddlewareMarker as c, MiddlewareProcedureType as d, MiddlewareResult as f, UnsetMarker as g, Simplify as h, IntersectIfDefined as i, MiddlewareNext as l, ResolveIfSet as m, AnyMiddlewareBuilder as n, MiddlewareBuilder as o, Overwrite as p, GetRawInputFn as r, MiddlewareFunction as s, AnyMiddleware as t, MiddlewareProcedureInfo as u };
package/dist/watcher.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { A as resolveConfiguredBackend, Ct as generateMeta, P as resolveRunDeps, Tt as logger, wt as getConvexConfig } from "./backend-core-Rv9NorIW.mjs";
2
+ import { A as resolveConfiguredBackend, Ct as generateMeta, K as withLocalCodegenEnv, P as resolveRunDeps, Tt as logger, wt as getConvexConfig } from "./backend-core-C0uwGXLx.mjs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
 
@@ -44,22 +44,25 @@ function shouldIgnoreWatchPath(watchedPath, functionsDir, outputFile) {
44
44
  if (normalizedPath === generatedFile) return true;
45
45
  if (normalizedPath === convexGeneratedDir || normalizedPath.startsWith(`${convexGeneratedDir}${path.sep}`)) return true;
46
46
  if (normalizedPath === generatedDir || normalizedPath.startsWith(`${generatedDir}${path.sep}`)) return true;
47
- return normalizedPath.endsWith(".runtime.ts");
47
+ return normalizedPath.endsWith(".runtime.ts") || normalizedPath.endsWith(".kitcn-parse.ts");
48
48
  }
49
49
  async function runWatcherCodegen(params, deps = {}) {
50
50
  const resolveRunDepsFn = deps.resolveRunDeps ?? resolveRunDeps;
51
51
  const resolveConfiguredBackendFn = deps.resolveConfiguredBackendFn ?? resolveConfiguredBackend;
52
52
  const { execa: execaFn, generateMeta: generateMetaFn, loadCliConfig: loadCliConfigFn } = resolveRunDepsFn();
53
53
  const config = loadCliConfigFn(params.configPath);
54
- if (resolveConfiguredBackendFn({
54
+ const backend = resolveConfiguredBackendFn({
55
55
  backendArg: params.backendArg,
56
56
  config
57
- }) !== "concave") {
58
- await generateMetaFn(params.sharedDir, {
59
- debug: params.debug,
60
- silent: true,
61
- scope: params.scope,
62
- trimSegments: params.trimSegments
57
+ });
58
+ if (backend !== "concave") {
59
+ await withLocalCodegenEnv(params.sharedDir, backend, async () => {
60
+ await generateMetaFn(params.sharedDir, {
61
+ debug: params.debug,
62
+ silent: true,
63
+ scope: params.scope,
64
+ trimSegments: params.trimSegments
65
+ });
63
66
  });
64
67
  return;
65
68
  }
@@ -3992,11 +3992,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
3992
3992
  readonly aggregate_extrema: ConvexTableWithColumns<{
3993
3993
  name: "aggregate_extrema";
3994
3994
  columns: {
3995
- value: ConvexCustomBuilderInitial<"", convex_values0.VAny<any, "required", string>> & {
3996
- _: {
3997
- $type: convex_values0.Value;
3998
- };
3999
- } & {
3995
+ count: ConvexNumberBuilderInitial<""> & {
4000
3996
  _: {
4001
3997
  notNull: true;
4002
3998
  };
@@ -4006,10 +4002,14 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
4006
4002
  };
4007
4003
  } & {
4008
4004
  _: {
4009
- fieldName: "value";
4005
+ fieldName: "count";
4010
4006
  };
4011
4007
  };
4012
- count: ConvexNumberBuilderInitial<""> & {
4008
+ value: ConvexCustomBuilderInitial<"", convex_values0.VAny<any, "required", string>> & {
4009
+ _: {
4010
+ $type: convex_values0.Value;
4011
+ };
4012
+ } & {
4013
4013
  _: {
4014
4014
  notNull: true;
4015
4015
  };
@@ -4019,7 +4019,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
4019
4019
  };
4020
4020
  } & {
4021
4021
  _: {
4022
- fieldName: "count";
4022
+ fieldName: "value";
4023
4023
  };
4024
4024
  };
4025
4025
  tableKey: ConvexTextBuilderInitial<""> & {
@@ -4398,22 +4398,22 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
4398
4398
  readonly migration_state: ConvexTableWithColumns<{
4399
4399
  name: "migration_state";
4400
4400
  columns: {
4401
- cursor: ConvexTextBuilderInitial<""> & {
4401
+ direction: ConvexTextBuilderInitial<""> & {
4402
4402
  _: {
4403
4403
  tableName: "migration_state";
4404
4404
  };
4405
4405
  } & {
4406
4406
  _: {
4407
- fieldName: "cursor";
4407
+ fieldName: "direction";
4408
4408
  };
4409
4409
  };
4410
- direction: ConvexTextBuilderInitial<""> & {
4410
+ cursor: ConvexTextBuilderInitial<""> & {
4411
4411
  _: {
4412
4412
  tableName: "migration_state";
4413
4413
  };
4414
4414
  } & {
4415
4415
  _: {
4416
- fieldName: "direction";
4416
+ fieldName: "cursor";
4417
4417
  };
4418
4418
  };
4419
4419
  status: ConvexTextBuilderInitial<""> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitcn",
3
- "version": "0.12.17",
3
+ "version": "0.12.19",
4
4
  "description": "kitcn - React Query integration and CLI tools for Convex",
5
5
  "keywords": [
6
6
  "convex",