kitcn 0.15.2 → 0.15.5

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 (31) hide show
  1. package/dist/aggregate/index.d.ts +1 -1
  2. package/dist/auth/client/index.d.ts +8 -2
  3. package/dist/auth/client/index.js +4 -2
  4. package/dist/auth/generated/index.d.ts +1 -1
  5. package/dist/auth/index.d.ts +1 -1
  6. package/dist/auth/start/index.d.ts +1 -15
  7. package/dist/auth/start/index.js +1 -124
  8. package/dist/auth/start/server/index.d.ts +17 -0
  9. package/dist/auth/start/server/index.js +126 -0
  10. package/dist/auth-store-B_ARzzEX.d.ts +156 -0
  11. package/dist/{backend-core-BYs_6mO4.mjs → backend-core-PsWKI66u.mjs} +46 -77
  12. package/dist/cli.mjs +1 -1
  13. package/dist/crpc/index.d.ts +1 -1
  14. package/dist/orm/index.d.ts +1 -1
  15. package/dist/plugins/index.d.ts +1 -1
  16. package/dist/ratelimit/index.d.ts +1 -1
  17. package/dist/react/index.d.ts +2 -152
  18. package/dist/react/index.js +4 -3
  19. package/dist/rsc/index.d.ts +1 -1
  20. package/dist/solid/index.js +1 -1
  21. package/dist/watcher.mjs +1 -1
  22. package/dist/{where-clause-compiler-DLiYI2EF.d.ts → where-clause-compiler-DcEhkJ12.d.ts} +8 -8
  23. package/package.json +7 -1
  24. package/skills/kitcn/references/features/auth.md +1 -0
  25. package/skills/kitcn/references/features/react.md +11 -16
  26. package/skills/kitcn/references/setup/index.md +1 -1
  27. package/skills/kitcn/references/setup/react.md +12 -21
  28. package/skills/kitcn/references/setup/start.md +1 -1
  29. /package/dist/{generated-contract-disabled-C_-KWRfT.d.ts → generated-contract-disabled-0xEF3NtW.d.ts} +0 -0
  30. /package/dist/{middleware-DrtexzF3.d.ts → middleware-Br5zubu7.d.ts} +0 -0
  31. /package/dist/{types-YHpe0rsb.d.ts → types-jNTcza_a.d.ts} +0 -0
@@ -8453,7 +8453,6 @@ import {
8453
8453
  ConvexReactClient,
8454
8454
  getConvexQueryClientSingleton,
8455
8455
  getQueryClientSingleton,
8456
- useAuthStore,
8457
8456
  } from 'kitcn/react';
8458
8457
  import { useRouter } from 'next/navigation';
8459
8458
  import type { ReactNode } from 'react';
@@ -8470,11 +8469,17 @@ export function AppConvexProvider({
8470
8469
  children: ReactNode;
8471
8470
  }) {
8472
8471
  const router = useRouter();
8472
+ const queryClient = getQueryClientSingleton(createQueryClient);
8473
+ const convexQueryClient = getConvexQueryClientSingleton({
8474
+ convex,
8475
+ queryClient,
8476
+ });
8473
8477
 
8474
8478
  return (
8475
8479
  <ConvexAuthProvider
8476
8480
  authClient={authClient}
8477
8481
  client={convex}
8482
+ convexQueryClient={convexQueryClient}
8478
8483
  onMutationUnauthorized={() => {
8479
8484
  router.push('/auth');
8480
8485
  }}
@@ -8482,28 +8487,14 @@ export function AppConvexProvider({
8482
8487
  router.push('/auth');
8483
8488
  }}
8484
8489
  >
8485
- <QueryProvider>{children}</QueryProvider>
8490
+ <TanstackQueryClientProvider client={queryClient}>
8491
+ <CRPCProvider convexClient={convex} convexQueryClient={convexQueryClient}>
8492
+ {children}
8493
+ </CRPCProvider>
8494
+ </TanstackQueryClientProvider>
8486
8495
  </ConvexAuthProvider>
8487
8496
  );
8488
8497
  }
8489
-
8490
- function QueryProvider({ children }: { children: ReactNode }) {
8491
- const authStore = useAuthStore();
8492
- const queryClient = getQueryClientSingleton(createQueryClient);
8493
- const convexQueryClient = getConvexQueryClientSingleton({
8494
- authStore,
8495
- convex,
8496
- queryClient,
8497
- });
8498
-
8499
- return (
8500
- <TanstackQueryClientProvider client={queryClient}>
8501
- <CRPCProvider convexClient={convex} convexQueryClient={convexQueryClient}>
8502
- {children}
8503
- </CRPCProvider>
8504
- </TanstackQueryClientProvider>
8505
- );
8506
- }
8507
8498
  `;
8508
8499
 
8509
8500
  //#endregion
@@ -8662,7 +8653,6 @@ import {
8662
8653
  ConvexReactClient,
8663
8654
  getConvexQueryClientSingleton,
8664
8655
  getQueryClientSingleton,
8665
- useAuthStore,
8666
8656
  } from 'kitcn/react';
8667
8657
  import type { ReactNode } from 'react';
8668
8658
 
@@ -8678,11 +8668,17 @@ export function AppConvexProvider({
8678
8668
  children: ReactNode;
8679
8669
  }) {
8680
8670
  const router = useRouter();
8671
+ const queryClient = getQueryClientSingleton(createQueryClient);
8672
+ const convexQueryClient = getConvexQueryClientSingleton({
8673
+ convex,
8674
+ queryClient,
8675
+ });
8681
8676
 
8682
8677
  return (
8683
8678
  <ConvexAuthProvider
8684
8679
  authClient={authClient}
8685
8680
  client={convex}
8681
+ convexQueryClient={convexQueryClient}
8686
8682
  onMutationUnauthorized={() => {
8687
8683
  router.push('/auth');
8688
8684
  }}
@@ -8690,28 +8686,14 @@ export function AppConvexProvider({
8690
8686
  router.push('/auth');
8691
8687
  }}
8692
8688
  >
8693
- <QueryProvider>{children}</QueryProvider>
8689
+ <TanstackQueryClientProvider client={queryClient}>
8690
+ <CRPCProvider convexClient={convex} convexQueryClient={convexQueryClient}>
8691
+ {children}
8692
+ </CRPCProvider>
8693
+ </TanstackQueryClientProvider>
8694
8694
  </ConvexAuthProvider>
8695
8695
  );
8696
8696
  }
8697
-
8698
- function QueryProvider({ children }: { children: ReactNode }) {
8699
- const authStore = useAuthStore();
8700
- const queryClient = getQueryClientSingleton(createQueryClient);
8701
- const convexQueryClient = getConvexQueryClientSingleton({
8702
- authStore,
8703
- convex,
8704
- queryClient,
8705
- });
8706
-
8707
- return (
8708
- <TanstackQueryClientProvider client={queryClient}>
8709
- <CRPCProvider convexClient={convex} convexQueryClient={convexQueryClient}>
8710
- {children}
8711
- </CRPCProvider>
8712
- </TanstackQueryClientProvider>
8713
- );
8714
- }
8715
8697
  `;
