better-convex 0.0.1 → 0.0.2
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 +516 -0
- package/dist/auth/index.js +1030 -0
- package/dist/auth-client/index.d.ts +36 -0
- package/dist/auth-client/index.js +80 -0
- package/dist/auth-nextjs/index.d.ts +56 -0
- package/dist/auth-nextjs/index.js +72 -0
- package/dist/auth-store-DPj6Z0Xl.js +234 -0
- package/dist/cli.cjs +215 -0
- package/dist/codegen-P6NmBpvG.cjs +151 -0
- package/dist/create-schema-CiLdn4rr.js +86 -0
- package/dist/crpc/index.d.ts +68 -0
- package/dist/crpc/index.js +29 -0
- package/dist/error-_XBsa1OD.js +333 -0
- package/dist/query-options-lmbltN6P.js +121 -0
- package/dist/react/index.d.ts +806 -0
- package/dist/react/index.js +1906 -0
- package/dist/rsc/index.d.ts +56 -0
- package/dist/rsc/index.js +143 -0
- package/dist/server/index.d.ts +597 -0
- package/dist/server/index.js +389 -0
- package/dist/types-h8_JnBVZ.d.ts +207 -0
- package/dist/watcher.cjs +24 -0
- package/package.json +62 -36
- package/LICENSE +0 -21
- package/README.md +0 -0
- package/dist/index.d.mts +0 -5
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -6
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import * as better_auth_adapters1 from "better-auth/adapters";
|
|
2
|
+
import { DBAdapterDebugLogOption } from "better-auth/adapters";
|
|
3
|
+
import { BetterAuthDBSchema } from "better-auth/db";
|
|
4
|
+
import * as convex_server24 from "convex/server";
|
|
5
|
+
import { DocumentByName, FunctionReference, GenericDataModel, GenericMutationCtx, GenericQueryCtx, GenericSchema, HttpRouter, IdField, PaginationOptions, PaginationResult, SchemaDefinition, SystemFields, TableNamesInDataModel, internalMutationGeneric } from "convex/server";
|
|
6
|
+
import * as convex_values0 from "convex/values";
|
|
7
|
+
import { Infer } from "convex/values";
|
|
8
|
+
import * as better_auth0 from "better-auth";
|
|
9
|
+
import { BetterAuthOptions, Where, betterAuth } from "better-auth";
|
|
10
|
+
import { GenericCtx } from "@convex-dev/better-auth";
|
|
11
|
+
import { SetOptional } from "type-fest";
|
|
12
|
+
|
|
13
|
+
//#region src/auth/create-client.d.ts
|
|
14
|
+
type AuthFunctions = {
|
|
15
|
+
create: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
16
|
+
deleteMany: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
17
|
+
deleteOne: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
18
|
+
findMany: FunctionReference<'query', 'internal', Record<string, any>>;
|
|
19
|
+
findOne: FunctionReference<'query', 'internal', Record<string, any>>;
|
|
20
|
+
updateMany: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
21
|
+
updateOne: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
22
|
+
onCreate: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
23
|
+
onDelete: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
24
|
+
onUpdate: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
25
|
+
beforeCreate?: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
26
|
+
beforeDelete?: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
27
|
+
beforeUpdate?: FunctionReference<'mutation', 'internal', Record<string, any>>;
|
|
28
|
+
};
|
|
29
|
+
type Triggers<DataModel extends GenericDataModel, Schema$1 extends SchemaDefinition<any, any>> = { [K in keyof Schema$1['tables'] & string]?: {
|
|
30
|
+
beforeCreate?: (ctx: GenericMutationCtx<DataModel>, data: Infer<Schema$1['tables'][K]['validator']>) => Promise<Infer<Schema$1['tables'][K]['validator']> | undefined>;
|
|
31
|
+
beforeDelete?: (ctx: GenericMutationCtx<DataModel>, doc: Infer<Schema$1['tables'][K]['validator']> & IdField<K> & SystemFields) => Promise<(Infer<Schema$1['tables'][K]['validator']> & IdField<K> & SystemFields) | undefined>;
|
|
32
|
+
beforeUpdate?: (ctx: GenericMutationCtx<DataModel>, doc: Infer<Schema$1['tables'][K]['validator']> & IdField<K> & SystemFields, update: Partial<Infer<Schema$1['tables'][K]['validator']>>) => Promise<Partial<Infer<Schema$1['tables'][K]['validator']>> | undefined>;
|
|
33
|
+
onCreate?: (ctx: GenericMutationCtx<DataModel>, doc: Infer<Schema$1['tables'][K]['validator']> & IdField<K> & SystemFields) => Promise<void>;
|
|
34
|
+
onDelete?: (ctx: GenericMutationCtx<DataModel>, doc: Infer<Schema$1['tables'][K]['validator']> & IdField<K> & SystemFields) => Promise<void>;
|
|
35
|
+
onUpdate?: (ctx: GenericMutationCtx<DataModel>, newDoc: Infer<Schema$1['tables'][K]['validator']> & IdField<K> & {
|
|
36
|
+
_creationTime: number;
|
|
37
|
+
}, oldDoc: Infer<Schema$1['tables'][K]['validator']> & IdField<K> & SystemFields) => Promise<void>;
|
|
38
|
+
} };
|
|
39
|
+
declare const createClient: <DataModel extends GenericDataModel, Schema$1 extends SchemaDefinition<GenericSchema, true>>(config: {
|
|
40
|
+
authFunctions: AuthFunctions;
|
|
41
|
+
schema: Schema$1;
|
|
42
|
+
internalMutation?: typeof internalMutationGeneric;
|
|
43
|
+
triggers?: Triggers<DataModel, Schema$1>;
|
|
44
|
+
}) => {
|
|
45
|
+
authFunctions: AuthFunctions;
|
|
46
|
+
triggers: Triggers<DataModel, Schema$1> | undefined;
|
|
47
|
+
adapter: (ctx: GenericCtx<DataModel>, createAuthOptions: (ctx: any) => BetterAuthOptions) => better_auth_adapters1.AdapterFactory;
|
|
48
|
+
httpAdapter: (ctx: GenericCtx<DataModel>) => better_auth_adapters1.AdapterFactory;
|
|
49
|
+
triggersApi: () => {
|
|
50
|
+
beforeCreate: convex_server24.RegisteredMutation<"internal", {
|
|
51
|
+
data: any;
|
|
52
|
+
model: string;
|
|
53
|
+
}, Promise<any>>;
|
|
54
|
+
beforeDelete: convex_server24.RegisteredMutation<"internal", {
|
|
55
|
+
model: string;
|
|
56
|
+
doc: any;
|
|
57
|
+
}, Promise<any>>;
|
|
58
|
+
beforeUpdate: convex_server24.RegisteredMutation<"internal", {
|
|
59
|
+
update: any;
|
|
60
|
+
model: string;
|
|
61
|
+
doc: any;
|
|
62
|
+
}, Promise<any>>;
|
|
63
|
+
onCreate: convex_server24.RegisteredMutation<"internal", {
|
|
64
|
+
model: string;
|
|
65
|
+
doc: any;
|
|
66
|
+
}, Promise<void>>;
|
|
67
|
+
onDelete: convex_server24.RegisteredMutation<"internal", {
|
|
68
|
+
model: string;
|
|
69
|
+
doc: any;
|
|
70
|
+
}, Promise<void>>;
|
|
71
|
+
onUpdate: convex_server24.RegisteredMutation<"internal", {
|
|
72
|
+
model: string;
|
|
73
|
+
newDoc: any;
|
|
74
|
+
oldDoc: any;
|
|
75
|
+
}, Promise<void>>;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/auth/adapter.d.ts
|
|
80
|
+
declare const handlePagination: (next: ({
|
|
81
|
+
paginationOpts
|
|
82
|
+
}: {
|
|
83
|
+
paginationOpts: PaginationOptions;
|
|
84
|
+
}) => Promise<SetOptional<PaginationResult<any>, "page"> & {
|
|
85
|
+
count?: number;
|
|
86
|
+
}>, {
|
|
87
|
+
limit,
|
|
88
|
+
numItems
|
|
89
|
+
}?: {
|
|
90
|
+
limit?: number;
|
|
91
|
+
numItems?: number;
|
|
92
|
+
}) => Promise<{
|
|
93
|
+
count: number;
|
|
94
|
+
cursor: string | null;
|
|
95
|
+
docs: any[];
|
|
96
|
+
isDone: boolean;
|
|
97
|
+
}>;
|
|
98
|
+
type ConvexCleanedWhere = Where & {
|
|
99
|
+
value: number[] | string[] | boolean | number | string | null;
|
|
100
|
+
};
|
|
101
|
+
declare const adapterConfig: {
|
|
102
|
+
adapterId: string;
|
|
103
|
+
adapterName: string;
|
|
104
|
+
debugLogs: false;
|
|
105
|
+
disableIdGeneration: true;
|
|
106
|
+
mapKeysTransformInput: {
|
|
107
|
+
id: string;
|
|
108
|
+
};
|
|
109
|
+
mapKeysTransformOutput: {
|
|
110
|
+
_id: string;
|
|
111
|
+
};
|
|
112
|
+
supportsJSON: false;
|
|
113
|
+
supportsNumericIds: false;
|
|
114
|
+
supportsDates: false;
|
|
115
|
+
supportsArrays: true;
|
|
116
|
+
transaction: false;
|
|
117
|
+
usePlural: false;
|
|
118
|
+
customTransformInput: ({
|
|
119
|
+
data,
|
|
120
|
+
fieldAttributes
|
|
121
|
+
}: {
|
|
122
|
+
data: any;
|
|
123
|
+
fieldAttributes: better_auth0.DBFieldAttribute;
|
|
124
|
+
field: string;
|
|
125
|
+
action: "create" | "update" | "findOne" | "findMany" | "updateMany" | "delete" | "deleteMany" | "count";
|
|
126
|
+
model: string;
|
|
127
|
+
schema: better_auth0.BetterAuthDBSchema;
|
|
128
|
+
options: BetterAuthOptions;
|
|
129
|
+
}) => any;
|
|
130
|
+
customTransformOutput: ({
|
|
131
|
+
data,
|
|
132
|
+
fieldAttributes
|
|
133
|
+
}: {
|
|
134
|
+
data: any;
|
|
135
|
+
fieldAttributes: better_auth0.DBFieldAttribute;
|
|
136
|
+
field: string;
|
|
137
|
+
select: string[];
|
|
138
|
+
model: string;
|
|
139
|
+
schema: better_auth0.BetterAuthDBSchema;
|
|
140
|
+
options: BetterAuthOptions;
|
|
141
|
+
}) => any;
|
|
142
|
+
};
|
|
143
|
+
declare const httpAdapter: <DataModel extends GenericDataModel, Schema$1 extends SchemaDefinition<any, any>>(ctx: GenericCtx<DataModel>, {
|
|
144
|
+
authFunctions,
|
|
145
|
+
debugLogs,
|
|
146
|
+
triggers
|
|
147
|
+
}: {
|
|
148
|
+
authFunctions: AuthFunctions;
|
|
149
|
+
debugLogs?: DBAdapterDebugLogOption;
|
|
150
|
+
triggers?: Triggers<DataModel, Schema$1>;
|
|
151
|
+
}) => better_auth_adapters1.AdapterFactory;
|
|
152
|
+
declare const dbAdapter: <DataModel extends GenericDataModel, Schema$1 extends SchemaDefinition<any, any>>(ctx: GenericCtx<DataModel>, createAuthOptions: (ctx: any) => BetterAuthOptions, {
|
|
153
|
+
authFunctions,
|
|
154
|
+
debugLogs,
|
|
155
|
+
schema,
|
|
156
|
+
triggers
|
|
157
|
+
}: {
|
|
158
|
+
authFunctions: AuthFunctions;
|
|
159
|
+
schema: Schema$1;
|
|
160
|
+
debugLogs?: DBAdapterDebugLogOption;
|
|
161
|
+
triggers?: Triggers<DataModel, Schema$1>;
|
|
162
|
+
}) => better_auth_adapters1.AdapterFactory;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/auth/adapter-utils.d.ts
|
|
165
|
+
declare const adapterWhereValidator: convex_values0.VObject<{
|
|
166
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
167
|
+
connector?: "AND" | "OR" | undefined;
|
|
168
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
169
|
+
field: string;
|
|
170
|
+
}, {
|
|
171
|
+
connector: convex_values0.VUnion<"AND" | "OR" | undefined, [convex_values0.VLiteral<"AND", "required">, convex_values0.VLiteral<"OR", "required">], "optional", never>;
|
|
172
|
+
field: convex_values0.VString<string, "required">;
|
|
173
|
+
operator: convex_values0.VUnion<"eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "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>;
|
|
174
|
+
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>;
|
|
175
|
+
}, "required", "operator" | "value" | "field" | "connector">;
|
|
176
|
+
declare const adapterArgsValidator: convex_values0.VObject<{
|
|
177
|
+
limit?: number | undefined;
|
|
178
|
+
where?: {
|
|
179
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
180
|
+
connector?: "AND" | "OR" | undefined;
|
|
181
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
182
|
+
field: string;
|
|
183
|
+
}[] | undefined;
|
|
184
|
+
select?: string[] | undefined;
|
|
185
|
+
offset?: number | undefined;
|
|
186
|
+
sortBy?: {
|
|
187
|
+
field: string;
|
|
188
|
+
direction: "asc" | "desc";
|
|
189
|
+
} | undefined;
|
|
190
|
+
model: string;
|
|
191
|
+
}, {
|
|
192
|
+
limit: convex_values0.VFloat64<number | undefined, "optional">;
|
|
193
|
+
model: convex_values0.VString<string, "required">;
|
|
194
|
+
offset: convex_values0.VFloat64<number | undefined, "optional">;
|
|
195
|
+
select: convex_values0.VArray<string[] | undefined, convex_values0.VString<string, "required">, "optional">;
|
|
196
|
+
sortBy: convex_values0.VObject<{
|
|
197
|
+
field: string;
|
|
198
|
+
direction: "asc" | "desc";
|
|
199
|
+
} | undefined, {
|
|
200
|
+
direction: convex_values0.VUnion<"asc" | "desc", [convex_values0.VLiteral<"asc", "required">, convex_values0.VLiteral<"desc", "required">], "required", never>;
|
|
201
|
+
field: convex_values0.VString<string, "required">;
|
|
202
|
+
}, "optional", "field" | "direction">;
|
|
203
|
+
where: convex_values0.VArray<{
|
|
204
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
205
|
+
connector?: "AND" | "OR" | undefined;
|
|
206
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
207
|
+
field: string;
|
|
208
|
+
}[] | undefined, convex_values0.VObject<{
|
|
209
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
210
|
+
connector?: "AND" | "OR" | undefined;
|
|
211
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
212
|
+
field: string;
|
|
213
|
+
}, {
|
|
214
|
+
connector: convex_values0.VUnion<"AND" | "OR" | undefined, [convex_values0.VLiteral<"AND", "required">, convex_values0.VLiteral<"OR", "required">], "optional", never>;
|
|
215
|
+
field: convex_values0.VString<string, "required">;
|
|
216
|
+
operator: convex_values0.VUnion<"eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "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>;
|
|
217
|
+
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>;
|
|
218
|
+
}, "required", "operator" | "value" | "field" | "connector">, "optional">;
|
|
219
|
+
}, "required", "limit" | "where" | "model" | "select" | "offset" | "sortBy" | "sortBy.field" | "sortBy.direction">;
|
|
220
|
+
declare const hasUniqueFields: (betterAuthSchema: BetterAuthDBSchema, model: string, input: Record<string, any>) => boolean;
|
|
221
|
+
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>;
|
|
222
|
+
declare const selectFields: <T extends TableNamesInDataModel<GenericDataModel>, D extends DocumentByName<GenericDataModel, T>>(doc: D | null, select?: string[]) => Promise<D | null>;
|
|
223
|
+
declare const paginate: <Doc extends DocumentByName<GenericDataModel, T>, T extends TableNamesInDataModel<GenericDataModel>>(ctx: GenericQueryCtx<GenericDataModel>, schema: SchemaDefinition<any, any>, betterAuthSchema: BetterAuthDBSchema, args: Infer<typeof adapterArgsValidator> & {
|
|
224
|
+
paginationOpts: PaginationOptions;
|
|
225
|
+
}) => Promise<PaginationResult<Doc>>;
|
|
226
|
+
declare const listOne: <Doc extends DocumentByName<GenericDataModel, T>, T extends TableNamesInDataModel<GenericDataModel>>(ctx: GenericQueryCtx<GenericDataModel>, schema: SchemaDefinition<any, any>, betterAuthSchema: BetterAuthDBSchema, args: Infer<typeof adapterArgsValidator>) => Promise<Doc | null>;
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/auth/types.d.ts
|
|
229
|
+
type CreateAuth = (ctx: any) => ReturnType<typeof betterAuth>;
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/auth/create-api.d.ts
|
|
232
|
+
type Schema = SchemaDefinition<any, any>;
|
|
233
|
+
declare const createHandler: (ctx: any, args: {
|
|
234
|
+
input: {
|
|
235
|
+
data: any;
|
|
236
|
+
model: string;
|
|
237
|
+
};
|
|
238
|
+
beforeCreateHandle?: string;
|
|
239
|
+
select?: string[];
|
|
240
|
+
skipBeforeHooks?: boolean;
|
|
241
|
+
onCreateHandle?: string;
|
|
242
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<any>;
|
|
243
|
+
declare const findOneHandler: (ctx: any, args: {
|
|
244
|
+
model: string;
|
|
245
|
+
select?: string[];
|
|
246
|
+
where?: any[];
|
|
247
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<convex_server24.GenericDocument | null>;
|
|
248
|
+
declare const findManyHandler: (ctx: any, args: {
|
|
249
|
+
model: string;
|
|
250
|
+
paginationOpts: any;
|
|
251
|
+
limit?: number;
|
|
252
|
+
offset?: number;
|
|
253
|
+
sortBy?: {
|
|
254
|
+
direction: "asc" | "desc";
|
|
255
|
+
field: string;
|
|
256
|
+
};
|
|
257
|
+
where?: any[];
|
|
258
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<convex_server24.PaginationResult<convex_server24.GenericDocument>>;
|
|
259
|
+
declare const updateOneHandler: (ctx: any, args: {
|
|
260
|
+
input: {
|
|
261
|
+
model: string;
|
|
262
|
+
update: any;
|
|
263
|
+
where?: any[];
|
|
264
|
+
};
|
|
265
|
+
beforeUpdateHandle?: string;
|
|
266
|
+
onUpdateHandle?: string;
|
|
267
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<any>;
|
|
268
|
+
declare const updateManyHandler: (ctx: any, args: {
|
|
269
|
+
input: {
|
|
270
|
+
model: string;
|
|
271
|
+
update?: any;
|
|
272
|
+
where?: any[];
|
|
273
|
+
};
|
|
274
|
+
paginationOpts: any;
|
|
275
|
+
beforeUpdateHandle?: string;
|
|
276
|
+
onUpdateHandle?: string;
|
|
277
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<{
|
|
278
|
+
count: number;
|
|
279
|
+
ids: any[];
|
|
280
|
+
isDone: boolean;
|
|
281
|
+
continueCursor: convex_server24.Cursor;
|
|
282
|
+
splitCursor?: convex_server24.Cursor | null;
|
|
283
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
284
|
+
}>;
|
|
285
|
+
declare const deleteOneHandler: (ctx: any, args: {
|
|
286
|
+
input: {
|
|
287
|
+
model: string;
|
|
288
|
+
where?: any[];
|
|
289
|
+
};
|
|
290
|
+
beforeDeleteHandle?: string;
|
|
291
|
+
skipBeforeHooks?: boolean;
|
|
292
|
+
onDeleteHandle?: string;
|
|
293
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<convex_server24.GenericDocument | undefined>;
|
|
294
|
+
declare const deleteManyHandler: (ctx: any, args: {
|
|
295
|
+
input: {
|
|
296
|
+
model: string;
|
|
297
|
+
where?: any[];
|
|
298
|
+
};
|
|
299
|
+
paginationOpts: any;
|
|
300
|
+
beforeDeleteHandle?: string;
|
|
301
|
+
skipBeforeHooks?: boolean;
|
|
302
|
+
onDeleteHandle?: string;
|
|
303
|
+
}, schema: Schema, betterAuthSchema: any) => Promise<{
|
|
304
|
+
count: number;
|
|
305
|
+
ids: any[];
|
|
306
|
+
isDone: boolean;
|
|
307
|
+
continueCursor: convex_server24.Cursor;
|
|
308
|
+
splitCursor?: convex_server24.Cursor | null;
|
|
309
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
310
|
+
}>;
|
|
311
|
+
declare const createApi: <Schema$1 extends SchemaDefinition<any, any>>(schema: Schema$1, createAuth: CreateAuth, options?: {
|
|
312
|
+
internalMutation?: typeof internalMutationGeneric;
|
|
313
|
+
/** Skip input validation for smaller generated types. Since these are internal functions, validation is optional. */
|
|
314
|
+
skipValidation?: boolean;
|
|
315
|
+
}) => {
|
|
316
|
+
create: convex_server24.RegisteredMutation<"internal", {
|
|
317
|
+
select?: string[] | undefined;
|
|
318
|
+
beforeCreateHandle?: string | undefined;
|
|
319
|
+
onCreateHandle?: string | undefined;
|
|
320
|
+
input: {
|
|
321
|
+
data: any;
|
|
322
|
+
model: string;
|
|
323
|
+
} | {
|
|
324
|
+
data: {
|
|
325
|
+
[x: string]: unknown;
|
|
326
|
+
[x: number]: unknown;
|
|
327
|
+
[x: symbol]: unknown;
|
|
328
|
+
};
|
|
329
|
+
model: string;
|
|
330
|
+
};
|
|
331
|
+
}, Promise<any>>;
|
|
332
|
+
deleteMany: convex_server24.RegisteredMutation<"internal", {
|
|
333
|
+
beforeDeleteHandle?: string | undefined;
|
|
334
|
+
onDeleteHandle?: string | undefined;
|
|
335
|
+
paginationOpts: {
|
|
336
|
+
id?: number;
|
|
337
|
+
endCursor?: string | null;
|
|
338
|
+
maximumRowsRead?: number;
|
|
339
|
+
maximumBytesRead?: number;
|
|
340
|
+
numItems: number;
|
|
341
|
+
cursor: string | null;
|
|
342
|
+
};
|
|
343
|
+
input: {
|
|
344
|
+
where?: any[] | undefined;
|
|
345
|
+
model: string;
|
|
346
|
+
} | {
|
|
347
|
+
where?: {
|
|
348
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
349
|
+
connector?: "AND" | "OR" | undefined;
|
|
350
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
351
|
+
field: string;
|
|
352
|
+
}[] | undefined;
|
|
353
|
+
model: string;
|
|
354
|
+
};
|
|
355
|
+
}, Promise<{
|
|
356
|
+
count: number;
|
|
357
|
+
ids: any[];
|
|
358
|
+
isDone: boolean;
|
|
359
|
+
continueCursor: convex_server24.Cursor;
|
|
360
|
+
splitCursor?: convex_server24.Cursor | null;
|
|
361
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
362
|
+
}>>;
|
|
363
|
+
deleteOne: convex_server24.RegisteredMutation<"internal", {
|
|
364
|
+
beforeDeleteHandle?: string | undefined;
|
|
365
|
+
onDeleteHandle?: string | undefined;
|
|
366
|
+
input: {
|
|
367
|
+
where?: any[] | undefined;
|
|
368
|
+
model: string;
|
|
369
|
+
} | {
|
|
370
|
+
where?: {
|
|
371
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
372
|
+
connector?: "AND" | "OR" | undefined;
|
|
373
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
374
|
+
field: string;
|
|
375
|
+
}[] | undefined;
|
|
376
|
+
model: string;
|
|
377
|
+
};
|
|
378
|
+
}, Promise<convex_server24.GenericDocument | undefined>>;
|
|
379
|
+
findMany: convex_server24.RegisteredQuery<"internal", {
|
|
380
|
+
limit?: number | undefined;
|
|
381
|
+
join?: any;
|
|
382
|
+
where?: {
|
|
383
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
384
|
+
connector?: "AND" | "OR" | undefined;
|
|
385
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
386
|
+
field: string;
|
|
387
|
+
}[] | undefined;
|
|
388
|
+
offset?: number | undefined;
|
|
389
|
+
sortBy?: {
|
|
390
|
+
field: string;
|
|
391
|
+
direction: "asc" | "desc";
|
|
392
|
+
} | undefined;
|
|
393
|
+
paginationOpts: {
|
|
394
|
+
id?: number;
|
|
395
|
+
endCursor?: string | null;
|
|
396
|
+
maximumRowsRead?: number;
|
|
397
|
+
maximumBytesRead?: number;
|
|
398
|
+
numItems: number;
|
|
399
|
+
cursor: string | null;
|
|
400
|
+
};
|
|
401
|
+
model: string;
|
|
402
|
+
}, Promise<convex_server24.PaginationResult<convex_server24.GenericDocument>>>;
|
|
403
|
+
findOne: convex_server24.RegisteredQuery<"internal", {
|
|
404
|
+
join?: any;
|
|
405
|
+
where?: {
|
|
406
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
407
|
+
connector?: "AND" | "OR" | undefined;
|
|
408
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
409
|
+
field: string;
|
|
410
|
+
}[] | undefined;
|
|
411
|
+
select?: string[] | undefined;
|
|
412
|
+
model: string;
|
|
413
|
+
}, Promise<convex_server24.GenericDocument | null>>;
|
|
414
|
+
updateMany: convex_server24.RegisteredMutation<"internal", {
|
|
415
|
+
beforeUpdateHandle?: string | undefined;
|
|
416
|
+
onUpdateHandle?: string | undefined;
|
|
417
|
+
paginationOpts: {
|
|
418
|
+
id?: number;
|
|
419
|
+
endCursor?: string | null;
|
|
420
|
+
maximumRowsRead?: number;
|
|
421
|
+
maximumBytesRead?: number;
|
|
422
|
+
numItems: number;
|
|
423
|
+
cursor: string | null;
|
|
424
|
+
};
|
|
425
|
+
input: {
|
|
426
|
+
where?: any[] | undefined;
|
|
427
|
+
update: any;
|
|
428
|
+
model: string;
|
|
429
|
+
} | {
|
|
430
|
+
where?: {
|
|
431
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
432
|
+
connector?: "AND" | "OR" | undefined;
|
|
433
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
434
|
+
field: string;
|
|
435
|
+
}[] | undefined;
|
|
436
|
+
update: {
|
|
437
|
+
[x: string]: unknown;
|
|
438
|
+
[x: number]: unknown;
|
|
439
|
+
[x: symbol]: unknown;
|
|
440
|
+
};
|
|
441
|
+
model: string;
|
|
442
|
+
};
|
|
443
|
+
}, Promise<{
|
|
444
|
+
count: number;
|
|
445
|
+
ids: any[];
|
|
446
|
+
isDone: boolean;
|
|
447
|
+
continueCursor: convex_server24.Cursor;
|
|
448
|
+
splitCursor?: convex_server24.Cursor | null;
|
|
449
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
450
|
+
}>>;
|
|
451
|
+
updateOne: convex_server24.RegisteredMutation<"internal", {
|
|
452
|
+
beforeUpdateHandle?: string | undefined;
|
|
453
|
+
onUpdateHandle?: string | undefined;
|
|
454
|
+
input: {
|
|
455
|
+
where?: any[] | undefined;
|
|
456
|
+
update: any;
|
|
457
|
+
model: string;
|
|
458
|
+
} | {
|
|
459
|
+
where?: {
|
|
460
|
+
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
461
|
+
connector?: "AND" | "OR" | undefined;
|
|
462
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
463
|
+
field: string;
|
|
464
|
+
}[] | undefined;
|
|
465
|
+
update: {
|
|
466
|
+
[x: string]: unknown;
|
|
467
|
+
[x: number]: unknown;
|
|
468
|
+
[x: symbol]: unknown;
|
|
469
|
+
};
|
|
470
|
+
model: string;
|
|
471
|
+
};
|
|
472
|
+
}, Promise<any>>;
|
|
473
|
+
getLatestJwks: convex_server24.RegisteredAction<"internal", {}, Promise<any>>;
|
|
474
|
+
rotateKeys: convex_server24.RegisteredAction<"internal", {}, Promise<any>>;
|
|
475
|
+
};
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/auth/helpers.d.ts
|
|
478
|
+
declare const getAuthUserIdentity: <DataModel extends GenericDataModel>(ctx: GenericQueryCtx<DataModel>) => Promise<{
|
|
479
|
+
sessionId: DocumentByName<DataModel, "session">["_id"];
|
|
480
|
+
userId: DocumentByName<DataModel, "user">["_id"];
|
|
481
|
+
tokenIdentifier: string;
|
|
482
|
+
subject: string;
|
|
483
|
+
issuer: string;
|
|
484
|
+
name?: string;
|
|
485
|
+
givenName?: string;
|
|
486
|
+
familyName?: string;
|
|
487
|
+
nickname?: string;
|
|
488
|
+
preferredUsername?: string;
|
|
489
|
+
profileUrl?: string;
|
|
490
|
+
pictureUrl?: string;
|
|
491
|
+
email?: string;
|
|
492
|
+
emailVerified?: boolean;
|
|
493
|
+
gender?: string;
|
|
494
|
+
birthday?: string;
|
|
495
|
+
timezone?: string;
|
|
496
|
+
language?: string;
|
|
497
|
+
phoneNumber?: string;
|
|
498
|
+
phoneNumberVerified?: boolean;
|
|
499
|
+
address?: string;
|
|
500
|
+
updatedAt?: string;
|
|
501
|
+
} | null>;
|
|
502
|
+
declare const getAuthUserId: <DataModel extends GenericDataModel>(ctx: GenericQueryCtx<DataModel>) => Promise<string | null>;
|
|
503
|
+
declare const getSession: <DataModel extends GenericDataModel>(ctx: GenericQueryCtx<DataModel>, _sessionId?: DocumentByName<DataModel, "session">["_id"]) => Promise<DocumentByName<DataModel, "session"> | null>;
|
|
504
|
+
declare const getHeaders: <DataModel extends GenericDataModel>(ctx: GenericQueryCtx<DataModel>, session?: DocumentByName<DataModel, "session"> | null) => Promise<Headers>;
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/auth/registerRoutes.d.ts
|
|
507
|
+
declare const registerRoutes: (http: HttpRouter, createAuth: CreateAuth, opts?: {
|
|
508
|
+
cors?: {
|
|
509
|
+
allowedHeaders?: string[];
|
|
510
|
+
allowedOrigins?: string[];
|
|
511
|
+
exposedHeaders?: string[];
|
|
512
|
+
} | boolean;
|
|
513
|
+
verbose?: boolean;
|
|
514
|
+
}) => void;
|
|
515
|
+
//#endregion
|
|
516
|
+
export { AuthFunctions, ConvexCleanedWhere, CreateAuth, Triggers, adapterArgsValidator, adapterConfig, adapterWhereValidator, checkUniqueFields, createApi, createClient, createHandler, dbAdapter, deleteManyHandler, deleteOneHandler, findManyHandler, findOneHandler, getAuthUserId, getAuthUserIdentity, getHeaders, getSession, handlePagination, hasUniqueFields, httpAdapter, listOne, paginate, registerRoutes, selectFields, updateManyHandler, updateOneHandler };
|