better-convex 0.3.1 → 0.5.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/auth/index.d.ts +60 -60
- package/dist/auth-nextjs/index.d.ts +1 -1
- package/dist/auth-nextjs/index.js +1 -1
- package/dist/crpc/index.d.ts +8 -3
- package/dist/crpc/index.js +2 -2
- package/dist/{error-CsSzFKod.js → error-CNMP5iLQ.js} +10 -1
- package/dist/{http-types-CZo9Xx5R.d.ts → http-types-B3tM9Old.d.ts} +12 -6
- package/dist/react/index.d.ts +163 -16
- package/dist/react/index.js +263 -93
- package/dist/rsc/index.d.ts +84 -14
- package/dist/server/index.d.ts +26 -24
- package/dist/server/index.js +43 -7
- package/dist/{types-U9pc_wi1.d.ts → types-DMJsgCiw.d.ts} +29 -2
- package/package.json +1 -1
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as better_auth_adapters1 from "better-auth/adapters";
|
|
2
2
|
import { DBAdapterDebugLogOption } from "better-auth/adapters";
|
|
3
3
|
import { BetterAuthDBSchema } from "better-auth/db";
|
|
4
|
-
import * as
|
|
4
|
+
import * as convex_server48 from "convex/server";
|
|
5
5
|
import { DocumentByName, FunctionReference, GenericDataModel, GenericMutationCtx, GenericQueryCtx, GenericSchema, IdField, PaginationOptions, PaginationResult, SchemaDefinition, SystemFields, TableNamesInDataModel, internalMutationGeneric } from "convex/server";
|
|
6
6
|
import * as convex_values0 from "convex/values";
|
|
7
7
|
import { Infer } from "convex/values";
|
|
@@ -48,28 +48,28 @@ declare const createClient: <DataModel extends GenericDataModel, Schema$1 extend
|
|
|
48
48
|
adapter: (ctx: GenericCtx<DataModel>, createAuthOptions: (ctx: any) => BetterAuthOptions) => better_auth_adapters1.AdapterFactory;
|
|
49
49
|
httpAdapter: (ctx: GenericCtx<DataModel>) => better_auth_adapters1.AdapterFactory;
|
|
50
50
|
triggersApi: () => {
|
|
51
|
-
beforeCreate:
|
|
51
|
+
beforeCreate: convex_server48.RegisteredMutation<"internal", {
|
|
52
52
|
data: any;
|
|
53
53
|
model: string;
|
|
54
54
|
}, Promise<any>>;
|
|
55
|
-
beforeDelete:
|
|
55
|
+
beforeDelete: convex_server48.RegisteredMutation<"internal", {
|
|
56
56
|
model: string;
|
|
57
57
|
doc: any;
|
|
58
58
|
}, Promise<any>>;
|
|
59
|
-
beforeUpdate:
|
|
59
|
+
beforeUpdate: convex_server48.RegisteredMutation<"internal", {
|
|
60
60
|
update: any;
|
|
61
61
|
model: string;
|
|
62
62
|
doc: any;
|
|
63
63
|
}, Promise<any>>;
|
|
64
|
-
onCreate:
|
|
64
|
+
onCreate: convex_server48.RegisteredMutation<"internal", {
|
|
65
65
|
model: string;
|
|
66
66
|
doc: any;
|
|
67
67
|
}, Promise<void>>;
|
|
68
|
-
onDelete:
|
|
68
|
+
onDelete: convex_server48.RegisteredMutation<"internal", {
|
|
69
69
|
model: string;
|
|
70
70
|
doc: any;
|
|
71
71
|
}, Promise<void>>;
|
|
72
|
-
onUpdate:
|
|
72
|
+
onUpdate: convex_server48.RegisteredMutation<"internal", {
|
|
73
73
|
model: string;
|
|
74
74
|
newDoc: any;
|
|
75
75
|
oldDoc: any;
|
|
@@ -164,20 +164,20 @@ declare const dbAdapter: <DataModel extends GenericDataModel, Schema$1 extends S
|
|
|
164
164
|
//#endregion
|
|
165
165
|
//#region src/auth/adapter-utils.d.ts
|
|
166
166
|
declare const adapterWhereValidator: convex_values0.VObject<{
|
|
167
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
167
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
168
168
|
connector?: "AND" | "OR" | undefined;
|
|
169
169
|
value: string | number | boolean | string[] | number[] | null;
|
|
170
170
|
field: string;
|
|
171
171
|
}, {
|
|
172
172
|
connector: convex_values0.VUnion<"AND" | "OR" | undefined, [convex_values0.VLiteral<"AND", "required">, convex_values0.VLiteral<"OR", "required">], "optional", never>;
|
|
173
173
|
field: convex_values0.VString<string, "required">;
|
|
174
|
-
operator: convex_values0.VUnion<"eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
174
|
+
operator: convex_values0.VUnion<"in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "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>;
|
|
175
175
|
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>;
|
|
176
|
-
}, "required", "
|
|
176
|
+
}, "required", "value" | "operator" | "field" | "connector">;
|
|
177
177
|
declare const adapterArgsValidator: convex_values0.VObject<{
|
|
178
178
|
limit?: number | undefined;
|
|
179
179
|
where?: {
|
|
180
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
180
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
181
181
|
connector?: "AND" | "OR" | undefined;
|
|
182
182
|
value: string | number | boolean | string[] | number[] | null;
|
|
183
183
|
field: string;
|
|
@@ -202,21 +202,21 @@ declare const adapterArgsValidator: convex_values0.VObject<{
|
|
|
202
202
|
field: convex_values0.VString<string, "required">;
|
|
203
203
|
}, "optional", "field" | "direction">;
|
|
204
204
|
where: convex_values0.VArray<{
|
|
205
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
205
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
206
206
|
connector?: "AND" | "OR" | undefined;
|
|
207
207
|
value: string | number | boolean | string[] | number[] | null;
|
|
208
208
|
field: string;
|
|
209
209
|
}[] | undefined, convex_values0.VObject<{
|
|
210
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
210
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
211
211
|
connector?: "AND" | "OR" | undefined;
|
|
212
212
|
value: string | number | boolean | string[] | number[] | null;
|
|
213
213
|
field: string;
|
|
214
214
|
}, {
|
|
215
215
|
connector: convex_values0.VUnion<"AND" | "OR" | undefined, [convex_values0.VLiteral<"AND", "required">, convex_values0.VLiteral<"OR", "required">], "optional", never>;
|
|
216
216
|
field: convex_values0.VString<string, "required">;
|
|
217
|
-
operator: convex_values0.VUnion<"eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
217
|
+
operator: convex_values0.VUnion<"in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "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>;
|
|
218
218
|
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>;
|
|
219
|
-
}, "required", "
|
|
219
|
+
}, "required", "value" | "operator" | "field" | "connector">, "optional">;
|
|
220
220
|
}, "required", "limit" | "where" | "model" | "select" | "offset" | "sortBy" | "sortBy.field" | "sortBy.direction">;
|
|
221
221
|
declare const hasUniqueFields: (betterAuthSchema: BetterAuthDBSchema, model: string, input: Record<string, any>) => boolean;
|
|
222
222
|
declare const checkUniqueFields: <Schema$1 extends SchemaDefinition<any, any>>(ctx: GenericQueryCtx<GenericDataModel>, schema: Schema$1, betterAuthSchema: BetterAuthDBSchema, table: string, input: Record<string, any>, doc?: Record<string, any>) => Promise<void>;
|
|
@@ -245,7 +245,7 @@ declare const findOneHandler: (ctx: any, args: {
|
|
|
245
245
|
model: string;
|
|
246
246
|
select?: string[];
|
|
247
247
|
where?: any[];
|
|
248
|
-
}, schema: Schema, betterAuthSchema: any) => Promise<
|
|
248
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<convex_server48.GenericDocument | null>;
|
|
249
249
|
declare const findManyHandler: (ctx: any, args: {
|
|
250
250
|
model: string;
|
|
251
251
|
paginationOpts: any;
|
|
@@ -256,7 +256,7 @@ declare const findManyHandler: (ctx: any, args: {
|
|
|
256
256
|
field: string;
|
|
257
257
|
};
|
|
258
258
|
where?: any[];
|
|
259
|
-
}, schema: Schema, betterAuthSchema: any) => Promise<
|
|
259
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<convex_server48.PaginationResult<convex_server48.GenericDocument>>;
|
|
260
260
|
declare const updateOneHandler: (ctx: any, args: {
|
|
261
261
|
input: {
|
|
262
262
|
model: string;
|
|
@@ -279,8 +279,8 @@ declare const updateManyHandler: (ctx: any, args: {
|
|
|
279
279
|
count: number;
|
|
280
280
|
ids: any[];
|
|
281
281
|
isDone: boolean;
|
|
282
|
-
continueCursor:
|
|
283
|
-
splitCursor?:
|
|
282
|
+
continueCursor: convex_server48.Cursor;
|
|
283
|
+
splitCursor?: convex_server48.Cursor | null;
|
|
284
284
|
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
285
285
|
}>;
|
|
286
286
|
declare const deleteOneHandler: (ctx: any, args: {
|
|
@@ -291,7 +291,7 @@ declare const deleteOneHandler: (ctx: any, args: {
|
|
|
291
291
|
beforeDeleteHandle?: string;
|
|
292
292
|
skipBeforeHooks?: boolean;
|
|
293
293
|
onDeleteHandle?: string;
|
|
294
|
-
}, schema: Schema, betterAuthSchema: any) => Promise<
|
|
294
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<convex_server48.GenericDocument | undefined>;
|
|
295
295
|
declare const deleteManyHandler: (ctx: any, args: {
|
|
296
296
|
input: {
|
|
297
297
|
model: string;
|
|
@@ -305,8 +305,8 @@ declare const deleteManyHandler: (ctx: any, args: {
|
|
|
305
305
|
count: number;
|
|
306
306
|
ids: any[];
|
|
307
307
|
isDone: boolean;
|
|
308
|
-
continueCursor:
|
|
309
|
-
splitCursor?:
|
|
308
|
+
continueCursor: convex_server48.Cursor;
|
|
309
|
+
splitCursor?: convex_server48.Cursor | null;
|
|
310
310
|
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
311
311
|
}>;
|
|
312
312
|
declare const createApi: <Schema$1 extends SchemaDefinition<any, any>>(schema: Schema$1, createAuth: CreateAuth, options?: {
|
|
@@ -314,7 +314,7 @@ declare const createApi: <Schema$1 extends SchemaDefinition<any, any>>(schema: S
|
|
|
314
314
|
/** Skip input validation for smaller generated types. Since these are internal functions, validation is optional. */
|
|
315
315
|
skipValidation?: boolean;
|
|
316
316
|
}) => {
|
|
317
|
-
create:
|
|
317
|
+
create: convex_server48.RegisteredMutation<"internal", {
|
|
318
318
|
select?: string[] | undefined;
|
|
319
319
|
beforeCreateHandle?: string | undefined;
|
|
320
320
|
onCreateHandle?: string | undefined;
|
|
@@ -330,38 +330,38 @@ declare const createApi: <Schema$1 extends SchemaDefinition<any, any>>(schema: S
|
|
|
330
330
|
model: string;
|
|
331
331
|
};
|
|
332
332
|
}, Promise<any>>;
|
|
333
|
-
deleteMany:
|
|
333
|
+
deleteMany: convex_server48.RegisteredMutation<"internal", {
|
|
334
334
|
beforeDeleteHandle?: string | undefined;
|
|
335
335
|
onDeleteHandle?: string | undefined;
|
|
336
|
-
paginationOpts: {
|
|
337
|
-
id?: number;
|
|
338
|
-
endCursor?: string | null;
|
|
339
|
-
maximumRowsRead?: number;
|
|
340
|
-
maximumBytesRead?: number;
|
|
341
|
-
numItems: number;
|
|
342
|
-
cursor: string | null;
|
|
343
|
-
};
|
|
344
336
|
input: {
|
|
345
337
|
where?: any[] | undefined;
|
|
346
338
|
model: string;
|
|
347
339
|
} | {
|
|
348
340
|
where?: {
|
|
349
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
341
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
350
342
|
connector?: "AND" | "OR" | undefined;
|
|
351
343
|
value: string | number | boolean | string[] | number[] | null;
|
|
352
344
|
field: string;
|
|
353
345
|
}[] | undefined;
|
|
354
346
|
model: string;
|
|
355
347
|
};
|
|
348
|
+
paginationOpts: {
|
|
349
|
+
id?: number;
|
|
350
|
+
endCursor?: string | null;
|
|
351
|
+
maximumRowsRead?: number;
|
|
352
|
+
maximumBytesRead?: number;
|
|
353
|
+
numItems: number;
|
|
354
|
+
cursor: string | null;
|
|
355
|
+
};
|
|
356
356
|
}, Promise<{
|
|
357
357
|
count: number;
|
|
358
358
|
ids: any[];
|
|
359
359
|
isDone: boolean;
|
|
360
|
-
continueCursor:
|
|
361
|
-
splitCursor?:
|
|
360
|
+
continueCursor: convex_server48.Cursor;
|
|
361
|
+
splitCursor?: convex_server48.Cursor | null;
|
|
362
362
|
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
363
363
|
}>>;
|
|
364
|
-
deleteOne:
|
|
364
|
+
deleteOne: convex_server48.RegisteredMutation<"internal", {
|
|
365
365
|
beforeDeleteHandle?: string | undefined;
|
|
366
366
|
onDeleteHandle?: string | undefined;
|
|
367
367
|
input: {
|
|
@@ -369,19 +369,19 @@ declare const createApi: <Schema$1 extends SchemaDefinition<any, any>>(schema: S
|
|
|
369
369
|
model: string;
|
|
370
370
|
} | {
|
|
371
371
|
where?: {
|
|
372
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
372
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
373
373
|
connector?: "AND" | "OR" | undefined;
|
|
374
374
|
value: string | number | boolean | string[] | number[] | null;
|
|
375
375
|
field: string;
|
|
376
376
|
}[] | undefined;
|
|
377
377
|
model: string;
|
|
378
378
|
};
|
|
379
|
-
}, Promise<
|
|
380
|
-
findMany:
|
|
379
|
+
}, Promise<convex_server48.GenericDocument | undefined>>;
|
|
380
|
+
findMany: convex_server48.RegisteredQuery<"internal", {
|
|
381
381
|
limit?: number | undefined;
|
|
382
382
|
join?: any;
|
|
383
383
|
where?: {
|
|
384
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
384
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
385
385
|
connector?: "AND" | "OR" | undefined;
|
|
386
386
|
value: string | number | boolean | string[] | number[] | null;
|
|
387
387
|
field: string;
|
|
@@ -400,36 +400,28 @@ declare const createApi: <Schema$1 extends SchemaDefinition<any, any>>(schema: S
|
|
|
400
400
|
cursor: string | null;
|
|
401
401
|
};
|
|
402
402
|
model: string;
|
|
403
|
-
}, Promise<
|
|
404
|
-
findOne:
|
|
403
|
+
}, Promise<convex_server48.PaginationResult<convex_server48.GenericDocument>>>;
|
|
404
|
+
findOne: convex_server48.RegisteredQuery<"internal", {
|
|
405
405
|
join?: any;
|
|
406
406
|
where?: {
|
|
407
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
407
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
408
408
|
connector?: "AND" | "OR" | undefined;
|
|
409
409
|
value: string | number | boolean | string[] | number[] | null;
|
|
410
410
|
field: string;
|
|
411
411
|
}[] | undefined;
|
|
412
412
|
select?: string[] | undefined;
|
|
413
413
|
model: string;
|
|
414
|
-
}, Promise<
|
|
415
|
-
updateMany:
|
|
414
|
+
}, Promise<convex_server48.GenericDocument | null>>;
|
|
415
|
+
updateMany: convex_server48.RegisteredMutation<"internal", {
|
|
416
416
|
beforeUpdateHandle?: string | undefined;
|
|
417
417
|
onUpdateHandle?: string | undefined;
|
|
418
|
-
paginationOpts: {
|
|
419
|
-
id?: number;
|
|
420
|
-
endCursor?: string | null;
|
|
421
|
-
maximumRowsRead?: number;
|
|
422
|
-
maximumBytesRead?: number;
|
|
423
|
-
numItems: number;
|
|
424
|
-
cursor: string | null;
|
|
425
|
-
};
|
|
426
418
|
input: {
|
|
427
419
|
where?: any[] | undefined;
|
|
428
420
|
update: any;
|
|
429
421
|
model: string;
|
|
430
422
|
} | {
|
|
431
423
|
where?: {
|
|
432
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
424
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
433
425
|
connector?: "AND" | "OR" | undefined;
|
|
434
426
|
value: string | number | boolean | string[] | number[] | null;
|
|
435
427
|
field: string;
|
|
@@ -441,15 +433,23 @@ declare const createApi: <Schema$1 extends SchemaDefinition<any, any>>(schema: S
|
|
|
441
433
|
};
|
|
442
434
|
model: string;
|
|
443
435
|
};
|
|
436
|
+
paginationOpts: {
|
|
437
|
+
id?: number;
|
|
438
|
+
endCursor?: string | null;
|
|
439
|
+
maximumRowsRead?: number;
|
|
440
|
+
maximumBytesRead?: number;
|
|
441
|
+
numItems: number;
|
|
442
|
+
cursor: string | null;
|
|
443
|
+
};
|
|
444
444
|
}, Promise<{
|
|
445
445
|
count: number;
|
|
446
446
|
ids: any[];
|
|
447
447
|
isDone: boolean;
|
|
448
|
-
continueCursor:
|
|
449
|
-
splitCursor?:
|
|
448
|
+
continueCursor: convex_server48.Cursor;
|
|
449
|
+
splitCursor?: convex_server48.Cursor | null;
|
|
450
450
|
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
451
451
|
}>>;
|
|
452
|
-
updateOne:
|
|
452
|
+
updateOne: convex_server48.RegisteredMutation<"internal", {
|
|
453
453
|
beforeUpdateHandle?: string | undefined;
|
|
454
454
|
onUpdateHandle?: string | undefined;
|
|
455
455
|
input: {
|
|
@@ -458,7 +458,7 @@ declare const createApi: <Schema$1 extends SchemaDefinition<any, any>>(schema: S
|
|
|
458
458
|
model: string;
|
|
459
459
|
} | {
|
|
460
460
|
where?: {
|
|
461
|
-
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "
|
|
461
|
+
operator?: "in" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
462
462
|
connector?: "AND" | "OR" | undefined;
|
|
463
463
|
value: string | number | boolean | string[] | number[] | null;
|
|
464
464
|
field: string;
|
|
@@ -471,8 +471,8 @@ declare const createApi: <Schema$1 extends SchemaDefinition<any, any>>(schema: S
|
|
|
471
471
|
model: string;
|
|
472
472
|
};
|
|
473
473
|
}, Promise<any>>;
|
|
474
|
-
getLatestJwks:
|
|
475
|
-
rotateKeys:
|
|
474
|
+
getLatestJwks: convex_server48.RegisteredAction<"internal", {}, Promise<any>>;
|
|
475
|
+
rotateKeys: convex_server48.RegisteredAction<"internal", {}, Promise<any>>;
|
|
476
476
|
};
|
|
477
477
|
//#endregion
|
|
478
478
|
//#region src/auth/helpers.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as defaultIsUnauthorized } from "../error-
|
|
1
|
+
import { n as defaultIsUnauthorized } from "../error-CNMP5iLQ.js";
|
|
2
2
|
import { t as createCallerFactory } from "../caller-factory-DxmuY355.js";
|
|
3
3
|
import { getToken } from "@convex-dev/better-auth/utils";
|
|
4
4
|
|
package/dist/crpc/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as HttpProcedureCall, c as InferHttpInput, i as HttpErrorCode, l as InferHttpOutput, n as HttpClientError, o as HttpRouteInfo, r as HttpClientFromRouter, s as HttpRouteMap, t as HttpClient, u as isHttpClientError } from "../http-types-
|
|
2
|
-
import { C as PaginatedFnMeta, S as Meta, _ as ExtractPaginatedItem, a as ConvexInfiniteQueryMeta, b as InfiniteQueryInput, c as ConvexMutationKey, d as ConvexQueryMeta, f as ConvexQueryOptions, g as DecorateQuery, h as DecorateMutation, i as ConvexActionOptions, l as ConvexQueryHookOptions, m as DecorateInfiniteQuery, n as CRPCClient, o as ConvexInfiniteQueryOptions, p as DecorateAction, r as ConvexActionKey, s as ConvexInfiniteQueryOptionsWithRef, t as AuthType, u as ConvexQueryKey, v as FUNC_REF_SYMBOL, w as PaginationOpts, x as InfiniteQueryOptsParam, y as FnMeta } from "../types-
|
|
1
|
+
import { a as HttpProcedureCall, c as InferHttpInput, i as HttpErrorCode, l as InferHttpOutput, n as HttpClientError, o as HttpRouteInfo, r as HttpClientFromRouter, s as HttpRouteMap, t as HttpClient, u as isHttpClientError } from "../http-types-B3tM9Old.js";
|
|
2
|
+
import { C as PaginatedFnMeta, D as VanillaMutation, E as VanillaCRPCClient, O as VanillaQuery, S as Meta, T as VanillaAction, _ as ExtractPaginatedItem, a as ConvexInfiniteQueryMeta, b as InfiniteQueryInput, c as ConvexMutationKey, d as ConvexQueryMeta, f as ConvexQueryOptions, g as DecorateQuery, h as DecorateMutation, i as ConvexActionOptions, l as ConvexQueryHookOptions, m as DecorateInfiniteQuery, n as CRPCClient, o as ConvexInfiniteQueryOptions, p as DecorateAction, r as ConvexActionKey, s as ConvexInfiniteQueryOptionsWithRef, t as AuthType, u as ConvexQueryKey, v as FUNC_REF_SYMBOL, w as PaginationOpts, x as InfiniteQueryOptsParam, y as FnMeta } from "../types-DMJsgCiw.js";
|
|
3
3
|
import { FunctionArgs, FunctionReference } from "convex/server";
|
|
4
4
|
|
|
5
5
|
//#region src/crpc/error.d.ts
|
|
@@ -23,6 +23,11 @@ declare class CRPCClientError extends Error {
|
|
|
23
23
|
}
|
|
24
24
|
/** Type guard for CRPCClientError */
|
|
25
25
|
declare const isCRPCClientError: (error: unknown) => error is CRPCClientError;
|
|
26
|
+
/**
|
|
27
|
+
* Unified check for any deterministic CRPC error (Convex or HTTP).
|
|
28
|
+
* Use in retry logic to skip retrying client errors (4xx).
|
|
29
|
+
*/
|
|
30
|
+
declare const isCRPCError: (error: unknown) => boolean;
|
|
26
31
|
/** Type guard for specific error code */
|
|
27
32
|
declare const isCRPCErrorCode: (error: unknown, code: ClientErrorCode) => error is CRPCClientError;
|
|
28
33
|
/** Default unauthorized detection - checks UNAUTHORIZED code */
|
|
@@ -68,4 +73,4 @@ declare function convexAction<T extends FunctionReference<'action'>>(funcRef: T,
|
|
|
68
73
|
*/
|
|
69
74
|
declare function convexInfiniteQueryOptions<T extends FunctionReference<'query'>>(funcRef: T, args: Record<string, unknown> | 'skip', opts?: InfiniteQueryOptsParam<T>, meta?: Meta): ConvexInfiniteQueryOptions<T>;
|
|
70
75
|
//#endregion
|
|
71
|
-
export { AuthType, CRPCClient, CRPCClientError, ConvexActionKey, ConvexActionOptions, ConvexInfiniteQueryMeta, ConvexInfiniteQueryOptions, ConvexInfiniteQueryOptionsWithRef, ConvexMutationKey, ConvexQueryHookOptions, ConvexQueryKey, ConvexQueryMeta, ConvexQueryOptions, DecorateAction, DecorateInfiniteQuery, DecorateMutation, DecorateQuery, ExtractPaginatedItem, FUNC_REF_SYMBOL, FnMeta, HttpClient, HttpClientError, HttpClientFromRouter, HttpErrorCode, HttpProcedureCall, HttpRouteInfo, HttpRouteMap, InferHttpInput, InferHttpOutput, InfiniteQueryInput, InfiniteQueryOptsParam, Meta, PaginatedFnMeta, PaginationOpts, convexAction, convexInfiniteQueryOptions, convexQuery, defaultIsUnauthorized, isCRPCClientError, isCRPCErrorCode, isHttpClientError };
|
|
76
|
+
export { AuthType, CRPCClient, CRPCClientError, ConvexActionKey, ConvexActionOptions, ConvexInfiniteQueryMeta, ConvexInfiniteQueryOptions, ConvexInfiniteQueryOptionsWithRef, ConvexMutationKey, ConvexQueryHookOptions, ConvexQueryKey, ConvexQueryMeta, ConvexQueryOptions, DecorateAction, DecorateInfiniteQuery, DecorateMutation, DecorateQuery, ExtractPaginatedItem, FUNC_REF_SYMBOL, FnMeta, HttpClient, HttpClientError, HttpClientFromRouter, HttpErrorCode, HttpProcedureCall, HttpRouteInfo, HttpRouteMap, InferHttpInput, InferHttpOutput, InfiniteQueryInput, InfiniteQueryOptsParam, Meta, PaginatedFnMeta, PaginationOpts, VanillaAction, VanillaCRPCClient, VanillaMutation, VanillaQuery, convexAction, convexInfiniteQueryOptions, convexQuery, defaultIsUnauthorized, isCRPCClientError, isCRPCError, isCRPCErrorCode, isHttpClientError };
|
package/dist/crpc/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as isCRPCErrorCode, i as isCRPCError, n as defaultIsUnauthorized, r as isCRPCClientError, t as CRPCClientError } from "../error-CNMP5iLQ.js";
|
|
2
2
|
import { n as convexInfiniteQueryOptions, r as convexQuery, t as convexAction } from "../query-options-sK2n1Ioe.js";
|
|
3
3
|
|
|
4
4
|
//#region src/crpc/http-types.ts
|
|
@@ -24,4 +24,4 @@ const isHttpClientError = (error) => error instanceof HttpClientError;
|
|
|
24
24
|
const FUNC_REF_SYMBOL = Symbol.for("convex.funcRef");
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
export { CRPCClientError, FUNC_REF_SYMBOL, HttpClientError, convexAction, convexInfiniteQueryOptions, convexQuery, defaultIsUnauthorized, isCRPCClientError, isCRPCErrorCode, isHttpClientError };
|
|
27
|
+
export { CRPCClientError, FUNC_REF_SYMBOL, HttpClientError, convexAction, convexInfiniteQueryOptions, convexQuery, defaultIsUnauthorized, isCRPCClientError, isCRPCError, isCRPCErrorCode, isHttpClientError };
|
|
@@ -15,6 +15,15 @@ var CRPCClientError = class extends Error {
|
|
|
15
15
|
};
|
|
16
16
|
/** Type guard for CRPCClientError */
|
|
17
17
|
const isCRPCClientError = (error) => error instanceof CRPCClientError;
|
|
18
|
+
/**
|
|
19
|
+
* Unified check for any deterministic CRPC error (Convex or HTTP).
|
|
20
|
+
* Use in retry logic to skip retrying client errors (4xx).
|
|
21
|
+
*/
|
|
22
|
+
const isCRPCError = (error) => {
|
|
23
|
+
if (error instanceof CRPCClientError) return true;
|
|
24
|
+
if (error instanceof Error && error.name === "HttpClientError" && "status" in error && typeof error.status === "number") return error.status < 500;
|
|
25
|
+
return false;
|
|
26
|
+
};
|
|
18
27
|
/** Type guard for specific error code */
|
|
19
28
|
const isCRPCErrorCode = (error, code) => isCRPCClientError(error) && error.code === code;
|
|
20
29
|
/** Default unauthorized detection - checks UNAUTHORIZED code */
|
|
@@ -29,4 +38,4 @@ const defaultIsUnauthorized = (error) => {
|
|
|
29
38
|
};
|
|
30
39
|
|
|
31
40
|
//#endregion
|
|
32
|
-
export { isCRPCErrorCode as i, defaultIsUnauthorized as n, isCRPCClientError as r, CRPCClientError as t };
|
|
41
|
+
export { isCRPCErrorCode as a, isCRPCError as i, defaultIsUnauthorized as n, isCRPCClientError as r, CRPCClientError as t };
|
|
@@ -91,13 +91,14 @@ type InferHttpInput$1<T> = T extends UnsetMarker ? undefined : T extends z.ZodTy
|
|
|
91
91
|
* Internal definition for HttpProcedureBuilder
|
|
92
92
|
* Stores schema types directly (like QueryProcedureBuilder)
|
|
93
93
|
*/
|
|
94
|
-
interface HttpProcedureBuilderDef<TCtx, TInput$1 extends UnsetMarker | z.ZodTypeAny, TOutput$1 extends UnsetMarker | z.ZodTypeAny, TParams$1 extends UnsetMarker | z.ZodTypeAny, TQuery$1 extends UnsetMarker | z.ZodTypeAny, TMeta extends ProcedureMeta, TMethod extends HttpMethod = HttpMethod> {
|
|
94
|
+
interface HttpProcedureBuilderDef<TCtx, TInput$1 extends UnsetMarker | z.ZodTypeAny, TOutput$1 extends UnsetMarker | z.ZodTypeAny, TParams$1 extends UnsetMarker | z.ZodTypeAny, TQuery$1 extends UnsetMarker | z.ZodTypeAny, TMeta extends ProcedureMeta, TMethod extends HttpMethod = HttpMethod, TForm extends UnsetMarker | z.ZodTypeAny = UnsetMarker> {
|
|
95
95
|
middlewares: AnyMiddleware[];
|
|
96
96
|
meta: TMeta;
|
|
97
97
|
inputSchema?: z.ZodTypeAny;
|
|
98
98
|
outputSchema?: z.ZodTypeAny;
|
|
99
99
|
paramsSchema?: z.ZodTypeAny;
|
|
100
100
|
querySchema?: z.ZodTypeAny;
|
|
101
|
+
formSchema?: z.ZodTypeAny;
|
|
101
102
|
route?: HttpRouteDefinition<TMethod>;
|
|
102
103
|
functionConfig: {
|
|
103
104
|
base: HttpActionConstructor;
|
|
@@ -109,13 +110,14 @@ interface HttpProcedureBuilderDef<TCtx, TInput$1 extends UnsetMarker | z.ZodType
|
|
|
109
110
|
output: TOutput$1;
|
|
110
111
|
params: TParams$1;
|
|
111
112
|
query: TQuery$1;
|
|
113
|
+
form: TForm;
|
|
112
114
|
};
|
|
113
115
|
}
|
|
114
116
|
type HttpActionConstructor = (handler: (ctx: GenericActionCtx<GenericDataModel>, request: Request) => Promise<Response>) => HttpActionHandler;
|
|
115
117
|
interface HttpActionHandler {
|
|
116
118
|
isHttp: true;
|
|
117
119
|
}
|
|
118
|
-
interface HttpProcedure<TInput$1 extends UnsetMarker | z.ZodTypeAny = any, TOutput$1 extends UnsetMarker | z.ZodTypeAny = any, TParams$1 extends UnsetMarker | z.ZodTypeAny = any, TQuery$1 extends UnsetMarker | z.ZodTypeAny = any, TMethod extends HttpMethod = HttpMethod> extends HttpActionHandler {
|
|
120
|
+
interface HttpProcedure<TInput$1 extends UnsetMarker | z.ZodTypeAny = any, TOutput$1 extends UnsetMarker | z.ZodTypeAny = any, TParams$1 extends UnsetMarker | z.ZodTypeAny = any, TQuery$1 extends UnsetMarker | z.ZodTypeAny = any, TMethod extends HttpMethod = HttpMethod, TForm extends UnsetMarker | z.ZodTypeAny = any> extends HttpActionHandler {
|
|
119
121
|
_crpcHttpRoute: HttpRouteDefinition<TMethod>;
|
|
120
122
|
/** @internal Expose def for client-side type inference */
|
|
121
123
|
_def: {
|
|
@@ -123,6 +125,7 @@ interface HttpProcedure<TInput$1 extends UnsetMarker | z.ZodTypeAny = any, TOutp
|
|
|
123
125
|
outputSchema?: TOutput$1;
|
|
124
126
|
paramsSchema?: TParams$1;
|
|
125
127
|
querySchema?: TQuery$1;
|
|
128
|
+
formSchema?: TForm;
|
|
126
129
|
};
|
|
127
130
|
}
|
|
128
131
|
/**
|
|
@@ -130,18 +133,21 @@ interface HttpProcedure<TInput$1 extends UnsetMarker | z.ZodTypeAny = any, TOutp
|
|
|
130
133
|
* - ctx: context properties (userId, db, runQuery, etc.)
|
|
131
134
|
* - input: parsed JSON body
|
|
132
135
|
* - params: parsed path params
|
|
133
|
-
* -
|
|
136
|
+
* - searchParams: parsed query params
|
|
137
|
+
* - form: parsed form data
|
|
134
138
|
* - c: Hono Context for Response helpers (c.json, c.text, c.redirect, c.header, c.req)
|
|
135
139
|
*/
|
|
136
|
-
type HttpHandlerOpts<TCtx, TInput$1 extends UnsetMarker | z.ZodTypeAny, TParams$1 extends UnsetMarker | z.ZodTypeAny,
|
|
140
|
+
type HttpHandlerOpts<TCtx, TInput$1 extends UnsetMarker | z.ZodTypeAny, TParams$1 extends UnsetMarker | z.ZodTypeAny, TSearchParams extends UnsetMarker | z.ZodTypeAny, TForm extends UnsetMarker | z.ZodTypeAny> = {
|
|
137
141
|
ctx: TCtx;
|
|
138
142
|
c: Context;
|
|
139
143
|
} & (TInput$1 extends UnsetMarker ? object : {
|
|
140
144
|
input: z.output<TInput$1>;
|
|
141
145
|
}) & (TParams$1 extends UnsetMarker ? object : {
|
|
142
146
|
params: z.output<TParams$1>;
|
|
143
|
-
}) & (
|
|
144
|
-
|
|
147
|
+
}) & (TSearchParams extends UnsetMarker ? object : {
|
|
148
|
+
searchParams: z.output<TSearchParams>;
|
|
149
|
+
}) & (TForm extends UnsetMarker ? object : {
|
|
150
|
+
form: z.output<TForm>;
|
|
145
151
|
});
|
|
146
152
|
/**
|
|
147
153
|
* Hono handler with cRPC route metadata attached
|