kitcn 0.33.1 → 0.33.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # kitcn
2
2
 
3
+ ## 0.33.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#467](https://github.com/udecode/kitcn/pull/467) [`5794ed3`](https://github.com/udecode/kitcn/commit/5794ed381c0a3074e74585269eb7c24a030497cc) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
8
+
9
+ - Fix Next.js scaffolds to select and reconcile a compatible ESLint release.
10
+
3
11
  ## 0.33.1
4
12
 
5
13
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import { Vn as ConvexTextBuilderInitial, Zt as ConvexTableWithColumns } from "../capabilities-Bxzoofl4.js";
2
- import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial } from "../where-clause-compiler-CoPVAVDO.js";
2
+ import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial } from "../where-clause-compiler-B0kyVGzW.js";
3
3
  import * as convex_values0 from "convex/values";
4
4
  import { GenericId, Infer, Value } from "convex/values";
5
5
  import { DocumentByName, GenericDataModel, GenericDatabaseReader, GenericDatabaseWriter, TableNamesInDataModel } from "convex/server";
@@ -1,2 +1,2 @@
1
- import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, b as GenericAuthBeforeResult, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../../generated-contract-disabled-B_EaHGCP.js";
1
+ import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, b as GenericAuthBeforeResult, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../../generated-contract-disabled-CTUQ9nxL.js";
2
2
  export { type AuthRuntime, BetterAuthOptionsWithoutDatabase, type GeneratedAuthDisabledReasonKind, GenericAuthBeforeResult, GenericAuthDefinition, GenericAuthTriggerChange, GenericAuthTriggerHandlers, GenericAuthTriggers, createDisabledAuthRuntime, defineAuth, getGeneratedAuthDisabledReason };
@@ -1,7 +1,7 @@
1
1
  import { a as QueryCtxWithPreferredOrmQueryTable, n as LookupByIdResultByCtx, t as DocByCtx } from "../query-context-BkNjkDCk.js";
2
2
  import { t as GetAuth } from "../types-ex0-J-SC.js";
3
- import { t as GenericCtx } from "../context-utils-ax351iFc.js";
4
- import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, _ as updateManyHandler, a as AuthFunctions, b as GenericAuthBeforeResult, c as consumeOneHandler, d as createHandler, f as deleteManyHandler, g as incrementOneHandler, h as findOneHandler, i as getGeneratedAuthDisabledReason, l as countHandler, m as findManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as deleteOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as createApi, v as updateOneHandler, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../generated-contract-disabled-B_EaHGCP.js";
3
+ import { t as GenericCtx } from "../context-utils-Cbv4r0AA.js";
4
+ import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, _ as updateManyHandler, a as AuthFunctions, b as GenericAuthBeforeResult, c as consumeOneHandler, d as createHandler, f as deleteManyHandler, g as incrementOneHandler, h as findOneHandler, i as getGeneratedAuthDisabledReason, l as countHandler, m as findManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as deleteOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as createApi, v as updateOneHandler, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../generated-contract-disabled-CTUQ9nxL.js";
5
5
  import * as convex_values0 from "convex/values";
6
6
  import { Infer } from "convex/values";
7
7
  import { AuthConfig, DocumentByName, GenericDataModel, GenericMutationCtx, GenericQueryCtx, GenericSchema, PaginationOptions, PaginationResult, SchemaDefinition, TableNamesInDataModel } from "convex/server";