8716
8698
 
8717
8699
  //#endregion
@@ -9129,7 +9111,6 @@ import {
9129
9111
  ConvexReactClient,
9130
9112
  getConvexQueryClientSingleton,
9131
9113
  getQueryClientSingleton,
9132
- useAuthStore,
9133
9114
  } from 'kitcn/react';
9134
9115
  import type { ReactNode } from 'react';
9135
9116
 
@@ -9146,32 +9127,25 @@ export function AppConvexProvider({
9146
9127
  children: ReactNode;
9147
9128
  token?: string;
9148
9129
  }) {
9149
- return (
9150
- <ConvexAuthProvider
9151
- authClient={authClient}
9152
- client={convex}
9153
- initialToken={token}
9154
- >
9155
- <QueryProvider>{children}</QueryProvider>
9156
- </ConvexAuthProvider>
9157
- );
9158
- }
9159
-
9160
- function QueryProvider({ children }: { children: ReactNode }) {
9161
- const authStore = useAuthStore();
9162
9130
  const queryClient = getQueryClientSingleton(createQueryClient);
9163
9131
  const convexQueryClient = getConvexQueryClientSingleton({
9164
- authStore,
9165
9132
  convex,
9166
9133
  queryClient,
9167
9134
  });
9168
9135
 
9169
9136
  return (
9170
- <TanstackQueryClientProvider client={queryClient}>
9171
- <CRPCProvider convexClient={convex} convexQueryClient={convexQueryClient}>
9172
- {children}
9173
- </CRPCProvider>
9174
- </TanstackQueryClientProvider>
9137
+ <ConvexAuthProvider
9138
+ authClient={authClient}
9139
+ client={convex}
9140
+ convexQueryClient={convexQueryClient}
9141
+ initialToken={token}
9142
+ >
9143
+ <TanstackQueryClientProvider client={queryClient}>
9144
+ <CRPCProvider convexClient={convex} convexQueryClient={convexQueryClient}>
9145
+ {children}
9146
+ </CRPCProvider>
9147
+ </TanstackQueryClientProvider>
9148
+ </ConvexAuthProvider>
9175
9149
  );
9176
9150
  }
9177
9151
  `;
@@ -9372,7 +9346,6 @@ import {
9372
9346
  ConvexReactClient,
9373
9347
  getConvexQueryClientSingleton,
9374
9348
  getQueryClientSingleton,
9375
- useAuthStore,
9376
9349
  } from 'kitcn/react';
9377
9350
  import type { ReactNode } from 'react';
9378
9351
 
@@ -9387,28 +9360,24 @@ export function AppConvexProvider({
9387
9360
  }: {
9388
9361
  children: ReactNode;
9389
9362
  }) {
9390
- return (
9391
- <ConvexAuthProvider authClient={authClient} client={convex}>
9392
- <QueryProvider>{children}</QueryProvider>
9393
- </ConvexAuthProvider>
9394
- );
9395
- }
9396
-
9397
- function QueryProvider({ children }: { children: ReactNode }) {
9398
- const authStore = useAuthStore();
9399
9363
  const queryClient = getQueryClientSingleton(createQueryClient);
9400
9364
  const convexQueryClient = getConvexQueryClientSingleton({
9401
- authStore,
9402
9365
  convex,
9403
9366
  queryClient,
9404
9367
  });
9405
9368
 
9406
9369
  return (
9407
- <TanstackQueryClientProvider client={queryClient}>
9408
- <CRPCProvider convexClient={convex} convexQueryClient={convexQueryClient}>
9409
- {children}
9410
- </CRPCProvider>
9411
- </TanstackQueryClientProvider>
9370
+ <ConvexAuthProvider
9371
+ authClient={authClient}
9372
+ client={convex}
9373
+ convexQueryClient={convexQueryClient}
9374
+ >
9375
+ <TanstackQueryClientProvider client={queryClient}>
9376
+ <CRPCProvider convexClient={convex} convexQueryClient={convexQueryClient}>
9377
+ {children}
9378
+ </CRPCProvider>
9379
+ </TanstackQueryClientProvider>
9380
+ </ConvexAuthProvider>
9412
9381
  );
9413
9382
  }
9414
9383
  `;
