better-convex 0.7.2 → 0.8.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.
Files changed (48) hide show
  1. package/dist/aggregate/index.d.ts +1 -1
  2. package/dist/aggregate/index.js +1 -1
  3. package/dist/auth/http/index.d.ts +1 -1
  4. package/dist/auth/index.d.ts +10 -10
  5. package/dist/auth/index.js +5 -4
  6. package/dist/auth/nextjs/index.d.ts +2 -2
  7. package/dist/auth/nextjs/index.js +2 -2
  8. package/dist/{caller-factory-D3OuR1eI.js → caller-factory-CCsm4Dut.js} +2 -2
  9. package/dist/cli.mjs +414 -5
  10. package/dist/{codegen-Cz1idI3-.mjs → codegen-BS36cYTH.mjs} +88 -5
  11. package/dist/{create-schema-orm-69VF4CFV.js → create-schema-orm-OcyA0apQ.js} +10 -13
  12. package/dist/crpc/index.d.ts +2 -2
  13. package/dist/crpc/index.js +3 -3
  14. package/dist/customFunctions-RnzME_cJ.js +167 -0
  15. package/dist/{http-types-BCf2wCgp.d.ts → http-types-BK7FuIcR.d.ts} +1 -1
  16. package/dist/id-BcBb900m.js +121 -0
  17. package/dist/orm/index.d.ts +4 -3
  18. package/dist/orm/index.js +706 -165
  19. package/dist/plugins/index.d.ts +9 -0
  20. package/dist/plugins/index.js +3 -0
  21. package/dist/plugins/ratelimit/index.d.ts +222 -0
  22. package/dist/plugins/ratelimit/index.js +846 -0
  23. package/dist/plugins/ratelimit/react/index.d.ts +76 -0
  24. package/dist/plugins/ratelimit/react/index.js +294 -0
  25. package/dist/{procedure-caller-CcjtUFvL.d.ts → procedure-caller-DYjpq7rG.d.ts} +4 -19
  26. package/dist/rsc/index.d.ts +3 -3
  27. package/dist/rsc/index.js +4 -4
  28. package/dist/runtime-C0WcYGY0.js +1028 -0
  29. package/dist/schema-Bx6j2doh.js +204 -0
  30. package/dist/server/index.d.ts +2 -2
  31. package/dist/server/index.js +4 -3
  32. package/dist/{runtime-B9xQFY8W.js → table-B7yzBihE.js} +3 -1088
  33. package/dist/text-enum-CFdcLUuw.js +30 -0
  34. package/dist/{types-CIBGEYXq.d.ts → types-f53SgpBL.d.ts} +1 -1
  35. package/dist/validators-BcQFm1oY.d.ts +88 -0
  36. package/dist/{customFunctions-CZnCwoR3.js → validators-D_i3BK7v.js} +67 -165
  37. package/dist/watcher.mjs +1 -1
  38. package/dist/{where-clause-compiler-CRP-i1Qa.d.ts → where-clause-compiler-BIjTkVVJ.d.ts} +138 -2
  39. package/package.json +4 -1
  40. /package/dist/{create-schema-BdZOL6ns.js → create-schema-BsN0jL5S.js} +0 -0
  41. /package/dist/{error-Be4OcwwD.js → error-CAGGSN5H.js} +0 -0
  42. /package/dist/{meta-utils-DDVYp9Xf.js → meta-utils-NRyocOSc.js} +0 -0
  43. /package/dist/{query-context-BDSis9rT.js → query-context-DEUFBhXS.js} +0 -0
  44. /package/dist/{query-context-DGExXZIV.d.ts → query-context-ji7By8u0.d.ts} +0 -0
  45. /package/dist/{query-options-B0c1b6pZ.js → query-options-CSCmKYdJ.js} +0 -0
  46. /package/dist/{transformer-Dh0w2py0.js → transformer-ogg-4d78.js} +0 -0
  47. /package/dist/{types-DwGkkq2s.d.ts → types-BTb_4BaU.d.ts} +0 -0
  48. /package/dist/{types-DgwvxKbT.d.ts → types-CM67ko7K.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { Ft as ConvexTableWithColumns, J as ConvexTextBuilderInitial, Z as ConvexNumberBuilderInitial, et as ConvexIdBuilderInitial, st as ConvexCustomBuilderInitial } from "../where-clause-compiler-CRP-i1Qa.js";
1
+ import { At as ConvexCustomBuilderInitial, Ct as ConvexIdBuilderInitial, _t as ConvexTextBuilderInitial, bt as ConvexNumberBuilderInitial, on as ConvexTableWithColumns } from "../where-clause-compiler-BIjTkVVJ.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,4 +1,4 @@
1
- import { n as TableAggregate$1, r as aggregateStorageTables, t as DirectAggregate$1 } from "../runtime-B9xQFY8W.js";
1
+ import { n as TableAggregate$1, r as aggregateStorageTables, t as DirectAggregate$1 } from "../runtime-C0WcYGY0.js";
2
2
 
3
3
  //#region src/aggregate/index.ts
4
4
  const wrapTriggerFactory = (methodName, factory) => ((...args) => {
@@ -1,4 +1,4 @@
1
- import { t as GetAuth } from "../../types-DgwvxKbT.js";
1
+ import { t as GetAuth } from "../../types-CM67ko7K.js";
2
2
  import { HttpRouter } from "convex/server";
3
3
  import { MiddlewareHandler } from "hono";
4
4
 
@@ -1,7 +1,7 @@
1
- import { a as QueryCtxWithPreferredOrmQueryTable, n as LookupByIdResultByCtx, t as DocByCtx } from "../query-context-DGExXZIV.js";
2
- import { t as GetAuth } from "../types-DgwvxKbT.js";
3
- import { A as GenericCtx } from "../procedure-caller-CcjtUFvL.js";
4
- import "../http-types-BCf2wCgp.js";
1
+ import { a as QueryCtxWithPreferredOrmQueryTable, n as LookupByIdResultByCtx, t as DocByCtx } from "../query-context-ji7By8u0.js";
2
+ import { t as GetAuth } from "../types-CM67ko7K.js";
3
+ import { A as GenericCtx } from "../procedure-caller-DYjpq7rG.js";
4
+ import "../http-types-BK7FuIcR.js";
5
5
  import "../server/index.js";
6
6
  import * as convex_values0 from "convex/values";
7
7
  import { Infer } from "convex/values";
@@ -196,8 +196,8 @@ declare const adapterArgsValidator: convex_values0.VObject<{
196
196
  select?: string[] | undefined;
197
197
  offset?: number | undefined;
198
198
  sortBy?: {
199
- field: string;
200
199
  direction: "asc" | "desc";
200
+ field: string;
201
201
  } | undefined;
202
202
  where?: {
203
203
  connector?: "AND" | "OR" | undefined;
@@ -212,12 +212,12 @@ declare const adapterArgsValidator: convex_values0.VObject<{
212
212
  offset: convex_values0.VFloat64<number | undefined, "optional">;
213
213
  select: convex_values0.VArray<string[] | undefined, convex_values0.VString<string, "required">, "optional">;
214
214
  sortBy: convex_values0.VObject<{
215
- field: string;
216
215
  direction: "asc" | "desc";
216
+ field: string;
217
217
  } | undefined, {
218
218
  direction: convex_values0.VUnion<"asc" | "desc", [convex_values0.VLiteral<"asc", "required">, convex_values0.VLiteral<"desc", "required">], "required", never>;
219
219
  field: convex_values0.VString<string, "required">;
220
- }, "optional", "field" | "direction">;
220
+ }, "optional", "direction" | "field">;
221
221
  where: convex_values0.VArray<{
222
222
  connector?: "AND" | "OR" | undefined;
223
223
  operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
@@ -234,7 +234,7 @@ declare const adapterArgsValidator: convex_values0.VObject<{
234
234
  operator: convex_values0.VUnion<"in" | "lt" | "lte" | "gt" | "gte" | "eq" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined, [convex_values0.VLiteral<"lt", "required">, convex_values0.VLiteral<"lte", "required">, convex_values0.VLiteral<"gt", "required">, convex_values0.VLiteral<"gte", "required">, convex_values0.VLiteral<"eq", "required">, convex_values0.VLiteral<"in", "required">, convex_values0.VLiteral<"not_in", "required">, convex_values0.VLiteral<"ne", "required">, convex_values0.VLiteral<"contains", "required">, convex_values0.VLiteral<"starts_with", "required">, convex_values0.VLiteral<"ends_with", "required">], "optional", never>;
235
235
  value: convex_values0.VUnion<string | number | boolean | string[] | number[] | null, [convex_values0.VString<string, "required">, convex_values0.VFloat64<number, "required">, convex_values0.VBoolean<boolean, "required">, convex_values0.VArray<string[], convex_values0.VString<string, "required">, "required">, convex_values0.VArray<number[], convex_values0.VFloat64<number, "required">, "required">, convex_values0.VNull<null, "required">], "required", never>;
236
236
  }, "required", "value" | "connector" | "field" | "operator">, "optional">;
237
- }, "required", "limit" | "model" | "select" | "offset" | "sortBy" | "where" | "sortBy.field" | "sortBy.direction">;
237
+ }, "required", "limit" | "model" | "select" | "offset" | "sortBy" | "where" | "sortBy.direction" | "sortBy.field">;
238
238
  declare const hasUniqueFields: (betterAuthSchema: BetterAuthDBSchema, model: string, input: Record<string, any>) => boolean;
239
239
  declare const checkUniqueFields: <Schema extends SchemaDefinition<any, any>>(ctx: GenericQueryCtx<GenericDataModel>, schema: Schema, betterAuthSchema: BetterAuthDBSchema, table: string, input: Record<string, any>, doc?: Record<string, any>) => Promise<void>;
240
240
  declare const selectFields: <T extends TableNamesInDataModel<GenericDataModel>, D extends DocumentByName<GenericDataModel, T>>(doc: D | null, select?: string[]) => Promise<D | null>;
@@ -406,8 +406,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
406
406
  join?: any;
407
407
  offset?: number | undefined;
408
408
  sortBy?: {
409
- field: string;
410
409
  direction: "asc" | "desc";
410
+ field: string;
411
411
  } | undefined;
412
412
  where?: {
413
413
  connector?: "AND" | "OR" | undefined;
@@ -19202,8 +19202,8 @@ declare const createAuthRuntime: <DataModel extends GenericDataModel, Schema ext
19202
19202
  join?: any;
19203
19203
  offset?: number | undefined;
19204
19204
  sortBy?: {
19205
- field: string;
19206
19205
  direction: "asc" | "desc";
19206
+ field: string;
19207
19207
  } | undefined;
19208
19208
  where?: {
19209
19209
  connector?: "AND" | "OR" | undefined;
@@ -1,5 +1,6 @@
1
- import { a as partial, h as asyncMap, l as isQueryCtx, n as customCtx, r as customMutation, u as isRunMutationCtx } from "../customFunctions-CZnCwoR3.js";
2
- import { a as mergedStream, l as unsetToken, o as stream, t as getByIdWithOrmQueryFallback, v as eq } from "../query-context-BDSis9rT.js";
1
+ import { r as partial, s as asyncMap } from "../validators-D_i3BK7v.js";
2
+ import { n as customCtx, o as isQueryCtx, r as customMutation, s as isRunMutationCtx } from "../customFunctions-RnzME_cJ.js";
3
+ import { a as mergedStream, l as unsetToken, o as stream, t as getByIdWithOrmQueryFallback, v as eq } from "../query-context-DEUFBhXS.js";
3
4
  import { v } from "convex/values";
4
5
  import { internalActionGeneric, internalMutationGeneric, internalQueryGeneric, paginationOptsValidator } from "convex/server";
5
6
  import { convex } from "@convex-dev/better-auth/plugins";
@@ -772,13 +773,13 @@ const ORM_SCHEMA_OPTIONS = Symbol.for("better-convex:OrmSchemaOptions");
772
773
  const hasOrmSchemaMetadata = (schema) => !!schema && typeof schema === "object" && ORM_SCHEMA_OPTIONS in schema;
773
774
  const createAuthSchema = async ({ file, schema, tables }) => {
774
775
  if (hasOrmSchemaMetadata(schema)) {
775
- const { createSchemaOrm } = await import("../create-schema-orm-69VF4CFV.js");
776
+ const { createSchemaOrm } = await import("../create-schema-orm-OcyA0apQ.js");
776
777
  return createSchemaOrm({
777
778
  file,
778
779
  tables
779
780
  });
780
781
  }
781
- const { createSchema } = await import("../create-schema-BdZOL6ns.js");
782
+ const { createSchema } = await import("../create-schema-BsN0jL5S.js");
782
783
  return createSchema({
783
784
  file,
784
785
  tables
@@ -1,5 +1,5 @@
1
- import { B as ConvexContext, H as LazyCaller } from "../../procedure-caller-CcjtUFvL.js";
2
- import "../../http-types-BCf2wCgp.js";
1
+ import { B as ConvexContext, H as LazyCaller } from "../../procedure-caller-DYjpq7rG.js";
2
+ import "../../http-types-BK7FuIcR.js";
3
3
  import "../../server/index.js";
4
4
  import { GetTokenOptions } from "@convex-dev/better-auth/utils";
5
5
 
@@ -1,5 +1,5 @@
1
- import { n as defaultIsUnauthorized } from "../../error-Be4OcwwD.js";
2
- import { t as createCallerFactory } from "../../caller-factory-D3OuR1eI.js";
1
+ import { n as defaultIsUnauthorized } from "../../error-CAGGSN5H.js";
2
+ import { t as createCallerFactory } from "../../caller-factory-CCsm4Dut.js";
3
3
  import { getToken } from "@convex-dev/better-auth/utils";
4
4
 
5
5
  //#region src/auth-nextjs/index.ts
@@ -1,5 +1,5 @@
1
- import { i as getFunctionType, n as getFuncRef, t as buildMetaIndex } from "./meta-utils-DDVYp9Xf.js";
2
- import { s as getTransformer } from "./transformer-Dh0w2py0.js";
1
+ import { i as getFunctionType, n as getFuncRef, t as buildMetaIndex } from "./meta-utils-NRyocOSc.js";
2
+ import { s as getTransformer } from "./transformer-ogg-4d78.js";
3
3
  import { fetchAction, fetchMutation, fetchQuery } from "convex/nextjs";
4
4
 
5
5
  //#region src/server/caller.ts