@@ -119,7 +119,7 @@ declare const adapterWhereValidator: convex_values0.VObject<{
119
119
  mode: convex_values0.VUnion<"sensitive" | "insensitive" | undefined, [convex_values0.VLiteral<"sensitive", "required">, convex_values0.VLiteral<"insensitive", "required">], "optional", never>;
120
120
  operator: convex_values0.VUnion<"eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined, [convex_values0.VLiteral<"lt", "required">, convex_values0.VLiteral<"lte", "required">, convex_values0.VLiteral<"gt", "required">, convex_values0.VLiteral<"gte", "required">, convex_values0.VLiteral<"eq", "required">, convex_values0.VLiteral<"in", "required">, convex_values0.VLiteral<"not_in", "required">, convex_values0.VLiteral<"ne", "required">, convex_values0.VLiteral<"contains", "required">, convex_values0.VLiteral<"starts_with", "required">, convex_values0.VLiteral<"ends_with", "required">], "optional", never>;
121
121
  value: convex_values0.VUnion<string | number | boolean | string[] | number[] | null, [convex_values0.VString<string, "required">, convex_values0.VFloat64<number, "required">, convex_values0.VBoolean<boolean, "required">, convex_values0.VArray<string[], convex_values0.VString<string, "required">, "required">, convex_values0.VArray<number[], convex_values0.VFloat64<number, "required">, "required">, convex_values0.VNull<null, "required">], "required", never>;
122
- }, "required", "mode" | "value" | "operator" | "field" | "connector">;
122
+ }, "required", "mode" | "operator" | "value" | "field" | "connector">;
123
123
  declare const adapterArgsValidator: convex_values0.VObject<{
124
124
  limit?: number | undefined;
125
125
  where?: {
@@ -132,8 +132,8 @@ declare const adapterArgsValidator: convex_values0.VObject<{
132
132
  select?: string[] | undefined;
133
133
  offset?: number | undefined;
134
134
  sortBy?: {
135
- direction: "asc" | "desc";
136
135
  field: string;
136
+ direction: "asc" | "desc";
137
137
  } | undefined;
138
138
  model: string;
139
139
  }, {
@@ -142,12 +142,12 @@ declare const adapterArgsValidator: convex_values0.VObject<{
142
142
  offset: convex_values0.VFloat64<number | undefined, "optional">;
143
143
  select: convex_values0.VArray<string[] | undefined, convex_values0.VString<string, "required">, "optional">;
144
144
  sortBy: convex_values0.VObject<{
145
- direction: "asc" | "desc";
146
145
  field: string;
146
+ direction: "asc" | "desc";
147
147
  } | undefined, {
148
148
  direction: convex_values0.VUnion<"asc" | "desc", [convex_values0.VLiteral<"asc", "required">, convex_values0.VLiteral<"desc", "required">], "required", never>;
149
149
  field: convex_values0.VString<string, "required">;
150
- }, "optional", "direction" | "field">;
150
+ }, "optional", "field" | "direction">;
151
151
  where: convex_values0.VArray<{
152
152
  mode?: "sensitive" | "insensitive" | undefined;
153
153
  operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
@@ -166,8 +166,8 @@ declare const adapterArgsValidator: convex_values0.VObject<{
166
166
  mode: convex_values0.VUnion<"sensitive" | "insensitive" | undefined, [convex_values0.VLiteral<"sensitive", "required">, convex_values0.VLiteral<"insensitive", "required">], "optional", never>;
167
167
  operator: convex_values0.VUnion<"eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined, [convex_values0.VLiteral<"lt", "required">, convex_values0.VLiteral<"lte", "required">, convex_values0.VLiteral<"gt", "required">, convex_values0.VLiteral<"gte", "required">, convex_values0.VLiteral<"eq", "required">, convex_values0.VLiteral<"in", "required">, convex_values0.VLiteral<"not_in", "required">, convex_values0.VLiteral<"ne", "required">, convex_values0.VLiteral<"contains", "required">, convex_values0.VLiteral<"starts_with", "required">, convex_values0.VLiteral<"ends_with", "required">], "optional", never>;
168
168
  value: convex_values0.VUnion<string | number | boolean | string[] | number[] | null, [convex_values0.VString<string, "required">, convex_values0.VFloat64<number, "required">, convex_values0.VBoolean<boolean, "required">, convex_values0.VArray<string[], convex_values0.VString<string, "required">, "required">, convex_values0.VArray<number[], convex_values0.VFloat64<number, "required">, "required">, convex_values0.VNull<null, "required">], "required", never>;
169
- }, "required", "mode" | "value" | "operator" | "field" | "connector">, "optional">;
170
- }, "required", "limit" | "where" | "model" | "select" | "offset" | "sortBy" | "sortBy.direction" | "sortBy.field">;
169
+ }, "required", "mode" | "operator" | "value" | "field" | "connector">, "optional">;
170
+ }, "required", "limit" | "where" | "model" | "select" | "offset" | "sortBy" | "sortBy.field" | "sortBy.direction">;
171
171
  declare const hasUniqueFields: (betterAuthSchema: BetterAuthDBSchema, model: string, input: Record<string, any>) => boolean;
172
172
  declare const checkUniqueFields: <Schema extends SchemaDefinition<any, any>>(ctx: GenericQueryCtx<GenericDataModel>, schema: Schema, betterAuthSchema: BetterAuthDBSchema, table: string, input: Record<string, any>, doc?: Record<string, any>) => Promise<void>;
173
173
  declare const selectFields: <T extends TableNamesInDataModel<GenericDataModel>, D extends DocumentByName<GenericDataModel, T>>(doc: D | null, select?: string[]) => D | null;
@@ -1,5 +1,5 @@
1
- import { r as LazyCaller, t as ConvexContext } from "../../caller-factory-C3pcbzo0.js";
2
- import { t as GetTokenOptions } from "../../token-CZpDQUHd.js";
1
+ import { H as ConvexContext, W as LazyCaller } from "../../procedure-name-DRSOwAJY.js";
2
+ import { t as GetTokenOptions } from "../../token-tlbNKQS0.js";
3
3
 
4
4
  //#region src/auth-nextjs/index.d.ts
5
5
  /** Auth options for server-side calls. */
@@ -1,5 +1,5 @@
1
- import { r as LazyCaller, t as ConvexContext } from "../../../caller-factory-C3pcbzo0.js";
2
- import { t as GetTokenOptions } from "../../../token-CZpDQUHd.js";
1
+ import { H as ConvexContext, W as LazyCaller } from "../../../procedure-name-DRSOwAJY.js";
2
+ import { t as GetTokenOptions } from "../../../token-tlbNKQS0.js";
3
3
  import { FunctionReference, FunctionReturnType, OptionalRestArgs } from "convex/server";
4
4
 
5
5
  //#region src/auth-start/server.d.ts
package/dist/cli.mjs CHANGED
@@ -9267,13 +9267,42 @@ const INIT_NEXT_PACKAGE_JSON_DEPENDENCIES = {
9267
9267
  "@opentelemetry/api": SUPPORTED_DEPENDENCY_VERSIONS.opentelemetryApi.exact,
9268
9268
  superjson: "2.2.6"
9269
9269
  };
9270
+ const INIT_NEXT_ESLINT_VERSION = "9.39.5";
9271
+ const MIN_ESLINT_9_NEXT_CONFIG_MAJOR = 15;
9272
+ const EXTERNALLY_MANAGED_VERSION_RE = /^(?:catalog|workspace):/;
9273
+ const SIMPLE_VERSION_MAJOR_RE = /^(?:[v=~^]\s*)?(\d+)(?:\.(?:\d+|x|\*)){0,2}(?:-[0-9A-Za-z.-]+)?$/i;
9270
9274
  const INIT_NEXT_PACKAGE_JSON_DEV_DEPENDENCIES = { "@types/bun": "latest" };
9271
- const getInitNextPackageJsonDevDependencies = (options) => ({
9275
+ const resolveSimpleVersionMajor = (version) => {
9276
+ const major = version?.trim().match(SIMPLE_VERSION_MAJOR_RE)?.[1];
9277
+ return major === void 0 ? void 0 : Number(major);
9278
+ };
9279
+ const resolveInitNextEslintVersionFromPackageJson = (packageJson) => {
9280
+ const eslintConfigNextVersion = packageJson.devDependencies?.["eslint-config-next"] ?? packageJson.dependencies?.["eslint-config-next"];
9281
+ if (eslintConfigNextVersion === void 0) return;
9282
+ const configMajor = resolveSimpleVersionMajor(eslintConfigNextVersion);
9283
+ if (configMajor !== void 0) return configMajor >= MIN_ESLINT_9_NEXT_CONFIG_MAJOR ? INIT_NEXT_ESLINT_VERSION : void 0;
9284
+ const nextVersion = packageJson.dependencies?.next ?? packageJson.devDependencies?.next;
9285
+ const nextMajor = resolveSimpleVersionMajor(nextVersion);
9286
+ if (nextMajor !== void 0) return nextMajor >= MIN_ESLINT_9_NEXT_CONFIG_MAJOR ? INIT_NEXT_ESLINT_VERSION : void 0;
9287
+ const eslintVersion = packageJson.devDependencies?.eslint ?? packageJson.dependencies?.eslint;
9288
+ const eslintMajor = resolveSimpleVersionMajor(eslintVersion);
9289
+ if (eslintMajor !== void 0 && eslintMajor < 9) return;
9290
+ if ([
9291
+ eslintConfigNextVersion,
9292
+ nextVersion,
9293
+ eslintVersion
9294
+ ].every((version) => version !== void 0 && EXTERNALLY_MANAGED_VERSION_RE.test(version))) return;
9295
+ return INIT_NEXT_ESLINT_VERSION;
9296
+ };
9297
+ const getInitNextPackageJsonDevDependencies = (options, eslintVersion) => ({
9272
9298
  ...INIT_NEXT_PACKAGE_JSON_DEV_DEPENDENCIES,
9299
+ ...eslintVersion ? { eslint: eslintVersion } : {},
9273
9300
  ...options.backend === "concave" ? { "@concavejs/cli": SUPPORTED_DEPENDENCY_VERSIONS.concaveCli.exact } : {}
9274
9301
  });
9275
9302
  function renderInitNextPackageJsonTemplate(source, options = {}) {
9276
9303
  const existing = source ? JSON.parse(source) : {};
9304
+ const eslintVersion = resolveInitNextEslintVersionFromPackageJson(existing);
9305
+ const existingDependencies = eslintVersion ? Object.fromEntries(Object.entries(existing.dependencies ?? {}).filter(([packageName]) => packageName !== "eslint")) : existing.dependencies;
9277
9306
  const nextScripts = {
9278
9307
  ...existing.scripts,
9279
9308
  ...INIT_NEXT_PACKAGE_JSON_SCRIPTS
@@ -9286,12 +9315,12 @@ function renderInitNextPackageJsonTemplate(source, options = {}) {
9286
9315
  ...existing,
9287
9316
  scripts: nextScripts,
9288
9317
  dependencies: {
9289
- ...existing.dependencies,
9318
+ ...existingDependencies,
9290
9319
  ...INIT_NEXT_PACKAGE_JSON_DEPENDENCIES
9291
9320
  },
9292
9321
  devDependencies: {
9293
9322
  ...existing.devDependencies,
9294
- ...getInitNextPackageJsonDevDependencies(options)
9323
+ ...getInitNextPackageJsonDevDependencies(options, eslintVersion)
9295
9324
  }
9296
9325
  }, null, 2)}\n`;
9297
9326
  }
@@ -11840,11 +11869,15 @@ function buildDependencyInstallPlan(projectDir, dependencies) {
11840
11869
  ...pkg.dependencies ?? {},
11841
11870
  ...pkg.devDependencies ?? {}
11842
11871
  };
11843
- const missing = dependencies.filter((dependency) => !(dependency.packageName in existing));
11844
- if (missing.length === 0) return null;
11872
+ const missing = dependencies.filter((dependency) => !dependency.installFromManifest && !(dependency.packageName in existing));
11873
+ const requiresReconcile = dependencies.some((dependency) => dependency.requiredVersion !== void 0 && (dependency.installFromManifest || existing[dependency.packageName] !== void 0) && existing[dependency.packageName] !== dependency.requiredVersion || dependency.requiredSection === "devDependencies" && pkg.dependencies?.[dependency.packageName] !== void 0 || dependency.requiredSection === "dependencies" && pkg.devDependencies?.[dependency.packageName] !== void 0);
11874
+ if (missing.length === 0 && !requiresReconcile) return null;
11845
11875
  const packageManager = detectPackageManager(projectDir);
11846
11876
  const missingSpecs = missing.map((dependency) => dependency.installSpec);
11847
- const installCommand = resolveDependencyInstallCommand(packageManager, missingSpecs);
11877
+ const installCommand = missingSpecs.length > 0 ? resolveDependencyInstallCommand(packageManager, missingSpecs) : {
11878
+ command: packageManager,
11879
+ args: ["install"]
11880
+ };
11848
11881
  return {
11849
11882
  packageManager,
11850
11883
  command: installCommand.command,
@@ -11954,6 +11987,7 @@ function buildInitializationPlan(params) {
11954
11987
  skipReason: "Baseline http.ts is already bootstrapped."
11955
11988
  }));
11956
11989
  files.push(...templateFiles);
11990
+ const nextEslintVersion = projectContext?.mode === "next-app" ? resolveInitNextEslintVersionFromPackageJson(JSON.parse(fs.readFileSync(resolve(process.cwd(), "package.json"), "utf8"))) : void 0;
11957
11991
  const dependencyPackages = projectContext ? [
11958
11992
  ...BASELINE_DEPENDENCY_INSTALL_SPECS.map((installSpec) => ({
11959
11993
  installSpec,
@@ -11966,7 +12000,14 @@ function buildInitializationPlan(params) {
11966
12000
  ...INIT_TEMPLATE_DEPENDENCY_INSTALL_SPECS.map((installSpec) => ({
11967
12001
  installSpec,
11968
12002
  packageName: getPackageNameFromInstallSpec(installSpec)
11969
- }))
12003
+ })),
12004
+ ...nextEslintVersion ? [{
12005
+ installFromManifest: true,
12006
+ installSpec: `eslint@${nextEslintVersion}`,
12007
+ packageName: "eslint",
12008
+ requiredSection: "devDependencies",
12009
+ requiredVersion: nextEslintVersion
12010
+ }] : []
11970
12011
  ] : [...BASELINE_DEPENDENCY_INSTALL_SPECS.map((installSpec) => ({
11971
12012
  installSpec,
11972
12013
  packageName: getPackageNameFromInstallSpec(installSpec)
@@ -1,6 +1,5 @@
1
- import { a as WireCodec, c as decodeWire, d as getTransformer, f as identityTransformer, i as DataTransformerOptions, l as defaultCRPCTransformer, n as DATE_CODEC_TAG, o as createTaggedTransformer, r as DataTransformer, s as dateWireCodec, t as CombinedDataTransformer, u as encodeWire } from "../transformer-BEkxlnss.js";
2
- import { a as HttpErrorCode, c as HttpQueryKey, d as HttpRouteMap, f as InferHttpInput, g as isHttpClientError, h as buildHttpQueryPrefixKey, i as HttpClientFromRouter, l as HttpQueryPrefixKey, m as buildHttpQueryKey, n as HttpClient, o as HttpMutationKey, p as InferHttpOutput, r as HttpClientError, s as HttpProcedureCall, t as HTTP_DEFAULT_STALE_TIME, u as HttpRouteInfo } from "../http-types-8FBr10yl.js";
3
- import { A as HttpInputArgs, C as ReservedMutationOptions, D as VanillaMutation, E as VanillaAction, F as replaceUrlParam, M as RESERVED_KEYS, N as buildSearchParams, O as HttpClientOptions, P as executeHttpRequest, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, a as BaseInfiniteQueryOptsParam, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, h as FnMeta, i as BaseConvexQueryOptions, j as HttpProxyBaseOptions, k as HttpFormValue, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, n as BaseConvexActionOptions, o as ConvexActionKey, p as ExtractPaginatedItem, r as BaseConvexInfiniteQueryOptions, s as ConvexInfiniteQueryMeta, t as AuthType, u as ConvexQueryKey, v as Meta, w as ReservedQueryOptions, x as PaginationOpts, y as MutationVariables } from "../types-Cl0utsTL.js";
1
+ import { B as dateWireCodec, F as DATE_CODEC_TAG, G as identityTransformer, H as defaultCRPCTransformer, I as DataTransformer, L as DataTransformerOptions, P as CombinedDataTransformer, R as WireCodec, U as encodeWire, V as decodeWire, W as getTransformer, a as HttpErrorCode, c as HttpQueryKey, d as HttpRouteMap, f as InferHttpInput, g as isHttpClientError, h as buildHttpQueryPrefixKey, i as HttpClientFromRouter, l as HttpQueryPrefixKey, m as buildHttpQueryKey, n as HttpClient, o as HttpMutationKey, p as InferHttpOutput, r as HttpClientError, s as HttpProcedureCall, t as HTTP_DEFAULT_STALE_TIME, u as HttpRouteInfo, z as createTaggedTransformer } from "../http-types-BhhPZtwa.js";
2
+ import { A as HttpInputArgs, C as ReservedMutationOptions, D as VanillaMutation, E as VanillaAction, F as replaceUrlParam, M as RESERVED_KEYS, N as buildSearchParams, O as HttpClientOptions, P as executeHttpRequest, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, a as BaseInfiniteQueryOptsParam, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, h as FnMeta, i as BaseConvexQueryOptions, j as HttpProxyBaseOptions, k as HttpFormValue, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, n as BaseConvexActionOptions, o as ConvexActionKey, p as ExtractPaginatedItem, r as BaseConvexInfiniteQueryOptions, s as ConvexInfiniteQueryMeta, t as AuthType, u as ConvexQueryKey, v as Meta, w as ReservedQueryOptions, x as PaginationOpts, y as MutationVariables } from "../types-C7JkpfeY.js";
4
3
  import { FunctionArgs, FunctionReference } from "convex/server";
5
4
 
6
5
  //#region src/crpc/auth-error.d.ts
@@ -1,5 +1,5 @@
1
1
  import { t as GetAuth } from "./types-ex0-J-SC.js";
2
- import { t as GenericCtx } from "./context-utils-ax351iFc.js";
2
+ import { t as GenericCtx } from "./context-utils-Cbv4r0AA.js";
3
3
  import * as convex_server0 from "convex/server";
4
4
  import { DocumentByName, FunctionReference, GenericDataModel, GenericMutationCtx, GenericSchema, PaginationResult, SchemaDefinition, TableNamesInDataModel, internalMutationGeneric } from "convex/server";
5
5
  import * as better_auth_adapters0 from "better-auth/adapters";
@@ -278,8 +278,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
278
278
  };
279
279
  }, Promise<Record<string, unknown> | undefined>>;
280
280
  findMany: convex_server0.RegisteredQuery<"internal", {
281
- join?: any;
282
281
  limit?: number | undefined;
282
+ join?: any;
283
283
  where?: {
284
284
  mode?: "sensitive" | "insensitive" | undefined;
285
285
  operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
@@ -289,8 +289,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
289
289
  }[] | undefined;
290
290
  offset?: number | undefined;
291
291
  sortBy?: {
292
- direction: "asc" | "desc";
293
292
  field: string;
293
+ direction: "asc" | "desc";
294
294
  } | undefined;
295
295
  paginationOpts: {
296
296
  id?: number;
@@ -1,10 +1,86 @@
1
1
  import { o as Simplify } from "./types-Bqi_ivSd.js";
2
- import { t as CombinedDataTransformer } from "./transformer-BEkxlnss.js";
3
- import { g as UnsetMarker, t as AnyMiddleware } from "./types-CzGsrLrY.js";
2
+ import { g as UnsetMarker, t as AnyMiddleware } from "./types-Bkeicpo6.js";
4
3
  import { GenericActionCtx, GenericDataModel, HttpRouter } from "convex/server";
5
4
  import { z } from "zod";
6
5
  import { Context, Hono } from "hono";
7
6
 
7
+ //#region src/crpc/transformer.d.ts
8
+ /**
9
+ * Generic transformer contract (mirrors tRPC shape).
10
+ */
11
+ interface DataTransformer {
12
+ deserialize(object: any): any;
13
+ serialize(object: any): any;
14
+ }
15
+ /**
16
+ * Separate input/output transformers.
17
+ */
18
+ interface CombinedDataTransformer {
19
+ input: DataTransformer;
20
+ output: DataTransformer;
21
+ }
22
+ /**
23
+ * Transformer config accepted by cRPC.
24
+ */
25
+ type DataTransformerOptions = CombinedDataTransformer | DataTransformer;
26
+ /**
27
+ * Extensible tagged wire codec.
28
+ */
29
+ interface WireCodec {
30
+ decode(value: unknown): unknown;
31
+ encode(value: unknown): unknown;
32
+ isType(value: unknown): boolean;
33
+ /**
34
+ * Declares that `isType` only ever claims a value where
35
+ * `typeof value === 'object' && value !== null` - never a primitive, a
36
+ * function, `null` or `undefined`.
37
+ *
38
+ * Lets `serialize` skip codec dispatch on primitives, which are the majority
39
+ * of visited nodes. It is opt-in because an arbitrary predicate cannot be
40
+ * classified by sampling values: a codec that claims, say, one specific
41
+ * number would be misread as object-only and silently lose its encoding.
42
+ * Codecs that leave it unset keep full dispatch.
43
+ */
44
+ readonly objectsOnly?: boolean;
45
+ readonly tag: `$${string}`;
46
+ }
47
+ /**
48
+ * Date wire tag (Convex-style reserved key).
49
+ */
50
+ declare const DATE_CODEC_TAG = "$date";
51
+ /**
52
+ * Built-in Date codec.
53
+ */
54
+ declare const dateWireCodec: WireCodec;
55
+ /**
56
+ * Build a recursive tagged transformer from codecs.
57
+ */
58
+ declare const createTaggedTransformer: (codecs: readonly WireCodec[]) => DataTransformer;
59
+ /**
60
+ * Default cRPC transformer (Date-enabled).
61
+ */
62
+ declare const defaultCRPCTransformer: DataTransformer;
63
+ /**
64
+ * Normalize transformer config to split input/output shape.
65
+ * User transformers are additive and always composed with default Date handling.
66
+ *
67
+ * Idempotent: passing a transformer this function already resolved returns it
68
+ * unchanged.
69
+ */
70
+ declare const getTransformer: (transformer?: DataTransformerOptions) => CombinedDataTransformer;
71
+ /**
72
+ * Encode request payloads (input direction).
73
+ */
74
+ declare const encodeWire: (value: unknown, transformer?: DataTransformerOptions) => unknown;
75
+ /**
76
+ * Decode response payloads (output direction).
77
+ */
78
+ declare const decodeWire: (value: unknown, transformer?: DataTransformerOptions) => unknown;
79
+ /**
80
+ * Exposed identity transformer for advanced composition.
81
+ */
82
+ declare const identityTransformer: CombinedDataTransformer;
83
+ //#endregion
8
84
  //#region src/server/http-types.d.ts
9
85
  type ProcedureMeta = object;
10
86
  type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
@@ -259,4 +335,4 @@ declare class HttpClientError extends Error {
259
335
  /** Type guard for HttpClientError */
260
336
  declare const isHttpClientError: (error: unknown) => error is HttpClientError;
261
337
  //#endregion
262
- export { HttpProcedureBuilderDef as A, extractRouteMap as C, HttpHandlerOpts as D, HttpActionHandler as E, InferHttpInput$1 as M, ProcedureMeta as N, HttpMethod as O, createHttpRouterFactory as S, HttpActionConstructor as T, CRPCHttpRouter as _, HttpErrorCode as a, HttpRouterWithHono as b, HttpQueryKey as c, HttpRouteMap as d, InferHttpInput as f, isHttpClientError as g, buildHttpQueryPrefixKey as h, HttpClientFromRouter as i, HttpRouteDefinition as j, HttpProcedure as k, HttpQueryPrefixKey as l, buildHttpQueryKey as m, HttpClient as n, HttpMutationKey as o, InferHttpOutput as p, HttpClientError as r, HttpProcedureCall as s, HTTP_DEFAULT_STALE_TIME as t, HttpRouteInfo as u, HttpRouterDef as v, CRPCHonoHandler as w, createHttpRouter as x, HttpRouterRecord as y };
338
+ export { HttpProcedureBuilderDef as A, dateWireCodec as B, extractRouteMap as C, HttpHandlerOpts as D, HttpActionHandler as E, DATE_CODEC_TAG as F, identityTransformer as G, defaultCRPCTransformer as H, DataTransformer as I, DataTransformerOptions as L, InferHttpInput$1 as M, ProcedureMeta as N, HttpMethod as O, CombinedDataTransformer as P, WireCodec as R, createHttpRouterFactory as S, HttpActionConstructor as T, encodeWire as U, decodeWire as V, getTransformer as W, CRPCHttpRouter as _, HttpErrorCode as a, HttpRouterWithHono as b, HttpQueryKey as c, HttpRouteMap as d, InferHttpInput as f, isHttpClientError as g, buildHttpQueryPrefixKey as h, HttpClientFromRouter as i, HttpRouteDefinition as j, HttpProcedure as k, HttpQueryPrefixKey as l, buildHttpQueryKey as m, HttpClient as n, HttpMutationKey as o, InferHttpOutput as p, HttpClientError as r, HttpProcedureCall as s, HTTP_DEFAULT_STALE_TIME as t, HttpRouteInfo as u, HttpRouterDef as v, CRPCHonoHandler as w, createHttpRouter as x, HttpRouterRecord as y, createTaggedTransformer as z };
@@ -1,4 +1,4 @@
1
- import { o as MiddlewareBuilder } from "./types-CzGsrLrY.js";
1
+ import { o as MiddlewareBuilder } from "./types-Bkeicpo6.js";
2
2
 
3
3
  //#region src/plugins/middleware.d.ts
4
4
  declare const PLUGIN_CONFIG_RESOLVERS: unique symbol;
@@ -1,5 +1,5 @@
1
1
  import { $n as TableName, $t as OrmLifecycleChange, An as ConvexCheckBuilder, At as UpdateSet, Bn as ConvexTextBuilder, Br as IsPrimaryKey, Bt as RelationsBuilderColumnBase, C as MigrationStep, Cn as ConvexVectorIndexConfig, Cr as not, Ct as OrderByClause, D as defineMigration, Dn as searchIndex, Dr as startsWith, Dt as ReturningAll, E as buildMigrationPlan, En as rankIndex, Er as or, Et as PredicateWhereIndexConfig, Fn as ConvexUniqueConstraintBuilderOn, Fr as ColumnBuilderTypeConfig, Ft as ExtractTablesFromSchema, Gn as Columns, Gt as TablesRelationalConfig, H as RlsMode, Hn as text, Hr as NotNull, In as ConvexUniqueConstraintConfig, Ir as ColumnBuilderWithTableName, It as ExtractTablesWithRelations, Jn as OrmSchemaExtensionTables, Jt as ConvexDeletionBuilder, Kt as defineRelations, Ln as check, Lr as ColumnDataType, Lt as ManyConfig, M as DatabaseWithQuery, Mn as ConvexForeignKeyBuilder, Mr as ColumnBuilder, Mt as VectorSearchProvider, N as OrmReader$1, Nn as ConvexForeignKeyConfig, Nr as ColumnBuilderBaseConfig, Nt as unsetToken, O as defineMigrationSet, On as uniqueIndex, Ot as ReturningResult, P as OrmWriter$1, Pn as ConvexUniqueConstraintBuilder, Pr as ColumnBuilderRuntimeConfig, Qn as OrmSchemaTriggers, Qt as DiscriminatorBuilderConfig, Rn as foreignKey, Rr as DrizzleEntity, Rt as OneConfig, S as MigrationStateMap, Sn as ConvexVectorIndexBuilderOn, Sr as ne, St as MutationRunMode, T as MigrationWriteMode, Tn as index, Tr as notInArray, Tt as PaginatedResult, U as EdgeMetadata, V as RlsContext, Vn as ConvexTextBuilderInitial, Vr as IsUnique, Vt as RelationsBuilderColumnConfig, W as extractRelationsConfig, Wn as Brand, Wt as TableRelationalConfig, Xn as OrmSchemaExtensions, Xt as ConvexTable, Yt as ConvexDeletionConfig, Zn as OrmSchemaRelations, Zt as ConvexTableWithColumns, _ as MigrationManifestEntry, _n as ConvexRankIndexBuilderOn, _r as isNotNull, _t as MutationExecutionMode, an as RlsPolicy, ar as UnaryExpression, at as BuildRelationResult, b as MigrationRunStatus, bn as ConvexSearchIndexConfig, br as lt, bt as MutationResult, cn as rlsPolicy, cr as contains, ct as DBQueryConfig, d as MigrationAppliedState, dn as rlsRole, dr as fieldRef, dt as InferInsertModel, en as OrmLifecycleOperation, er as BinaryExpression, f as MigrationDefinition, fn as ConvexAggregateIndexBuilder, fr as gt, ft as InferModelFromColumns, g as MigrationDriftIssue, gn as ConvexRankIndexBuilder, gr as isFieldReference, gt as MutationExecuteResult, h as MigrationDocContext, hn as ConvexIndexBuilderOn, hr as inArray, ht as MutationExecuteConfig, i as OrmMigrationCapability, in as discriminator, ir as LogicalExpression, it as BuildQueryResult, j as DatabaseWithMutations, jn as ConvexCheckConfig, jr as AnyColumn, jt as VectorQueryConfig, k as detectMigrationDrift, kn as vectorIndex, kr as SystemFields, kt as ReturningSelection, ln as RlsRole, lr as endsWith, lt as FilterOperators, m as MigrationDoc, mn as ConvexIndexBuilder, mr as ilike, mt as InsertValue, n as OrmCapabilities, nn as convexTable, nr as FieldReference, nt as AggregateFieldValue, on as RlsPolicyConfig, or as and, ot as CountConfig, p as MigrationDirection, pn as ConvexAggregateIndexBuilderOn, pr as gte, pt as InferSelectModel, qt as defineRelationsPart, r as OrmCapability, rn as deletion, rr as FilterExpression, rt as AggregateResult, sn as RlsPolicyToOption, sr as between, st as CountResult, t as OrmAggregateCapability, tn as TableConfig, tr as ExpressionVisitor, tt as AggregateConfig, un as RlsRoleConfig, ur as eq, ut as GetColumnData, v as MigrationMigrateOne, vn as ConvexSearchIndexBuilder, vr as isNull, vt as MutationPaginateConfig, w as MigrationTableName, wn as aggregateIndex, wr as notBetween, wt as OrderDirection, x as MigrationSet, xn as ConvexVectorIndexBuilder, xr as lte, xt as MutationReturning, y as MigrationPlan, yn as ConvexSearchIndexBuilderOn, yr as like, yt as MutationPaginatedResult, zn as unique, zr as HasDefault, zt as RelationsBuilder } from "../capabilities-Bxzoofl4.js";
2
- import { $ as OrmClientWithApi$1, A as ConvexDateMode, B as ConvexBytesBuilderInitial, C as ConvexNumberBuilderInitial, D as id, E as ConvexIdBuilderInitial, F as custom, G as ConvexBigIntBuilder, H as ConvexBooleanBuilder, I as json, J as CreateOrmOptions, K as ConvexBigIntBuilderInitial, L as objectOf, M as ConvexCustomBuilder, N as ConvexCustomBuilderInitial, O as ConvexDateBuilder, P as arrayOf, Q as OrmClientBase$1, R as unionOf, S as ConvexNumberBuilder, St as defineTriggers, T as ConvexIdBuilder, U as ConvexBooleanBuilderInitial, V as bytes, W as boolean, X as GenericOrmCtx$1, Y as GenericOrm$1, Z as OrmApiResult, _ as ConvexTimestampMode, _t as OrmBeforeResult, a as requireSchemaRelations, at as ScheduledMutationBatchArgs, b as ConvexTextEnumBuilderInitial, bt as OrmTriggerContext, c as TableConfigResult, ct as scheduledDeleteFactory, d as OrmNotFoundError, et as OrmFunctions, f as ConvexVectorBuilder, g as ConvexTimestampBuilderInitial, gt as defineSchemaExtension, h as ConvexTimestampBuilder, ht as SchemaExtension, i as getSchemaTriggers, it as createOrm, j as date, k as ConvexDateBuilderInitial, l as getTableColumns, m as vector, n as defineSchema, nt as OrmWriterCtx, o as asc, ot as scheduledMutationBatchFactory, p as ConvexVectorBuilderInitial, q as bigint, r as getSchemaRelations, rt as ResolveOrmSchema, s as desc, st as ScheduledDeleteArgs, t as WhereClauseResult, tt as OrmReaderCtx, u as getTableConfig, v as timestamp, vt as OrmTableTriggers, w as integer, x as textEnum, xt as OrmTriggers, y as ConvexTextEnumBuilder, yt as OrmTriggerChange, z as ConvexBytesBuilder } from "../where-clause-compiler-CoPVAVDO.js";
2
+ import { $ as OrmClientWithApi$1, A as ConvexDateMode, B as ConvexBytesBuilderInitial, C as ConvexNumberBuilderInitial, D as id, E as ConvexIdBuilderInitial, F as custom, G as ConvexBigIntBuilder, H as ConvexBooleanBuilder, I as json, J as CreateOrmOptions, K as ConvexBigIntBuilderInitial, L as objectOf, M as ConvexCustomBuilder, N as ConvexCustomBuilderInitial, O as ConvexDateBuilder, P as arrayOf, Q as OrmClientBase$1, R as unionOf, S as ConvexNumberBuilder, St as defineTriggers, T as ConvexIdBuilder, U as ConvexBooleanBuilderInitial, V as bytes, W as boolean, X as GenericOrmCtx$1, Y as GenericOrm$1, Z as OrmApiResult, _ as ConvexTimestampMode, _t as OrmBeforeResult, a as requireSchemaRelations, at as ScheduledMutationBatchArgs, b as ConvexTextEnumBuilderInitial, bt as OrmTriggerContext, c as TableConfigResult, ct as scheduledDeleteFactory, d as OrmNotFoundError, et as OrmFunctions, f as ConvexVectorBuilder, g as ConvexTimestampBuilderInitial, gt as defineSchemaExtension, h as ConvexTimestampBuilder, ht as SchemaExtension, i as getSchemaTriggers, it as createOrm, j as date, k as ConvexDateBuilderInitial, l as getTableColumns, m as vector, n as defineSchema, nt as OrmWriterCtx, o as asc, ot as scheduledMutationBatchFactory, p as ConvexVectorBuilderInitial, q as bigint, r as getSchemaRelations, rt as ResolveOrmSchema, s as desc, st as ScheduledDeleteArgs, t as WhereClauseResult, tt as OrmReaderCtx, u as getTableConfig, v as timestamp, vt as OrmTableTriggers, w as integer, x as textEnum, xt as OrmTriggers, y as ConvexTextEnumBuilder, yt as OrmTriggerChange, z as ConvexBytesBuilder } from "../where-clause-compiler-B0kyVGzW.js";
3
3
  import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-0I-Ik1EN.js";
4
4
  import { a as QueryCtxWithPreferredOrmQueryTable, i as QueryCtxWithOrmQueryTable, n as LookupByIdResultByCtx, o as getByIdWithOrmQueryFallback, r as QueryCtxWithOptionalOrmQueryTable, t as DocByCtx } from "../query-context-BkNjkDCk.js";
5
5
  import { DefineSchemaOptions, GenericDatabaseReader, GenericDatabaseWriter, GenericSchema, SchemaDefinition } from "convex/server";
@@ -1,3 +1,3 @@
1
1
  import { C as MigrationStep, D as defineMigration, E as buildMigrationPlan, O as defineMigrationSet, S as MigrationStateMap, T as MigrationWriteMode, _ as MigrationManifestEntry, a as MAX_STATUS_RUN_LIMIT, b as MigrationRunStatus, c as MigrationRunChunkArgs, d as MigrationAppliedState, f as MigrationDefinition, g as MigrationDriftIssue, h as MigrationDocContext, k as detectMigrationDrift, l as MigrationStatusArgs, m as MigrationDoc, o as MigrationCancelArgs, p as MigrationDirection, s as MigrationRunArgs, u as createMigrationHandlers, v as MigrationMigrateOne, w as MigrationTableName, x as MigrationSet, y as MigrationPlan } from "../../capabilities-Bxzoofl4.js";
2
- import { Ct as migrationCapability, dt as MIGRATION_STORAGE_TABLE_NAMES, ft as injectMigrationStorageTables, lt as MIGRATION_RUN_TABLE, mt as migrationStorageTables, pt as migrationExtension, ut as MIGRATION_STATE_TABLE } from "../../where-clause-compiler-CoPVAVDO.js";
2
+ import { Ct as migrationCapability, dt as MIGRATION_STORAGE_TABLE_NAMES, ft as injectMigrationStorageTables, lt as MIGRATION_RUN_TABLE, mt as migrationStorageTables, pt as migrationExtension, ut as MIGRATION_STATE_TABLE } from "../../where-clause-compiler-B0kyVGzW.js";
3
3
  export { MAX_STATUS_RUN_LIMIT, MIGRATION_RUN_TABLE, MIGRATION_STATE_TABLE, MIGRATION_STORAGE_TABLE_NAMES, type MigrationAppliedState, type MigrationCancelArgs, type MigrationDefinition, type MigrationDirection, type MigrationDoc, type MigrationDocContext, type MigrationDriftIssue, type MigrationManifestEntry, type MigrationMigrateOne, type MigrationPlan, type MigrationRunArgs, type MigrationRunChunkArgs, type MigrationRunStatus, type MigrationSet, type MigrationStateMap, type MigrationStatusArgs, type MigrationStep, type MigrationTableName, type MigrationWriteMode, buildMigrationPlan, createMigrationHandlers, defineMigration, defineMigrationSet, detectMigrationDrift, injectMigrationStorageTables, migrationCapability, migrationExtension, migrationStorageTables };
@@ -1,2 +1,2 @@
1
- import { a as PluginConfigureResolver, i as PluginConfigureInput, n as PluginApiScope, o as definePlugin, r as PluginConfigureContext, s as resolvePluginOptions, t as Plugin } from "../middleware-D2hKJuSZ.js";
1
+ import { a as PluginConfigureResolver, i as PluginConfigureInput, n as PluginApiScope, o as definePlugin, r as PluginConfigureContext, s as resolvePluginOptions, t as Plugin } from "../middleware-BBS7oLtT.js";
2
2
  export { type Plugin, type PluginApiScope, type PluginConfigureContext, type PluginConfigureInput, type PluginConfigureResolver, definePlugin, resolvePluginOptions };
@@ -1,14 +1,22 @@
1
1
  import { t as VRequired } from "./validators-0I-Ik1EN.js";
2
- import { l as EmptyObject, u as Expand } from "./caller-factory-C3pcbzo0.js";
3
- import { d as getTransformer, i as DataTransformerOptions } from "./transformer-BEkxlnss.js";
4
- import { g as UnsetMarker, i as IntersectIfDefined, o as MiddlewareBuilder, p as Overwrite$1, s as MiddlewareFunction, t as AnyMiddleware } from "./types-CzGsrLrY.js";
5
- import { A as HttpProcedureBuilderDef, D as HttpHandlerOpts, N as ProcedureMeta, O as HttpMethod, _ as CRPCHttpRouter, f as InferHttpInput, k as HttpProcedure, p as InferHttpOutput, y as HttpRouterRecord } from "./http-types-8FBr10yl.js";
2
+ import { A as HttpProcedureBuilderDef, D as HttpHandlerOpts, L as DataTransformerOptions, N as ProcedureMeta, O as HttpMethod, W as getTransformer, _ as CRPCHttpRouter, f as InferHttpInput, k as HttpProcedure, p as InferHttpOutput, y as HttpRouterRecord } from "./http-types-BhhPZtwa.js";
3
+ import { g as UnsetMarker, i as IntersectIfDefined, o as MiddlewareBuilder, p as Overwrite$1, s as MiddlewareFunction, t as AnyMiddleware } from "./types-Bkeicpo6.js";
6
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";
7
5
  import { ActionBuilder, ArgsArrayToObject, DefaultFunctionArgs, FunctionReference, FunctionReturnType, FunctionVisibility, GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx, MutationBuilder, QueryBuilder, RegisteredAction, RegisteredMutation, RegisteredQuery, TableNamesInDataModel } from "convex/server";
8
6
  import * as z$1 from "zod";
9
7
  import * as z$2 from "zod/v4";
10
8
  import * as zCore from "zod/v4/core";
11
9
 
10
+ //#region src/internal/upstream/index.d.ts
11
+ type EmptyObject = Record<string, never>;
12
+ /**
13
+ * Hack! This type causes TypeScript to simplify how it renders object types.
14
+ *
15
+ * It is functionally the identity for object types, but in practice it can
16
+ * simplify expressions like `A & B`.
17
+ */
18
+ type Expand<ObjectType extends Record<any, any>> = ObjectType extends Record<any, any> ? { [Key in keyof ObjectType]: ObjectType[Key] } : never;
19
+ //#endregion
12
20
  //#region src/internal/upstream/server/customFunctions.d.ts
13
21
  /**
14
22
  * A customization of a query, mutation, or action.
@@ -1001,6 +1009,132 @@ declare function createApiLeaf<TType extends ApiFunctionType, TExport, TMeta ext
1001
1009
  };
1002
1010
  declare function createGeneratedFunctionReference<TType extends ApiFunctionType, TVisibility extends GeneratedFunctionVisibility, TExport>(name: string): GeneratedFunctionRefFromExport<TType, TVisibility, TExport>;
1003
1011
  //#endregion
1012
+ //#region src/server/caller.d.ts
1013
+ /** Metadata for a single function */
1014
+ type FnMeta = {
1015
+ type?: 'query' | 'mutation' | 'action';
1016
+ [key: string]: unknown;
1017
+ };
1018
+ /** Metadata for all functions in a module */
1019
+ type ModuleMeta = Record<string, FnMeta>;
1020
+ /** Metadata for all modules - from generated `@convex/api` */
1021
+ type CallerMeta = Record<string, ModuleMeta>;
1022
+ /** Options for individual caller function calls */
1023
+ type CallerOpts = {
1024
+ /** Skip query silently when unauthenticated (returns null instead of throwing) */skipUnauth?: boolean;
1025
+ };
1026
+ type CallerReturn<T, Opts extends CallerOpts | undefined> = Opts extends {
1027
+ skipUnauth: true;
1028
+ } ? T | null : T;
1029
+ type FetchFn<T extends 'query' | 'mutation' | 'action'> = <Fn extends FunctionReference<T>>(fn: Fn, args: Fn['_args'], opts?: CallerOpts) => Promise<FunctionReturnType<Fn> | null>;
1030
+ type CreateCallerOptions = {
1031
+ fetchQuery: FetchFn<'query'>;
1032
+ fetchMutation: FetchFn<'mutation'>;
1033
+ fetchAction: FetchFn<'action'>;
1034
+ meta: CallerMeta;
1035
+ transformer?: DataTransformerOptions;
1036
+ };
1037
+ 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]>;
1038
+ type ServerCaller<TApi> = { [K in keyof TApi as K extends string ? K extends `_${string}` ? never : K extends 'http' ? never : K : K]: ServerCallerFn<TApi, K> };
1039
+ /**
1040
+ * Create a server caller for direct data fetching without React Query.
1041
+ *
1042
+ * This is detached from React Query cache - data is NOT available in client components.
1043
+ * Use for server-only data that doesn't need to be shared with the client.
1044
+ *
1045
+ * @example
1046
+ * ```tsx
1047
+ * // src/lib/convex/rsc.tsx
1048
+ * export const caller = createServerCaller(api, {
1049
+ * fetchQuery: fetchAuthQuery,
1050
+ * fetchMutation: fetchAuthMutation,
1051
+ * });
1052
+ *
1053
+ * // app/page.tsx (RSC)
1054
+ * const posts = await caller.posts.list();
1055
+ * return <div>{posts?.length} posts</div>;
1056
+ * ```
1057
+ */
1058
+ declare function createServerCaller<TApi extends Record<string, unknown>>(api: TApi, opts: CreateCallerOptions): ServerCaller<TApi>;
1059
+ //#endregion
1060
+ //#region src/server/lazy-caller.d.ts
1061
+ type CallerContext<TApi> = {
1062
+ caller: ServerCaller<TApi>;
1063
+ token: string | undefined;
1064
+ isAuthenticated: boolean;
1065
+ };
1066
+ /**
1067
+ * Lazy caller with auth helper methods.
1068
+ * Context is created on first procedure invocation, not at definition time.
1069
+ */
1070
+ type LazyCaller<TApi> = ServerCaller<TApi> & {
1071
+ /** Check if user is authenticated */isAuth: () => Promise<boolean>; /** Check if user is unauthenticated */
1072
+ isUnauth: () => Promise<boolean>; /** Get the auth token (for RSC prefetching) */
1073
+ getToken: () => Promise<string | undefined>;
1074
+ };
1075
+ /**
1076
+ * Create a lazy caller that creates context on each procedure invocation.
1077
+ * Matches tRPC's `appRouter.createCaller(createTRPCContext)` pattern.
1078
+ *
1079
+ * @example
1080
+ * ```ts
1081
+ * // server.ts
1082
+ * const { createContext, createCaller } = createCallerFactory({...});
1083
+ *
1084
+ * // rsc.tsx
1085
+ * const createRSCContext = cache(async () => {
1086
+ * const heads = await headers();
1087
+ * return createContext({ headers: heads });
1088
+ * });
1089
+ * export const caller = createCaller(createRSCContext);
1090
+ *
1091
+ * // app/page.tsx - single call! Context created lazily
1092
+ * const posts = await caller.posts.list();
1093
+ * ```
1094
+ */
1095
+ declare function createLazyCaller<TApi extends Record<string, unknown>>(api: TApi, createContext: () => Promise<CallerContext<TApi>>): LazyCaller<TApi>;
1096
+ //#endregion
1097
+ //#region src/server/caller-factory.d.ts
1098
+ type TokenResult = {
1099
+ token?: string;
1100
+ isFresh?: boolean;
1101
+ };
1102
+ type GetTokenFn = (siteUrl: string, headers: Headers, opts?: unknown) => Promise<TokenResult>;
1103
+ /** Auth options for server-side calls. */
1104
+ type AuthOptions = {
1105
+ /** Function to extract auth token from request headers. */getToken: GetTokenFn;
1106
+ /**
1107
+ * Custom function to detect UNAUTHORIZED errors.
1108
+ * Set this to resolve those errors to `null` instead of throwing.
1109
+ *
1110
+ * Refreshing an expired cached token and retrying does not require this:
1111
+ * that always falls back to `defaultIsUnauthorized`.
1112
+ */
1113
+ isUnauthorized?: (error: unknown) => boolean;
1114
+ };
1115
+ type CreateCallerFactoryOptions<TApi> = {
1116
+ /** Your Convex API object. */api: TApi; /** Convex site URL (must end in `.convex.site`). */
1117
+ convexSiteUrl: string;
1118
+ /**
1119
+ * Convex deployment URL (must end in `.convex.cloud`).
1120
+ * Defaults to `convexSiteUrl` with the domain swapped.
1121
+ */
1122
+ convexUrl?: string; /** Auth options. Pass to enable authenticated calls with JWT caching. */
1123
+ auth?: AuthOptions; /** Optional wire transformer for request/response payloads (always composed with Date). */
1124
+ transformer?: DataTransformerOptions;
1125
+ };
1126
+ type ConvexContext<TApi> = {
1127
+ token: string | undefined;
1128
+ isAuthenticated: boolean;
1129
+ caller: ServerCaller<TApi>;
1130
+ };
1131
+ declare function createCallerFactory<TApi extends Record<string, unknown>>(opts: CreateCallerFactoryOptions<TApi>): {
1132
+ createCaller: (ctxFn: () => Promise<ConvexContext<TApi>>) => LazyCaller<TApi>;
1133
+ createContext: (reqOpts: {
1134
+ headers: Headers;
1135
+ }) => Promise<ConvexContext<TApi>>;
1136
+ };
1137
+ //#endregion
1004
1138
  //#region src/server/env.d.ts
1005
1139
  type RuntimeEnv = Record<string, string | undefined>;
1006
1140
  type CreateEnvOptions<TSchema extends z$1.ZodObject<z$1.ZodRawShape>> = {
@@ -1279,4 +1413,4 @@ type ProcedureNameLookup = Record<string, ProcedureNameEntry[]>;
1279
1413
  declare function registerProcedureNameLookup(lookup: ProcedureNameLookup, functionsDirHint: string): void;
1280
1414
  declare function inferProcedureNameFromCallsite(): string | undefined;
1281
1415
  //#endregion
1282
- export { createHttpProcedureBuilder as $, CRPCError as A, RuntimeEnv as B, createProcedureHandlerFactory as C, WithHttpRouter as D, typedProcedureResolver as E, getCRPCErrorFromUnknown as F, ActionProcedureBuilder as G, createApiLeaf as H, getHTTPStatusCodeFromError as I, ProcedureBuilder as J, CRPCFunctionTypeHint 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, HttpProcedureBuilder as Q, toCRPCError as R, createProcedureCallerFactory as S, getGeneratedFunctionReference as T, createGeneratedFunctionReference as U, createEnv as V, getGeneratedValue as W, createMiddlewareFactory as X, QueryProcedureBuilder as Y, initCRPC as Z, ProcedureSchedulableCallerFromRegistry as _, zodOutputToConvex as _t, CreateProcedureCallerFactoryOptions as a, CustomBuilder as at, createGenericCallerFactory as b, zodToConvexFields as bt, GeneratedRegistryCallerFactory as c, ZodFromValidatorBase as ct, GeneratedRegistryHandlerForContext as d, convexToZodFields as dt, extractPathParams as et, ProcedureActionCallerFromRegistry as f, withSystemFields as ft, ProcedureFromFunctionReference as g, zid as gt, ProcedureDefinition as h, zCustomQuery as ht, registerProcedureNameLookup as i, ConvexValidatorFromZodOutput as it, CRPCErrorCode as j, inferApiOutputs as k, GeneratedRegistryCallerForContext as l, ZodValidatorFromConvex as lt, ProcedureCallerFromRegistry as m, zCustomMutation as mt, ProcedureNameLookup as n, matchPathParams as nt, GeneratedProcedureRegistry as o, ZCustomCtx as ot, ProcedureCaller as p, zCustomAction as pt, MutationProcedureBuilder as q, inferProcedureNameFromCallsite as r, ConvexValidatorFromZod as rt, GeneratedProcedureRegistryEntry as s, Zid as st, ProcedureNameEntry as t, handleHttpError as tt, GeneratedRegistryHandlerFactory as u, convexToZod as ut, ProcedureScheduleCallerFromRegistry as v, zodOutputToConvexFields as vt, defineProcedure as w, createGenericHandlerFactory as x, createGeneratedRegistryRuntime as y, zodToConvex as yt, CreateEnvOptions as z };
1416
+ export { ActionProcedureBuilder as $, CRPCError as A, RuntimeEnv as B, createProcedureHandlerFactory as C, zCustomQuery as Ct, WithHttpRouter as D, zodToConvex as Dt, typedProcedureResolver as E, zodOutputToConvexFields as Et, getCRPCErrorFromUnknown as F, createLazyCaller as G, ConvexContext as H, getHTTPStatusCodeFromError as I, ServerCaller as J, CallerMeta as K, isCRPCError as L, CRPCErrorData as M, CRPC_ERROR_CODES_BY_KEY as N, inferApiInputs as O, zodToConvexFields as Ot, CRPC_ERROR_CODE_TO_HTTP as P, getGeneratedValue as Q, toCRPCError as R, createProcedureCallerFactory as S, zCustomMutation as St, getGeneratedFunctionReference as T, zodOutputToConvex as Tt, createCallerFactory as U, createEnv as V, LazyCaller as W, createApiLeaf as X, createServerCaller as Y, createGeneratedFunctionReference as Z, ProcedureSchedulableCallerFromRegistry as _, ZodValidatorFromConvex as _t, CreateProcedureCallerFactoryOptions as a, initCRPC as at, createGenericCallerFactory as b, withSystemFields as bt, GeneratedRegistryCallerFactory as c, extractPathParams as ct, GeneratedRegistryHandlerForContext as d, ConvexValidatorFromZod as dt, CRPCFunctionTypeHint as et, ProcedureActionCallerFromRegistry as f, ConvexValidatorFromZodOutput as ft, ProcedureFromFunctionReference as g, ZodFromValidatorBase as gt, ProcedureDefinition as h, Zid as ht, registerProcedureNameLookup as i, createMiddlewareFactory as it, CRPCErrorCode as j, inferApiOutputs as k, GeneratedRegistryCallerForContext as l, handleHttpError as lt, ProcedureCallerFromRegistry as m, ZCustomCtx as mt, ProcedureNameLookup as n, ProcedureBuilder as nt, GeneratedProcedureRegistry as o, HttpProcedureBuilder as ot, ProcedureCaller as p, CustomBuilder as pt, CallerOpts as q, inferProcedureNameFromCallsite as r, QueryProcedureBuilder as rt, GeneratedProcedureRegistryEntry as s, createHttpProcedureBuilder as st, ProcedureNameEntry as t, MutationProcedureBuilder as tt, GeneratedRegistryHandlerFactory as u, matchPathParams as ut, ProcedureScheduleCallerFromRegistry as v, convexToZod as vt, defineProcedure as w, zid as wt, createGenericHandlerFactory as x, zCustomAction as xt, createGeneratedRegistryRuntime as y, convexToZodFields as yt, CreateEnvOptions as z };
@@ -1,5 +1,5 @@
1
- import { o as MiddlewareBuilder } from "../types-CzGsrLrY.js";
2
- import { t as Plugin } from "../middleware-D2hKJuSZ.js";
1
+ import { o as MiddlewareBuilder } from "../types-Bkeicpo6.js";
2
+ import { t as Plugin } from "../middleware-BBS7oLtT.js";
3
3
  import * as convex_server0 from "convex/server";
4
4
 
5
5
  //#region src/ratelimit/duration.d.ts
@@ -1,8 +1,7 @@
1
1
  import { n as DeepPartial, o as Simplify, r as DistributiveOmit } from "../types-Bqi_ivSd.js";
2
- import { i as DataTransformerOptions } from "../transformer-BEkxlnss.js";
3
- import { g as UnsetMarker } from "../types-CzGsrLrY.js";
4
- import { _ as CRPCHttpRouter, c as HttpQueryKey, k as HttpProcedure, o as HttpMutationKey, y as HttpRouterRecord } from "../http-types-8FBr10yl.js";
5
- 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-Cl0utsTL.js";
2
+ import { L as DataTransformerOptions, _ as CRPCHttpRouter, c as HttpQueryKey, k as HttpProcedure, o as HttpMutationKey, y as HttpRouterRecord } from "../http-types-BhhPZtwa.js";
3
+ import { g as UnsetMarker } from "../types-Bkeicpo6.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-C7JkpfeY.js";
6
5
  import { FunctionArgs, FunctionReference, FunctionReturnType } from "convex/server";
7
6
  import { z } from "zod";
8
7
  import { DefaultError, QueryFilters, SkipToken, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";