@@ -9600,7 +9569,7 @@ export const Route = createFileRoute('/api/auth/$')({
9600
9569
 
9601
9570
  //#endregion
9602
9571
  //#region src/cli/registry/items/auth/auth-start-server.template.ts
9603
- const AUTH_START_SERVER_TEMPLATE = `import { convexBetterAuthReactStart } from 'kitcn/auth/start';
9572
+ const AUTH_START_SERVER_TEMPLATE = `import { convexBetterAuthReactStart } from 'kitcn/auth/start/server';
9604
9573
 
9605
9574
  export const {
9606
9575
  handler,
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as promptForScaffoldTemplateSelection, A as resolveCodegenTrimSegments, At as highlighter, B as runConfiguredCodegen, C as isEntryPoint, Ct as formatDependencyInstallCommand, D as parseInitCommandArgs, E as parseBackendRunJson, Et as stripConvexCommandNoise, F as resolveRunDeps, G as runMigrationFlow, H as runDevSchemaBackfillIfNeeded, I as runAfterScaffoldScript, J as withWorkingDirectory, K as trackProcess, L as runAggregateBackfillFlow, M as resolveDocTopic, N as resolveInitProjectDir, O as readPackageVersions, P as resolveMigrationConfig, Q as promptForPluginSelection, R as runAggregatePruneFlow, S as isConvexDevPreRunConflictFlag, St as detectPackageManager, T as parseArgs, Tt as serializeEnvValue, U as runInitCommandFlow, V as runConvexInitIfNeeded, W as runMigrationCreate, X as collectPluginScaffoldTemplates, Y as createSpinner, Z as filterScaffoldTemplatePathMap, _ as formatInfoOutput, _t as applyPlanningDependencyInstall, a as cleanup, at as getPluginCatalogEntry, b as getDevAggregateBackfillStatePath, bt as resolveSupportedDependencyWarnings, c as createCommandEnv, ct as buildPluginInstallPlan, d as extractBackfillCliOptions, dt as collectInstalledPluginKeys, et as resolveAddTemplateDefaults, f as extractConcaveRunTargetArgs, ft as getPluginLockfilePath, g as formatDocsOutput, gt as applyDependencyHintsInstall, h as extractResetCliOptions, ht as resolveSchemaInstalledPlugins, i as buildInitializationPlan, it as resolveTemplatesByIdOrThrow, j as resolveConfiguredBackend, k as resolveBackfillConfig, kt as logger, l as ensureConvexGitignoreEntry, lt as resolvePluginScaffoldRoots, m as extractMigrationDownOptions, mt as readPluginLockfile, n as applyPluginInstallPlanFiles, nt as resolvePresetScaffoldTemplates, o as createBackendAdapter, ot as getSupportedPluginKeys, p as extractMigrationCliOptions, pt as getSchemaFilePath, q as withLocalCodegenEnv, r as assertNoRemovedDevPreRunFlag, rt as resolveTemplateSelectionSource, s as createBackendCommandEnv, st as isSupportedPluginKey, t as applyDependencyInstallPlan, tt as resolvePluginPreset, u as extractBackendRunTargetArgs, ut as assertSchemaFileExists, v as getAggregateBackfillDeploymentKey, vt as applyPluginDependencyInstall, w as isInitialized, wt as resolveAuthEnvState, x as hasRemoteConvexDeploymentEnv, xt as resolveProjectScaffoldContext, y as getConvexDeploymentCommandEnv, yt as inspectPluginDependencyInstall, z as runBackendFunction } from "./backend-core-BYs_6mO4.mjs";
2
+ import { $ as promptForScaffoldTemplateSelection, A as resolveCodegenTrimSegments, At as highlighter, B as runConfiguredCodegen, C as isEntryPoint, Ct as formatDependencyInstallCommand, D as parseInitCommandArgs, E as parseBackendRunJson, Et as stripConvexCommandNoise, F as resolveRunDeps, G as runMigrationFlow, H as runDevSchemaBackfillIfNeeded, I as runAfterScaffoldScript, J as withWorkingDirectory, K as trackProcess, L as runAggregateBackfillFlow, M as resolveDocTopic, N as resolveInitProjectDir, O as readPackageVersions, P as resolveMigrationConfig, Q as promptForPluginSelection, R as runAggregatePruneFlow, S as isConvexDevPreRunConflictFlag, St as detectPackageManager, T as parseArgs, Tt as serializeEnvValue, U as runInitCommandFlow, V as runConvexInitIfNeeded, W as runMigrationCreate, X as collectPluginScaffoldTemplates, Y as createSpinner, Z as filterScaffoldTemplatePathMap, _ as formatInfoOutput, _t as applyPlanningDependencyInstall, a as cleanup, at as getPluginCatalogEntry, b as getDevAggregateBackfillStatePath, bt as resolveSupportedDependencyWarnings, c as createCommandEnv, ct as buildPluginInstallPlan, d as extractBackfillCliOptions, dt as collectInstalledPluginKeys, et as resolveAddTemplateDefaults, f as extractConcaveRunTargetArgs, ft as getPluginLockfilePath, g as formatDocsOutput, gt as applyDependencyHintsInstall, h as extractResetCliOptions, ht as resolveSchemaInstalledPlugins, i as buildInitializationPlan, it as resolveTemplatesByIdOrThrow, j as resolveConfiguredBackend, k as resolveBackfillConfig, kt as logger, l as ensureConvexGitignoreEntry, lt as resolvePluginScaffoldRoots, m as extractMigrationDownOptions, mt as readPluginLockfile, n as applyPluginInstallPlanFiles, nt as resolvePresetScaffoldTemplates, o as createBackendAdapter, ot as getSupportedPluginKeys, p as extractMigrationCliOptions, pt as getSchemaFilePath, q as withLocalCodegenEnv, r as assertNoRemovedDevPreRunFlag, rt as resolveTemplateSelectionSource, s as createBackendCommandEnv, st as isSupportedPluginKey, t as applyDependencyInstallPlan, tt as resolvePluginPreset, u as extractBackendRunTargetArgs, ut as assertSchemaFileExists, v as getAggregateBackfillDeploymentKey, vt as applyPluginDependencyInstall, w as isInitialized, wt as resolveAuthEnvState, x as hasRemoteConvexDeploymentEnv, xt as resolveProjectScaffoldContext, y as getConvexDeploymentCommandEnv, yt as inspectPluginDependencyInstall, z as runBackendFunction } from "./backend-core-PsWKI66u.mjs";
3
3
  import fs, { existsSync, readFileSync } from "node:fs";
4
4
  import path, { delimiter, dirname, join, relative, resolve } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -1,5 +1,5 @@
1
1
  import { A as DataTransformer, F as decodeWire, I as defaultCRPCTransformer, L as encodeWire, M as WireCodec, N as createTaggedTransformer, O as CombinedDataTransformer, P as dateWireCodec, R as getTransformer, a as HttpProcedureCall, c as InferHttpInput, i as HttpErrorCode, j as DataTransformerOptions, k as DATE_CODEC_TAG, l as InferHttpOutput, n as HttpClientError, o as HttpRouteInfo, r as HttpClientFromRouter, s as HttpRouteMap, t as HttpClient, u as isHttpClientError, z as identityTransformer } from "../http-types-zsMHb_QN.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-YHpe0rsb.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-jNTcza_a.js";
3
3
  import { FunctionArgs, FunctionReference } from "convex/server";
4
4
 
5
5
  //#region src/crpc/auth-error.d.ts
@@ -1,4 +1,4 @@
1
- import { $ as GenericOrmCtx$1, $n as unique, $r as endsWith, $t as ManyConfig, A as ConvexDateMode, An as ConvexRankIndexBuilder, Ar as ReturningResult, At as MigrationManifestEntry, B as ConvexBytesBuilderInitial, Bn as rankIndex, Br as OrmSchemaRelations, Bt as defineMigration, C as ConvexNumberBuilderInitial, Ci as ColumnBuilderWithTableName, Cn as RlsRole, Cr as MutationReturning, Ct as MigrationStatusArgs, D as id, Di as IsPrimaryKey, Dn as ConvexAggregateIndexBuilderOn, Dr as PaginatedResult, Dt as MigrationDoc, E as ConvexIdBuilderInitial, Ei as HasDefault, En as ConvexAggregateIndexBuilder, Er as OrderDirection, Et as MigrationDirection, F as custom, Fn as ConvexVectorIndexBuilder, Fr as unsetToken, Ft as MigrationStateMap, G as ConvexBigIntBuilder, Gn as ConvexCheckConfig, Gr as ExpressionVisitor, Gt as OrmReader$1, H as ConvexBooleanBuilder, Hn as uniqueIndex, Hr as TableName, Ht as detectMigrationDrift, I as json, In as ConvexVectorIndexBuilderOn, Ir as Brand, It as MigrationStep, J as CountBackfillChunkArgs, Jn as ConvexUniqueConstraintBuilder, Jr as LogicalExpression, Jt as RlsMode, K as ConvexBigIntBuilderInitial, Kn as ConvexForeignKeyBuilder, Kr as FieldReference, Kt as OrmWriter$1, L as objectOf, Ln as ConvexVectorIndexConfig, Lr as Columns, Lt as MigrationTableName, M as ConvexCustomBuilder, Mn as ConvexSearchIndexBuilder, Mr as UpdateSet, Mt as MigrationPlan, N as ConvexCustomBuilderInitial, Nn as ConvexSearchIndexBuilderOn, Nr as VectorQueryConfig, Nt as MigrationRunStatus, O as ConvexDateBuilder, Oi as IsUnique, On as ConvexIndexBuilder, Or as PredicateWhereIndexConfig, Ot as MigrationDocContext, P as arrayOf, Pn as ConvexSearchIndexConfig, Pr as VectorSearchProvider, Pt as MigrationSet, Q as GenericOrm$1, Qn as foreignKey, Qr as contains, Qt as ExtractTablesWithRelations, R as unionOf, Rn as aggregateIndex, Rr as OrmSchemaExtensionTables, Rt as MigrationWriteMode, S as ConvexNumberBuilder, Si as ColumnBuilderTypeConfig, Sn as rlsPolicy, Sr as MutationResult, St as MigrationRunChunkArgs, T as ConvexIdBuilder, Ti as DrizzleEntity, Tn as rlsRole, Tr as OrderByClause, Tt as MigrationDefinition, U as ConvexBooleanBuilderInitial, Un as vectorIndex, Ur as SystemFields, Ut as DatabaseWithMutations, V as bytes, Vn as searchIndex, Vr as OrmSchemaTriggers, Vt as defineMigrationSet, W as boolean, Wn as ConvexCheckBuilder, Wr as BinaryExpression, Wt as DatabaseWithQuery, X as CountBackfillStatusArgs, Xn as ConvexUniqueConstraintConfig, Xr as and, Xt as extractRelationsConfig, Y as CountBackfillKickoffArgs, Yn as ConvexUniqueConstraintBuilderOn, Yr as UnaryExpression, Yt as EdgeMetadata, Z as CreateOrmOptions, Zn as check, Zr as between, Zt as ExtractTablesFromSchema, _ as ConvexTimestampMode, _i as startsWith, _n as deletion, _r as MutationExecuteConfig, _t as OrmTriggerContext, a as requireSchemaRelations, ai as inArray, an as TablesRelationalConfig, ar as AggregateResult, at as OrmWriterCtx, b as ConvexTextEnumBuilderInitial, bi as ColumnBuilderBaseConfig, bn as RlsPolicyConfig, br as MutationPaginateConfig, bt as MigrationCancelArgs, c as TableConfigResult, ci as isNull, cn as ConvexDeletionBuilder, cr as CountConfig, ct as ScheduledMutationBatchArgs, d as OrmNotFoundError, di as lte, dn as ConvexTableWithColumns, dr as FilterOperators, dt as scheduledDeleteFactory, ei as eq, en as OneConfig, er as ConvexTextBuilder, et as OrmApiResult, f as ConvexVectorBuilder, fi as ne, fn as DiscriminatorBuilderConfig, fr as GetColumnData, ft as SchemaExtension, g as ConvexTimestampBuilderInitial, gi as or, gn as convexTable, gr as InsertValue, gt as OrmTriggerChange, h as ConvexTimestampBuilder, hi as notInArray, hn as TableConfig, hr as InferSelectModel, ht as OrmTableTriggers, i as getSchemaTriggers, ii as ilike, in as TableRelationalConfig, ir as AggregateFieldValue, it as OrmReaderCtx, j as date, jn as ConvexRankIndexBuilderOn, jr as ReturningSelection, jt as MigrationMigrateOne, k as ConvexDateBuilderInitial, ki as NotNull, kn as ConvexIndexBuilderOn, kr as ReturningAll, kt as MigrationDriftIssue, l as getTableColumns, li as like, ln as ConvexDeletionConfig, lr as CountResult, lt as scheduledMutationBatchFactory, m as vector, mi as notBetween, mn as OrmLifecycleOperation, mr as InferModelFromColumns, mt as OrmBeforeResult, n as defineSchema, ni as gt, nn as RelationsBuilderColumnBase, nr as text, nt as OrmClientWithApi$1, o as asc, oi as isFieldReference, on as defineRelations, or as BuildQueryResult, ot as ResolveOrmSchema, p as ConvexVectorBuilderInitial, pi as not, pn as OrmLifecycleChange, pr as InferInsertModel, pt as defineSchemaExtension, q as bigint, qn as ConvexForeignKeyConfig, qr as FilterExpression, qt as RlsContext, r as getSchemaRelations, ri as gte, rn as RelationsBuilderColumnConfig, rr as AggregateConfig, rt as OrmFunctions, s as desc, si as isNotNull, sn as defineRelationsPart, sr as BuildRelationResult, st as createOrm, t as WhereClauseResult, ti as fieldRef, tn as RelationsBuilder, tr as ConvexTextBuilderInitial, tt as OrmClientBase$1, u as getTableConfig, ui as lt, un as ConvexTable, ur as DBQueryConfig, ut as ScheduledDeleteArgs, v as timestamp, vi as AnyColumn, vn as discriminator, vr as MutationExecuteResult, vt as OrmTriggers, w as integer, wi as ColumnDataType, wn as RlsRoleConfig, wr as MutationRunMode, wt as MigrationAppliedState, x as textEnum, xi as ColumnBuilderRuntimeConfig, xn as RlsPolicyToOption, xr as MutationPaginatedResult, xt as MigrationRunArgs, y as ConvexTextEnumBuilder, yi as ColumnBuilder, yn as RlsPolicy, yr as MutationExecutionMode, yt as defineTriggers, z as ConvexBytesBuilder, zn as index, zr as OrmSchemaExtensions, zt as buildMigrationPlan } from "../where-clause-compiler-DLiYI2EF.js";
1
+ import { $ as GenericOrmCtx$1, $n as unique, $r as endsWith, $t as ManyConfig, A as ConvexDateMode, An as ConvexRankIndexBuilder, Ar as ReturningResult, At as MigrationManifestEntry, B as ConvexBytesBuilderInitial, Bn as rankIndex, Br as OrmSchemaRelations, Bt as defineMigration, C as ConvexNumberBuilderInitial, Ci as ColumnBuilderWithTableName, Cn as RlsRole, Cr as MutationReturning, Ct as MigrationStatusArgs, D as id, Di as IsPrimaryKey, Dn as ConvexAggregateIndexBuilderOn, Dr as PaginatedResult, Dt as MigrationDoc, E as ConvexIdBuilderInitial, Ei as HasDefault, En as ConvexAggregateIndexBuilder, Er as OrderDirection, Et as MigrationDirection, F as custom, Fn as ConvexVectorIndexBuilder, Fr as unsetToken, Ft as MigrationStateMap, G as ConvexBigIntBuilder, Gn as ConvexCheckConfig, Gr as ExpressionVisitor, Gt as OrmReader$1, H as ConvexBooleanBuilder, Hn as uniqueIndex, Hr as TableName, Ht as detectMigrationDrift, I as json, In as ConvexVectorIndexBuilderOn, Ir as Brand, It as MigrationStep, J as CountBackfillChunkArgs, Jn as ConvexUniqueConstraintBuilder, Jr as LogicalExpression, Jt as RlsMode, K as ConvexBigIntBuilderInitial, Kn as ConvexForeignKeyBuilder, Kr as FieldReference, Kt as OrmWriter$1, L as objectOf, Ln as ConvexVectorIndexConfig, Lr as Columns, Lt as MigrationTableName, M as ConvexCustomBuilder, Mn as ConvexSearchIndexBuilder, Mr as UpdateSet, Mt as MigrationPlan, N as ConvexCustomBuilderInitial, Nn as ConvexSearchIndexBuilderOn, Nr as VectorQueryConfig, Nt as MigrationRunStatus, O as ConvexDateBuilder, Oi as IsUnique, On as ConvexIndexBuilder, Or as PredicateWhereIndexConfig, Ot as MigrationDocContext, P as arrayOf, Pn as ConvexSearchIndexConfig, Pr as VectorSearchProvider, Pt as MigrationSet, Q as GenericOrm$1, Qn as foreignKey, Qr as contains, Qt as ExtractTablesWithRelations, R as unionOf, Rn as aggregateIndex, Rr as OrmSchemaExtensionTables, Rt as MigrationWriteMode, S as ConvexNumberBuilder, Si as ColumnBuilderTypeConfig, Sn as rlsPolicy, Sr as MutationResult, St as MigrationRunChunkArgs, T as ConvexIdBuilder, Ti as DrizzleEntity, Tn as rlsRole, Tr as OrderByClause, Tt as MigrationDefinition, U as ConvexBooleanBuilderInitial, Un as vectorIndex, Ur as SystemFields, Ut as DatabaseWithMutations, V as bytes, Vn as searchIndex, Vr as OrmSchemaTriggers, Vt as defineMigrationSet, W as boolean, Wn as ConvexCheckBuilder, Wr as BinaryExpression, Wt as DatabaseWithQuery, X as CountBackfillStatusArgs, Xn as ConvexUniqueConstraintConfig, Xr as and, Xt as extractRelationsConfig, Y as CountBackfillKickoffArgs, Yn as ConvexUniqueConstraintBuilderOn, Yr as UnaryExpression, Yt as EdgeMetadata, Z as CreateOrmOptions, Zn as check, Zr as between, Zt as ExtractTablesFromSchema, _ as ConvexTimestampMode, _i as startsWith, _n as deletion, _r as MutationExecuteConfig, _t as OrmTriggerContext, a as requireSchemaRelations, ai as inArray, an as TablesRelationalConfig, ar as AggregateResult, at as OrmWriterCtx, b as ConvexTextEnumBuilderInitial, bi as ColumnBuilderBaseConfig, bn as RlsPolicyConfig, br as MutationPaginateConfig, bt as MigrationCancelArgs, c as TableConfigResult, ci as isNull, cn as ConvexDeletionBuilder, cr as CountConfig, ct as ScheduledMutationBatchArgs, d as OrmNotFoundError, di as lte, dn as ConvexTableWithColumns, dr as FilterOperators, dt as scheduledDeleteFactory, ei as eq, en as OneConfig, er as ConvexTextBuilder, et as OrmApiResult, f as ConvexVectorBuilder, fi as ne, fn as DiscriminatorBuilderConfig, fr as GetColumnData, ft as SchemaExtension, g as ConvexTimestampBuilderInitial, gi as or, gn as convexTable, gr as InsertValue, gt as OrmTriggerChange, h as ConvexTimestampBuilder, hi as notInArray, hn as TableConfig, hr as InferSelectModel, ht as OrmTableTriggers, i as getSchemaTriggers, ii as ilike, in as TableRelationalConfig, ir as AggregateFieldValue, it as OrmReaderCtx, j as date, jn as ConvexRankIndexBuilderOn, jr as ReturningSelection, jt as MigrationMigrateOne, k as ConvexDateBuilderInitial, ki as NotNull, kn as ConvexIndexBuilderOn, kr as ReturningAll, kt as MigrationDriftIssue, l as getTableColumns, li as like, ln as ConvexDeletionConfig, lr as CountResult, lt as scheduledMutationBatchFactory, m as vector, mi as notBetween, mn as OrmLifecycleOperation, mr as InferModelFromColumns, mt as OrmBeforeResult, n as defineSchema, ni as gt, nn as RelationsBuilderColumnBase, nr as text, nt as OrmClientWithApi$1, o as asc, oi as isFieldReference, on as defineRelations, or as BuildQueryResult, ot as ResolveOrmSchema, p as ConvexVectorBuilderInitial, pi as not, pn as OrmLifecycleChange, pr as InferInsertModel, pt as defineSchemaExtension, q as bigint, qn as ConvexForeignKeyConfig, qr as FilterExpression, qt as RlsContext, r as getSchemaRelations, ri as gte, rn as RelationsBuilderColumnConfig, rr as AggregateConfig, rt as OrmFunctions, s as desc, si as isNotNull, sn as defineRelationsPart, sr as BuildRelationResult, st as createOrm, t as WhereClauseResult, ti as fieldRef, tn as RelationsBuilder, tr as ConvexTextBuilderInitial, tt as OrmClientBase$1, u as getTableConfig, ui as lt, un as ConvexTable, ur as DBQueryConfig, ut as ScheduledDeleteArgs, v as timestamp, vi as AnyColumn, vn as discriminator, vr as MutationExecuteResult, vt as OrmTriggers, w as integer, wi as ColumnDataType, wn as RlsRoleConfig, wr as MutationRunMode, wt as MigrationAppliedState, x as textEnum, xi as ColumnBuilderRuntimeConfig, xn as RlsPolicyToOption, xr as MutationPaginatedResult, xt as MigrationRunArgs, y as ConvexTextEnumBuilder, yi as ColumnBuilder, yn as RlsPolicy, yr as MutationExecutionMode, yt as defineTriggers, z as ConvexBytesBuilder, zn as index, zr as OrmSchemaExtensions, zt as buildMigrationPlan } from "../where-clause-compiler-DcEhkJ12.js";
2
2
  import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-BhsByJeg.js";
3
3
  import { a as QueryCtxWithPreferredOrmQueryTable, i as QueryCtxWithOrmQueryTable, n as LookupByIdResultByCtx, o as getByIdWithOrmQueryFallback, r as QueryCtxWithOptionalOrmQueryTable, t as DocByCtx } from "../query-context-CNo9ffvI.js";
4
4
  import { DefineSchemaOptions, GenericDatabaseReader, GenericDatabaseWriter, GenericSchema, SchemaDefinition } from "convex/server";
@@ -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-DrtexzF3.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-Br5zubu7.js";
2
2
  export { type Plugin, type PluginApiScope, type PluginConfigureContext, type PluginConfigureInput, type PluginConfigureResolver, definePlugin, resolvePluginOptions };
@@ -1,5 +1,5 @@
1
1
  import { o as MiddlewareBuilder } from "../types-CnTpHR1F.js";
2
- import { t as Plugin } from "../middleware-DrtexzF3.js";
2
+ import { t as Plugin } from "../middleware-Br5zubu7.js";
3
3
  import * as convex_server0 from "convex/server";
4
4
 
5
5
  //#region src/ratelimit/duration.d.ts
@@ -1,13 +1,11 @@
1
1
  'use client';
2
- import { ConvexProvider, ConvexProviderWithAuth as ConvexProviderWithAuth$1, ConvexReactClient, ConvexReactClient as ConvexReactClient$1, ConvexReactClientOptions, Watch, WatchQueryOptions, useConvex } from "convex/react";
3
- import * as react from "react";
2
+ import { C as useMaybeAuth, S as useIsAuth, _ as useAuthState, a as Authenticated, b as useConvexAuthBridge, c as FetchAccessTokenContext, d as MaybeUnauthenticated, f as Unauthenticated, g as useAuthGuard, h as useAuth, i as AuthStoreState, l as FetchAccessTokenFn, m as isSessionSyncGraceActive, n as AuthProvider, o as ConvexAuthBridge, p as decodeJwtExp, r as AuthStore, s as ConvexProviderWithAuth, t as AUTH_SESSION_SYNC_GRACE_MS, u as MaybeAuthenticated, v as useAuthStore, w as useSafeConvexAuth, x as useFetchAccessToken, y as useAuthValue } from "../auth-store-B_ARzzEX.js";
3
+ import { ConvexProvider, ConvexReactClient, ConvexReactClient as ConvexReactClient$1, ConvexReactClientOptions, Watch, WatchQueryOptions, useConvex } from "convex/react";
4
4
  import { ReactNode } from "react";
5
- import * as jotai_x0 from "jotai-x";
6
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
7
6
  import { FunctionArgs, FunctionReference, FunctionReturnType } from "convex/server";
8
7
  import { DefaultError, QueryCache, QueryClient, QueryFilters, QueryFunction, QueryFunctionContext, QueryKey, SkipToken, UseMutationOptions, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
9
8
  import { ConvexHttpClient } from "convex/browser";
10
- import * as jotai_vanilla0 from "jotai/vanilla";
11
9
  import { z } from "zod";
12
10
 
13
11
  //#region src/crpc/auth-error.d.ts
@@ -112,154 +110,6 @@ type AuthMutationsResult = {
112
110
  };
113
111
  declare function createAuthMutations(authClient: AuthClient): AuthMutationsResult;
114
112
  //#endregion
115
- //#region src/react/auth-store.d.ts
116
- type FetchAccessTokenFn = (args: {
117
- forceRefreshToken: boolean;
118
- }) => Promise<string | null>;
119
- declare const FetchAccessTokenContext: react.Context<FetchAccessTokenFn | null>;
120
- /** Get fetchAccessToken from context (available immediately, no race condition) */
121
- declare const useFetchAccessToken: () => FetchAccessTokenFn | null;
122
- type ConvexAuthResult = {
123
- isAuthenticated: boolean;
124
- isLoading: boolean;
125
- };
126
- /** Get auth from bridge context (null if no bridge configured) */
127
- declare const useConvexAuthBridge: () => ConvexAuthResult | null;
128
- type AuthStoreState = {
129
- /** Callback when mutation/action called while unauthorized. Throws by default. */onMutationUnauthorized: () => void; /** Callback when query called while unauthorized. Noop by default. */
130
- onQueryUnauthorized: (info: {
131
- queryName: string;
132
- }) => void; /** Custom function to detect UNAUTHORIZED errors. Default checks code or "auth" in message. */
133
- isUnauthorized: (error: unknown) => boolean; /** Cached Convex JWT for HTTP requests */
134
- token: string | null; /** JWT expiration timestamp (ms) */
135
- expiresAt: number | null; /** Auth loading state (synced from useConvexAuth for class methods) */
136
- isLoading: boolean; /** Auth state (synced from useConvexAuth for class methods) */
137
- isAuthenticated: boolean; /** Grace window for freshly seeded auth tokens while session sync catches up */
138
- sessionSyncGraceUntil: number | null;
139
- };
140
- declare const AUTH_SESSION_SYNC_GRACE_MS = 10000;
141
- declare const isSessionSyncGraceActive: (sessionSyncGraceUntil: number | null) => boolean;
142
- /** Decode JWT expiration (ms timestamp) from token */
143
- declare function decodeJwtExp(token: string): number | null;
144
- declare const AuthProvider: react.FC<jotai_x0.ProviderProps<{
145
- onMutationUnauthorized: () => void;
146
- onQueryUnauthorized: (info: {
147
- queryName: string;
148
- }) => void;
149
- isUnauthorized: (error: unknown) => boolean;
150
- token: string | null;
151
- expiresAt: number | null;
152
- isLoading: boolean;
153
- isAuthenticated: boolean;
154
- sessionSyncGraceUntil: number | null;
155
- }>>, useAuthStore: jotai_x0.UseStoreApi<AuthStoreState, object>, useAuthState: <K extends keyof AuthStoreState>(key: K, options?: string | jotai_x0.UseAtomOptions) => ({
156
- onMutationUnauthorized: jotai_x0.SimpleWritableAtom<() => void>;
157
- onQueryUnauthorized: jotai_x0.SimpleWritableAtom<(info: {
158
- queryName: string;
159
- }) => void>;
160
- isUnauthorized: jotai_x0.SimpleWritableAtom<(error: unknown) => boolean>;
161
- token: jotai_x0.SimpleWritableAtom<string | null>;
162
- expiresAt: jotai_x0.SimpleWritableAtom<number | null>;
163
- isLoading: jotai_x0.SimpleWritableAtom<boolean>;
164
- isAuthenticated: jotai_x0.SimpleWritableAtom<boolean>;
165
- sessionSyncGraceUntil: jotai_x0.SimpleWritableAtom<number | null>;
166
- } & object)[K] extends jotai_vanilla0.WritableAtom<infer V, infer A extends unknown[], infer R> ? [V, (...args: A) => R] : never, useAuthValue: <K extends keyof AuthStoreState, S = (({
167
- onMutationUnauthorized: jotai_x0.SimpleWritableAtom<() => void>;
168
- onQueryUnauthorized: jotai_x0.SimpleWritableAtom<(info: {
169
- queryName: string;
170
- }) => void>;
171
- isUnauthorized: jotai_x0.SimpleWritableAtom<(error: unknown) => boolean>;
172
- token: jotai_x0.SimpleWritableAtom<string | null>;
173
- expiresAt: jotai_x0.SimpleWritableAtom<number | null>;
174
- isLoading: jotai_x0.SimpleWritableAtom<boolean>;
175
- isAuthenticated: jotai_x0.SimpleWritableAtom<boolean>;
176
- sessionSyncGraceUntil: jotai_x0.SimpleWritableAtom<number | null>;
177
- } & object)[K] extends jotai_vanilla0.Atom<infer V> ? V : never)>(key: K, options?: ({
178
- selector?: ((v: ({
179
- onMutationUnauthorized: jotai_x0.SimpleWritableAtom<() => void>;
180
- onQueryUnauthorized: jotai_x0.SimpleWritableAtom<(info: {
181
- queryName: string;
182
- }) => void>;
183
- isUnauthorized: jotai_x0.SimpleWritableAtom<(error: unknown) => boolean>;
184
- token: jotai_x0.SimpleWritableAtom<string | null>;
185
- expiresAt: jotai_x0.SimpleWritableAtom<number | null>;
186
- isLoading: jotai_x0.SimpleWritableAtom<boolean>;
187
- isAuthenticated: jotai_x0.SimpleWritableAtom<boolean>;
188
- sessionSyncGraceUntil: jotai_x0.SimpleWritableAtom<number | null>;
189
- } & object)[K] extends jotai_vanilla0.Atom<infer V_1> ? V_1 : never, prevSelectorOutput?: S | undefined) => S) | undefined;
190
- equalityFn?: ((prev: S, next: S) => boolean) | undefined;
191
- } & jotai_x0.UseAtomOptions) | undefined, deps?: unknown[]) => S;
192
- type AuthStore = ReturnType<typeof useAuthStore>;
193
- /**
194
- * Safe wrapper around useConvexAuth that doesn't throw when used outside auth provider.
195
- * Returns { isAuthenticated: false, isLoading: false } when no auth provider.
196
- *
197
- * Supports both:
198
- * - better-auth users (via AuthProvider)
199
- * - @convex-dev/auth users (via ConvexAuthBridge)
200
- */
201
- declare function useSafeConvexAuth(): ConvexAuthResult;
202
- /**
203
- * Internal bridge component. Use `ConvexProviderWithAuth` instead.
204
- * @internal
205
- */
206
- declare function ConvexAuthBridge({
207
- children
208
- }: {
209
- children: React.ReactNode;
210
- }): react_jsx_runtime0.JSX.Element;
211
- /**
212
- * Convex provider with auth bridge for @convex-dev/auth users.
213
- * Automatically wraps children with ConvexAuthBridge.
214
- *
215
- * @example
216
- * ```tsx
217
- * import { ConvexProviderWithAuth } from 'kitcn/react';
218
- *
219
- * <ConvexProviderWithAuth client={convex} useAuth={useAuthFromConvexDev}>
220
- * <App />
221
- * </ConvexProviderWithAuth>
222
- * ```
223
- */
224
- declare function ConvexProviderWithAuth({
225
- children,
226
- ...props
227
- }: React.ComponentProps<typeof ConvexProviderWithAuth$1>): react_jsx_runtime0.JSX.Element;
228
- declare const useAuth: () => {
229
- hasSession: boolean;
230
- isAuthenticated: boolean;
231
- isLoading: boolean;
232
- };
233
- /** Check if user maybe has auth (optimistic, has token) */
234
- declare const useMaybeAuth: () => boolean;
235
- /** Check if user is authenticated (server-verified) */
236
- declare const useIsAuth: () => boolean;
237
- declare const useAuthGuard: () => (callback?: () => Promise<void> | void) => boolean | undefined;
238
- /** Render children only when maybe has auth (optimistic) */
239
- declare function MaybeAuthenticated({
240
- children
241
- }: {
242
- children: React.ReactNode;
243
- }): react.ReactNode;
244
- /** Render children only when authenticated (server-verified) */
245
- declare function Authenticated({
246
- children
247
- }: {
248
- children: React.ReactNode;
249
- }): react.ReactNode;
250
- /** Render children only when maybe not auth (optimistic) */
251
- declare function MaybeUnauthenticated({
252
- children
253
- }: {
254
- children: React.ReactNode;
255
- }): react.ReactNode;
256
- /** Render children only when not authenticated (server-verified) */
257
- declare function Unauthenticated({
258
- children
259
- }: {
260
- children: React.ReactNode;
261
- }): react.ReactNode;
262
- //#endregion
263
113
  //#region src/crpc/transformer.d.ts
264
114
  /**
265
115
  * Generic transformer contract (mirrors tRPC shape).
@@ -1926,7 +1926,7 @@ var ConvexQueryClient = class {
1926
1926
  }
1927
1927
  if (result.ok) {
1928
1928
  const existingData = this.queryClient.getQueryData(queryKey);
1929
- if (result.value !== null && result.value !== void 0 || !(existingData !== null && existingData !== void 0)) this.queryClient.setQueryData(queryKey, this.transformer.output.deserialize(result.value));
1929
+ if (result.value !== void 0 || !(existingData !== void 0)) this.queryClient.setQueryData(queryKey, this.transformer.output.deserialize(result.value));
1930
1930
  } else {
1931
1931
  const { error } = result;
1932
1932
  const authState = this.getAuthState();
@@ -2136,8 +2136,9 @@ const getConvexQueryClientSingleton = ({ authStore, convex, queryClient, symbolK
2136
2136
  transformer
2137
2137
  });
2138
2138
  else {
2139
- if (globalStore[key]) globalStore[key].updateAuthStore(authStore);
2140
- else globalStore[key] = new ConvexQueryClient(convex, {
2139
+ if (globalStore[key]) {
2140
+ if (authStore !== void 0) globalStore[key].updateAuthStore(authStore);
2141
+ } else globalStore[key] = new ConvexQueryClient(convex, {
2141
2142
  authStore,
2142
2143
  unsubscribeDelay,
2143
2144
  transformer
@@ -1,7 +1,7 @@
1
1
  import { n as DeepPartial, o as Simplify, r as DistributiveOmit } from "../types-DF2cg_w0.js";
2
2
  import { C as HttpProcedure, d as CRPCHttpRouter, j as DataTransformerOptions, p as HttpRouterRecord } from "../http-types-zsMHb_QN.js";
3
3
  import { g as UnsetMarker } from "../types-CnTpHR1F.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-YHpe0rsb.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-jNTcza_a.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";
@@ -2048,7 +2048,7 @@ var ConvexQueryClient = class {
2048
2048
  };
2049
2049
  if (result.ok) {
2050
2050
  const existingData = this.queryClient.getQueryData(queryKey);
2051
- if (result.value !== null && result.value !== void 0 || !(existingData !== null && existingData !== void 0)) this.queryClient.setQueryData(queryKey, this.transformer.output.deserialize(result.value));
2051
+ if (result.value !== void 0 || !(existingData !== void 0)) this.queryClient.setQueryData(queryKey, this.transformer.output.deserialize(result.value));
2052
2052
  } else {
2053
2053
  const { error } = result;
2054
2054
  const authState = this.getAuthState();
package/dist/watcher.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { Dt as generateMeta, F as resolveRunDeps, Ot as getConvexConfig, j as resolveConfiguredBackend, kt as logger, q as withLocalCodegenEnv } from "./backend-core-BYs_6mO4.mjs";
2
+ import { Dt as generateMeta, F as resolveRunDeps, Ot as getConvexConfig, j as resolveConfiguredBackend, kt as logger, q as withLocalCodegenEnv } from "./backend-core-PsWKI66u.mjs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
 
@@ -3717,7 +3717,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
3717
3717
  readonly aggregate_bucket: ConvexTableWithColumns<{
3718
3718
  name: "aggregate_bucket";
3719
3719
  columns: {
3720
- updatedAt: ConvexNumberBuilderInitial<""> & {
3720
+ count: ConvexNumberBuilderInitial<""> & {
3721
3721
  _: {
3722
3722
  notNull: true;
3723
3723
  };
@@ -3727,10 +3727,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
3727
3727
  };
3728
3728
  } & {
3729
3729
  _: {
3730
- fieldName: "updatedAt";
3730
+ fieldName: "count";
3731
3731
  };
3732
3732
  };
3733
- count: ConvexNumberBuilderInitial<""> & {
3733
+ updatedAt: ConvexNumberBuilderInitial<""> & {
3734
3734
  _: {
3735
3735
  notNull: true;
3736
3736
  };
@@ -3740,7 +3740,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
3740
3740
  };
3741
3741
  } & {
3742
3742
  _: {
3743
- fieldName: "count";
3743
+ fieldName: "updatedAt";
3744
3744
  };
3745
3745
  };
3746
3746
  tableKey: ConvexTextBuilderInitial<""> & {
@@ -4009,7 +4009,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
4009
4009
  fieldName: "value";
4010
4010
  };
4011
4011
  };
4012
- updatedAt: ConvexNumberBuilderInitial<""> & {
4012
+ count: ConvexNumberBuilderInitial<""> & {
4013
4013
  _: {
4014
4014
  notNull: true;
4015
4015
  };
@@ -4019,10 +4019,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
4019
4019
  };
4020
4020
  } & {
4021
4021
  _: {
4022
- fieldName: "updatedAt";
4022
+ fieldName: "count";
4023
4023
  };
4024
4024
  };
4025
- count: ConvexNumberBuilderInitial<""> & {
4025
+ updatedAt: ConvexNumberBuilderInitial<""> & {
4026
4026
  _: {
4027
4027
  notNull: true;
4028
4028
  };
@@ -4032,7 +4032,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
4032
4032
  };
4033
4033
  } & {
4034
4034
  _: {
4035
- fieldName: "count";
4035
+ fieldName: "updatedAt";
4036
4036
  };
4037
4037
  };
4038
4038
  tableKey: ConvexTextBuilderInitial<""> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitcn",
3
- "version": "0.15.2",
3
+ "version": "0.15.5",
4
4
  "description": "kitcn - React Query integration and CLI tools for Convex",
5
5
  "keywords": [
6
6
  "convex",
@@ -28,6 +28,7 @@
28
28
  "./auth/http": "./dist/auth/http/index.js",
29
29
  "./auth/nextjs": "./dist/auth/nextjs/index.js",
30
30
  "./auth/start": "./dist/auth/start/index.js",
31
+ "./auth/start/server": "./dist/auth/start/server/index.js",
31
32
  "./crpc": "./dist/crpc/index.js",
32
33
  "./orm": "./dist/orm/index.js",
33
34
  "./plugins": "./dist/plugins/index.js",
@@ -80,6 +81,7 @@
80
81
  "@rollup/plugin-babel": "^6.1.0",
81
82
  "@tanstack/intent": "0.0.23",
82
83
  "@tanstack/query-core": "5.90.20",
84
+ "@tanstack/react-start": "1.166.15",
83
85
  "@types/common-tags": "^1.8.4",
84
86
  "babel-plugin-react-compiler": "^1.0.0",
85
87
  "rolldown-plugin-solid": "^0.2.1",
@@ -88,6 +90,7 @@
88
90
  "peerDependencies": {
89
91
  "@tanstack/query-core": ">=5",
90
92
  "@tanstack/react-query": ">=5",
93
+ "@tanstack/react-start": ">=1",
91
94
  "@tanstack/solid-query": ">=5",
92
95
  "better-auth": "1.6.9",
93
96
  "convex": ">=1.38",
@@ -101,6 +104,9 @@
101
104
  "@tanstack/react-query": {
102
105
  "optional": true
103
106
  },
107
+ "@tanstack/react-start": {
108
+ "optional": true
109
+ },
104
110
  "@tanstack/solid-query": {
105
111
  "optional": true
106
112
  },
@@ -387,6 +387,7 @@ All from `kitcn/react`:
387
387
  <ConvexAuthProvider
388
388
  client={convex}
389
389
  authClient={authClient}
390
+ convexQueryClient={convexQueryClient} // when using TanStack Query
390
391
  initialToken={token} // from SSR (caller.getToken())
391
392
  onMutationUnauthorized={() => router.push('/login')}
392
393
  onQueryUnauthorized={({ queryName }) => console.log(`Unauth: ${queryName}`)}