kitcn 0.15.18 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aggregate/index.d.ts +1 -1
- package/dist/auth/generated/index.d.ts +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +11 -6
- package/dist/{backend-core-qvNnNFFS.mjs → backend-core-DqPydYyx.mjs} +2 -19
- package/dist/cli.mjs +1 -1
- package/dist/{context-utils-OMkMGhBk.d.ts → context-utils-BBUtBqjN.d.ts} +1 -1
- package/dist/{generated-contract-disabled-0xEF3NtW.d.ts → generated-contract-disabled-LOAfma7_.d.ts} +1 -1
- package/dist/orm/index.d.ts +1 -1
- package/dist/orm/index.js +153 -17
- package/dist/{query-context-ydn9kb6P.js → query-context-B47_3n97.js} +26 -8
- package/dist/server/index.d.ts +1 -1
- package/dist/watcher.mjs +1 -1
- package/dist/{where-clause-compiler-DKgRvIn_.d.ts → where-clause-compiler-C8UKgzTO.d.ts} +72 -45
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial, dn as ConvexTableWithColumns, tr as ConvexTextBuilderInitial } from "../where-clause-compiler-
|
|
1
|
+
import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial, dn as ConvexTableWithColumns, tr as ConvexTextBuilderInitial } from "../where-clause-compiler-C8UKgzTO.js";
|
|
2
2
|
import * as convex_values0 from "convex/values";
|
|
3
3
|
import { GenericId, Infer, Value } from "convex/values";
|
|
4
4
|
import { DocumentByName, GenericDataModel, GenericDatabaseReader, GenericDatabaseWriter, TableNamesInDataModel } from "convex/server";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as defineAuth, _ as GenericAuthBeforeResult, b as GenericAuthTriggerHandlers, g as BetterAuthOptionsWithoutDatabase, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, v as GenericAuthDefinition, x as GenericAuthTriggers, y as GenericAuthTriggerChange } from "../../generated-contract-disabled-
|
|
1
|
+
import { S as defineAuth, _ as GenericAuthBeforeResult, b as GenericAuthTriggerHandlers, g as BetterAuthOptionsWithoutDatabase, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, v as GenericAuthDefinition, x as GenericAuthTriggers, y as GenericAuthTriggerChange } from "../../generated-contract-disabled-LOAfma7_.js";
|
|
2
2
|
export { type AuthRuntime, BetterAuthOptionsWithoutDatabase, type GeneratedAuthDisabledReasonKind, GenericAuthBeforeResult, GenericAuthDefinition, GenericAuthTriggerChange, GenericAuthTriggerHandlers, GenericAuthTriggers, createDisabledAuthRuntime, defineAuth, getGeneratedAuthDisabledReason };
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as QueryCtxWithPreferredOrmQueryTable, n as LookupByIdResultByCtx, t as DocByCtx } from "../query-context-CNo9ffvI.js";
|
|
2
2
|
import { t as GetAuth } from "../types-BCl8gfGy.js";
|
|
3
|
-
import { t as GenericCtx } from "../context-utils-
|
|
4
|
-
import { S as defineAuth, _ as GenericAuthBeforeResult, a as AuthFunctions, b as GenericAuthTriggerHandlers, c as createApi, d as deleteOneHandler, f as findManyHandler, g as BetterAuthOptionsWithoutDatabase, h as updateOneHandler, i as getGeneratedAuthDisabledReason, l as createHandler, m as updateManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as findOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as deleteManyHandler, v as GenericAuthDefinition, x as GenericAuthTriggers, y as GenericAuthTriggerChange } from "../generated-contract-disabled-
|
|
3
|
+
import { t as GenericCtx } from "../context-utils-BBUtBqjN.js";
|
|
4
|
+
import { S as defineAuth, _ as GenericAuthBeforeResult, a as AuthFunctions, b as GenericAuthTriggerHandlers, c as createApi, d as deleteOneHandler, f as findManyHandler, g as BetterAuthOptionsWithoutDatabase, h as updateOneHandler, i as getGeneratedAuthDisabledReason, l as createHandler, m as updateManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as findOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as deleteManyHandler, v as GenericAuthDefinition, x as GenericAuthTriggers, y as GenericAuthTriggerChange } from "../generated-contract-disabled-LOAfma7_.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";
|
package/dist/auth/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { r as partial } from "../validators-C7LelqTN.js";
|
|
|
3
3
|
import { i as defineAuth, n as createDisabledAuthRuntime, r as getGeneratedAuthDisabledReason, t as DEFAULT_AUTH_DEFINITION_PATH } from "../generated-contract-disabled-BXaz7JCE.js";
|
|
4
4
|
import { n as createGeneratedFunctionReference, o as isQueryCtx, s as isRunMutationCtx } from "../api-entry-N3nBOlI2.js";
|
|
5
5
|
import { n as customCtx, r as customMutation } from "../customFunctions-DxEEO4Dq.js";
|
|
6
|
-
import { a as mergedStream, l as unsetToken, o as stream, t as getByIdWithOrmQueryFallback, v as eq } from "../query-context-
|
|
6
|
+
import { a as mergedStream, l as unsetToken, o as stream, t as getByIdWithOrmQueryFallback, v as eq } from "../query-context-B47_3n97.js";
|
|
7
7
|
import { n as convex } from "../convex-plugin-BHVCqWTH.js";
|
|
8
8
|
import { v } from "convex/values";
|
|
9
9
|
import { internalActionGeneric, internalMutationGeneric, internalQueryGeneric, paginationOptsValidator } from "convex/server";
|
|
@@ -776,12 +776,17 @@ const handlePagination = async (next, { limit, numItems } = {}) => {
|
|
|
776
776
|
}
|
|
777
777
|
state.isDone = result.isDone;
|
|
778
778
|
};
|
|
779
|
-
do
|
|
780
|
-
|
|
779
|
+
do {
|
|
780
|
+
const cursorBeforePage = state.cursor;
|
|
781
|
+
const result = await next({ paginationOpts: {
|
|
781
782
|
cursor: state.cursor,
|
|
782
|
-
numItems: Math.min(numItems ?? 200,
|
|
783
|
-
} })
|
|
784
|
-
|
|
783
|
+
numItems: Math.min(numItems ?? 200, limit === void 0 ? Number.POSITIVE_INFINITY : limit - state.docs.length, 200)
|
|
784
|
+
} });
|
|
785
|
+
onResult(result);
|
|
786
|
+
const advanced = state.cursor !== cursorBeforePage;
|
|
787
|
+
const produced = (result.page?.length ?? 0) > 0 || (result.count ?? 0) > 0;
|
|
788
|
+
if (!(state.isDone || advanced || produced)) throw new Error("Pagination made no forward progress");
|
|
789
|
+
} while (!state.isDone);
|
|
785
790
|
return state;
|
|
786
791
|
};
|
|
787
792
|
const hasOrWhere = (where) => where?.some((clause) => clause.connector === "OR") ?? false;
|
|
@@ -6235,7 +6235,7 @@ const VERSION_IN_SPEC_RE = /(\d+)\.(\d+)(?:\.\d+)?/;
|
|
|
6235
6235
|
const PLAIN_VERSION_SPEC_RE = /^[\^~]?v?\d+\.\d+(?:\.\d+)?$/;
|
|
6236
6236
|
const UPPER_BOUND_RE = /(?:^|\s)<={0,1}\s*v?(\d+)\.(\d+)(?:\.\d+)?/g;
|
|
6237
6237
|
const SUPPORTED_CONCAVE_CLI_VERSION = "0.0.1-alpha.14";
|
|
6238
|
-
const SUPPORTED_CONVEX_VERSION = "1.
|
|
6238
|
+
const SUPPORTED_CONVEX_VERSION = "1.42.3";
|
|
6239
6239
|
const SUPPORTED_BETTER_AUTH_VERSION = "1.6.18";
|
|
6240
6240
|
const SUPPORTED_BETTER_AUTH_MIN_VERSION = "1.6.11";
|
|
6241
6241
|
const SUPPORTED_HONO_VERSION = "4.12.9";
|
|
@@ -16035,9 +16035,6 @@ function buildCodegenBootstrapArgs(targetArgs) {
|
|
|
16035
16035
|
function didConvexInitCreateConfiguration(output) {
|
|
16036
16036
|
return CONVEX_INIT_CREATED_CONFIG_RE.test(output);
|
|
16037
16037
|
}
|
|
16038
|
-
function isLocalBackendUpgradePrompt(output) {
|
|
16039
|
-
return output.includes("This deployment is using an older version of the Convex backend. Upgrade now?");
|
|
16040
|
-
}
|
|
16041
16038
|
async function runConvexInitIfNeeded(params) {
|
|
16042
16039
|
if (params.backendAdapter.publicName !== "convex") return {
|
|
16043
16040
|
created: false,
|
|
@@ -16045,31 +16042,17 @@ async function runConvexInitIfNeeded(params) {
|
|
|
16045
16042
|
stdout: "",
|
|
16046
16043
|
stderr: ""
|
|
16047
16044
|
};
|
|
16048
|
-
const shouldUseLocalDevPreflight = getAggregateBackfillDeploymentKey(params.targetArgs ?? [], process.cwd(), params.env) === "local";
|
|
16049
16045
|
const runCommand = async (commandArgs) => normalizeConvexCommandResult(await params.execaFn(params.backendAdapter.command, commandArgs, {
|
|
16050
16046
|
cwd: process.cwd(),
|
|
16051
16047
|
env: createBackendCommandEnv(params.env),
|
|
16052
16048
|
reject: false,
|
|
16053
16049
|
stdio: "pipe"
|
|
16054
16050
|
}));
|
|
16055
|
-
|
|
16051
|
+
const result = await runCommand([
|
|
16056
16052
|
...params.backendAdapter.argsPrefix,
|
|
16057
16053
|
"init",
|
|
16058
16054
|
...params.targetArgs ?? []
|
|
16059
16055
|
]);
|
|
16060
|
-
if (shouldUseLocalDevPreflight && result.exitCode !== 0 && isLocalBackendUpgradePrompt(`${result.stdout}\n${result.stderr}`)) result = await runCommand([
|
|
16061
|
-
...params.backendAdapter.argsPrefix,
|
|
16062
|
-
"dev",
|
|
16063
|
-
"--local",
|
|
16064
|
-
"--once",
|
|
16065
|
-
"--skip-push",
|
|
16066
|
-
"--local-force-upgrade",
|
|
16067
|
-
"--typecheck",
|
|
16068
|
-
"disable",
|
|
16069
|
-
"--codegen",
|
|
16070
|
-
"disable",
|
|
16071
|
-
...params.targetArgs ?? []
|
|
16072
|
-
]);
|
|
16073
16056
|
if (params.echoOutput !== false || result.exitCode !== 0) writeConvexCommandOutput(result);
|
|
16074
16057
|
return {
|
|
16075
16058
|
created: didConvexInitCreateConfiguration(`${result.stdout}\n${result.stderr}`),
|
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-
|
|
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-DqPydYyx.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";
|
|
@@ -3,7 +3,7 @@ import { GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx
|
|
|
3
3
|
//#region src/server/context-utils.d.ts
|
|
4
4
|
type GenericCtx<DataModel extends GenericDataModel = GenericDataModel> = GenericQueryCtx<DataModel> | GenericMutationCtx<DataModel> | GenericActionCtx<DataModel>;
|
|
5
5
|
type RunMutationCtx<DataModel extends GenericDataModel> = (GenericMutationCtx<DataModel> | GenericActionCtx<DataModel>) & {
|
|
6
|
-
runMutation:
|
|
6
|
+
runMutation: GenericActionCtx<DataModel>['runMutation'];
|
|
7
7
|
};
|
|
8
8
|
type SchedulerCtx<TCtx> = TCtx extends {
|
|
9
9
|
scheduler?: infer TScheduler;
|
package/dist/{generated-contract-disabled-0xEF3NtW.d.ts → generated-contract-disabled-LOAfma7_.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as GetAuth } from "./types-BCl8gfGy.js";
|
|
2
|
-
import { t as GenericCtx } from "./context-utils-
|
|
2
|
+
import { t as GenericCtx } from "./context-utils-BBUtBqjN.js";
|
|
3
3
|
import * as convex_server0 from "convex/server";
|
|
4
4
|
import { DocumentByName, FunctionReference, GenericDataModel, GenericMutationCtx, GenericSchema, SchemaDefinition, TableNamesInDataModel, internalMutationGeneric } from "convex/server";
|
|
5
5
|
import * as better_auth_adapters0 from "better-auth/adapters";
|
package/dist/orm/index.d.ts
CHANGED
|
@@ -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-
|
|
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-C8UKgzTO.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";
|
package/dist/orm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as vectorIndex, B as ConvexColumnBuilder, C as RlsPolicy, D as rankIndex, E as index, F as arrayOf, I as custom, L as json, M as createSystemFields, N as integer, O as searchIndex, P as id, R as objectOf, S as TablePolymorphic, T as aggregateIndex, V as entityKind, _ as OrmSchemaRelations, a as deletion, b as TableDeleteConfig, c as Columns, d as OrmSchemaDefinition, f as OrmSchemaExtensionRelations, g as OrmSchemaOptions, h as OrmSchemaExtensions, i as convexTable, j as text, k as uniqueIndex, l as EnableRLS, m as OrmSchemaExtensionTriggers, o as discriminator, p as OrmSchemaExtensionTables, s as Brand, t as DirectAggregate, u as OrmContext, v as OrmSchemaTriggers, w as rlsPolicy, x as TableName, y as RlsPolicies, z as unionOf } from "../runtime-DmVSOe24.js";
|
|
2
2
|
import { a as pretendRequired, i as pretend, n as deprecated } from "../validators-C7LelqTN.js";
|
|
3
|
-
import { A as ne, C as inArray, D as like, E as isNull, F as notLike, I as or, L as startsWith, M as notBetween, N as notIlike, O as lt, P as notInArray, S as ilike, T as isNotNull, _ as endsWith, a as mergedStream, b as gt, c as isUnsetToken, d as arrayContained, f as arrayContains, g as contains, h as column, i as getIndexFields, j as not, k as lte, l as unsetToken, m as between, n as EmptyStream, o as stream, p as arrayOverlaps, r as QueryStream, s as streamIndexRange, t as getByIdWithOrmQueryFallback, u as and, v as eq, w as isFieldReference, x as gte, y as fieldRef } from "../query-context-
|
|
3
|
+
import { A as ne, C as inArray, D as like, E as isNull, F as notLike, I as or, L as startsWith, M as notBetween, N as notIlike, O as lt, P as notInArray, S as ilike, T as isNotNull, _ as endsWith, a as mergedStream, b as gt, c as isUnsetToken, d as arrayContained, f as arrayContains, g as contains, h as column, i as getIndexFields, j as not, k as lte, l as unsetToken, m as between, n as EmptyStream, o as stream, p as arrayOverlaps, r as QueryStream, s as streamIndexRange, t as getByIdWithOrmQueryFallback, u as and, v as eq, w as isFieldReference, x as gte, y as fieldRef } from "../query-context-B47_3n97.js";
|
|
4
4
|
import { v } from "convex/values";
|
|
5
5
|
import { defineSchema as defineSchema$1, internalActionGeneric, internalMutationGeneric } from "convex/server";
|
|
6
6
|
|
|
@@ -3849,11 +3849,11 @@ var WhereClauseCompiler = class {
|
|
|
3849
3849
|
const selectedIndex = this.findLeadingIndex(operand.fieldName);
|
|
3850
3850
|
if (!selectedIndex) return null;
|
|
3851
3851
|
return {
|
|
3852
|
-
strategy: "
|
|
3852
|
+
strategy: "rangeIndex",
|
|
3853
3853
|
selectedIndex,
|
|
3854
|
-
indexFilters: [
|
|
3854
|
+
indexFilters: [lte(fieldRef(operand.fieldName), null)],
|
|
3855
3855
|
probeFilters: [],
|
|
3856
|
-
postFilters: []
|
|
3856
|
+
postFilters: [expression]
|
|
3857
3857
|
};
|
|
3858
3858
|
}
|
|
3859
3859
|
tryCompileIsNotNull(expression) {
|
|
@@ -4255,6 +4255,24 @@ var WhereClauseCompiler = class {
|
|
|
4255
4255
|
|
|
4256
4256
|
//#endregion
|
|
4257
4257
|
//#region src/orm/query.ts
|
|
4258
|
+
/**
|
|
4259
|
+
* Operators that Convex's `.filter()` cannot express, so `_toConvexExpression`
|
|
4260
|
+
* compiles them to a `() => true` placeholder and `_evaluatePostFetchFilter`
|
|
4261
|
+
* applies the real predicate in JavaScript after the rows are read.
|
|
4262
|
+
* Keep in sync with the string/array cases in `_toConvexExpression`.
|
|
4263
|
+
*/
|
|
4264
|
+
const POST_FETCH_ONLY_OPERATORS = new Set([
|
|
4265
|
+
"like",
|
|
4266
|
+
"ilike",
|
|
4267
|
+
"notLike",
|
|
4268
|
+
"notIlike",
|
|
4269
|
+
"startsWith",
|
|
4270
|
+
"endsWith",
|
|
4271
|
+
"contains",
|
|
4272
|
+
"arrayContains",
|
|
4273
|
+
"arrayContained",
|
|
4274
|
+
"arrayOverlaps"
|
|
4275
|
+
]);
|
|
4258
4276
|
const DEFAULT_RELATION_FAN_OUT_MAX_KEYS = 1e3;
|
|
4259
4277
|
const DEFAULT_AGGREGATE_CARTESIAN_MAX_KEYS = 4096;
|
|
4260
4278
|
const DEFAULT_AGGREGATE_WORK_BUDGET = 16384;
|
|
@@ -4531,6 +4549,28 @@ var GelRelationalQuery = class extends QueryPromise {
|
|
|
4531
4549
|
return targetValue === targetPattern;
|
|
4532
4550
|
}
|
|
4533
4551
|
/**
|
|
4552
|
+
* True when the expression can be fully enforced by Convex's own `.filter()`.
|
|
4553
|
+
*
|
|
4554
|
+
* `_toConvexExpression` compiles the string/array operators to `() => true`
|
|
4555
|
+
* because Convex filters cannot run JavaScript string methods; those are
|
|
4556
|
+
* evaluated later by `_evaluatePostFetchFilter`. Pushing such an expression
|
|
4557
|
+
* into `.filter()` is not merely useless, it is wrong in two ways: a `take()`
|
|
4558
|
+
* downstream spends its budget on rows that have not been filtered yet, and a
|
|
4559
|
+
* surrounding `NOT` turns the `true` placeholder into `q.not(true)`, which
|
|
4560
|
+
* matches nothing. So the caller must know whether Convex can carry the whole
|
|
4561
|
+
* expression before relying on it.
|
|
4562
|
+
*/
|
|
4563
|
+
_isConvexEnforceableFilter(filter) {
|
|
4564
|
+
if (filter.type === "binary") return !POST_FETCH_ONLY_OPERATORS.has(filter.operator);
|
|
4565
|
+
if (filter.type === "unary") {
|
|
4566
|
+
const [operand] = filter.operands;
|
|
4567
|
+
if (isFieldReference(operand)) return true;
|
|
4568
|
+
return this._isConvexEnforceableFilter(operand);
|
|
4569
|
+
}
|
|
4570
|
+
if (filter.type === "logical") return filter.operands.every((operand) => this._isConvexEnforceableFilter(operand));
|
|
4571
|
+
return true;
|
|
4572
|
+
}
|
|
4573
|
+
/**
|
|
4534
4574
|
* Evaluate a filter expression against a fetched row
|
|
4535
4575
|
* Used for post-fetch filtering (string operators, etc.)
|
|
4536
4576
|
*/
|
|
@@ -5340,6 +5380,38 @@ var GelRelationalQuery = class extends QueryPromise {
|
|
|
5340
5380
|
});
|
|
5341
5381
|
return streamQuery;
|
|
5342
5382
|
}
|
|
5383
|
+
/**
|
|
5384
|
+
* Stream equivalent of the `db.query(...)` chain, used when a post-fetch
|
|
5385
|
+
* filter has to run in JavaScript before `limit` or a page boundary can be
|
|
5386
|
+
* applied. `filterWith` evaluates the predicate as rows are pulled, so
|
|
5387
|
+
* `take`/`paginate` size by matches instead of by scanned rows.
|
|
5388
|
+
*
|
|
5389
|
+
* It deliberately mirrors the index and order decisions the caller already
|
|
5390
|
+
* made for the plain query rather than re-deriving them, so switching to the
|
|
5391
|
+
* stream cannot change which index is scanned or in what direction.
|
|
5392
|
+
*
|
|
5393
|
+
* Returns null when the schema definition needed by `stream()` is missing;
|
|
5394
|
+
* the caller then falls back to its plain-query path.
|
|
5395
|
+
*/
|
|
5396
|
+
_buildResidualFilterStream(params) {
|
|
5397
|
+
const schemaDefinition = this.schema[OrmSchemaDefinition];
|
|
5398
|
+
if (!schemaDefinition) return null;
|
|
5399
|
+
const { queryConfig, configuredIndex, membershipFilter, orderIndexName, primaryOrder, fallbackOrder } = params;
|
|
5400
|
+
let streamQuery = stream(this.db, schemaDefinition).query(this.tableConfig.name);
|
|
5401
|
+
if (queryConfig.index) streamQuery = streamQuery.withIndex(queryConfig.index.name, (q) => {
|
|
5402
|
+
let indexQuery = q;
|
|
5403
|
+
for (const filter of queryConfig.index.filters) indexQuery = this._applyFilterToQuery(indexQuery, filter);
|
|
5404
|
+
return indexQuery;
|
|
5405
|
+
});
|
|
5406
|
+
else if (configuredIndex?.name) streamQuery = streamQuery.withIndex(configuredIndex.name, configuredIndex.range ? configuredIndex.range : (q) => q);
|
|
5407
|
+
else if (orderIndexName) streamQuery = streamQuery.withIndex(orderIndexName, (q) => q);
|
|
5408
|
+
streamQuery = streamQuery.order(primaryOrder ? primaryOrder.direction : fallbackOrder);
|
|
5409
|
+
streamQuery = streamQuery.filterWith(async (row) => {
|
|
5410
|
+
for (const filter of queryConfig.postFilters) if (!this._evaluatePostFetchFilter(row, filter)) return false;
|
|
5411
|
+
return membershipFilter ? await membershipFilter(row) : true;
|
|
5412
|
+
});
|
|
5413
|
+
return streamQuery;
|
|
5414
|
+
}
|
|
5343
5415
|
_buildUnionSourceStream(source, fallbackOrder) {
|
|
5344
5416
|
const configuredIndex = this.configuredIndex;
|
|
5345
5417
|
this._assertWhereIndexRequirement({
|
|
@@ -6652,6 +6724,12 @@ var GelRelationalQuery = class extends QueryPromise {
|
|
|
6652
6724
|
const selectedRows = await this._finalizeRows(rows);
|
|
6653
6725
|
return this._returnSelectedRows(selectedRows);
|
|
6654
6726
|
}
|
|
6727
|
+
const matchesPostFetchMembership = async (row) => {
|
|
6728
|
+
const visibleRows = await this._applyRlsSelectFilter([row], this.tableConfig);
|
|
6729
|
+
if (visibleRows.length === 0) return false;
|
|
6730
|
+
if (!whereFilter) return true;
|
|
6731
|
+
return (await this._applyRelationsFilterToRows(visibleRows, this.tableConfig, whereFilter, this.edgeMetadata, 0, 3, this.config.with)).length > 0;
|
|
6732
|
+
};
|
|
6655
6733
|
if (isCursorPaginated) {
|
|
6656
6734
|
if (queryConfig.strategy === "multiProbe") if (maxScan === void 0) {
|
|
6657
6735
|
if (strict) throw new Error("Pagination with multi-probe index-union filters requires maxScan when strict=true. Add maxScan or make the query indexable.");
|
|
@@ -6716,9 +6794,40 @@ var GelRelationalQuery = class extends QueryPromise {
|
|
|
6716
6794
|
splitCursor: paginationResult.splitCursor
|
|
6717
6795
|
};
|
|
6718
6796
|
}
|
|
6719
|
-
|
|
6797
|
+
const convexPostFilters = queryConfig.postFilters.filter((filter) => this._isConvexEnforceableFilter(filter));
|
|
6798
|
+
const hasResidualPostFilter = convexPostFilters.length !== queryConfig.postFilters.length;
|
|
6799
|
+
const residualPageStream = hasResidualPostFilter ? this._buildResidualFilterStream({
|
|
6800
|
+
queryConfig,
|
|
6801
|
+
configuredIndex,
|
|
6802
|
+
membershipFilter: matchesPostFetchMembership,
|
|
6803
|
+
orderIndexName,
|
|
6804
|
+
primaryOrder,
|
|
6805
|
+
fallbackOrder: "desc"
|
|
6806
|
+
}) : null;
|
|
6807
|
+
if (hasResidualPostFilter && !residualPageStream) this._getSchemaDefinitionOrThrow();
|
|
6808
|
+
if (residualPageStream) {
|
|
6809
|
+
if (queryConfig.order && primaryOrder) {
|
|
6810
|
+
if (needsPostFetchSortForPrimary && strict) throw new Error(`Pagination: Field '${primaryOrder.field}' has no index. Add an index or disable strict.`);
|
|
6811
|
+
if (needsPostFetchSortForPrimary) console.warn(`Pagination: Field '${primaryOrder.field}' has no index. Falling back to _creationTime ordering.`);
|
|
6812
|
+
if (hasSecondaryOrders) console.warn("Pagination: Only the first orderBy field is used for cursor ordering. Secondary orderBy fields are applied per page and may be unstable across pages.");
|
|
6813
|
+
}
|
|
6814
|
+
const paginationResult = await residualPageStream.paginate({
|
|
6815
|
+
cursor: cursor ?? null,
|
|
6816
|
+
endCursor: endCursor ?? void 0,
|
|
6817
|
+
limit: config.limit,
|
|
6818
|
+
maxScan
|
|
6819
|
+
});
|
|
6820
|
+
return {
|
|
6821
|
+
page: await this._finalizeRows(paginationResult.page),
|
|
6822
|
+
continueCursor: paginationResult.continueCursor,
|
|
6823
|
+
isDone: paginationResult.isDone,
|
|
6824
|
+
pageStatus: paginationResult.pageStatus,
|
|
6825
|
+
splitCursor: paginationResult.splitCursor
|
|
6826
|
+
};
|
|
6827
|
+
}
|
|
6828
|
+
if (convexPostFilters.length > 0) query = query.filter((q) => {
|
|
6720
6829
|
let result = null;
|
|
6721
|
-
for (const filter of
|
|
6830
|
+
for (const filter of convexPostFilters) {
|
|
6722
6831
|
const expr = this._toConvexExpression(filter)(q);
|
|
6723
6832
|
result = result ? q.and(result, expr) : expr;
|
|
6724
6833
|
}
|
|
@@ -6745,9 +6854,11 @@ var GelRelationalQuery = class extends QueryPromise {
|
|
|
6745
6854
|
isDone: paginationResult.isDone
|
|
6746
6855
|
};
|
|
6747
6856
|
}
|
|
6748
|
-
|
|
6857
|
+
const convexPostFilters = queryConfig.postFilters.filter((filter) => this._isConvexEnforceableFilter(filter));
|
|
6858
|
+
const hasResidualPostFilter = convexPostFilters.length !== queryConfig.postFilters.length;
|
|
6859
|
+
if (convexPostFilters.length > 0) query = query.filter((q) => {
|
|
6749
6860
|
let result = null;
|
|
6750
|
-
for (const filter of
|
|
6861
|
+
for (const filter of convexPostFilters) {
|
|
6751
6862
|
const expr = this._toConvexExpression(filter)(q);
|
|
6752
6863
|
result = result ? q.and(result, expr) : expr;
|
|
6753
6864
|
}
|
|
@@ -6757,11 +6868,29 @@ var GelRelationalQuery = class extends QueryPromise {
|
|
|
6757
6868
|
if (typeof offset !== "number") throw new Error("Only numeric offset is supported in kitcn ORM.");
|
|
6758
6869
|
const limit = this._resolveNonPaginatedLimit(config);
|
|
6759
6870
|
const paginateAfterPostFetchSort = usePostFetchSort && postFetchOrders.length > 0;
|
|
6760
|
-
|
|
6761
|
-
|
|
6871
|
+
const sizeAfterPostFilter = hasResidualPostFilter && !paginateAfterPostFetchSort;
|
|
6872
|
+
const residualLimitStream = sizeAfterPostFilter && limit !== void 0 ? this._buildResidualFilterStream({
|
|
6873
|
+
queryConfig,
|
|
6874
|
+
configuredIndex,
|
|
6875
|
+
membershipFilter: matchesPostFetchMembership,
|
|
6876
|
+
orderIndexName,
|
|
6877
|
+
primaryOrder,
|
|
6878
|
+
fallbackOrder: "asc"
|
|
6879
|
+
}) : null;
|
|
6880
|
+
let rows;
|
|
6881
|
+
if (residualLimitStream) rows = await residualLimitStream.take(offset > 0 ? offset + limit : limit);
|
|
6882
|
+
else if (limit === void 0 || paginateAfterPostFetchSort || hasResidualPostFilter) rows = await query.collect();
|
|
6883
|
+
else rows = await query.take(offset > 0 ? offset + limit : limit);
|
|
6884
|
+
if (!(paginateAfterPostFetchSort || sizeAfterPostFilter) && offset > 0) rows = rows.slice(offset);
|
|
6762
6885
|
if (queryConfig.postFilters.length > 0) rows = rows.filter((row) => queryConfig.postFilters.every((filter) => this._evaluatePostFetchFilter(row, filter)));
|
|
6763
|
-
|
|
6764
|
-
|
|
6886
|
+
if (!residualLimitStream) {
|
|
6887
|
+
rows = await this._applyRlsSelectFilter(rows, this.tableConfig);
|
|
6888
|
+
if (whereFilter) rows = await this._applyRelationsFilterToRows(rows, this.tableConfig, whereFilter, this.edgeMetadata, 0, 3, this.config.with);
|
|
6889
|
+
}
|
|
6890
|
+
if (sizeAfterPostFilter) {
|
|
6891
|
+
if (offset > 0) rows = rows.slice(offset);
|
|
6892
|
+
if (limit !== void 0) rows = rows.slice(0, limit);
|
|
6893
|
+
}
|
|
6765
6894
|
if (usePostFetchSort && postFetchOrders.length > 0) rows = rows.sort((a, b) => this._compareByOrderSpecs(a, b, postFetchOrders));
|
|
6766
6895
|
if (paginateAfterPostFetchSort) {
|
|
6767
6896
|
if (offset > 0) rows = rows.slice(offset);
|
|
@@ -10122,6 +10251,8 @@ function scheduledDeleteFactory(schema, edgeMetadata, scheduledMutationBatch) {
|
|
|
10122
10251
|
|
|
10123
10252
|
//#endregion
|
|
10124
10253
|
//#region src/orm/scheduled-mutation-batch.ts
|
|
10254
|
+
/** Column stamped by `softDeleteRow`; see mutation-utils.ts. */
|
|
10255
|
+
const DELETION_TIME_FIELD = "deletionTime";
|
|
10125
10256
|
const isRecord = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
10126
10257
|
function scheduledMutationBatchFactory(schema, edgeMetadata, scheduledMutationBatch) {
|
|
10127
10258
|
const tableByName = /* @__PURE__ */ new Map();
|
|
@@ -10185,12 +10316,17 @@ function scheduledMutationBatchFactory(schema, edgeMetadata, scheduledMutationBa
|
|
|
10185
10316
|
const targetValues = decodeUndefinedDeep(args.targetValues);
|
|
10186
10317
|
if (!targetValues || !Array.isArray(targetValues)) throw new Error("scheduledMutationBatch: targetValues are required for cascade work.");
|
|
10187
10318
|
if (!args.foreignIndexName) throw new Error("scheduledMutationBatch: foreignIndexName is required for cascade work.");
|
|
10188
|
-
const queryWithIndex = () => ctx.db.query(args.table).withIndex(args.foreignIndexName, (q) => {
|
|
10189
|
-
let builder = q.eq(sourceColumns[0], targetValues[0]);
|
|
10190
|
-
for (let i = 1; i < sourceColumns.length; i += 1) builder = builder.eq(sourceColumns[i], targetValues[i]);
|
|
10191
|
-
return builder;
|
|
10192
|
-
});
|
|
10193
10319
|
const action = args.foreignAction ?? "no action";
|
|
10320
|
+
const skipSoftDeletedRows = workType === "cascade-delete" && action === "cascade" && (args.cascadeMode ?? "hard") === "soft";
|
|
10321
|
+
const queryWithIndex = () => {
|
|
10322
|
+
const indexed = ctx.db.query(args.table).withIndex(args.foreignIndexName, (q) => {
|
|
10323
|
+
let builder = q.eq(sourceColumns[0], targetValues[0]);
|
|
10324
|
+
for (let i = 1; i < sourceColumns.length; i += 1) builder = builder.eq(sourceColumns[i], targetValues[i]);
|
|
10325
|
+
return builder;
|
|
10326
|
+
});
|
|
10327
|
+
if (!skipSoftDeletedRows) return indexed;
|
|
10328
|
+
return indexed.filter((q) => q.or(q.eq(q.field(DELETION_TIME_FIELD), void 0), q.eq(q.field(DELETION_TIME_FIELD), null)));
|
|
10329
|
+
};
|
|
10194
10330
|
const paged = await queryWithIndex().paginate({
|
|
10195
10331
|
cursor: null,
|
|
10196
10332
|
numItems: args.batchSize
|
|
@@ -1136,7 +1136,7 @@ var FlatMapStreamIterator = class {
|
|
|
1136
1136
|
let innerStream;
|
|
1137
1137
|
if (t === null) innerStream = this.singletonSkipInnerStream();
|
|
1138
1138
|
else {
|
|
1139
|
-
innerStream = await this.#mapper(t);
|
|
1139
|
+
innerStream = await this.#mapper(t, indexKey);
|
|
1140
1140
|
if (!equalIndexFields(innerStream.getIndexFields(), this.#mappedIndexFields)) throw new Error(`FlatMapStream: inner stream has different index fields than expected: ${JSON.stringify(innerStream.getIndexFields())} vs ${JSON.stringify(this.#mappedIndexFields)}`);
|
|
1141
1141
|
if (innerStream.getOrder() !== this.#outerStream.getOrder()) throw new Error(`FlatMapStream: inner stream has different order than outer stream: ${innerStream.getOrder()} vs ${this.#outerStream.getOrder()}`);
|
|
1142
1142
|
}
|
|
@@ -1210,14 +1210,32 @@ var FlatMapStream = class FlatMapStream extends QueryStream {
|
|
|
1210
1210
|
upperBound: outerUpperBound,
|
|
1211
1211
|
upperBoundInclusive: innerUpperBound.length === 0 ? indexBounds.upperBoundInclusive : true
|
|
1212
1212
|
};
|
|
1213
|
-
const
|
|
1214
|
-
lowerBound:
|
|
1215
|
-
lowerBoundInclusive:
|
|
1216
|
-
upperBound:
|
|
1217
|
-
upperBoundInclusive:
|
|
1213
|
+
const unrestricted = {
|
|
1214
|
+
lowerBound: [],
|
|
1215
|
+
lowerBoundInclusive: true,
|
|
1216
|
+
upperBound: [],
|
|
1217
|
+
upperBoundInclusive: true
|
|
1218
1218
|
};
|
|
1219
|
-
|
|
1220
|
-
|
|
1219
|
+
const isBoundaryParent = (parentKey, bound) => bound.length === outerLength && compareKeys({
|
|
1220
|
+
value: parentKey,
|
|
1221
|
+
kind: "exact"
|
|
1222
|
+
}, {
|
|
1223
|
+
value: bound,
|
|
1224
|
+
kind: "exact"
|
|
1225
|
+
}) === 0;
|
|
1226
|
+
const innerBoundsForParent = (parentKey) => {
|
|
1227
|
+
const atLowerBound = innerLowerBound.length > 0 && isBoundaryParent(parentKey, outerLowerBound);
|
|
1228
|
+
const atUpperBound = innerUpperBound.length > 0 && isBoundaryParent(parentKey, outerUpperBound);
|
|
1229
|
+
if (!(atLowerBound || atUpperBound)) return unrestricted;
|
|
1230
|
+
return {
|
|
1231
|
+
lowerBound: atLowerBound ? innerLowerBound : unrestricted.lowerBound,
|
|
1232
|
+
lowerBoundInclusive: atLowerBound ? indexBounds.lowerBoundInclusive : true,
|
|
1233
|
+
upperBound: atUpperBound ? innerUpperBound : unrestricted.upperBound,
|
|
1234
|
+
upperBoundInclusive: atUpperBound ? indexBounds.upperBoundInclusive : true
|
|
1235
|
+
};
|
|
1236
|
+
};
|
|
1237
|
+
return new FlatMapStream(this.#stream.narrow(outerIndexBounds), async (t, parentKey) => {
|
|
1238
|
+
return (await this.#mapper(t, parentKey)).narrow(innerBoundsForParent(parentKey));
|
|
1221
1239
|
}, this.#mappedIndexFields);
|
|
1222
1240
|
}
|
|
1223
1241
|
};
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as ActionProcedureBuilder, A as CRPCError, B as RuntimeEnv, C as createProcedureHandlerFactory, Ct as zCustomQuery, D as WithHttpRouter, Dt as zodToConvex, E as typedProcedureResolver, Et as zodOutputToConvexFields, F as getCRPCErrorFromUnknown, G as createLazyCaller, H as ConvexContext, I as getHTTPStatusCodeFromError, J as ServerCaller, K as CallerMeta, L as isCRPCError, M as CRPCErrorData, N as CRPC_ERROR_CODES_BY_KEY, O as inferApiInputs, Ot as zodToConvexFields, P as CRPC_ERROR_CODE_TO_HTTP, Q as getGeneratedValue, R as toCRPCError, S as createProcedureCallerFactory, St as zCustomMutation, T as getGeneratedFunctionReference, Tt as zodOutputToConvex, U as createCallerFactory, V as createEnv, W as LazyCaller, X as createApiLeaf, Y as createServerCaller, Z as createGeneratedFunctionReference, _ as ProcedureSchedulableCallerFromRegistry, _t as ZodValidatorFromConvex, a as CreateProcedureCallerFactoryOptions, at as initCRPC, b as createGenericCallerFactory, bt as withSystemFields, c as GeneratedRegistryCallerFactory, ct as extractPathParams, d as GeneratedRegistryHandlerForContext, dt as ConvexValidatorFromZod, et as CRPCFunctionTypeHint, f as ProcedureActionCallerFromRegistry, ft as ConvexValidatorFromZodOutput, g as ProcedureFromFunctionReference, gt as ZodFromValidatorBase, h as ProcedureDefinition, ht as Zid, i as registerProcedureNameLookup, it as createMiddlewareFactory, j as CRPCErrorCode, k as inferApiOutputs, l as GeneratedRegistryCallerForContext, lt as handleHttpError, m as ProcedureCallerFromRegistry, mt as ZCustomCtx, n as ProcedureNameLookup, nt as ProcedureBuilder, o as GeneratedProcedureRegistry, ot as HttpProcedureBuilder, p as ProcedureCaller, pt as CustomBuilder, q as CallerOpts, r as inferProcedureNameFromCallsite, rt as QueryProcedureBuilder, s as GeneratedProcedureRegistryEntry, st as createHttpProcedureBuilder, t as ProcedureNameEntry, tt as MutationProcedureBuilder, u as GeneratedRegistryHandlerFactory, ut as matchPathParams, v as ProcedureScheduleCallerFromRegistry, vt as convexToZod, w as defineProcedure, wt as zid, x as createGenericHandlerFactory, xt as zCustomAction, y as createGeneratedRegistryRuntime, yt as convexToZodFields, z as CreateEnvOptions } from "../procedure-name-Cy1AxayA.js";
|
|
2
2
|
import { C as HttpProcedure, D as ProcedureMeta, E as InferHttpInput, S as HttpMethod, T as HttpRouteDefinition, _ as extractRouteMap, b as HttpActionHandler, d as CRPCHttpRouter, f as HttpRouterDef, g as createHttpRouterFactory, h as createHttpRouter, m as HttpRouterWithHono, p as HttpRouterRecord, v as CRPCHonoHandler, w as HttpProcedureBuilderDef, x as HttpHandlerOpts, y as HttpActionConstructor } from "../http-types-zsMHb_QN.js";
|
|
3
3
|
import { a as MergeZodObjects, c as MiddlewareMarker, d as MiddlewareProcedureType, f as MiddlewareResult, g as UnsetMarker, h as Simplify, i as IntersectIfDefined, l as MiddlewareNext, m as ResolveIfSet, n as AnyMiddlewareBuilder, o as MiddlewareBuilder, p as Overwrite, r as GetRawInputFn, s as MiddlewareFunction, t as AnyMiddleware, u as MiddlewareProcedureInfo } from "../types-CnTpHR1F.js";
|
|
4
|
-
import { a as isMutationCtx, c as isSchedulerCtx, d as requireQueryCtx, f as requireRunMutationCtx, i as isActionCtx, l as requireActionCtx, n as RunMutationCtx, o as isQueryCtx, p as requireSchedulerCtx, r as SchedulerCtx, s as isRunMutationCtx, t as GenericCtx, u as requireMutationCtx } from "../context-utils-
|
|
4
|
+
import { a as isMutationCtx, c as isSchedulerCtx, d as requireQueryCtx, f as requireRunMutationCtx, i as isActionCtx, l as requireActionCtx, n as RunMutationCtx, o as isQueryCtx, p as requireSchedulerCtx, r as SchedulerCtx, s as isRunMutationCtx, t as GenericCtx, u as requireMutationCtx } from "../context-utils-BBUtBqjN.js";
|
|
5
5
|
export { ActionProcedureBuilder, AnyMiddleware, AnyMiddlewareBuilder, CRPCError, CRPCErrorCode, CRPCErrorData, CRPCFunctionTypeHint, CRPCHonoHandler, CRPCHttpRouter, CRPC_ERROR_CODES_BY_KEY, CRPC_ERROR_CODE_TO_HTTP, CallerMeta, CallerOpts, ConvexContext, ConvexValidatorFromZod, ConvexValidatorFromZodOutput, CreateEnvOptions, CreateProcedureCallerFactoryOptions, CustomBuilder, GeneratedProcedureRegistry, GeneratedProcedureRegistryEntry, GeneratedRegistryCallerFactory, GeneratedRegistryCallerForContext, GeneratedRegistryHandlerFactory, GeneratedRegistryHandlerForContext, GenericCtx, GetRawInputFn, HttpActionConstructor, HttpActionHandler, HttpHandlerOpts, HttpMethod, HttpProcedure, HttpProcedureBuilder, HttpProcedureBuilderDef, HttpRouteDefinition, HttpRouterDef, HttpRouterRecord, HttpRouterWithHono, InferHttpInput, IntersectIfDefined, LazyCaller, MergeZodObjects, MiddlewareBuilder, MiddlewareFunction, MiddlewareMarker, MiddlewareNext, MiddlewareProcedureInfo, MiddlewareProcedureType, MiddlewareResult, MutationProcedureBuilder, Overwrite, ProcedureActionCallerFromRegistry, ProcedureBuilder, ProcedureCaller, ProcedureCallerFromRegistry, ProcedureDefinition, ProcedureFromFunctionReference, ProcedureMeta, ProcedureNameEntry, ProcedureNameLookup, ProcedureSchedulableCallerFromRegistry, ProcedureScheduleCallerFromRegistry, QueryProcedureBuilder, ResolveIfSet, RunMutationCtx, RuntimeEnv, SchedulerCtx, ServerCaller, Simplify, UnsetMarker, WithHttpRouter, ZCustomCtx, Zid, ZodFromValidatorBase, ZodValidatorFromConvex, convexToZod, convexToZodFields, createApiLeaf, createCallerFactory, createEnv, createGeneratedFunctionReference, createGeneratedRegistryRuntime, createGenericCallerFactory, createGenericHandlerFactory, createHttpProcedureBuilder, createHttpRouter, createHttpRouterFactory, createLazyCaller, createMiddlewareFactory, createProcedureCallerFactory, createProcedureHandlerFactory, createServerCaller, defineProcedure, extractPathParams, extractRouteMap, getCRPCErrorFromUnknown, getGeneratedFunctionReference, getGeneratedValue, getHTTPStatusCodeFromError, handleHttpError, inferApiInputs, inferApiOutputs, inferProcedureNameFromCallsite, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, isSchedulerCtx, matchPathParams, registerProcedureNameLookup, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, requireSchedulerCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
|
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-
|
|
2
|
+
import { Dt as generateMeta, F as resolveRunDeps, Ot as getConvexConfig, j as resolveConfiguredBackend, kt as logger, q as withLocalCodegenEnv } from "./backend-core-DqPydYyx.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
@@ -2436,6 +2436,19 @@ declare class GelRelationalQuery<TSchema extends TablesRelationalConfig, TTableC
|
|
|
2436
2436
|
private _compareByOrderSpecs;
|
|
2437
2437
|
private _getTableConfigByDbName;
|
|
2438
2438
|
private _matchLike;
|
|
2439
|
+
/**
|
|
2440
|
+
* True when the expression can be fully enforced by Convex's own `.filter()`.
|
|
2441
|
+
*
|
|
2442
|
+
* `_toConvexExpression` compiles the string/array operators to `() => true`
|
|
2443
|
+
* because Convex filters cannot run JavaScript string methods; those are
|
|
2444
|
+
* evaluated later by `_evaluatePostFetchFilter`. Pushing such an expression
|
|
2445
|
+
* into `.filter()` is not merely useless, it is wrong in two ways: a `take()`
|
|
2446
|
+
* downstream spends its budget on rows that have not been filtered yet, and a
|
|
2447
|
+
* surrounding `NOT` turns the `true` placeholder into `q.not(true)`, which
|
|
2448
|
+
* matches nothing. So the caller must know whether Convex can carry the whole
|
|
2449
|
+
* expression before relying on it.
|
|
2450
|
+
*/
|
|
2451
|
+
private _isConvexEnforceableFilter;
|
|
2439
2452
|
/**
|
|
2440
2453
|
* Evaluate a filter expression against a fetched row
|
|
2441
2454
|
* Used for post-fetch filtering (string operators, etc.)
|
|
@@ -2471,6 +2484,20 @@ declare class GelRelationalQuery<TSchema extends TablesRelationalConfig, TTableC
|
|
|
2471
2484
|
private _createFilterOperators;
|
|
2472
2485
|
private _resolveWhereCallbackExpression;
|
|
2473
2486
|
private _buildBasePipelineStream;
|
|
2487
|
+
/**
|
|
2488
|
+
* Stream equivalent of the `db.query(...)` chain, used when a post-fetch
|
|
2489
|
+
* filter has to run in JavaScript before `limit` or a page boundary can be
|
|
2490
|
+
* applied. `filterWith` evaluates the predicate as rows are pulled, so
|
|
2491
|
+
* `take`/`paginate` size by matches instead of by scanned rows.
|
|
2492
|
+
*
|
|
2493
|
+
* It deliberately mirrors the index and order decisions the caller already
|
|
2494
|
+
* made for the plain query rather than re-deriving them, so switching to the
|
|
2495
|
+
* stream cannot change which index is scanned or in what direction.
|
|
2496
|
+
*
|
|
2497
|
+
* Returns null when the schema definition needed by `stream()` is missing;
|
|
2498
|
+
* the caller then falls back to its plain-query path.
|
|
2499
|
+
*/
|
|
2500
|
+
private _buildResidualFilterStream;
|
|
2474
2501
|
private _buildUnionSourceStream;
|
|
2475
2502
|
private _applyFlatMapStage;
|
|
2476
2503
|
private _applyPipelineStages;
|
|
@@ -3727,7 +3754,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3727
3754
|
fieldName: "count";
|
|
3728
3755
|
};
|
|
3729
3756
|
};
|
|
3730
|
-
|
|
3757
|
+
updatedAt: ConvexNumberBuilderInitial<""> & {
|
|
3731
3758
|
_: {
|
|
3732
3759
|
notNull: true;
|
|
3733
3760
|
};
|
|
@@ -3737,10 +3764,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3737
3764
|
};
|
|
3738
3765
|
} & {
|
|
3739
3766
|
_: {
|
|
3740
|
-
fieldName: "
|
|
3767
|
+
fieldName: "updatedAt";
|
|
3741
3768
|
};
|
|
3742
3769
|
};
|
|
3743
|
-
|
|
3770
|
+
tableKey: ConvexTextBuilderInitial<""> & {
|
|
3744
3771
|
_: {
|
|
3745
3772
|
notNull: true;
|
|
3746
3773
|
};
|
|
@@ -3750,10 +3777,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3750
3777
|
};
|
|
3751
3778
|
} & {
|
|
3752
3779
|
_: {
|
|
3753
|
-
fieldName: "
|
|
3780
|
+
fieldName: "tableKey";
|
|
3754
3781
|
};
|
|
3755
3782
|
};
|
|
3756
|
-
|
|
3783
|
+
indexName: ConvexTextBuilderInitial<""> & {
|
|
3757
3784
|
_: {
|
|
3758
3785
|
notNull: true;
|
|
3759
3786
|
};
|
|
@@ -3763,7 +3790,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3763
3790
|
};
|
|
3764
3791
|
} & {
|
|
3765
3792
|
_: {
|
|
3766
|
-
fieldName: "
|
|
3793
|
+
fieldName: "indexName";
|
|
3767
3794
|
};
|
|
3768
3795
|
};
|
|
3769
3796
|
keyHash: ConvexTextBuilderInitial<""> & {
|
|
@@ -3836,7 +3863,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3836
3863
|
fieldName: "kind";
|
|
3837
3864
|
};
|
|
3838
3865
|
};
|
|
3839
|
-
|
|
3866
|
+
updatedAt: ConvexNumberBuilderInitial<""> & {
|
|
3840
3867
|
_: {
|
|
3841
3868
|
notNull: true;
|
|
3842
3869
|
};
|
|
@@ -3846,10 +3873,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3846
3873
|
};
|
|
3847
3874
|
} & {
|
|
3848
3875
|
_: {
|
|
3849
|
-
fieldName: "
|
|
3876
|
+
fieldName: "updatedAt";
|
|
3850
3877
|
};
|
|
3851
3878
|
};
|
|
3852
|
-
|
|
3879
|
+
tableKey: ConvexTextBuilderInitial<""> & {
|
|
3853
3880
|
_: {
|
|
3854
3881
|
notNull: true;
|
|
3855
3882
|
};
|
|
@@ -3859,10 +3886,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3859
3886
|
};
|
|
3860
3887
|
} & {
|
|
3861
3888
|
_: {
|
|
3862
|
-
fieldName: "
|
|
3889
|
+
fieldName: "tableKey";
|
|
3863
3890
|
};
|
|
3864
3891
|
};
|
|
3865
|
-
|
|
3892
|
+
indexName: ConvexTextBuilderInitial<""> & {
|
|
3866
3893
|
_: {
|
|
3867
3894
|
notNull: true;
|
|
3868
3895
|
};
|
|
@@ -3872,7 +3899,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3872
3899
|
};
|
|
3873
3900
|
} & {
|
|
3874
3901
|
_: {
|
|
3875
|
-
fieldName: "
|
|
3902
|
+
fieldName: "indexName";
|
|
3876
3903
|
};
|
|
3877
3904
|
};
|
|
3878
3905
|
keyHash: ConvexTextBuilderInitial<""> & {
|
|
@@ -4019,7 +4046,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4019
4046
|
fieldName: "count";
|
|
4020
4047
|
};
|
|
4021
4048
|
};
|
|
4022
|
-
|
|
4049
|
+
updatedAt: ConvexNumberBuilderInitial<""> & {
|
|
4023
4050
|
_: {
|
|
4024
4051
|
notNull: true;
|
|
4025
4052
|
};
|
|
@@ -4029,10 +4056,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4029
4056
|
};
|
|
4030
4057
|
} & {
|
|
4031
4058
|
_: {
|
|
4032
|
-
fieldName: "
|
|
4059
|
+
fieldName: "updatedAt";
|
|
4033
4060
|
};
|
|
4034
4061
|
};
|
|
4035
|
-
|
|
4062
|
+
tableKey: ConvexTextBuilderInitial<""> & {
|
|
4036
4063
|
_: {
|
|
4037
4064
|
notNull: true;
|
|
4038
4065
|
};
|
|
@@ -4042,10 +4069,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4042
4069
|
};
|
|
4043
4070
|
} & {
|
|
4044
4071
|
_: {
|
|
4045
|
-
fieldName: "
|
|
4072
|
+
fieldName: "tableKey";
|
|
4046
4073
|
};
|
|
4047
4074
|
};
|
|
4048
|
-
|
|
4075
|
+
indexName: ConvexTextBuilderInitial<""> & {
|
|
4049
4076
|
_: {
|
|
4050
4077
|
notNull: true;
|
|
4051
4078
|
};
|
|
@@ -4055,7 +4082,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4055
4082
|
};
|
|
4056
4083
|
} & {
|
|
4057
4084
|
_: {
|
|
4058
|
-
fieldName: "
|
|
4085
|
+
fieldName: "indexName";
|
|
4059
4086
|
};
|
|
4060
4087
|
};
|
|
4061
4088
|
keyHash: ConvexTextBuilderInitial<""> & {
|
|
@@ -4276,6 +4303,19 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4276
4303
|
fieldName: "cursor";
|
|
4277
4304
|
};
|
|
4278
4305
|
};
|
|
4306
|
+
updatedAt: ConvexNumberBuilderInitial<""> & {
|
|
4307
|
+
_: {
|
|
4308
|
+
notNull: true;
|
|
4309
|
+
};
|
|
4310
|
+
} & {
|
|
4311
|
+
_: {
|
|
4312
|
+
tableName: "aggregate_state";
|
|
4313
|
+
};
|
|
4314
|
+
} & {
|
|
4315
|
+
_: {
|
|
4316
|
+
fieldName: "updatedAt";
|
|
4317
|
+
};
|
|
4318
|
+
};
|
|
4279
4319
|
tableKey: ConvexTextBuilderInitial<""> & {
|
|
4280
4320
|
_: {
|
|
4281
4321
|
notNull: true;
|
|
@@ -4354,19 +4394,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4354
4394
|
fieldName: "startedAt";
|
|
4355
4395
|
};
|
|
4356
4396
|
};
|
|
4357
|
-
updatedAt: ConvexNumberBuilderInitial<""> & {
|
|
4358
|
-
_: {
|
|
4359
|
-
notNull: true;
|
|
4360
|
-
};
|
|
4361
|
-
} & {
|
|
4362
|
-
_: {
|
|
4363
|
-
tableName: "aggregate_state";
|
|
4364
|
-
};
|
|
4365
|
-
} & {
|
|
4366
|
-
_: {
|
|
4367
|
-
fieldName: "updatedAt";
|
|
4368
|
-
};
|
|
4369
|
-
};
|
|
4370
4397
|
completedAt: ConvexNumberBuilderInitial<""> & {
|
|
4371
4398
|
_: {
|
|
4372
4399
|
tableName: "aggregate_state";
|
|
@@ -4426,7 +4453,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4426
4453
|
fieldName: "direction";
|
|
4427
4454
|
};
|
|
4428
4455
|
};
|
|
4429
|
-
|
|
4456
|
+
updatedAt: ConvexNumberBuilderInitial<""> & {
|
|
4430
4457
|
_: {
|
|
4431
4458
|
notNull: true;
|
|
4432
4459
|
};
|
|
@@ -4436,29 +4463,29 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4436
4463
|
};
|
|
4437
4464
|
} & {
|
|
4438
4465
|
_: {
|
|
4439
|
-
fieldName: "
|
|
4466
|
+
fieldName: "updatedAt";
|
|
4440
4467
|
};
|
|
4441
4468
|
};
|
|
4442
|
-
|
|
4469
|
+
processed: ConvexNumberBuilderInitial<""> & {
|
|
4443
4470
|
_: {
|
|
4444
|
-
|
|
4471
|
+
notNull: true;
|
|
4445
4472
|
};
|
|
4446
4473
|
} & {
|
|
4447
4474
|
_: {
|
|
4448
|
-
|
|
4475
|
+
tableName: "migration_state";
|
|
4449
4476
|
};
|
|
4450
|
-
}
|
|
4451
|
-
updatedAt: ConvexNumberBuilderInitial<""> & {
|
|
4477
|
+
} & {
|
|
4452
4478
|
_: {
|
|
4453
|
-
|
|
4479
|
+
fieldName: "processed";
|
|
4454
4480
|
};
|
|
4455
|
-
}
|
|
4481
|
+
};
|
|
4482
|
+
startedAt: ConvexNumberBuilderInitial<""> & {
|
|
4456
4483
|
_: {
|
|
4457
4484
|
tableName: "migration_state";
|
|
4458
4485
|
};
|
|
4459
4486
|
} & {
|
|
4460
4487
|
_: {
|
|
4461
|
-
fieldName: "
|
|
4488
|
+
fieldName: "startedAt";
|
|
4462
4489
|
};
|
|
4463
4490
|
};
|
|
4464
4491
|
completedAt: ConvexNumberBuilderInitial<""> & {
|
|
@@ -4575,7 +4602,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4575
4602
|
fieldName: "direction";
|
|
4576
4603
|
};
|
|
4577
4604
|
};
|
|
4578
|
-
|
|
4605
|
+
updatedAt: ConvexNumberBuilderInitial<""> & {
|
|
4579
4606
|
_: {
|
|
4580
4607
|
notNull: true;
|
|
4581
4608
|
};
|
|
@@ -4585,10 +4612,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4585
4612
|
};
|
|
4586
4613
|
} & {
|
|
4587
4614
|
_: {
|
|
4588
|
-
fieldName: "
|
|
4615
|
+
fieldName: "updatedAt";
|
|
4589
4616
|
};
|
|
4590
4617
|
};
|
|
4591
|
-
|
|
4618
|
+
startedAt: ConvexNumberBuilderInitial<""> & {
|
|
4592
4619
|
_: {
|
|
4593
4620
|
notNull: true;
|
|
4594
4621
|
};
|
|
@@ -4598,7 +4625,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4598
4625
|
};
|
|
4599
4626
|
} & {
|
|
4600
4627
|
_: {
|
|
4601
|
-
fieldName: "
|
|
4628
|
+
fieldName: "startedAt";
|
|
4602
4629
|
};
|
|
4603
4630
|
};
|
|
4604
4631
|
completedAt: ConvexNumberBuilderInitial<""> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kitcn",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "kitcn - React Query integration and CLI tools for Convex",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"convex",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@tanstack/react-start": ">=1",
|
|
94
94
|
"@tanstack/solid-query": ">=5",
|
|
95
95
|
"better-auth": ">=1.6.11 <1.7.0",
|
|
96
|
-
"convex": ">=1.
|
|
96
|
+
"convex": ">=1.42",
|
|
97
97
|
"hono": "4.12.9",
|
|
98
98
|
"next": ">=14",
|
|
99
99
|
"react": ">=18",
|