kitcn 0.33.9 → 0.33.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/aggregate/index.d.ts +1 -1
- package/dist/auth/generated/index.d.ts +1 -1
- package/dist/auth/index.d.ts +19 -19
- package/dist/auth/index.js +29 -12
- package/dist/cli.mjs +1 -1
- package/dist/{generated-contract-disabled-QZXEzUnd.d.ts → generated-contract-disabled-DcgLIEHK.d.ts} +28 -26
- package/dist/{local-env-DfRydipT.mjs → local-env-tM3bdL1l.mjs} +296 -46
- package/dist/orm/index.d.ts +1 -1
- package/dist/orm/migrations/index.d.ts +1 -1
- package/dist/watcher.mjs +1 -1
- package/dist/{where-clause-compiler-BPQv90gK.d.ts → where-clause-compiler-DNFGsYBl.d.ts} +81 -81
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# kitcn
|
|
2
2
|
|
|
3
|
+
## 0.33.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#485](https://github.com/udecode/kitcn/pull/485) [`1aea19e`](https://github.com/udecode/kitcn/commit/1aea19e9a2d6afe909fa7fe3e31238a15809eb74) Thanks [@EfficiencyCorp](https://github.com/EfficiencyCorp)! - ## Patches
|
|
8
|
+
|
|
9
|
+
- Fix Better Auth 1.7.6+ HTTP auth routes failing with `Unexpected field 'modelKey'`: the auth adapters no longer forward Better Auth's `modelKey` into Convex function arguments.
|
|
10
|
+
|
|
11
|
+
- [#481](https://github.com/udecode/kitcn/pull/481) [`88140a0`](https://github.com/udecode/kitcn/commit/88140a045795e0fe4234dca44180d37ee3bcfa55) Thanks [@EfficiencyCorp](https://github.com/EfficiencyCorp)! - ## Patches
|
|
12
|
+
|
|
13
|
+
- Fix Better Auth `findMany` calls with `select` failing with `Unexpected field select` in the generated auth `findMany` query.
|
|
14
|
+
|
|
15
|
+
- [#483](https://github.com/udecode/kitcn/pull/483) [`64d84a2`](https://github.com/udecode/kitcn/commit/64d84a28e629e0201ac0bbb768462d71f618c75d) Thanks [@EfficiencyCorp](https://github.com/EfficiencyCorp)! - ## Patches
|
|
16
|
+
|
|
17
|
+
- Fix `kitcn codegen` and `kitcn dev` making a running `convex dev` redeploy
|
|
18
|
+
when nothing changed.
|
|
19
|
+
|
|
20
|
+
## 0.33.10
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [#480](https://github.com/udecode/kitcn/pull/480) [`7d976bd`](https://github.com/udecode/kitcn/commit/7d976bd84c5012c115f00f7bc89a5f93a37e886d) Thanks [@EfficiencyCorp](https://github.com/EfficiencyCorp)! - ## Patches
|
|
25
|
+
|
|
26
|
+
- Fix generated auth modules missing the internal `consumeOne` and `incrementOne` mutations that the Better Auth adapter calls. Rerun `kitcn codegen` and redeploy.
|
|
27
|
+
|
|
3
28
|
## 0.33.9
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vn as ConvexTextBuilderInitial, Zt as ConvexTableWithColumns } from "../capabilities-Bxzoofl4.js";
|
|
2
|
-
import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial } from "../where-clause-compiler-
|
|
2
|
+
import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial } from "../where-clause-compiler-DNFGsYBl.js";
|
|
3
3
|
import * as convex_values0 from "convex/values";
|
|
4
4
|
import { GenericId, Infer, Value } from "convex/values";
|
|
5
5
|
import { DocumentByName, GenericDataModel, GenericDatabaseReader, GenericDatabaseWriter, TableNamesInDataModel } from "convex/server";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, b as GenericAuthBeforeResult, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../../generated-contract-disabled-
|
|
1
|
+
import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, b as GenericAuthBeforeResult, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../../generated-contract-disabled-DcgLIEHK.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-BkNjkDCk.js";
|
|
2
2
|
import { t as GetAuth } from "../types-ex0-J-SC.js";
|
|
3
3
|
import { t as GenericCtx } from "../context-utils-Cbv4r0AA.js";
|
|
4
|
-
import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, _ as updateManyHandler, a as AuthFunctions, b as GenericAuthBeforeResult, c as consumeOneHandler, d as createHandler, f as deleteManyHandler, g as incrementOneHandler, h as findOneHandler, i as getGeneratedAuthDisabledReason, l as countHandler, m as findManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as deleteOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as createApi, v as updateOneHandler, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../generated-contract-disabled-
|
|
4
|
+
import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, _ as updateManyHandler, a as AuthFunctions, b as GenericAuthBeforeResult, c as consumeOneHandler, d as createHandler, f as deleteManyHandler, g as incrementOneHandler, h as findOneHandler, i as getGeneratedAuthDisabledReason, l as countHandler, m as findManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as deleteOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as createApi, v as updateOneHandler, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../generated-contract-disabled-DcgLIEHK.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";
|
|
@@ -109,31 +109,31 @@ type AdapterPaginationOptions = PaginationOptions & {
|
|
|
109
109
|
};
|
|
110
110
|
declare const adapterWhereValidator: convex_values0.VObject<{
|
|
111
111
|
mode?: "sensitive" | "insensitive" | undefined;
|
|
112
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
113
112
|
connector?: "AND" | "OR" | undefined;
|
|
114
|
-
|
|
113
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
115
114
|
field: string;
|
|
115
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
116
116
|
}, {
|
|
117
117
|
connector: convex_values0.VUnion<"AND" | "OR" | undefined, [convex_values0.VLiteral<"AND", "required">, convex_values0.VLiteral<"OR", "required">], "optional", never>;
|
|
118
118
|
field: convex_values0.VString<string, "required">;
|
|
119
119
|
mode: convex_values0.VUnion<"sensitive" | "insensitive" | undefined, [convex_values0.VLiteral<"sensitive", "required">, convex_values0.VLiteral<"insensitive", "required">], "optional", never>;
|
|
120
|
-
operator: convex_values0.VUnion<"
|
|
120
|
+
operator: convex_values0.VUnion<"lt" | "lte" | "gt" | "gte" | "eq" | "in" | "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>;
|
|
121
121
|
value: convex_values0.VUnion<string | number | boolean | string[] | number[] | null, [convex_values0.VString<string, "required">, convex_values0.VFloat64<number, "required">, convex_values0.VBoolean<boolean, "required">, convex_values0.VArray<string[], convex_values0.VString<string, "required">, "required">, convex_values0.VArray<number[], convex_values0.VFloat64<number, "required">, "required">, convex_values0.VNull<null, "required">], "required", never>;
|
|
122
|
-
}, "required", "mode" | "
|
|
122
|
+
}, "required", "mode" | "connector" | "field" | "operator" | "value">;
|
|
123
123
|
declare const adapterArgsValidator: convex_values0.VObject<{
|
|
124
|
-
limit?: number | undefined;
|
|
125
124
|
where?: {
|
|
126
125
|
mode?: "sensitive" | "insensitive" | undefined;
|
|
127
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
128
126
|
connector?: "AND" | "OR" | undefined;
|
|
129
|
-
|
|
127
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
130
128
|
field: string;
|
|
129
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
131
130
|
}[] | undefined;
|
|
132
|
-
|
|
131
|
+
limit?: number | undefined;
|
|
133
132
|
offset?: number | undefined;
|
|
133
|
+
select?: string[] | undefined;
|
|
134
134
|
sortBy?: {
|
|
135
|
-
direction: "asc" | "desc";
|
|
136
135
|
field: string;
|
|
136
|
+
direction: "asc" | "desc";
|
|
137
137
|
} | undefined;
|
|
138
138
|
model: string;
|
|
139
139
|
}, {
|
|
@@ -142,32 +142,32 @@ declare const adapterArgsValidator: convex_values0.VObject<{
|
|
|
142
142
|
offset: convex_values0.VFloat64<number | undefined, "optional">;
|
|
143
143
|
select: convex_values0.VArray<string[] | undefined, convex_values0.VString<string, "required">, "optional">;
|
|
144
144
|
sortBy: convex_values0.VObject<{
|
|
145
|
-
direction: "asc" | "desc";
|
|
146
145
|
field: string;
|
|
146
|
+
direction: "asc" | "desc";
|
|
147
147
|
} | undefined, {
|
|
148
148
|
direction: convex_values0.VUnion<"asc" | "desc", [convex_values0.VLiteral<"asc", "required">, convex_values0.VLiteral<"desc", "required">], "required", never>;
|
|
149
149
|
field: convex_values0.VString<string, "required">;
|
|
150
|
-
}, "optional", "
|
|
150
|
+
}, "optional", "field" | "direction">;
|
|
151
151
|
where: convex_values0.VArray<{
|
|
152
152
|
mode?: "sensitive" | "insensitive" | undefined;
|
|
153
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
154
153
|
connector?: "AND" | "OR" | undefined;
|
|
155
|
-
|
|
154
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
156
155
|
field: string;
|
|
156
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
157
157
|
}[] | undefined, convex_values0.VObject<{
|
|
158
158
|
mode?: "sensitive" | "insensitive" | undefined;
|
|
159
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
160
159
|
connector?: "AND" | "OR" | undefined;
|
|
161
|
-
|
|
160
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
162
161
|
field: string;
|
|
162
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
163
163
|
}, {
|
|
164
164
|
connector: convex_values0.VUnion<"AND" | "OR" | undefined, [convex_values0.VLiteral<"AND", "required">, convex_values0.VLiteral<"OR", "required">], "optional", never>;
|
|
165
165
|
field: convex_values0.VString<string, "required">;
|
|
166
166
|
mode: convex_values0.VUnion<"sensitive" | "insensitive" | undefined, [convex_values0.VLiteral<"sensitive", "required">, convex_values0.VLiteral<"insensitive", "required">], "optional", never>;
|
|
167
|
-
operator: convex_values0.VUnion<"
|
|
167
|
+
operator: convex_values0.VUnion<"lt" | "lte" | "gt" | "gte" | "eq" | "in" | "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>;
|
|
168
168
|
value: convex_values0.VUnion<string | number | boolean | string[] | number[] | null, [convex_values0.VString<string, "required">, convex_values0.VFloat64<number, "required">, convex_values0.VBoolean<boolean, "required">, convex_values0.VArray<string[], convex_values0.VString<string, "required">, "required">, convex_values0.VArray<number[], convex_values0.VFloat64<number, "required">, "required">, convex_values0.VNull<null, "required">], "required", never>;
|
|
169
|
-
}, "required", "mode" | "
|
|
170
|
-
}, "required", "
|
|
169
|
+
}, "required", "mode" | "connector" | "field" | "operator" | "value">, "optional">;
|
|
170
|
+
}, "required", "model" | "where" | "limit" | "offset" | "select" | "sortBy" | "sortBy.field" | "sortBy.direction">;
|
|
171
171
|
declare const hasUniqueFields: (betterAuthSchema: BetterAuthDBSchema, model: string, input: Record<string, any>) => boolean;
|
|
172
172
|
declare const checkUniqueFields: <Schema extends SchemaDefinition<any, any>>(ctx: GenericQueryCtx<GenericDataModel>, schema: Schema, betterAuthSchema: BetterAuthDBSchema, table: string, input: Record<string, any>, doc?: Record<string, any>) => Promise<void>;
|
|
173
173
|
declare const selectFields: <T extends TableNamesInDataModel<GenericDataModel>, D extends DocumentByName<GenericDataModel, T>>(doc: D | null, select?: string[]) => D | null;
|
package/dist/auth/index.js
CHANGED
|
@@ -932,6 +932,7 @@ const createApi = (schema, getAuth, options) => {
|
|
|
932
932
|
model: modelValidator,
|
|
933
933
|
offset: v.optional(v.number()),
|
|
934
934
|
paginationOpts: paginationOptsValidator,
|
|
935
|
+
select: v.optional(v.array(v.string())),
|
|
935
936
|
sortBy: v.optional(v.object({
|
|
936
937
|
direction: v.union(v.literal("asc"), v.literal("desc")),
|
|
937
938
|
field: v.string()
|
|
@@ -1072,6 +1073,10 @@ const parseWhere = (where) => {
|
|
|
1072
1073
|
return w;
|
|
1073
1074
|
});
|
|
1074
1075
|
};
|
|
1076
|
+
const omitModelKey = (args) => {
|
|
1077
|
+
const { modelKey: _modelKey, ...rest } = args;
|
|
1078
|
+
return rest;
|
|
1079
|
+
};
|
|
1075
1080
|
const getDocId = (doc) => {
|
|
1076
1081
|
if (doc?._id !== void 0 && doc?._id !== null) return String(doc._id);
|
|
1077
1082
|
if (doc?.id !== void 0 && doc?.id !== null) return String(doc.id);
|
|
@@ -1156,7 +1161,8 @@ const httpAdapter = (ctx, { authFunctions, debugLogs, schema }) => {
|
|
|
1156
1161
|
return {
|
|
1157
1162
|
id: "convex",
|
|
1158
1163
|
options: { isRunMutationCtx: isRunMutationCtx(ctx) },
|
|
1159
|
-
count: async (
|
|
1164
|
+
count: async (args) => {
|
|
1165
|
+
const data = omitModelKey(args);
|
|
1160
1166
|
assertSupportedOrWhere(data.where, "count");
|
|
1161
1167
|
if (hasOrWhere(data.where)) return dedupeDocsById((await asyncMap(data.where, async (w) => handlePagination(async ({ paginationOpts }) => await ctx.runQuery(authFunctions.findMany, {
|
|
1162
1168
|
...data,
|
|
@@ -1203,7 +1209,8 @@ const httpAdapter = (ctx, { authFunctions, debugLogs, schema }) => {
|
|
|
1203
1209
|
where: parseWhere(data.where)
|
|
1204
1210
|
} });
|
|
1205
1211
|
},
|
|
1206
|
-
deleteMany: async (
|
|
1212
|
+
deleteMany: async (args) => {
|
|
1213
|
+
const data = omitModelKey(args);
|
|
1207
1214
|
if (!("runMutation" in ctx)) throw new Error("ctx is not a mutation ctx");
|
|
1208
1215
|
assertSupportedOrWhere(data.where, "deleteMany");
|
|
1209
1216
|
if (hasOrWhere(data.where)) {
|
|
@@ -1231,7 +1238,8 @@ const httpAdapter = (ctx, { authFunctions, debugLogs, schema }) => {
|
|
|
1231
1238
|
paginationOpts
|
|
1232
1239
|
}))).count;
|
|
1233
1240
|
},
|
|
1234
|
-
findMany: async (
|
|
1241
|
+
findMany: async (args) => {
|
|
1242
|
+
const data = omitModelKey(args);
|
|
1235
1243
|
if (data.offset) throw new Error("offset not supported");
|
|
1236
1244
|
assertSupportedOrWhere(data.where, "findMany");
|
|
1237
1245
|
if (hasOrWhere(data.where)) {
|
|
@@ -1251,7 +1259,8 @@ const httpAdapter = (ctx, { authFunctions, debugLogs, schema }) => {
|
|
|
1251
1259
|
where: parseWhere(data.where)
|
|
1252
1260
|
}), { limit: data.limit })).docs;
|
|
1253
1261
|
},
|
|
1254
|
-
findOne: async (
|
|
1262
|
+
findOne: async (args) => {
|
|
1263
|
+
const data = omitModelKey(args);
|
|
1255
1264
|
const parsedWhere = parseWhere(data.where);
|
|
1256
1265
|
if (data.where?.every((w) => w.connector === "OR")) for (const w of data.where) {
|
|
1257
1266
|
const result = await ctx.runQuery(authFunctions.findOne, {
|
|
@@ -1265,7 +1274,8 @@ const httpAdapter = (ctx, { authFunctions, debugLogs, schema }) => {
|
|
|
1265
1274
|
where: parsedWhere
|
|
1266
1275
|
});
|
|
1267
1276
|
},
|
|
1268
|
-
incrementOne: async (
|
|
1277
|
+
incrementOne: async (args) => {
|
|
1278
|
+
const data = omitModelKey(args);
|
|
1269
1279
|
if (!("runMutation" in ctx)) throw new Error("ctx is not a mutation ctx");
|
|
1270
1280
|
const { set, ...input } = data;
|
|
1271
1281
|
return await ctx.runMutation(authFunctions.incrementOne, { input: {
|
|
@@ -1284,7 +1294,8 @@ const httpAdapter = (ctx, { authFunctions, debugLogs, schema }) => {
|
|
|
1284
1294
|
} });
|
|
1285
1295
|
throw new Error("where clause not supported");
|
|
1286
1296
|
},
|
|
1287
|
-
updateMany: async (
|
|
1297
|
+
updateMany: async (args) => {
|
|
1298
|
+
const data = omitModelKey(args);
|
|
1288
1299
|
if (!("runMutation" in ctx)) throw new Error("ctx is not a mutation ctx");
|
|
1289
1300
|
assertSupportedOrWhere(data.where, "updateMany");
|
|
1290
1301
|
if (hasOrWhere(data.where)) {
|
|
@@ -1337,7 +1348,8 @@ const dbAdapter = (ctx, { authFunctions, debugLogs, getBetterAuthSchema, schema
|
|
|
1337
1348
|
return {
|
|
1338
1349
|
id: "convex",
|
|
1339
1350
|
options: { isRunMutationCtx: isRunMutationCtx(ctx) },
|
|
1340
|
-
count: async (
|
|
1351
|
+
count: async (args) => {
|
|
1352
|
+
const data = omitModelKey(args);
|
|
1341
1353
|
assertSupportedOrWhere(data.where, "count");
|
|
1342
1354
|
if (hasOrWhere(data.where)) return dedupeDocsById((await asyncMap(data.where, async (w) => handlePagination(async ({ paginationOpts }) => await findManyHandler(ctx, {
|
|
1343
1355
|
...data,
|
|
@@ -1384,7 +1396,8 @@ const dbAdapter = (ctx, { authFunctions, debugLogs, getBetterAuthSchema, schema
|
|
|
1384
1396
|
where: parseWhere(data.where)
|
|
1385
1397
|
} });
|
|
1386
1398
|
},
|
|
1387
|
-
deleteMany: async (
|
|
1399
|
+
deleteMany: async (args) => {
|
|
1400
|
+
const data = omitModelKey(args);
|
|
1388
1401
|
if (!("runMutation" in ctx)) throw new Error("ctx is not a mutation ctx");
|
|
1389
1402
|
assertSupportedOrWhere(data.where, "deleteMany");
|
|
1390
1403
|
if (hasOrWhere(data.where)) {
|
|
@@ -1412,7 +1425,8 @@ const dbAdapter = (ctx, { authFunctions, debugLogs, getBetterAuthSchema, schema
|
|
|
1412
1425
|
paginationOpts
|
|
1413
1426
|
}))).count;
|
|
1414
1427
|
},
|
|
1415
|
-
findMany: async (
|
|
1428
|
+
findMany: async (args) => {
|
|
1429
|
+
const data = omitModelKey(args);
|
|
1416
1430
|
if (data.offset) throw new Error("offset not supported");
|
|
1417
1431
|
assertSupportedOrWhere(data.where, "findMany");
|
|
1418
1432
|
if (hasOrWhere(data.where)) {
|
|
@@ -1432,7 +1446,8 @@ const dbAdapter = (ctx, { authFunctions, debugLogs, getBetterAuthSchema, schema
|
|
|
1432
1446
|
where: parseWhere(data.where)
|
|
1433
1447
|
}, schema, betterAuthSchema), { limit: data.limit })).docs;
|
|
1434
1448
|
},
|
|
1435
|
-
findOne: async (
|
|
1449
|
+
findOne: async (args) => {
|
|
1450
|
+
const data = omitModelKey(args);
|
|
1436
1451
|
if (data.where?.every((w) => w.connector === "OR")) for (const w of data.where) {
|
|
1437
1452
|
const result = await findOneHandler(ctx, {
|
|
1438
1453
|
...data,
|
|
@@ -1445,7 +1460,8 @@ const dbAdapter = (ctx, { authFunctions, debugLogs, getBetterAuthSchema, schema
|
|
|
1445
1460
|
where: parseWhere(data.where)
|
|
1446
1461
|
}, schema, betterAuthSchema);
|
|
1447
1462
|
},
|
|
1448
|
-
incrementOne: async (
|
|
1463
|
+
incrementOne: async (args) => {
|
|
1464
|
+
const data = omitModelKey(args);
|
|
1449
1465
|
if (!("runMutation" in ctx)) throw new Error("ctx is not a mutation ctx");
|
|
1450
1466
|
const { set, ...input } = data;
|
|
1451
1467
|
return await ctx.runMutation(authFunctions.incrementOne, { input: {
|
|
@@ -1466,7 +1482,8 @@ const dbAdapter = (ctx, { authFunctions, debugLogs, getBetterAuthSchema, schema
|
|
|
1466
1482
|
}
|
|
1467
1483
|
throw new Error("where clause not supported");
|
|
1468
1484
|
},
|
|
1469
|
-
updateMany: async (
|
|
1485
|
+
updateMany: async (args) => {
|
|
1486
|
+
const data = omitModelKey(args);
|
|
1470
1487
|
if (!("runMutation" in ctx)) throw new Error("ctx is not a mutation ctx");
|
|
1471
1488
|
assertSupportedOrWhere(data.where, "updateMany");
|
|
1472
1489
|
if (hasOrWhere(data.where)) {
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as Columns, D as TableName, E as RlsPolicies, O as createSystemFields, S as getRankIndexes, T as OrmSchemaExtensions, _ as loadEsbuild, a as generateMeta, b as getAggregateIndexes, c as resolveSchemaDefaultExport, f as createProjectJiti, g as loadDotenv, h as loadClackPrompts, i as resolveConfiguredBackend, l as schemaDeclaresAggregateIndexes, m as loadBabelParser, n as withLocalCodegenEnv, o as getConvexConfig, p as CRPC_BUILDER_STUB_SOURCE, r as loadCliConfig, s as collectSchemaTables, t as getLocalBackendEnvVars, u as logger, v as highlighter, w as EnableRLS, x as getIndexes, y as isColorEnabled } from "./local-env-
|
|
2
|
+
import { C as Columns, D as TableName, E as RlsPolicies, O as createSystemFields, S as getRankIndexes, T as OrmSchemaExtensions, _ as loadEsbuild, a as generateMeta, b as getAggregateIndexes, c as resolveSchemaDefaultExport, f as createProjectJiti, g as loadDotenv, h as loadClackPrompts, i as resolveConfiguredBackend, l as schemaDeclaresAggregateIndexes, m as loadBabelParser, n as withLocalCodegenEnv, o as getConvexConfig, p as CRPC_BUILDER_STUB_SOURCE, r as loadCliConfig, s as collectSchemaTables, t as getLocalBackendEnvVars, u as logger, v as highlighter, w as EnableRLS, x as getIndexes, y as isColorEnabled } from "./local-env-tM3bdL1l.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import fs, { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import path, { basename, delimiter, dirname, extname, isAbsolute, join, posix, relative, resolve } from "node:path";
|
package/dist/{generated-contract-disabled-QZXEzUnd.d.ts → generated-contract-disabled-DcgLIEHK.d.ts}
RENAMED
|
@@ -116,6 +116,7 @@ declare const findManyHandler: (ctx: any, args: {
|
|
|
116
116
|
paginationOpts: any;
|
|
117
117
|
limit?: number;
|
|
118
118
|
offset?: number;
|
|
119
|
+
select?: string[];
|
|
119
120
|
sortBy?: {
|
|
120
121
|
direction: "asc" | "desc";
|
|
121
122
|
field: string;
|
|
@@ -199,20 +200,20 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
199
200
|
count: convex_server0.RegisteredQuery<"internal", {
|
|
200
201
|
where?: {
|
|
201
202
|
mode?: "sensitive" | "insensitive" | undefined;
|
|
202
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
203
203
|
connector?: "AND" | "OR" | undefined;
|
|
204
|
-
|
|
204
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
205
205
|
field: string;
|
|
206
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
206
207
|
}[] | undefined;
|
|
207
208
|
model: string;
|
|
208
209
|
}, Promise<number | null>>;
|
|
209
210
|
consumeOne: convex_server0.RegisteredMutation<"internal", {
|
|
210
211
|
input: {
|
|
211
212
|
where?: {
|
|
212
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
213
213
|
connector?: "AND" | "OR" | undefined;
|
|
214
|
-
|
|
214
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
215
215
|
field: string;
|
|
216
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
216
217
|
}[] | undefined;
|
|
217
218
|
model: string;
|
|
218
219
|
} | {
|
|
@@ -237,10 +238,10 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
237
238
|
deleteMany: convex_server0.RegisteredMutation<"internal", {
|
|
238
239
|
input: {
|
|
239
240
|
where?: {
|
|
240
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
241
241
|
connector?: "AND" | "OR" | undefined;
|
|
242
|
-
|
|
242
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
243
243
|
field: string;
|
|
244
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
244
245
|
}[] | undefined;
|
|
245
246
|
model: string;
|
|
246
247
|
} | {
|
|
@@ -266,10 +267,10 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
266
267
|
deleteOne: convex_server0.RegisteredMutation<"internal", {
|
|
267
268
|
input: {
|
|
268
269
|
where?: {
|
|
269
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
270
270
|
connector?: "AND" | "OR" | undefined;
|
|
271
|
-
|
|
271
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
272
272
|
field: string;
|
|
273
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
273
274
|
}[] | undefined;
|
|
274
275
|
model: string;
|
|
275
276
|
} | {
|
|
@@ -278,20 +279,22 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
278
279
|
};
|
|
279
280
|
}, Promise<Record<string, unknown> | undefined>>;
|
|
280
281
|
findMany: convex_server0.RegisteredQuery<"internal", {
|
|
281
|
-
limit?: number | undefined;
|
|
282
282
|
join?: any;
|
|
283
283
|
where?: {
|
|
284
284
|
mode?: "sensitive" | "insensitive" | undefined;
|
|
285
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
286
285
|
connector?: "AND" | "OR" | undefined;
|
|
287
|
-
|
|
286
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
288
287
|
field: string;
|
|
288
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
289
289
|
}[] | undefined;
|
|
290
|
+
limit?: number | undefined;
|
|
290
291
|
offset?: number | undefined;
|
|
292
|
+
select?: string[] | undefined;
|
|
291
293
|
sortBy?: {
|
|
292
|
-
direction: "asc" | "desc";
|
|
293
294
|
field: string;
|
|
295
|
+
direction: "asc" | "desc";
|
|
294
296
|
} | undefined;
|
|
297
|
+
model: string;
|
|
295
298
|
paginationOpts: {
|
|
296
299
|
id?: number;
|
|
297
300
|
endCursor?: string | null;
|
|
@@ -300,16 +303,15 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
300
303
|
numItems: number;
|
|
301
304
|
cursor: string | null;
|
|
302
305
|
};
|
|
303
|
-
model: string;
|
|
304
306
|
}, Promise<PaginationResult<convex_server0.GenericDocument>>>;
|
|
305
307
|
findOne: convex_server0.RegisteredQuery<"internal", {
|
|
306
308
|
join?: any;
|
|
307
309
|
where?: {
|
|
308
310
|
mode?: "sensitive" | "insensitive" | undefined;
|
|
309
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
310
311
|
connector?: "AND" | "OR" | undefined;
|
|
311
|
-
|
|
312
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
312
313
|
field: string;
|
|
314
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
313
315
|
}[] | undefined;
|
|
314
316
|
select?: string[] | undefined;
|
|
315
317
|
model: string;
|
|
@@ -317,14 +319,14 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
317
319
|
getLatestJwks: convex_server0.RegisteredAction<"internal", {}, Promise<unknown>>;
|
|
318
320
|
incrementOne: convex_server0.RegisteredMutation<"internal", {
|
|
319
321
|
input: {
|
|
320
|
-
set?: Record<string, any> | undefined;
|
|
321
322
|
where?: {
|
|
322
323
|
mode?: "sensitive" | "insensitive" | undefined;
|
|
323
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
324
324
|
connector?: "AND" | "OR" | undefined;
|
|
325
|
-
|
|
325
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
326
326
|
field: string;
|
|
327
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
327
328
|
}[] | undefined;
|
|
329
|
+
set?: Record<string, any> | undefined;
|
|
328
330
|
model: string;
|
|
329
331
|
increment: Record<string, number>;
|
|
330
332
|
};
|
|
@@ -333,21 +335,21 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
333
335
|
updateMany: convex_server0.RegisteredMutation<"internal", {
|
|
334
336
|
input: {
|
|
335
337
|
where?: {
|
|
336
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
337
338
|
connector?: "AND" | "OR" | undefined;
|
|
338
|
-
|
|
339
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
339
340
|
field: string;
|
|
341
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
340
342
|
}[] | undefined;
|
|
343
|
+
model: string;
|
|
341
344
|
update: {
|
|
342
345
|
[x: string]: unknown;
|
|
343
346
|
[x: number]: unknown;
|
|
344
347
|
[x: symbol]: unknown;
|
|
345
348
|
};
|
|
346
|
-
model: string;
|
|
347
349
|
} | {
|
|
348
350
|
where?: any[] | undefined;
|
|
349
|
-
update: any;
|
|
350
351
|
model: string;
|
|
352
|
+
update: any;
|
|
351
353
|
};
|
|
352
354
|
paginationOpts: {
|
|
353
355
|
id?: number;
|
|
@@ -368,21 +370,21 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
368
370
|
updateOne: convex_server0.RegisteredMutation<"internal", {
|
|
369
371
|
input: {
|
|
370
372
|
where?: {
|
|
371
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
372
373
|
connector?: "AND" | "OR" | undefined;
|
|
373
|
-
|
|
374
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
374
375
|
field: string;
|
|
376
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
375
377
|
}[] | undefined;
|
|
378
|
+
model: string;
|
|
376
379
|
update: {
|
|
377
380
|
[x: string]: unknown;
|
|
378
381
|
[x: number]: unknown;
|
|
379
382
|
[x: symbol]: unknown;
|
|
380
383
|
};
|
|
381
|
-
model: string;
|
|
382
384
|
} | {
|
|
383
385
|
where?: any[] | undefined;
|
|
384
|
-
update: any;
|
|
385
386
|
model: string;
|
|
387
|
+
update: any;
|
|
386
388
|
};
|
|
387
389
|
}, Promise<any>>;
|
|
388
390
|
};
|