better-convex 0.6.3 → 0.6.4
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/auth/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as GenericCtx } from "../context-utils-DSuX99Da.js";
|
|
2
2
|
import { convex } from "@convex-dev/better-auth/plugins";
|
|
3
|
-
import * as
|
|
3
|
+
import * as better_auth_adapters0 from "better-auth/adapters";
|
|
4
4
|
import { DBAdapterDebugLogOption } from "better-auth/adapters";
|
|
5
5
|
import { BetterAuthDBSchema } from "better-auth/db";
|
|
6
|
-
import * as
|
|
6
|
+
import * as convex_server0 from "convex/server";
|
|
7
7
|
import { DocumentByName, FunctionReference, GenericDataModel, GenericMutationCtx, GenericQueryCtx, GenericSchema, HttpRouter, PaginationOptions, PaginationResult, SchemaDefinition, TableNamesInDataModel, internalMutationGeneric } from "convex/server";
|
|
8
8
|
import * as convex_values0 from "convex/values";
|
|
9
9
|
import { Infer } from "convex/values";
|
|
@@ -45,30 +45,30 @@ declare const createClient: <DataModel extends GenericDataModel, Schema extends
|
|
|
45
45
|
}) => {
|
|
46
46
|
authFunctions: AuthFunctions;
|
|
47
47
|
triggers: Triggers<DataModel, Schema, TriggerCtx> | undefined;
|
|
48
|
-
adapter: (ctx: GenericCtx<DataModel>, getAuthOptions: (ctx: any) => BetterAuthOptions) =>
|
|
48
|
+
adapter: (ctx: GenericCtx<DataModel>, getAuthOptions: (ctx: any) => BetterAuthOptions) => better_auth_adapters0.AdapterFactory;
|
|
49
49
|
triggersApi: () => {
|
|
50
|
-
beforeCreate:
|
|
50
|
+
beforeCreate: convex_server0.RegisteredMutation<"internal", {
|
|
51
51
|
data: any;
|
|
52
52
|
model: string;
|
|
53
53
|
}, Promise<any>>;
|
|
54
|
-
beforeDelete:
|
|
54
|
+
beforeDelete: convex_server0.RegisteredMutation<"internal", {
|
|
55
55
|
model: string;
|
|
56
56
|
doc: any;
|
|
57
57
|
}, Promise<any>>;
|
|
58
|
-
beforeUpdate:
|
|
58
|
+
beforeUpdate: convex_server0.RegisteredMutation<"internal", {
|
|
59
59
|
update: any;
|
|
60
60
|
model: string;
|
|
61
61
|
doc: any;
|
|
62
62
|
}, Promise<any>>;
|
|
63
|
-
onCreate:
|
|
63
|
+
onCreate: convex_server0.RegisteredMutation<"internal", {
|
|
64
64
|
model: string;
|
|
65
65
|
doc: any;
|
|
66
66
|
}, Promise<void>>;
|
|
67
|
-
onDelete:
|
|
67
|
+
onDelete: convex_server0.RegisteredMutation<"internal", {
|
|
68
68
|
model: string;
|
|
69
69
|
doc: any;
|
|
70
70
|
}, Promise<void>>;
|
|
71
|
-
onUpdate:
|
|
71
|
+
onUpdate: convex_server0.RegisteredMutation<"internal", {
|
|
72
72
|
model: string;
|
|
73
73
|
newDoc: any;
|
|
74
74
|
oldDoc: any;
|
|
@@ -150,7 +150,7 @@ declare const httpAdapter: <DataModel extends GenericDataModel, Schema extends S
|
|
|
150
150
|
debugLogs?: DBAdapterDebugLogOption;
|
|
151
151
|
schema?: Schema;
|
|
152
152
|
triggers?: Triggers<DataModel, Schema>;
|
|
153
|
-
}) =>
|
|
153
|
+
}) => better_auth_adapters0.AdapterFactory;
|
|
154
154
|
declare const dbAdapter: <DataModel extends GenericDataModel, Schema extends SchemaDefinition<any, any>>(ctx: GenericCtx<DataModel>, getAuthOptions: (ctx: any) => BetterAuthOptions, {
|
|
155
155
|
authFunctions,
|
|
156
156
|
debugLogs,
|
|
@@ -161,7 +161,7 @@ declare const dbAdapter: <DataModel extends GenericDataModel, Schema extends Sch
|
|
|
161
161
|
schema: Schema;
|
|
162
162
|
debugLogs?: DBAdapterDebugLogOption;
|
|
163
163
|
triggers?: Triggers<DataModel, Schema>;
|
|
164
|
-
}) =>
|
|
164
|
+
}) => better_auth_adapters0.AdapterFactory;
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region src/auth/adapter-utils.d.ts
|
|
167
167
|
type AdapterPaginationOptions = PaginationOptions & {
|
|
@@ -171,14 +171,14 @@ type AdapterPaginationOptions = PaginationOptions & {
|
|
|
171
171
|
declare const adapterWhereValidator: convex_values0.VObject<{
|
|
172
172
|
connector?: "AND" | "OR" | undefined;
|
|
173
173
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
174
|
-
field: string;
|
|
175
174
|
value: string | number | boolean | string[] | number[] | null;
|
|
175
|
+
field: string;
|
|
176
176
|
}, {
|
|
177
177
|
connector: convex_values0.VUnion<"AND" | "OR" | undefined, [convex_values0.VLiteral<"AND", "required">, convex_values0.VLiteral<"OR", "required">], "optional", never>;
|
|
178
178
|
field: convex_values0.VString<string, "required">;
|
|
179
179
|
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>;
|
|
180
180
|
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>;
|
|
181
|
-
}, "required", "
|
|
181
|
+
}, "required", "value" | "connector" | "field" | "operator">;
|
|
182
182
|
declare const adapterArgsValidator: convex_values0.VObject<{
|
|
183
183
|
limit?: number | undefined;
|
|
184
184
|
select?: string[] | undefined;
|
|
@@ -190,8 +190,8 @@ declare const adapterArgsValidator: convex_values0.VObject<{
|
|
|
190
190
|
where?: {
|
|
191
191
|
connector?: "AND" | "OR" | undefined;
|
|
192
192
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
193
|
-
field: string;
|
|
194
193
|
value: string | number | boolean | string[] | number[] | null;
|
|
194
|
+
field: string;
|
|
195
195
|
}[] | undefined;
|
|
196
196
|
model: string;
|
|
197
197
|
}, {
|
|
@@ -209,19 +209,19 @@ declare const adapterArgsValidator: convex_values0.VObject<{
|
|
|
209
209
|
where: convex_values0.VArray<{
|
|
210
210
|
connector?: "AND" | "OR" | undefined;
|
|
211
211
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
212
|
-
field: string;
|
|
213
212
|
value: string | number | boolean | string[] | number[] | null;
|
|
213
|
+
field: string;
|
|
214
214
|
}[] | undefined, convex_values0.VObject<{
|
|
215
215
|
connector?: "AND" | "OR" | undefined;
|
|
216
216
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
217
|
-
field: string;
|
|
218
217
|
value: string | number | boolean | string[] | number[] | null;
|
|
218
|
+
field: string;
|
|
219
219
|
}, {
|
|
220
220
|
connector: convex_values0.VUnion<"AND" | "OR" | undefined, [convex_values0.VLiteral<"AND", "required">, convex_values0.VLiteral<"OR", "required">], "optional", never>;
|
|
221
221
|
field: convex_values0.VString<string, "required">;
|
|
222
222
|
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>;
|
|
223
223
|
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>;
|
|
224
|
-
}, "required", "
|
|
224
|
+
}, "required", "value" | "connector" | "field" | "operator">, "optional">;
|
|
225
225
|
}, "required", "limit" | "model" | "select" | "offset" | "sortBy" | "where" | "sortBy.field" | "sortBy.direction">;
|
|
226
226
|
declare const hasUniqueFields: (betterAuthSchema: BetterAuthDBSchema, model: string, input: Record<string, any>) => boolean;
|
|
227
227
|
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>;
|
|
@@ -250,7 +250,7 @@ declare const findOneHandler: (ctx: any, args: {
|
|
|
250
250
|
model: string;
|
|
251
251
|
select?: string[];
|
|
252
252
|
where?: any[];
|
|
253
|
-
}, schema: Schema, betterAuthSchema: any) => Promise<
|
|
253
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<convex_server0.GenericDocument | null>;
|
|
254
254
|
declare const findManyHandler: (ctx: any, args: {
|
|
255
255
|
model: string;
|
|
256
256
|
paginationOpts: any;
|
|
@@ -261,7 +261,7 @@ declare const findManyHandler: (ctx: any, args: {
|
|
|
261
261
|
field: string;
|
|
262
262
|
};
|
|
263
263
|
where?: any[];
|
|
264
|
-
}, schema: Schema, betterAuthSchema: any) => Promise<
|
|
264
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<convex_server0.PaginationResult<convex_server0.GenericDocument>>;
|
|
265
265
|
declare const updateOneHandler: (ctx: any, args: {
|
|
266
266
|
input: {
|
|
267
267
|
model: string;
|
|
@@ -284,8 +284,8 @@ declare const updateManyHandler: (ctx: any, args: {
|
|
|
284
284
|
count: number;
|
|
285
285
|
ids: any[];
|
|
286
286
|
isDone: boolean;
|
|
287
|
-
continueCursor:
|
|
288
|
-
splitCursor?:
|
|
287
|
+
continueCursor: convex_server0.Cursor;
|
|
288
|
+
splitCursor?: convex_server0.Cursor | null;
|
|
289
289
|
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
290
290
|
}>;
|
|
291
291
|
declare const deleteOneHandler: (ctx: any, args: {
|
|
@@ -296,7 +296,7 @@ declare const deleteOneHandler: (ctx: any, args: {
|
|
|
296
296
|
beforeDeleteHandle?: string;
|
|
297
297
|
skipBeforeHooks?: boolean;
|
|
298
298
|
onDeleteHandle?: string;
|
|
299
|
-
}, schema: Schema, betterAuthSchema: any) => Promise<
|
|
299
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<convex_server0.GenericDocument | undefined>;
|
|
300
300
|
declare const deleteManyHandler: (ctx: any, args: {
|
|
301
301
|
input: {
|
|
302
302
|
model: string;
|
|
@@ -310,8 +310,8 @@ declare const deleteManyHandler: (ctx: any, args: {
|
|
|
310
310
|
count: number;
|
|
311
311
|
ids: any[];
|
|
312
312
|
isDone: boolean;
|
|
313
|
-
continueCursor:
|
|
314
|
-
splitCursor?:
|
|
313
|
+
continueCursor: convex_server0.Cursor;
|
|
314
|
+
splitCursor?: convex_server0.Cursor | null;
|
|
315
315
|
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
316
316
|
}>;
|
|
317
317
|
declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Schema, getAuth: GetAuth, options?: {
|
|
@@ -319,7 +319,7 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
319
319
|
context?: (ctx: any) => any | Promise<any>; /** Skip input validation for smaller generated types. Since these are internal functions, validation is optional. */
|
|
320
320
|
skipValidation?: boolean;
|
|
321
321
|
}) => {
|
|
322
|
-
create:
|
|
322
|
+
create: convex_server0.RegisteredMutation<"internal", {
|
|
323
323
|
select?: string[] | undefined;
|
|
324
324
|
beforeCreateHandle?: string | undefined;
|
|
325
325
|
onCreateHandle?: string | undefined;
|
|
@@ -335,7 +335,7 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
335
335
|
model: string;
|
|
336
336
|
};
|
|
337
337
|
}, Promise<any>>;
|
|
338
|
-
deleteMany:
|
|
338
|
+
deleteMany: convex_server0.RegisteredMutation<"internal", {
|
|
339
339
|
beforeDeleteHandle?: string | undefined;
|
|
340
340
|
onDeleteHandle?: string | undefined;
|
|
341
341
|
paginationOpts: {
|
|
@@ -353,8 +353,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
353
353
|
where?: {
|
|
354
354
|
connector?: "AND" | "OR" | undefined;
|
|
355
355
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
356
|
-
field: string;
|
|
357
356
|
value: string | number | boolean | string[] | number[] | null;
|
|
357
|
+
field: string;
|
|
358
358
|
}[] | undefined;
|
|
359
359
|
model: string;
|
|
360
360
|
};
|
|
@@ -362,11 +362,11 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
362
362
|
count: number;
|
|
363
363
|
ids: any[];
|
|
364
364
|
isDone: boolean;
|
|
365
|
-
continueCursor:
|
|
366
|
-
splitCursor?:
|
|
365
|
+
continueCursor: convex_server0.Cursor;
|
|
366
|
+
splitCursor?: convex_server0.Cursor | null;
|
|
367
367
|
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
368
368
|
}>>;
|
|
369
|
-
deleteOne:
|
|
369
|
+
deleteOne: convex_server0.RegisteredMutation<"internal", {
|
|
370
370
|
beforeDeleteHandle?: string | undefined;
|
|
371
371
|
onDeleteHandle?: string | undefined;
|
|
372
372
|
input: {
|
|
@@ -376,15 +376,15 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
376
376
|
where?: {
|
|
377
377
|
connector?: "AND" | "OR" | undefined;
|
|
378
378
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
379
|
-
field: string;
|
|
380
379
|
value: string | number | boolean | string[] | number[] | null;
|
|
380
|
+
field: string;
|
|
381
381
|
}[] | undefined;
|
|
382
382
|
model: string;
|
|
383
383
|
};
|
|
384
|
-
}, Promise<
|
|
385
|
-
findMany:
|
|
386
|
-
limit?: number | undefined;
|
|
384
|
+
}, Promise<convex_server0.GenericDocument | undefined>>;
|
|
385
|
+
findMany: convex_server0.RegisteredQuery<"internal", {
|
|
387
386
|
join?: any;
|
|
387
|
+
limit?: number | undefined;
|
|
388
388
|
offset?: number | undefined;
|
|
389
389
|
sortBy?: {
|
|
390
390
|
field: string;
|
|
@@ -393,8 +393,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
393
393
|
where?: {
|
|
394
394
|
connector?: "AND" | "OR" | undefined;
|
|
395
395
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
396
|
-
field: string;
|
|
397
396
|
value: string | number | boolean | string[] | number[] | null;
|
|
397
|
+
field: string;
|
|
398
398
|
}[] | undefined;
|
|
399
399
|
paginationOpts: {
|
|
400
400
|
id?: number;
|
|
@@ -405,19 +405,19 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
405
405
|
cursor: string | null;
|
|
406
406
|
};
|
|
407
407
|
model: string;
|
|
408
|
-
}, Promise<
|
|
409
|
-
findOne:
|
|
408
|
+
}, Promise<convex_server0.PaginationResult<convex_server0.GenericDocument>>>;
|
|
409
|
+
findOne: convex_server0.RegisteredQuery<"internal", {
|
|
410
410
|
join?: any;
|
|
411
411
|
select?: string[] | undefined;
|
|
412
412
|
where?: {
|
|
413
413
|
connector?: "AND" | "OR" | undefined;
|
|
414
414
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
415
|
-
field: string;
|
|
416
415
|
value: string | number | boolean | string[] | number[] | null;
|
|
416
|
+
field: string;
|
|
417
417
|
}[] | undefined;
|
|
418
418
|
model: string;
|
|
419
|
-
}, Promise<
|
|
420
|
-
updateMany:
|
|
419
|
+
}, Promise<convex_server0.GenericDocument | null>>;
|
|
420
|
+
updateMany: convex_server0.RegisteredMutation<"internal", {
|
|
421
421
|
beforeUpdateHandle?: string | undefined;
|
|
422
422
|
onUpdateHandle?: string | undefined;
|
|
423
423
|
paginationOpts: {
|
|
@@ -436,8 +436,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
436
436
|
where?: {
|
|
437
437
|
connector?: "AND" | "OR" | undefined;
|
|
438
438
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
439
|
-
field: string;
|
|
440
439
|
value: string | number | boolean | string[] | number[] | null;
|
|
440
|
+
field: string;
|
|
441
441
|
}[] | undefined;
|
|
442
442
|
update: {
|
|
443
443
|
[x: string]: unknown;
|
|
@@ -450,11 +450,11 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
450
450
|
count: number;
|
|
451
451
|
ids: any[];
|
|
452
452
|
isDone: boolean;
|
|
453
|
-
continueCursor:
|
|
454
|
-
splitCursor?:
|
|
453
|
+
continueCursor: convex_server0.Cursor;
|
|
454
|
+
splitCursor?: convex_server0.Cursor | null;
|
|
455
455
|
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
456
456
|
}>>;
|
|
457
|
-
updateOne:
|
|
457
|
+
updateOne: convex_server0.RegisteredMutation<"internal", {
|
|
458
458
|
beforeUpdateHandle?: string | undefined;
|
|
459
459
|
onUpdateHandle?: string | undefined;
|
|
460
460
|
input: {
|
|
@@ -465,8 +465,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
465
465
|
where?: {
|
|
466
466
|
connector?: "AND" | "OR" | undefined;
|
|
467
467
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
468
|
-
field: string;
|
|
469
468
|
value: string | number | boolean | string[] | number[] | null;
|
|
469
|
+
field: string;
|
|
470
470
|
}[] | undefined;
|
|
471
471
|
update: {
|
|
472
472
|
[x: string]: unknown;
|
|
@@ -476,8 +476,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>>(schema: Sch
|
|
|
476
476
|
model: string;
|
|
477
477
|
};
|
|
478
478
|
}, Promise<any>>;
|
|
479
|
-
getLatestJwks:
|
|
480
|
-
rotateKeys:
|
|
479
|
+
getLatestJwks: convex_server0.RegisteredAction<"internal", {}, Promise<any>>;
|
|
480
|
+
rotateKeys: convex_server0.RegisteredAction<"internal", {}, Promise<any>>;
|
|
481
481
|
};
|
|
482
482
|
//#endregion
|
|
483
483
|
//#region src/auth/helpers.d.ts
|
package/dist/auth/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as partial, h as asyncMap, l as isQueryCtx, n as customCtx, r as customMutation, u as isRunMutationCtx } from "../customFunctions-C1okqCzL.js";
|
|
2
|
-
import { C as stream, D as unsetToken, L as eq, S as mergedStream } from "../orm-
|
|
2
|
+
import { C as stream, D as unsetToken, L as eq, S as mergedStream } from "../orm-BKc-pwj_.js";
|
|
3
3
|
import { convex } from "@convex-dev/better-auth/plugins";
|
|
4
4
|
import { createAdapterFactory } from "better-auth/adapters";
|
|
5
5
|
import { getAuthTables } from "better-auth/db";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { g as LazyCaller, m as ConvexContext, v as CallerMeta } from "../index-BQkhP2ny.js";
|
|
2
2
|
import "../http-types-BRLY10NX.js";
|
|
3
|
+
import "../context-utils-DSuX99Da.js";
|
|
3
4
|
import { GetTokenOptions } from "@convex-dev/better-auth/utils";
|
|
4
5
|
|
|
5
6
|
//#region src/auth-nextjs/index.d.ts
|
package/dist/orm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as ReturnTypeOrValue, i as KnownKeysOnly, o as Simplify, t as Assume } from "../types-jftzhhuc.js";
|
|
2
2
|
import { DefineSchemaOptions, DefineSchemaOptions as DefineSchemaOptions$1, FilterExpression as FilterExpression$1, GenericDatabaseReader, GenericDatabaseWriter, GenericIndexFields, GenericSchema, GenericSchema as GenericSchema$1, GenericTableIndexes, GenericTableSearchIndexes, GenericTableVectorIndexes, IndexRange, IndexRangeBuilder, SchedulableFunctionReference, Scheduler, SchemaDefinition, SchemaDefinition as SchemaDefinition$1, TableDefinition, VectorFilterBuilder, internalMutationGeneric } from "convex/server";
|
|
3
|
-
import * as
|
|
3
|
+
import * as convex_values63 from "convex/values";
|
|
4
4
|
import { GenericId, Validator, Value } from "convex/values";
|
|
5
5
|
|
|
6
6
|
//#region src/orm/builders/column-builder.d.ts
|
|
@@ -390,7 +390,7 @@ declare function custom<TName extends string, TValidator extends AnyValidator>(n
|
|
|
390
390
|
*
|
|
391
391
|
* Note: This is Convex JSON (runtime `v.any()`), not SQL JSON/JSONB.
|
|
392
392
|
*/
|
|
393
|
-
declare function json<T = Value>(): $Type<ConvexCustomBuilderInitial<"",
|
|
393
|
+
declare function json<T = Value>(): $Type<ConvexCustomBuilderInitial<"", convex_values63.VAny<any, "required", string>>, T>;
|
|
394
394
|
//#endregion
|
|
395
395
|
//#region src/orm/builders/date.d.ts
|
|
396
396
|
type ConvexDateMode = 'string' | 'date';
|
|
@@ -523,12 +523,12 @@ declare class ConvexSystemIdBuilder<_TTableName extends string> extends ColumnBu
|
|
|
523
523
|
static readonly [entityKind]: string;
|
|
524
524
|
readonly [entityKind]: string;
|
|
525
525
|
constructor();
|
|
526
|
-
build():
|
|
526
|
+
build(): convex_values63.VString<string, "required">;
|
|
527
527
|
/**
|
|
528
528
|
* Convex validator - runtime access
|
|
529
529
|
* System fields use v.string() for _id
|
|
530
530
|
*/
|
|
531
|
-
get convexValidator():
|
|
531
|
+
get convexValidator(): convex_values63.VString<string, "required">;
|
|
532
532
|
}
|
|
533
533
|
/**
|
|
534
534
|
* System creation time field builder (_creationTime)
|
|
@@ -545,12 +545,12 @@ declare class ConvexSystemCreationTimeBuilder extends ColumnBuilder<ConvexSystem
|
|
|
545
545
|
static readonly [entityKind]: string;
|
|
546
546
|
readonly [entityKind]: string;
|
|
547
547
|
constructor();
|
|
548
|
-
build():
|
|
548
|
+
build(): convex_values63.VFloat64<number, "required">;
|
|
549
549
|
/**
|
|
550
550
|
* Convex validator - runtime access
|
|
551
551
|
* System fields use v.number() for _creationTime
|
|
552
552
|
*/
|
|
553
|
-
get convexValidator():
|
|
553
|
+
get convexValidator(): convex_values63.VFloat64<number, "required">;
|
|
554
554
|
}
|
|
555
555
|
type ConvexSystemCreatedAtConfig = ColumnBuilderBaseConfig<'number', 'ConvexSystemCreatedAt'> & {
|
|
556
556
|
data: number;
|
|
@@ -563,8 +563,8 @@ declare class ConvexSystemCreatedAtBuilder extends ColumnBuilder<ConvexSystemCre
|
|
|
563
563
|
static readonly [entityKind]: string;
|
|
564
564
|
readonly [entityKind]: string;
|
|
565
565
|
constructor();
|
|
566
|
-
build():
|
|
567
|
-
get convexValidator():
|
|
566
|
+
build(): convex_values63.VFloat64<number, "required">;
|
|
567
|
+
get convexValidator(): convex_values63.VFloat64<number, "required">;
|
|
568
568
|
}
|
|
569
569
|
/**
|
|
570
570
|
* Create system field builders for a table
|
|
@@ -2661,7 +2661,7 @@ declare class RelationalSelectChain<TSchema extends TablesRelationalConfig, TTab
|
|
|
2661
2661
|
interleaveBy(interleaveBy: string[]): RelationalSelectChain<TSchema, TTableConfig, TRow>;
|
|
2662
2662
|
paginate(config: PaginateConfig): GelRelationalQuery<TSchema, TTableConfig, PaginatedResult<TRow>>;
|
|
2663
2663
|
pageByKey(pageByKey: FindManyPageByKeyConfig): GelRelationalQuery<TSchema, TTableConfig, KeyPageResult<TRow>>;
|
|
2664
|
-
first(): GelRelationalQuery<TSchema, TTableConfig, TRow |
|
|
2664
|
+
first(): GelRelationalQuery<TSchema, TTableConfig, TRow | null>;
|
|
2665
2665
|
firstOrThrow(): GelRelationalQuery<TSchema, TTableConfig, TRow>;
|
|
2666
2666
|
}
|
|
2667
2667
|
/**
|
|
@@ -2732,7 +2732,7 @@ declare class RelationalQueryBuilder<TSchema extends TablesRelationalConfig, TTa
|
|
|
2732
2732
|
*
|
|
2733
2733
|
* @template TConfig - Query configuration type (without limit)
|
|
2734
2734
|
* @param config - Optional query configuration (columns, with, where, orderBy, offset)
|
|
2735
|
-
* @returns Query promise that resolves to single result or
|
|
2735
|
+
* @returns Query promise that resolves to single result or null
|
|
2736
2736
|
*
|
|
2737
2737
|
* @example
|
|
2738
2738
|
* const user = await ctx.db.query.users.findFirst({
|
|
@@ -2740,8 +2740,8 @@ declare class RelationalQueryBuilder<TSchema extends TablesRelationalConfig, TTa
|
|
|
2740
2740
|
* with: { profile: true }
|
|
2741
2741
|
* });
|
|
2742
2742
|
*/
|
|
2743
|
-
findFirst<TConfig extends SearchFindFirstConfig<TSchema, TTableConfig>>(config: KnownKeysOnly<TConfig, SearchFindFirstConfig<TSchema, TTableConfig>> & DisallowWithIndexSearchOrVector<THasIndex>): GelRelationalQuery<TSchema, TTableConfig, BuildQueryResult<TSchema, TTableConfig, TConfig> |
|
|
2744
|
-
findFirst<TConfig extends FindFirstConfigNoSearch<TSchema, TTableConfig>>(config?: KnownKeysOnly<TConfig, FindFirstConfigNoSearch<TSchema, TTableConfig>> & EnforcedConfig<TConfig, TTableConfig, THasIndex>): GelRelationalQuery<TSchema, TTableConfig, BuildQueryResult<TSchema, TTableConfig, TConfig> |
|
|
2743
|
+
findFirst<TConfig extends SearchFindFirstConfig<TSchema, TTableConfig>>(config: KnownKeysOnly<TConfig, SearchFindFirstConfig<TSchema, TTableConfig>> & DisallowWithIndexSearchOrVector<THasIndex>): GelRelationalQuery<TSchema, TTableConfig, BuildQueryResult<TSchema, TTableConfig, TConfig> | null>;
|
|
2744
|
+
findFirst<TConfig extends FindFirstConfigNoSearch<TSchema, TTableConfig>>(config?: KnownKeysOnly<TConfig, FindFirstConfigNoSearch<TSchema, TTableConfig>> & EnforcedConfig<TConfig, TTableConfig, THasIndex>): GelRelationalQuery<TSchema, TTableConfig, BuildQueryResult<TSchema, TTableConfig, TConfig> | null>;
|
|
2745
2745
|
/**
|
|
2746
2746
|
* Find first row matching the query configuration, or throw if none exists.
|
|
2747
2747
|
*
|
package/dist/orm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as or, A as Brand, B as gte, D as unsetToken, E as OrmNotFoundError, F as contains, G as isNull, H as inArray, I as endsWith, J as lte, K as like, L as eq, M as TableName, N as and, O as RlsRole, P as between, Q as notInArray, R as fieldRef, T as desc, U as isFieldReference, V as ilike, W as isNotNull, X as not, Y as ne, Z as notBetween, _ as onInsert, a as getTableConfig, at as timestamp, b as rlsPolicy, c as uniqueIndex, ct as integer, d as scheduledMutationBatchFactory, dt as custom, et as startsWith, f as scheduledDeleteFactory, ft as json, g as onDelete, h as onChange, ht as bigint, i as getTableColumns, it as vector, j as Columns, k as rlsRole, l as vectorIndex, lt as id, m as deletion, mt as boolean, n as defineRelations, nt as foreignKey, o as index, ot as textEnum, p as convexTable, pt as bytes, q as lt, r as defineRelationsPart, rt as unique, s as searchIndex, st as text, t as defineSchema, tt as check, u as createOrm, ut as date, v as onUpdate, w as asc, x as extractRelationsConfig, y as RlsPolicy, z as gt } from "../orm-
|
|
1
|
+
import { $ as or, A as Brand, B as gte, D as unsetToken, E as OrmNotFoundError, F as contains, G as isNull, H as inArray, I as endsWith, J as lte, K as like, L as eq, M as TableName, N as and, O as RlsRole, P as between, Q as notInArray, R as fieldRef, T as desc, U as isFieldReference, V as ilike, W as isNotNull, X as not, Y as ne, Z as notBetween, _ as onInsert, a as getTableConfig, at as timestamp, b as rlsPolicy, c as uniqueIndex, ct as integer, d as scheduledMutationBatchFactory, dt as custom, et as startsWith, f as scheduledDeleteFactory, ft as json, g as onDelete, h as onChange, ht as bigint, i as getTableColumns, it as vector, j as Columns, k as rlsRole, l as vectorIndex, lt as id, m as deletion, mt as boolean, n as defineRelations, nt as foreignKey, o as index, ot as textEnum, p as convexTable, pt as bytes, q as lt, r as defineRelationsPart, rt as unique, s as searchIndex, st as text, t as defineSchema, tt as check, u as createOrm, ut as date, v as onUpdate, w as asc, x as extractRelationsConfig, y as RlsPolicy, z as gt } from "../orm-BKc-pwj_.js";
|
|
2
2
|
|
|
3
3
|
export { Brand, Columns, OrmNotFoundError, RlsPolicy, RlsRole, TableName, and, asc, between, bigint, boolean, bytes, check, contains, convexTable, createOrm, custom, date, defineRelations, defineRelationsPart, defineSchema, deletion, desc, endsWith, eq, extractRelationsConfig, fieldRef, foreignKey, getTableColumns, getTableConfig, gt, gte, id, ilike, inArray, index, integer, isFieldReference, isNotNull, isNull, json, like, lt, lte, ne, not, notBetween, notInArray, onChange, onDelete, onInsert, onUpdate, or, rlsPolicy, rlsRole, scheduledDeleteFactory, scheduledMutationBatchFactory, searchIndex, startsWith, text, textEnum, timestamp, unique, uniqueIndex, unsetToken, vector, vectorIndex };
|
|
@@ -1133,6 +1133,7 @@ const hydrateDateFieldsForRead = (table, value) => {
|
|
|
1133
1133
|
result[name] = hydrateTemporalReadValue(descriptor, rawCreationTime);
|
|
1134
1134
|
continue;
|
|
1135
1135
|
}
|
|
1136
|
+
if (!Object.hasOwn(result, name)) continue;
|
|
1136
1137
|
result[name] = hydrateTemporalReadValue(descriptor, result[name]);
|
|
1137
1138
|
}
|
|
1138
1139
|
return result;
|
|
@@ -4620,7 +4621,7 @@ var GelRelationalQuery = class extends QueryPromise {
|
|
|
4620
4621
|
if (this.mode === "many") return selectedRows;
|
|
4621
4622
|
const first = selectedRows[0];
|
|
4622
4623
|
if (this.mode === "firstOrThrow" && first === void 0) throw new OrmNotFoundError(`Could not find ${this.tableConfig.name}.`, this.tableConfig.name);
|
|
4623
|
-
return first;
|
|
4624
|
+
return first ?? null;
|
|
4624
4625
|
}
|
|
4625
4626
|
async _applyRlsSelectFilter(rows, tableConfig) {
|
|
4626
4627
|
if (!rows.length || !tableConfig) return rows;
|