better-convex 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aggregate/index.d.ts +1 -2
- package/dist/aggregate/index.js +1 -1
- package/dist/cli.mjs +16 -1
- package/dist/{id-DdAxiGby.js → id-BF_SaWhQ.js} +1 -1
- package/dist/orm/index.d.ts +2 -2
- package/dist/orm/index.js +98 -90
- package/dist/plugins/index.d.ts +4 -2
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/ratelimit/index.d.ts +1 -2
- package/dist/plugins/ratelimit/index.js +2 -2
- package/dist/{runtime-oWZgeWOJ.js → runtime-B20PP4Qr.js} +2 -2
- package/dist/{schema-DVFZAlKx.js → schema-Cw5-LWTg.js} +2 -2
- package/dist/{table-B7yzBihE.js → table-Bxqm450r.js} +107 -3
- package/dist/{text-enum-CFdcLUuw.js → text-enum-KyijdQ8Q.js} +1 -1
- package/dist/{where-clause-compiler-_b1UHbYW.d.ts → where-clause-compiler-UavDdMUX.d.ts} +180 -163
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../orm/index.js";
|
|
1
|
+
import { Dt as ConvexCustomBuilderInitial, _t as ConvexNumberBuilderInitial, bt as ConvexIdBuilderInitial, qn as ConvexTextBuilderInitial, rn as ConvexTableWithColumns } from "../where-clause-compiler-UavDdMUX.js";
|
|
3
2
|
import * as convex_values0 from "convex/values";
|
|
4
3
|
import { GenericId, Infer, Value } from "convex/values";
|
|
5
4
|
import { DocumentByName, GenericDataModel, GenericDatabaseReader, GenericDatabaseWriter, TableNamesInDataModel } from "convex/server";
|
package/dist/aggregate/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TableAggregate$1, r as aggregateStorageTables, t as DirectAggregate$1 } from "../runtime-
|
|
1
|
+
import { n as TableAggregate$1, r as aggregateStorageTables, t as DirectAggregate$1 } from "../runtime-B20PP4Qr.js";
|
|
2
2
|
|
|
3
3
|
//#region src/aggregate/index.ts
|
|
4
4
|
const wrapTriggerFactory = (methodName, factory) => ((...args) => {
|
package/dist/cli.mjs
CHANGED
|
@@ -230,6 +230,7 @@ const OrmContext = Symbol.for("better-convex:OrmContext");
|
|
|
230
230
|
const RlsPolicies = Symbol.for("better-convex:RlsPolicies");
|
|
231
231
|
const EnableRLS = Symbol.for("better-convex:EnableRLS");
|
|
232
232
|
const TableDeleteConfig = Symbol.for("better-convex:TableDeleteConfig");
|
|
233
|
+
const TablePolymorphic = Symbol.for("better-convex:TablePolymorphic");
|
|
233
234
|
const OrmSchemaOptions = Symbol.for("better-convex:OrmSchemaOptions");
|
|
234
235
|
const OrmSchemaDefinition = Symbol.for("better-convex:OrmSchemaDefinition");
|
|
235
236
|
const OrmSchemaPluginTables = Symbol.for("better-convex:OrmSchemaPluginTables");
|
|
@@ -449,8 +450,22 @@ const walkDeployEntryPoints = (dir, options) => {
|
|
|
449
450
|
};
|
|
450
451
|
const detectProjectRoots = () => {
|
|
451
452
|
const projectRoot = process.cwd();
|
|
453
|
+
const convexConfigPath = path.join(projectRoot, "convex.json");
|
|
454
|
+
const configuredFunctionsRoot = (() => {
|
|
455
|
+
if (!fs.existsSync(convexConfigPath)) return null;
|
|
456
|
+
try {
|
|
457
|
+
const parsed = JSON.parse(fs.readFileSync(convexConfigPath, "utf8"));
|
|
458
|
+
return typeof parsed.functions === "string" && parsed.functions.length > 0 ? path.join(projectRoot, parsed.functions) : null;
|
|
459
|
+
} catch {
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
})();
|
|
452
463
|
const preferredFunctionsRoot = path.join(projectRoot, "convex", "functions");
|
|
453
464
|
const fallbackFunctionsRoot = path.join(projectRoot, "convex");
|
|
465
|
+
if (configuredFunctionsRoot && fs.existsSync(configuredFunctionsRoot)) return {
|
|
466
|
+
projectRoot,
|
|
467
|
+
functionsRoot: configuredFunctionsRoot
|
|
468
|
+
};
|
|
454
469
|
if (fs.existsSync(preferredFunctionsRoot)) return {
|
|
455
470
|
projectRoot,
|
|
456
471
|
functionsRoot: preferredFunctionsRoot
|
|
@@ -459,7 +474,7 @@ const detectProjectRoots = () => {
|
|
|
459
474
|
projectRoot,
|
|
460
475
|
functionsRoot: fallbackFunctionsRoot
|
|
461
476
|
};
|
|
462
|
-
throw new Error(`Missing Convex functions directory. Expected one of:\n- ${preferredFunctionsRoot}\n- ${fallbackFunctionsRoot}`);
|
|
477
|
+
throw new Error(`Missing Convex functions directory. Expected one of:\n- ${configuredFunctionsRoot ?? "<convex.json functions>"}\n- ${preferredFunctionsRoot}\n- ${fallbackFunctionsRoot}`);
|
|
463
478
|
};
|
|
464
479
|
const hasUseNodeDirective = (source) => {
|
|
465
480
|
if (!source.includes("use node")) return false;
|
package/dist/orm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-BcQFm1oY.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as DatabaseWithQuery, $n as BuildRelationResult, $r as notInArray, $t as defineRelationsPart, A as MigrationRunArgs, An as aggregateIndex, Ar as FieldReference, At as json, B as MigrationMigrateOne, Bn as ConvexUniqueConstraintBuilder, Br as gt, Bt as bigint, C as OrmBeforeResult, Cn as ConvexRankIndexBuilderOn, Cr as ReturningSelection, Ct as ConvexDateBuilderInitial, D as OrmTriggers, Dn as ConvexVectorIndexBuilder, Dr as unsetToken, Dt as ConvexCustomBuilderInitial, E as OrmTriggerContext, En as ConvexSearchIndexConfig, Er as VectorSearchProvider, Et as ConvexCustomBuilder, F as MigrationDirection, Fn as vectorIndex, Fr as between, Ft as ConvexBooleanBuilder, G as MigrationStep, Gn as unique, Gr as isNotNull, Gt as ManyConfig, H as MigrationRunStatus, Hn as ConvexUniqueConstraintConfig, Hr as ilike, Ht as CountBackfillKickoffArgs, I as MigrationDoc, In as ConvexCheckBuilder, Ir as contains, It as ConvexBooleanBuilderInitial, J as buildMigrationPlan, Jn as text, Jr as lt, Jt as RelationsBuilderColumnBase, K as MigrationTableName, Kn as ConvexTextBuilder, Kr as isNull, Kt as OneConfig, L as MigrationDocContext, Ln as ConvexCheckConfig, Lr as endsWith, Lt as boolean, M as MigrationStatusArgs, Mn as rankIndex, Mr as LogicalExpression, Mt as ConvexBytesBuilder, N as MigrationAppliedState, Nn as searchIndex, Nr as UnaryExpression, Nt as ConvexBytesBuilderInitial, O as defineTriggers, On as ConvexVectorIndexBuilderOn, Or as BinaryExpression, Ot as arrayOf, P as MigrationDefinition, Pn as uniqueIndex, Pr as and, Pt as bytes, Q as DatabaseWithMutations, Qn as BuildQueryResult, Qr as notBetween, Qt as defineRelations, R as MigrationDriftIssue, Rn as ConvexForeignKeyBuilder, Rr as eq, Rt as ConvexBigIntBuilder, S as scheduledDeleteFactory, Sn as ConvexRankIndexBuilder, Sr as ReturningResult, St as ConvexDateBuilder, T as OrmTriggerChange, Tn as ConvexSearchIndexBuilderOn, Tr as VectorQueryConfig, Tt as date, U as MigrationSet, Un as check, Ur as inArray, Ut as CountBackfillStatusArgs, V as MigrationPlan, Vn as ConvexUniqueConstraintBuilderOn, Vr as gte, Vt as CountBackfillChunkArgs, W as MigrationStateMap, Wn as foreignKey, Wr as isFieldReference, Wt as ExtractTablesWithRelations, X as defineMigrationSet, Xn as AggregateFieldValue, Xr as ne, Xt as TableRelationalConfig, Y as defineMigration, Yn as AggregateConfig, Yr as lte, Yt as RelationsBuilderColumnConfig, Z as detectMigrationDrift, Zn as AggregateResult, Zr as not, Zt as TablesRelationalConfig, _ as OrmWriterCtx, _i as IsPrimaryKey, _n as rlsRole, _r as OrderByClause, _t as ConvexNumberBuilderInitial, a as TableConfigResult, ai as OrmSchemaPluginTables, an as OrmLifecycleChange, ar as InferInsertModel, at as extractRelationsConfig, b as scheduledMutationBatchFactory, bn as ConvexIndexBuilder, br as PredicateWhereIndexConfig, bt as ConvexIdBuilderInitial, c as OrmNotFoundError, ci as AnyColumn, cn as convexTable, cr as InsertValue, ct as vector, d as GenericOrmCtx, di as ColumnBuilderRuntimeConfig, dn as RlsPolicy, dr as MutationExecutionMode, dt as ConvexTimestampMode, ei as or, en as ConvexDeletionBuilder, er as CountConfig, et as OrmReader, f as OrmApiResult, fi as ColumnBuilderTypeConfig, fn as RlsPolicyConfig, fr as MutationPaginateConfig, ft as timestamp, g as OrmReaderCtx, gi as HasDefault, gn as RlsRoleConfig, gr as MutationRunMode, gt as ConvexNumberBuilder, h as OrmFunctions, hi as DrizzleEntity, hn as RlsRole, hr as MutationReturning, ht as textEnum, i as desc, ii as OrmSchemaPlugin, in as DiscriminatorBuilderConfig, ir as GetColumnData, it as EdgeMetadata, j as MigrationRunChunkArgs, jn as index, jr as FilterExpression, jt as objectOf, k as MigrationCancelArgs, kn as ConvexVectorIndexConfig, kr as ExpressionVisitor, kt as custom, l as CreateOrmOptions, li as ColumnBuilder, ln as deletion, lr as MutationExecuteConfig, lt as ConvexTimestampBuilder, m as OrmClientWithApi, mi as ColumnDataType, mn as rlsPolicy, mr as MutationResult, mt as ConvexTextEnumBuilderInitial, n as defineSchema, ni as Brand, nn as ConvexTable, nr as DBQueryConfig, nt as RlsContext, o as getTableColumns, oi as TableName, on as OrmLifecycleOperation, or as InferModelFromColumns, ot as ConvexVectorBuilder, p as OrmClientBase, pi as ColumnBuilderWithTableName, pn as RlsPolicyToOption, pr as MutationPaginatedResult, pt as ConvexTextEnumBuilder, q as MigrationWriteMode, qn as ConvexTextBuilderInitial, qr as like, qt as RelationsBuilder, r as asc, ri as Columns, rr as FilterOperators, rt as RlsMode, s as getTableConfig, si as SystemFields, sn as TableConfig, sr as InferSelectModel, st as ConvexVectorBuilderInitial, t as WhereClauseResult, ti as startsWith, tn as ConvexDeletionConfig, tr as CountResult, tt as OrmWriter, u as GenericOrm, ui as ColumnBuilderBaseConfig, un as discriminator, ur as MutationExecuteResult, ut as ConvexTimestampBuilderInitial, v as createOrm, vi as IsUnique, vn as ConvexAggregateIndexBuilder, vr as OrderDirection, vt as integer, w as OrmTableTriggers, wn as ConvexSearchIndexBuilder, wr as UpdateSet, wt as ConvexDateMode, x as ScheduledDeleteArgs, xn as ConvexIndexBuilderOn, xr as ReturningAll, xt as id, y as ScheduledMutationBatchArgs, yi as NotNull, yn as ConvexAggregateIndexBuilderOn, yr as PaginatedResult, yt as ConvexIdBuilder, z as MigrationManifestEntry, zn as ConvexForeignKeyConfig, zr as fieldRef, zt as ConvexBigIntBuilderInitial } from "../where-clause-compiler-UavDdMUX.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-ji7By8u0.js";
|
|
4
4
|
import { DefineSchemaOptions, GenericSchema, SchemaDefinition } from "convex/server";
|
|
5
|
-
export { type AggregateConfig, type AggregateFieldValue, type AggregateResult, type AnyColumn, type BinaryExpression, Brand, type BuildQueryResult, type BuildRelationResult, type ColumnBuilder, type ColumnBuilderBaseConfig, type ColumnBuilderRuntimeConfig, type ColumnBuilderTypeConfig, type ColumnBuilderWithTableName, type ColumnDataType, Columns, type ConvexAggregateIndexBuilder, type ConvexAggregateIndexBuilderOn, type ConvexBigIntBuilder, type ConvexBigIntBuilderInitial, type ConvexBooleanBuilder, type ConvexBooleanBuilderInitial, type ConvexBytesBuilder, type ConvexBytesBuilderInitial, type ConvexCheckBuilder, type ConvexCheckConfig, type ConvexCustomBuilder, type ConvexCustomBuilderInitial, type ConvexDateBuilder, type ConvexDateBuilderInitial, type ConvexDateMode, type ConvexDeletionBuilder, type ConvexDeletionConfig, type ConvexForeignKeyBuilder, type ConvexForeignKeyConfig, type ConvexIdBuilder, type ConvexIdBuilderInitial, type ConvexIndexBuilder, type ConvexIndexBuilderOn, type ConvexNumberBuilder, type ConvexNumberBuilderInitial, type ConvexRankIndexBuilder, type ConvexRankIndexBuilderOn, type ConvexSearchIndexBuilder, type ConvexSearchIndexBuilderOn, type ConvexSearchIndexConfig, type ConvexTable, type ConvexTextBuilder, type ConvexTextBuilderInitial, type ConvexTextEnumBuilder, type ConvexTextEnumBuilderInitial, type ConvexTimestampBuilder, type ConvexTimestampBuilderInitial, type ConvexTimestampMode, type ConvexUniqueConstraintBuilder, type ConvexUniqueConstraintBuilderOn, type ConvexUniqueConstraintConfig, type ConvexVectorBuilder, type ConvexVectorBuilderInitial, type ConvexVectorIndexBuilder, type ConvexVectorIndexBuilderOn, type ConvexVectorIndexConfig, type CountBackfillChunkArgs, type CountBackfillKickoffArgs, type CountBackfillStatusArgs, type CountConfig, type CountResult, type CreateOrmOptions, type DBQueryConfig, type DatabaseWithMutations, type DatabaseWithQuery, type DefineSchemaOptions, type DocByCtx, type DrizzleEntity, type EdgeMetadata, type ExpressionVisitor, type ExtractTablesWithRelations, type FieldReference, type FilterExpression, type FilterOperators, type GenericOrm, type GenericOrmCtx, type GenericSchema, type GetColumnData, type HasDefault, type InferInsertModel, type InferModelFromColumns, type InferSelectModel, type InsertValue, type IsPrimaryKey, type IsUnique, type LogicalExpression, type LookupByIdResultByCtx, type ManyConfig, type MigrationAppliedState, type MigrationCancelArgs, type MigrationDefinition, type MigrationDirection, type MigrationDoc, type MigrationDocContext, type MigrationDriftIssue, type MigrationManifestEntry, type MigrationMigrateOne, type MigrationPlan, type MigrationRunArgs, type MigrationRunChunkArgs, type MigrationRunStatus, type MigrationSet, type MigrationStateMap, type MigrationStatusArgs, type MigrationStep, type MigrationTableName, type MigrationWriteMode, type MutationExecuteConfig, type MutationExecuteResult, type MutationExecutionMode, type MutationPaginateConfig, type MutationPaginatedResult, type MutationResult, type MutationReturning, type MutationRunMode, type NotNull, type OneConfig, type OrderByClause, type OrderDirection, type OrmApiResult, type OrmBeforeResult, type OrmClientBase, type OrmClientWithApi, type OrmFunctions, type OrmLifecycleChange, type OrmLifecycleOperation, OrmNotFoundError, type OrmReader, type OrmReaderCtx, type OrmSchemaPlugin, OrmSchemaPluginTables, type OrmTableTriggers, type OrmTriggerChange, type OrmTriggerContext, type OrmTriggers, type OrmWriter, type OrmWriterCtx, type PaginatedResult, type PredicateWhereIndexConfig, type QueryCtxWithOptionalOrmQueryTable, type QueryCtxWithOrmQueryTable, type QueryCtxWithPreferredOrmQueryTable, type RelationsBuilder, type RelationsBuilderColumnBase, type RelationsBuilderColumnConfig, type ReturningAll, type ReturningResult, type ReturningSelection, type RlsContext, type RlsMode, RlsPolicy, type RlsPolicyConfig, type RlsPolicyToOption, RlsRole, type RlsRoleConfig, type ScheduledDeleteArgs, type ScheduledMutationBatchArgs, type SchemaDefinition, type SystemFields, type TableConfig, type TableConfigResult, TableName, type TableRelationalConfig, type TablesRelationalConfig, type UnaryExpression, type UpdateSet, type VectorQueryConfig, type VectorSearchProvider, type WhereClauseResult, aggregateIndex, and, arrayOf, asc, between, bigint, boolean, buildMigrationPlan, bytes, check, contains, convexTable, createOrm, custom, date, defineMigration, defineMigrationSet, defineRelations, defineRelationsPart, defineSchema, defineTriggers, deletion, deprecated, desc, detectMigrationDrift, endsWith, eq, extractRelationsConfig, fieldRef, foreignKey, getByIdWithOrmQueryFallback, getTableColumns, getTableConfig, gt, gte, id, ilike, inArray, index, integer, isFieldReference, isNotNull, isNull, json, like, lt, lte, ne, not, notBetween, notInArray, objectOf, or, pretend, pretendRequired, rankIndex, rlsPolicy, rlsRole, scheduledDeleteFactory, scheduledMutationBatchFactory, searchIndex, startsWith, text, textEnum, timestamp, unique, uniqueIndex, unsetToken, vector, vectorIndex };
|
|
5
|
+
export { type AggregateConfig, type AggregateFieldValue, type AggregateResult, type AnyColumn, type BinaryExpression, Brand, type BuildQueryResult, type BuildRelationResult, type ColumnBuilder, type ColumnBuilderBaseConfig, type ColumnBuilderRuntimeConfig, type ColumnBuilderTypeConfig, type ColumnBuilderWithTableName, type ColumnDataType, Columns, type ConvexAggregateIndexBuilder, type ConvexAggregateIndexBuilderOn, type ConvexBigIntBuilder, type ConvexBigIntBuilderInitial, type ConvexBooleanBuilder, type ConvexBooleanBuilderInitial, type ConvexBytesBuilder, type ConvexBytesBuilderInitial, type ConvexCheckBuilder, type ConvexCheckConfig, type ConvexCustomBuilder, type ConvexCustomBuilderInitial, type ConvexDateBuilder, type ConvexDateBuilderInitial, type ConvexDateMode, type ConvexDeletionBuilder, type ConvexDeletionConfig, type ConvexForeignKeyBuilder, type ConvexForeignKeyConfig, type ConvexIdBuilder, type ConvexIdBuilderInitial, type ConvexIndexBuilder, type ConvexIndexBuilderOn, type ConvexNumberBuilder, type ConvexNumberBuilderInitial, type ConvexRankIndexBuilder, type ConvexRankIndexBuilderOn, type ConvexSearchIndexBuilder, type ConvexSearchIndexBuilderOn, type ConvexSearchIndexConfig, type ConvexTable, type ConvexTextBuilder, type ConvexTextBuilderInitial, type ConvexTextEnumBuilder, type ConvexTextEnumBuilderInitial, type ConvexTimestampBuilder, type ConvexTimestampBuilderInitial, type ConvexTimestampMode, type ConvexUniqueConstraintBuilder, type ConvexUniqueConstraintBuilderOn, type ConvexUniqueConstraintConfig, type ConvexVectorBuilder, type ConvexVectorBuilderInitial, type ConvexVectorIndexBuilder, type ConvexVectorIndexBuilderOn, type ConvexVectorIndexConfig, type CountBackfillChunkArgs, type CountBackfillKickoffArgs, type CountBackfillStatusArgs, type CountConfig, type CountResult, type CreateOrmOptions, type DBQueryConfig, type DatabaseWithMutations, type DatabaseWithQuery, type DefineSchemaOptions, type DiscriminatorBuilderConfig, type DocByCtx, type DrizzleEntity, type EdgeMetadata, type ExpressionVisitor, type ExtractTablesWithRelations, type FieldReference, type FilterExpression, type FilterOperators, type GenericOrm, type GenericOrmCtx, type GenericSchema, type GetColumnData, type HasDefault, type InferInsertModel, type InferModelFromColumns, type InferSelectModel, type InsertValue, type IsPrimaryKey, type IsUnique, type LogicalExpression, type LookupByIdResultByCtx, type ManyConfig, type MigrationAppliedState, type MigrationCancelArgs, type MigrationDefinition, type MigrationDirection, type MigrationDoc, type MigrationDocContext, type MigrationDriftIssue, type MigrationManifestEntry, type MigrationMigrateOne, type MigrationPlan, type MigrationRunArgs, type MigrationRunChunkArgs, type MigrationRunStatus, type MigrationSet, type MigrationStateMap, type MigrationStatusArgs, type MigrationStep, type MigrationTableName, type MigrationWriteMode, type MutationExecuteConfig, type MutationExecuteResult, type MutationExecutionMode, type MutationPaginateConfig, type MutationPaginatedResult, type MutationResult, type MutationReturning, type MutationRunMode, type NotNull, type OneConfig, type OrderByClause, type OrderDirection, type OrmApiResult, type OrmBeforeResult, type OrmClientBase, type OrmClientWithApi, type OrmFunctions, type OrmLifecycleChange, type OrmLifecycleOperation, OrmNotFoundError, type OrmReader, type OrmReaderCtx, type OrmSchemaPlugin, OrmSchemaPluginTables, type OrmTableTriggers, type OrmTriggerChange, type OrmTriggerContext, type OrmTriggers, type OrmWriter, type OrmWriterCtx, type PaginatedResult, type PredicateWhereIndexConfig, type QueryCtxWithOptionalOrmQueryTable, type QueryCtxWithOrmQueryTable, type QueryCtxWithPreferredOrmQueryTable, type RelationsBuilder, type RelationsBuilderColumnBase, type RelationsBuilderColumnConfig, type ReturningAll, type ReturningResult, type ReturningSelection, type RlsContext, type RlsMode, RlsPolicy, type RlsPolicyConfig, type RlsPolicyToOption, RlsRole, type RlsRoleConfig, type ScheduledDeleteArgs, type ScheduledMutationBatchArgs, type SchemaDefinition, type SystemFields, type TableConfig, type TableConfigResult, TableName, type TableRelationalConfig, type TablesRelationalConfig, type UnaryExpression, type UpdateSet, type VectorQueryConfig, type VectorSearchProvider, type WhereClauseResult, aggregateIndex, and, arrayOf, asc, between, bigint, boolean, buildMigrationPlan, bytes, check, contains, convexTable, createOrm, custom, date, defineMigration, defineMigrationSet, defineRelations, defineRelationsPart, defineSchema, defineTriggers, deletion, deprecated, desc, detectMigrationDrift, discriminator, endsWith, eq, extractRelationsConfig, fieldRef, foreignKey, getByIdWithOrmQueryFallback, getTableColumns, getTableConfig, gt, gte, id, ilike, inArray, index, integer, isFieldReference, isNotNull, isNull, json, like, lt, lte, ne, not, notBetween, notInArray, objectOf, or, pretend, pretendRequired, rankIndex, rlsPolicy, rlsRole, scheduledDeleteFactory, scheduledMutationBatchFactory, searchIndex, startsWith, text, textEnum, timestamp, unique, uniqueIndex, unsetToken, vector, vectorIndex };
|
package/dist/orm/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as DirectAggregate } from "../runtime-
|
|
2
|
-
import { C as
|
|
3
|
-
import { a as AGGREGATE_EXTREMA_TABLE, c as aggregatePlugin, i as AGGREGATE_BUCKET_TABLE, l as boolean, n as MIGRATION_STATE_TABLE, o as AGGREGATE_MEMBER_TABLE, r as migrationPlugin, s as AGGREGATE_STATE_TABLE, t as MIGRATION_RUN_TABLE } from "../schema-
|
|
1
|
+
import { t as DirectAggregate } from "../runtime-B20PP4Qr.js";
|
|
2
|
+
import { C as text, D as entityKind, E as ConvexColumnBuilder, S as vectorIndex, T as integer, _ as aggregateIndex, a as Columns, b as searchIndex, c as OrmSchemaDefinition, d as RlsPolicies, f as TableDeleteConfig, g as rlsPolicy, h as RlsPolicy, i as Brand, l as OrmSchemaOptions, m as TablePolymorphic, n as deletion, o as EnableRLS, p as TableName, r as discriminator, s as OrmContext, t as convexTable, u as OrmSchemaPluginTables, v as index, w as createSystemFields, x as uniqueIndex, y as rankIndex } from "../table-Bxqm450r.js";
|
|
3
|
+
import { a as AGGREGATE_EXTREMA_TABLE, c as aggregatePlugin, i as AGGREGATE_BUCKET_TABLE, l as boolean, n as MIGRATION_STATE_TABLE, o as AGGREGATE_MEMBER_TABLE, r as migrationPlugin, s as AGGREGATE_STATE_TABLE, t as MIGRATION_RUN_TABLE } from "../schema-Cw5-LWTg.js";
|
|
4
4
|
import { a as pretendRequired, i as pretend, n as deprecated } from "../validators-D_i3BK7v.js";
|
|
5
|
-
import { a as objectOf, i as json, n as arrayOf, r as custom, t as id } from "../id-
|
|
6
|
-
import { t as textEnum } from "../text-enum-
|
|
5
|
+
import { a as objectOf, i as json, n as arrayOf, r as custom, t as id } from "../id-BF_SaWhQ.js";
|
|
6
|
+
import { t as textEnum } from "../text-enum-KyijdQ8Q.js";
|
|
7
7
|
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-DEUFBhXS.js";
|
|
8
8
|
import { v } from "convex/values";
|
|
9
9
|
import { defineSchema as defineSchema$1, internalActionGeneric, internalMutationGeneric } from "convex/server";
|
|
@@ -2485,6 +2485,36 @@ function getColumnName$1(column) {
|
|
|
2485
2485
|
function getTableColumns$2(table) {
|
|
2486
2486
|
return table[Columns] ?? {};
|
|
2487
2487
|
}
|
|
2488
|
+
function getTablePolymorphicConfigs(table) {
|
|
2489
|
+
const fromMethod = table.getPolymorphicConfigs?.();
|
|
2490
|
+
if (Array.isArray(fromMethod)) return fromMethod;
|
|
2491
|
+
const fromSymbol = table[TablePolymorphic];
|
|
2492
|
+
return Array.isArray(fromSymbol) ? fromSymbol : [];
|
|
2493
|
+
}
|
|
2494
|
+
function enforcePolymorphicWrite(table, candidate, options) {
|
|
2495
|
+
const configs = getTablePolymorphicConfigs(table);
|
|
2496
|
+
if (configs.length === 0) return;
|
|
2497
|
+
for (const config of configs) {
|
|
2498
|
+
const changedFields = options?.changedFields;
|
|
2499
|
+
const discriminatorChanged = !changedFields || changedFields.has(config.discriminator);
|
|
2500
|
+
const generatedFieldChanged = !changedFields || config.generatedFieldNames.some((fieldName) => changedFields.has(fieldName));
|
|
2501
|
+
if (!discriminatorChanged && !generatedFieldChanged) continue;
|
|
2502
|
+
const discriminatorValue = candidate[config.discriminator];
|
|
2503
|
+
if (typeof discriminatorValue !== "string" || !Object.hasOwn(config.variants, discriminatorValue)) throw new Error(`Invalid discriminator '${config.discriminator}' on '${getTableName(table)}'. Expected one of: ${Object.keys(config.variants).join(", ")}.`);
|
|
2504
|
+
const activeVariant = config.variants[discriminatorValue];
|
|
2505
|
+
if (!activeVariant) throw new Error(`Invalid discriminator '${config.discriminator}' value '${discriminatorValue}' on '${getTableName(table)}'.`);
|
|
2506
|
+
for (const requiredFieldName of activeVariant.requiredFieldNames) {
|
|
2507
|
+
const value = candidate[requiredFieldName];
|
|
2508
|
+
if (value === null || value === void 0) throw new Error(`discriminator branch '${discriminatorValue}' requires '${requiredFieldName}' on '${getTableName(table)}'.`);
|
|
2509
|
+
}
|
|
2510
|
+
const activeFieldSet = new Set(activeVariant.fieldNames);
|
|
2511
|
+
for (const generatedFieldName of config.generatedFieldNames) {
|
|
2512
|
+
if (activeFieldSet.has(generatedFieldName)) continue;
|
|
2513
|
+
const value = candidate[generatedFieldName];
|
|
2514
|
+
if (value !== null && value !== void 0) throw new Error(`discriminator branch '${discriminatorValue}' cannot set '${generatedFieldName}' on '${getTableName(table)}' because it belongs to another variant.`);
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2488
2518
|
function getColumnConfig(table, columnName) {
|
|
2489
2519
|
const builder = getTableColumns$2(table)[columnName];
|
|
2490
2520
|
if (!builder) return null;
|
|
@@ -2494,8 +2524,20 @@ function applyDefaults(table, value) {
|
|
|
2494
2524
|
const columns = table[Columns];
|
|
2495
2525
|
if (!columns) return value;
|
|
2496
2526
|
const result = { ...value };
|
|
2527
|
+
const polymorphicConfigs = getTablePolymorphicConfigs(table);
|
|
2528
|
+
const activeGeneratedFields = /* @__PURE__ */ new Set();
|
|
2529
|
+
const generatedFields = /* @__PURE__ */ new Set();
|
|
2530
|
+
for (const config of polymorphicConfigs) {
|
|
2531
|
+
for (const fieldName of config.generatedFieldNames) generatedFields.add(fieldName);
|
|
2532
|
+
const discriminatorValue = result[config.discriminator];
|
|
2533
|
+
if (typeof discriminatorValue !== "string") continue;
|
|
2534
|
+
const activeVariant = config.variants[discriminatorValue];
|
|
2535
|
+
if (!activeVariant) continue;
|
|
2536
|
+
for (const fieldName of activeVariant.fieldNames) activeGeneratedFields.add(fieldName);
|
|
2537
|
+
}
|
|
2497
2538
|
for (const [columnName, builder] of Object.entries(columns)) {
|
|
2498
2539
|
if (result[columnName] !== void 0) continue;
|
|
2540
|
+
if (generatedFields.has(columnName) && !activeGeneratedFields.has(columnName)) continue;
|
|
2499
2541
|
const config = builder.config;
|
|
2500
2542
|
if (!config) continue;
|
|
2501
2543
|
if (typeof config.defaultFn === "function") {
|
|
@@ -4816,85 +4858,57 @@ var GelRelationalQuery = class extends QueryPromise {
|
|
|
4816
4858
|
return filtered;
|
|
4817
4859
|
}
|
|
4818
4860
|
_resolvePolymorphicFinalizeState() {
|
|
4819
|
-
const
|
|
4820
|
-
if (
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
const
|
|
4825
|
-
|
|
4826
|
-
if (
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
const
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
effectiveWith: Object.keys(effectiveWith).length ? effectiveWith : void 0,
|
|
4849
|
-
autoLoadedCaseRelations,
|
|
4850
|
-
discriminator,
|
|
4851
|
-
alias,
|
|
4852
|
-
cases,
|
|
4853
|
-
schema
|
|
4854
|
-
};
|
|
4855
|
-
}
|
|
4856
|
-
_extractPolymorphicSchemaErrorMessage(error) {
|
|
4857
|
-
if (!error || typeof error !== "object") return String(error);
|
|
4858
|
-
const issueMessage = error.issues?.[0]?.message;
|
|
4859
|
-
if (issueMessage) return issueMessage;
|
|
4860
|
-
return error.message ?? String(error);
|
|
4861
|
-
}
|
|
4862
|
-
_synthesizePolymorphicRows(rows, config) {
|
|
4863
|
-
for (const row of rows) {
|
|
4861
|
+
const configs = this.tableConfig.polymorphic;
|
|
4862
|
+
if (!configs || configs.length === 0) return null;
|
|
4863
|
+
return { configs };
|
|
4864
|
+
}
|
|
4865
|
+
_resolveWithVariantsState(requestedWith, polymorphicState) {
|
|
4866
|
+
const withVariants = this.config.withVariants;
|
|
4867
|
+
if (withVariants === void 0 || withVariants === false) return { effectiveWith: requestedWith };
|
|
4868
|
+
if (withVariants !== true) throw new Error("withVariants currently supports only `true`.");
|
|
4869
|
+
if (!polymorphicState) throw new Error(`withVariants is only available on tables with discriminator(...) columns ('${this.tableConfig.name}').`);
|
|
4870
|
+
const oneRelations = Object.entries(this.tableConfig.relations).filter(([, relation]) => relation.relationType === "one");
|
|
4871
|
+
if (oneRelations.length === 0) return { effectiveWith: requestedWith };
|
|
4872
|
+
const autoWith = Object.fromEntries(oneRelations.map(([relationName]) => [relationName, true]));
|
|
4873
|
+
return { effectiveWith: requestedWith ? {
|
|
4874
|
+
...autoWith,
|
|
4875
|
+
...requestedWith
|
|
4876
|
+
} : autoWith };
|
|
4877
|
+
}
|
|
4878
|
+
_assertPolymorphicAliasCollisions(configs, requestedWith, resolvedExtras) {
|
|
4879
|
+
const tableColumns = this._getColumns(this.tableConfig);
|
|
4880
|
+
const extras = this._isRecord(resolvedExtras) ? resolvedExtras : void 0;
|
|
4881
|
+
for (const config of configs) {
|
|
4882
|
+
if (config.alias in tableColumns) throw new Error(`discriminator alias '${config.alias}' on '${this.tableConfig.name}' conflicts with an existing column.`);
|
|
4883
|
+
if (config.alias in this.tableConfig.relations) throw new Error(`discriminator alias '${config.alias}' on '${this.tableConfig.name}' conflicts with a relation.`);
|
|
4884
|
+
if (requestedWith && config.alias in requestedWith) throw new Error(`discriminator alias '${config.alias}' on '${this.tableConfig.name}' conflicts with with.${config.alias}.`);
|
|
4885
|
+
if (extras && config.alias in extras) throw new Error(`discriminator alias '${config.alias}' on '${this.tableConfig.name}' conflicts with extras.${config.alias}.`);
|
|
4886
|
+
}
|
|
4887
|
+
}
|
|
4888
|
+
_synthesizePolymorphicRows(rows, configs) {
|
|
4889
|
+
for (const row of rows) for (const config of configs) {
|
|
4864
4890
|
const discriminatorValue = row[config.discriminator];
|
|
4865
4891
|
const caseKey = String(discriminatorValue);
|
|
4866
|
-
const
|
|
4867
|
-
if (!
|
|
4868
|
-
const
|
|
4869
|
-
|
|
4870
|
-
row[config.alias] =
|
|
4871
|
-
const payload = {
|
|
4872
|
-
[config.discriminator]: discriminatorValue,
|
|
4873
|
-
[config.alias]: targetValue
|
|
4874
|
-
};
|
|
4875
|
-
if (typeof config.schema.safeParse === "function") {
|
|
4876
|
-
const result = config.schema.safeParse(payload);
|
|
4877
|
-
if (!result.success) throw new Error(`polymorphic schema parse failed: ${this._extractPolymorphicSchemaErrorMessage(result.error)}`);
|
|
4878
|
-
} else if (typeof config.schema.parse === "function") try {
|
|
4879
|
-
config.schema.parse(payload);
|
|
4880
|
-
} catch (error) {
|
|
4881
|
-
throw new Error(`polymorphic schema parse failed: ${this._extractPolymorphicSchemaErrorMessage(error)}`);
|
|
4882
|
-
}
|
|
4883
|
-
}
|
|
4884
|
-
for (const relationName of config.autoLoadedCaseRelations) {
|
|
4885
|
-
if (relationName === config.alias) continue;
|
|
4886
|
-
for (const row of rows) delete row[relationName];
|
|
4892
|
+
const variant = config.variants[caseKey];
|
|
4893
|
+
if (!variant) throw new Error(`discriminator '${config.discriminator}' value '${caseKey}' has no matching variant on '${this.tableConfig.name}'.`);
|
|
4894
|
+
const nested = {};
|
|
4895
|
+
for (const fieldName of variant.fieldNames) nested[fieldName] = row[fieldName];
|
|
4896
|
+
row[config.alias] = nested;
|
|
4887
4897
|
}
|
|
4888
4898
|
}
|
|
4889
4899
|
async _finalizeRows(rows) {
|
|
4890
4900
|
const polymorphicState = this._resolvePolymorphicFinalizeState();
|
|
4891
|
-
const requestedWith =
|
|
4892
|
-
const effectiveWith =
|
|
4901
|
+
const requestedWith = this.config.with;
|
|
4902
|
+
const effectiveWith = this._resolveWithVariantsState(requestedWith, polymorphicState).effectiveWith;
|
|
4903
|
+
const tableColumns = this._getColumns(this.tableConfig);
|
|
4904
|
+
const extrasConfig = this.config.extras;
|
|
4905
|
+
const resolvedExtras = typeof extrasConfig === "function" ? extrasConfig(tableColumns) : extrasConfig;
|
|
4906
|
+
if (polymorphicState) this._assertPolymorphicAliasCollisions(polymorphicState.configs, requestedWith, resolvedExtras);
|
|
4893
4907
|
let rowsWithRelations = rows;
|
|
4894
4908
|
if (effectiveWith) rowsWithRelations = await this._loadRelations(rowsWithRelations, effectiveWith, 0, 3, this.edgeMetadata, this.tableConfig);
|
|
4895
|
-
if (polymorphicState) this._synthesizePolymorphicRows(rowsWithRelations, polymorphicState);
|
|
4896
|
-
if (
|
|
4897
|
-
return this._selectColumns(rowsWithRelations, this.config.columns,
|
|
4909
|
+
if (polymorphicState) this._synthesizePolymorphicRows(rowsWithRelations, polymorphicState.configs);
|
|
4910
|
+
if (resolvedExtras) rowsWithRelations = this._applyExtras(rowsWithRelations, resolvedExtras, tableColumns, effectiveWith, this.tableConfig.name, this.tableConfig);
|
|
4911
|
+
return this._selectColumns(rowsWithRelations, this.config.columns, tableColumns, this.tableConfig);
|
|
4898
4912
|
}
|
|
4899
4913
|
_getSchemaDefinitionOrThrow() {
|
|
4900
4914
|
const schemaDefinition = this.schema[OrmSchemaDefinition];
|
|
@@ -6036,7 +6050,6 @@ var GelRelationalQuery = class extends QueryPromise {
|
|
|
6036
6050
|
if (config.with !== void 0) throw new Error("pipeline cannot be combined with with in findMany().");
|
|
6037
6051
|
if (config.extras !== void 0) throw new Error("pipeline cannot be combined with extras in findMany().");
|
|
6038
6052
|
if (config.columns !== void 0) throw new Error("pipeline cannot be combined with columns in findMany().");
|
|
6039
|
-
if (config.polymorphic !== void 0) throw new Error("pipeline cannot be combined with polymorphic in findMany().");
|
|
6040
6053
|
}
|
|
6041
6054
|
if (pageByKey) {
|
|
6042
6055
|
if (this.mode !== "many") throw new Error("pageByKey is only supported on findMany().");
|
|
@@ -7534,6 +7547,7 @@ var ConvexInsertBuilder = class extends QueryPromise {
|
|
|
7534
7547
|
const results = [];
|
|
7535
7548
|
for (const value of this.valuesList) {
|
|
7536
7549
|
const preparedValue = normalizeDateFieldsForWrite(this.table, applyDefaults(this.table, value));
|
|
7550
|
+
enforcePolymorphicWrite(this.table, preparedValue);
|
|
7537
7551
|
const rls = ormContext?.rls;
|
|
7538
7552
|
const tableName = getTableName(this.table);
|
|
7539
7553
|
if (!await canInsertRow({
|
|
@@ -8265,27 +8279,18 @@ var RelationalQueryBuilder = class RelationalQueryBuilder {
|
|
|
8265
8279
|
return new GelRankQuery(this.db, this.tableConfig, indexName, config, this.rls);
|
|
8266
8280
|
}
|
|
8267
8281
|
findMany(config) {
|
|
8268
|
-
if (config && config.pipeline !== void 0) {
|
|
8269
|
-
if (config.polymorphic !== void 0) throw new Error("polymorphic cannot be combined with pipeline in findMany().");
|
|
8270
|
-
throw new Error("findMany({ pipeline }) is removed; use db.query.<table>.select() chain instead");
|
|
8271
|
-
}
|
|
8282
|
+
if (config && config.pipeline !== void 0) throw new Error("findMany({ pipeline }) is removed; use db.query.<table>.select() chain instead");
|
|
8272
8283
|
return this.createQuery(config ? config : {}, "many");
|
|
8273
8284
|
}
|
|
8274
8285
|
findFirst(config) {
|
|
8275
|
-
if (config && config.pipeline !== void 0) {
|
|
8276
|
-
if (config.polymorphic !== void 0) throw new Error("polymorphic cannot be combined with pipeline in findFirst().");
|
|
8277
|
-
throw new Error("findMany({ pipeline }) is removed; use db.query.<table>.select() chain instead");
|
|
8278
|
-
}
|
|
8286
|
+
if (config && config.pipeline !== void 0) throw new Error("findMany({ pipeline }) is removed; use db.query.<table>.select() chain instead");
|
|
8279
8287
|
return this.createQuery({
|
|
8280
8288
|
...config ? config : {},
|
|
8281
8289
|
limit: 1
|
|
8282
8290
|
}, "first");
|
|
8283
8291
|
}
|
|
8284
8292
|
findFirstOrThrow(config) {
|
|
8285
|
-
if (config && config.pipeline !== void 0) {
|
|
8286
|
-
if (config.polymorphic !== void 0) throw new Error("polymorphic cannot be combined with pipeline in findFirstOrThrow().");
|
|
8287
|
-
throw new Error("findMany({ pipeline }) is removed; use db.query.<table>.select() chain instead");
|
|
8288
|
-
}
|
|
8293
|
+
if (config && config.pipeline !== void 0) throw new Error("findMany({ pipeline }) is removed; use db.query.<table>.select() chain instead");
|
|
8289
8294
|
return this.createQuery({
|
|
8290
8295
|
...config ? config : {},
|
|
8291
8296
|
limit: 1
|
|
@@ -8593,6 +8598,7 @@ var ConvexUpdateBuilder = class extends QueryPromise {
|
|
|
8593
8598
|
const fkBatchSize = isPaginated ? pagination.limit : batchSize;
|
|
8594
8599
|
for (const { row, updatedRow, decision } of updates) {
|
|
8595
8600
|
if (!decision.allowed) continue;
|
|
8601
|
+
enforcePolymorphicWrite(this.table, updatedRow, { changedFields: new Set(Object.keys(effectiveSet)) });
|
|
8596
8602
|
enforceCheckConstraints(this.table, updatedRow);
|
|
8597
8603
|
await enforceForeignKeys(this.db, this.table, updatedRow, { changedFields: new Set(Object.keys(effectiveSet)) });
|
|
8598
8604
|
await applyIncomingForeignKeyActionsOnUpdate(this.db, this.table, row, updatedRow, {
|
|
@@ -9974,6 +9980,7 @@ function buildRelations(tables, config, strict, defaults) {
|
|
|
9974
9980
|
for (const [tsName, table] of Object.entries(tables)) tablesConfig[tsName] = {
|
|
9975
9981
|
table,
|
|
9976
9982
|
name: tsName,
|
|
9983
|
+
polymorphic: table[TablePolymorphic],
|
|
9977
9984
|
relations: config[tsName] ?? {},
|
|
9978
9985
|
strict,
|
|
9979
9986
|
defaults
|
|
@@ -9987,6 +9994,7 @@ function buildRelationsParts(tables, config, strict, defaults) {
|
|
|
9987
9994
|
tablesConfig[tsName] = {
|
|
9988
9995
|
table: tables[tsName],
|
|
9989
9996
|
name: tsName,
|
|
9997
|
+
polymorphic: tables[tsName][TablePolymorphic],
|
|
9990
9998
|
relations,
|
|
9991
9999
|
strict,
|
|
9992
10000
|
defaults
|
|
@@ -10234,4 +10242,4 @@ function defineSchema(schema, options) {
|
|
|
10234
10242
|
}
|
|
10235
10243
|
|
|
10236
10244
|
//#endregion
|
|
10237
|
-
export { Brand, Columns, OrmNotFoundError, OrmSchemaPluginTables, RlsPolicy, RlsRole, TableName, aggregateIndex, and, arrayOf, asc, between, bigint, boolean, buildMigrationPlan, bytes, check, contains, convexTable, createOrm, custom, date, defineMigration, defineMigrationSet, defineRelations, defineRelationsPart, defineSchema, defineTriggers, deletion, deprecated, desc, detectMigrationDrift, endsWith, eq, extractRelationsConfig, fieldRef, foreignKey, getByIdWithOrmQueryFallback, getTableColumns, getTableConfig, gt, gte, id, ilike, inArray, index, integer, isFieldReference, isNotNull, isNull, json, like, lt, lte, ne, not, notBetween, notInArray, objectOf, or, pretend, pretendRequired, rankIndex, rlsPolicy, rlsRole, scheduledDeleteFactory, scheduledMutationBatchFactory, searchIndex, startsWith, text, textEnum, timestamp, unique, uniqueIndex, unsetToken, vector, vectorIndex };
|
|
10245
|
+
export { Brand, Columns, OrmNotFoundError, OrmSchemaPluginTables, RlsPolicy, RlsRole, TableName, aggregateIndex, and, arrayOf, asc, between, bigint, boolean, buildMigrationPlan, bytes, check, contains, convexTable, createOrm, custom, date, defineMigration, defineMigrationSet, defineRelations, defineRelationsPart, defineSchema, defineTriggers, deletion, deprecated, desc, detectMigrationDrift, discriminator, endsWith, eq, extractRelationsConfig, fieldRef, foreignKey, getByIdWithOrmQueryFallback, getTableColumns, getTableConfig, gt, gte, id, ilike, inArray, index, integer, isFieldReference, isNotNull, isNull, json, like, lt, lte, ne, not, notBetween, notInArray, objectOf, or, pretend, pretendRequired, rankIndex, rlsPolicy, rlsRole, scheduledDeleteFactory, scheduledMutationBatchFactory, searchIndex, startsWith, text, textEnum, timestamp, unique, uniqueIndex, unsetToken, vector, vectorIndex };
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../orm/index.js";
|
|
1
|
+
import { ii as OrmSchemaPlugin } from "../where-clause-compiler-UavDdMUX.js";
|
|
3
2
|
|
|
3
|
+
//#region src/orm/migrations/schema.d.ts
|
|
4
|
+
declare function migrationPlugin(): OrmSchemaPlugin;
|
|
5
|
+
//#endregion
|
|
4
6
|
//#region src/orm/aggregate-index/schema.d.ts
|
|
5
7
|
declare function aggregatePlugin(): OrmSchemaPlugin;
|
|
6
8
|
//#endregion
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../orm/index.js";
|
|
1
|
+
import { ii as OrmSchemaPlugin } from "../../where-clause-compiler-UavDdMUX.js";
|
|
3
2
|
import * as convex_server0 from "convex/server";
|
|
4
3
|
|
|
5
4
|
//#region src/plugins/ratelimit/duration.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { t as textEnum } from "../../text-enum-
|
|
1
|
+
import { C as text, T as integer, t as convexTable, v as index } from "../../table-Bxqm450r.js";
|
|
2
|
+
import { t as textEnum } from "../../text-enum-KyijdQ8Q.js";
|
|
3
3
|
import { v } from "convex/values";
|
|
4
4
|
import { mutationGeneric, queryGeneric } from "convex/server";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { r as custom, t as id } from "./id-
|
|
1
|
+
import { C as text, T as integer, t as convexTable, v as index } from "./table-Bxqm450r.js";
|
|
2
|
+
import { r as custom, t as id } from "./id-BF_SaWhQ.js";
|
|
3
3
|
import { ConvexError, convexToJson, jsonToConvex, v } from "convex/values";
|
|
4
4
|
|
|
5
5
|
//#region src/aggregate-core/compare.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { r as custom, t as id } from "./id-
|
|
1
|
+
import { C as text, D as entityKind, E as ConvexColumnBuilder, T as integer, t as convexTable, v as index } from "./table-Bxqm450r.js";
|
|
2
|
+
import { r as custom, t as id } from "./id-BF_SaWhQ.js";
|
|
3
3
|
import { v } from "convex/values";
|
|
4
4
|
|
|
5
5
|
//#region src/orm/builders/boolean.ts
|