@convex-dev/better-auth 0.7.0-alpha.8 → 0.7.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/commonjs/client/adapter.d.ts +10 -1
- package/dist/commonjs/client/adapter.d.ts.map +1 -1
- package/dist/commonjs/client/adapter.js +190 -192
- package/dist/commonjs/client/adapter.js.map +1 -1
- package/dist/commonjs/client/index.d.ts +283 -179
- package/dist/commonjs/client/index.d.ts.map +1 -1
- package/dist/commonjs/client/index.js +59 -67
- package/dist/commonjs/client/index.js.map +1 -1
- package/dist/commonjs/component/adapterTest.d.ts +19 -0
- package/dist/commonjs/component/adapterTest.d.ts.map +1 -0
- package/dist/commonjs/component/adapterTest.js +82 -0
- package/dist/commonjs/component/adapterTest.js.map +1 -0
- package/dist/commonjs/component/lib.d.ts +308 -536
- package/dist/commonjs/component/lib.d.ts.map +1 -1
- package/dist/commonjs/component/lib.js +469 -292
- package/dist/commonjs/component/lib.js.map +1 -1
- package/dist/commonjs/component/schema.d.ts +465 -26
- package/dist/commonjs/component/schema.d.ts.map +1 -1
- package/dist/commonjs/component/schema.js +334 -18
- package/dist/commonjs/component/schema.js.map +1 -1
- package/dist/commonjs/component/util.d.ts +944 -68
- package/dist/commonjs/component/util.d.ts.map +1 -1
- package/dist/commonjs/nextjs/index.d.ts.map +1 -1
- package/dist/commonjs/nextjs/index.js +3 -9
- package/dist/commonjs/nextjs/index.js.map +1 -1
- package/dist/commonjs/plugins/convex/index.d.ts +14 -11
- package/dist/commonjs/plugins/convex/index.d.ts.map +1 -1
- package/dist/commonjs/plugins/convex/index.js +3 -2
- package/dist/commonjs/plugins/convex/index.js.map +1 -1
- package/dist/commonjs/plugins/cross-domain/client.d.ts +1 -1
- package/dist/commonjs/plugins/cross-domain/index.d.ts +5 -3
- package/dist/commonjs/plugins/cross-domain/index.d.ts.map +1 -1
- package/dist/commonjs/plugins/cross-domain/index.js +19 -5
- package/dist/commonjs/plugins/cross-domain/index.js.map +1 -1
- package/dist/commonjs/react/client.d.ts +1 -1
- package/dist/commonjs/react/client.d.ts.map +1 -1
- package/dist/commonjs/react/client.js +3 -9
- package/dist/commonjs/react/client.js.map +1 -1
- package/dist/commonjs/react-start/index.d.ts +4 -4
- package/dist/commonjs/react-start/index.d.ts.map +1 -1
- package/dist/commonjs/react-start/index.js +3 -0
- package/dist/commonjs/react-start/index.js.map +1 -1
- package/dist/commonjs/utils/index.d.ts +2 -0
- package/dist/commonjs/utils/index.d.ts.map +1 -0
- package/dist/commonjs/utils/index.js +8 -0
- package/dist/commonjs/utils/index.js.map +1 -0
- package/dist/esm/client/adapter.d.ts +10 -1
- package/dist/esm/client/adapter.d.ts.map +1 -1
- package/dist/esm/client/adapter.js +190 -192
- package/dist/esm/client/adapter.js.map +1 -1
- package/dist/esm/client/index.d.ts +283 -179
- package/dist/esm/client/index.d.ts.map +1 -1
- package/dist/esm/client/index.js +59 -67
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/component/adapterTest.d.ts +19 -0
- package/dist/esm/component/adapterTest.d.ts.map +1 -0
- package/dist/esm/component/adapterTest.js +82 -0
- package/dist/esm/component/adapterTest.js.map +1 -0
- package/dist/esm/component/lib.d.ts +308 -536
- package/dist/esm/component/lib.d.ts.map +1 -1
- package/dist/esm/component/lib.js +469 -292
- package/dist/esm/component/lib.js.map +1 -1
- package/dist/esm/component/schema.d.ts +465 -26
- package/dist/esm/component/schema.d.ts.map +1 -1
- package/dist/esm/component/schema.js +334 -18
- package/dist/esm/component/schema.js.map +1 -1
- package/dist/esm/component/util.d.ts +944 -68
- package/dist/esm/component/util.d.ts.map +1 -1
- package/dist/esm/nextjs/index.d.ts.map +1 -1
- package/dist/esm/nextjs/index.js +3 -9
- package/dist/esm/nextjs/index.js.map +1 -1
- package/dist/esm/plugins/convex/index.d.ts +14 -11
- package/dist/esm/plugins/convex/index.d.ts.map +1 -1
- package/dist/esm/plugins/convex/index.js +3 -2
- package/dist/esm/plugins/convex/index.js.map +1 -1
- package/dist/esm/plugins/cross-domain/client.d.ts +1 -1
- package/dist/esm/plugins/cross-domain/index.d.ts +5 -3
- package/dist/esm/plugins/cross-domain/index.d.ts.map +1 -1
- package/dist/esm/plugins/cross-domain/index.js +19 -5
- package/dist/esm/plugins/cross-domain/index.js.map +1 -1
- package/dist/esm/react/client.d.ts +1 -1
- package/dist/esm/react/client.d.ts.map +1 -1
- package/dist/esm/react/client.js +3 -9
- package/dist/esm/react/client.js.map +1 -1
- package/dist/esm/react-start/index.d.ts +4 -4
- package/dist/esm/react-start/index.d.ts.map +1 -1
- package/dist/esm/react-start/index.js +3 -0
- package/dist/esm/react-start/index.js.map +1 -1
- package/dist/esm/utils/index.d.ts +2 -0
- package/dist/esm/utils/index.d.ts.map +1 -0
- package/dist/esm/utils/index.js +8 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/package.json +24 -7
- package/src/client/adapter.test.ts +378 -0
- package/src/client/adapter.ts +206 -198
- package/src/client/index.ts +60 -80
- package/src/component/_generated/api.d.ts +2189 -171
- package/src/component/adapterTest.ts +141 -0
- package/src/component/lib.ts +648 -342
- package/src/component/schema.ts +349 -18
- package/src/nextjs/index.ts +3 -14
- package/src/plugins/convex/index.ts +5 -2
- package/src/plugins/cross-domain/index.ts +19 -5
- package/src/react/client.tsx +5 -11
- package/src/react-start/index.ts +4 -1
- package/src/client/cors.ts +0 -425
- /package/src/{util.ts → utils/index.ts} +0 -0
|
@@ -4,10 +4,17 @@ import type { api } from "../component/_generated/api";
|
|
|
4
4
|
import schema from "../component/schema";
|
|
5
5
|
import { convexAdapter } from "./adapter";
|
|
6
6
|
import { betterAuth } from "better-auth";
|
|
7
|
+
import { adapterArgsValidator } from "../component/lib";
|
|
7
8
|
export { convexAdapter };
|
|
8
9
|
declare const createUserValidator: import("convex/values").VObject<{
|
|
9
10
|
image?: string | undefined;
|
|
10
11
|
twoFactorEnabled?: boolean | undefined;
|
|
12
|
+
isAnonymous?: boolean | undefined;
|
|
13
|
+
username?: string | undefined;
|
|
14
|
+
displayUsername?: string | undefined;
|
|
15
|
+
phoneNumber?: string | undefined;
|
|
16
|
+
phoneNumberVerified?: boolean | undefined;
|
|
17
|
+
stripeCustomerId?: string | undefined;
|
|
11
18
|
name: string;
|
|
12
19
|
email: string;
|
|
13
20
|
emailVerified: boolean;
|
|
@@ -18,118 +25,238 @@ declare const createUserValidator: import("convex/values").VObject<{
|
|
|
18
25
|
email: import("convex/values").VString<string, "required">;
|
|
19
26
|
emailVerified: import("convex/values").VBoolean<boolean, "required">;
|
|
20
27
|
image: import("convex/values").VString<string | undefined, "optional">;
|
|
21
|
-
twoFactorEnabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
22
28
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
23
29
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
24
|
-
|
|
30
|
+
twoFactorEnabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
31
|
+
isAnonymous: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
32
|
+
username: import("convex/values").VString<string | undefined, "optional">;
|
|
33
|
+
displayUsername: import("convex/values").VString<string | undefined, "optional">;
|
|
34
|
+
phoneNumber: import("convex/values").VString<string | undefined, "optional">;
|
|
35
|
+
phoneNumberVerified: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
36
|
+
stripeCustomerId: import("convex/values").VString<string | undefined, "optional">;
|
|
37
|
+
}, "required", "name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt" | "twoFactorEnabled" | "isAnonymous" | "username" | "displayUsername" | "phoneNumber" | "phoneNumberVerified" | "stripeCustomerId">;
|
|
25
38
|
declare const createUserArgsValidator: import("convex/values").VObject<{
|
|
26
39
|
input: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
model: "user";
|
|
41
|
+
data: {
|
|
42
|
+
image?: string | undefined;
|
|
43
|
+
twoFactorEnabled?: boolean | undefined;
|
|
44
|
+
isAnonymous?: boolean | undefined;
|
|
45
|
+
username?: string | undefined;
|
|
46
|
+
displayUsername?: string | undefined;
|
|
47
|
+
phoneNumber?: string | undefined;
|
|
48
|
+
phoneNumberVerified?: boolean | undefined;
|
|
49
|
+
stripeCustomerId?: string | undefined;
|
|
50
|
+
name: string;
|
|
51
|
+
email: string;
|
|
52
|
+
emailVerified: boolean;
|
|
53
|
+
createdAt: number;
|
|
54
|
+
updatedAt: number;
|
|
55
|
+
};
|
|
35
56
|
};
|
|
36
57
|
}, {
|
|
37
58
|
input: import("convex/values").VObject<{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
59
|
+
model: "user";
|
|
60
|
+
data: {
|
|
61
|
+
image?: string | undefined;
|
|
62
|
+
twoFactorEnabled?: boolean | undefined;
|
|
63
|
+
isAnonymous?: boolean | undefined;
|
|
64
|
+
username?: string | undefined;
|
|
65
|
+
displayUsername?: string | undefined;
|
|
66
|
+
phoneNumber?: string | undefined;
|
|
67
|
+
phoneNumberVerified?: boolean | undefined;
|
|
68
|
+
stripeCustomerId?: string | undefined;
|
|
69
|
+
name: string;
|
|
70
|
+
email: string;
|
|
71
|
+
emailVerified: boolean;
|
|
72
|
+
createdAt: number;
|
|
73
|
+
updatedAt: number;
|
|
74
|
+
};
|
|
46
75
|
}, {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
76
|
+
model: import("convex/values").VLiteral<"user", "required">;
|
|
77
|
+
data: import("convex/values").VObject<{
|
|
78
|
+
image?: string | undefined;
|
|
79
|
+
twoFactorEnabled?: boolean | undefined;
|
|
80
|
+
isAnonymous?: boolean | undefined;
|
|
81
|
+
username?: string | undefined;
|
|
82
|
+
displayUsername?: string | undefined;
|
|
83
|
+
phoneNumber?: string | undefined;
|
|
84
|
+
phoneNumberVerified?: boolean | undefined;
|
|
85
|
+
stripeCustomerId?: string | undefined;
|
|
86
|
+
name: string;
|
|
87
|
+
email: string;
|
|
88
|
+
emailVerified: boolean;
|
|
89
|
+
createdAt: number;
|
|
90
|
+
updatedAt: number;
|
|
91
|
+
}, {
|
|
92
|
+
name: import("convex/values").VString<string, "required">;
|
|
93
|
+
email: import("convex/values").VString<string, "required">;
|
|
94
|
+
emailVerified: import("convex/values").VBoolean<boolean, "required">;
|
|
95
|
+
image: import("convex/values").VString<string | undefined, "optional">;
|
|
96
|
+
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
97
|
+
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
98
|
+
twoFactorEnabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
99
|
+
isAnonymous: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
100
|
+
username: import("convex/values").VString<string | undefined, "optional">;
|
|
101
|
+
displayUsername: import("convex/values").VString<string | undefined, "optional">;
|
|
102
|
+
phoneNumber: import("convex/values").VString<string | undefined, "optional">;
|
|
103
|
+
phoneNumberVerified: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
104
|
+
stripeCustomerId: import("convex/values").VString<string | undefined, "optional">;
|
|
105
|
+
}, "required", "name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt" | "twoFactorEnabled" | "isAnonymous" | "username" | "displayUsername" | "phoneNumber" | "phoneNumberVerified" | "stripeCustomerId">;
|
|
106
|
+
}, "required", "model" | "data" | "data.name" | "data.email" | "data.emailVerified" | "data.image" | "data.createdAt" | "data.updatedAt" | "data.twoFactorEnabled" | "data.isAnonymous" | "data.username" | "data.displayUsername" | "data.phoneNumber" | "data.phoneNumberVerified" | "data.stripeCustomerId">;
|
|
107
|
+
}, "required", "input" | "input.model" | "input.data" | "input.data.name" | "input.data.email" | "input.data.emailVerified" | "input.data.image" | "input.data.createdAt" | "input.data.updatedAt" | "input.data.twoFactorEnabled" | "input.data.isAnonymous" | "input.data.username" | "input.data.displayUsername" | "input.data.phoneNumber" | "input.data.phoneNumberVerified" | "input.data.stripeCustomerId">;
|
|
57
108
|
declare const updateUserArgsValidator: import("convex/values").VObject<{
|
|
58
109
|
input: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
value: string | number | boolean |
|
|
110
|
+
where?: {
|
|
111
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
112
|
+
connector?: "AND" | "OR" | undefined;
|
|
113
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
63
114
|
field: string;
|
|
115
|
+
}[] | undefined;
|
|
116
|
+
update: {
|
|
117
|
+
name?: string | undefined;
|
|
118
|
+
email?: string | undefined;
|
|
119
|
+
emailVerified?: boolean | undefined;
|
|
120
|
+
image?: string | undefined;
|
|
121
|
+
createdAt?: number | undefined;
|
|
122
|
+
updatedAt?: number | undefined;
|
|
123
|
+
twoFactorEnabled?: boolean | undefined;
|
|
124
|
+
isAnonymous?: boolean | undefined;
|
|
125
|
+
username?: string | undefined;
|
|
126
|
+
displayUsername?: string | undefined;
|
|
127
|
+
phoneNumber?: string | undefined;
|
|
128
|
+
phoneNumberVerified?: boolean | undefined;
|
|
129
|
+
stripeCustomerId?: string | undefined;
|
|
64
130
|
};
|
|
131
|
+
model: "user";
|
|
65
132
|
};
|
|
66
133
|
}, {
|
|
67
134
|
input: import("convex/values").VObject<{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
value: string | number | boolean |
|
|
135
|
+
where?: {
|
|
136
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
137
|
+
connector?: "AND" | "OR" | undefined;
|
|
138
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
72
139
|
field: string;
|
|
140
|
+
}[] | undefined;
|
|
141
|
+
update: {
|
|
142
|
+
name?: string | undefined;
|
|
143
|
+
email?: string | undefined;
|
|
144
|
+
emailVerified?: boolean | undefined;
|
|
145
|
+
image?: string | undefined;
|
|
146
|
+
createdAt?: number | undefined;
|
|
147
|
+
updatedAt?: number | undefined;
|
|
148
|
+
twoFactorEnabled?: boolean | undefined;
|
|
149
|
+
isAnonymous?: boolean | undefined;
|
|
150
|
+
username?: string | undefined;
|
|
151
|
+
displayUsername?: string | undefined;
|
|
152
|
+
phoneNumber?: string | undefined;
|
|
153
|
+
phoneNumberVerified?: boolean | undefined;
|
|
154
|
+
stripeCustomerId?: string | undefined;
|
|
73
155
|
};
|
|
156
|
+
model: "user";
|
|
74
157
|
}, {
|
|
75
|
-
|
|
76
|
-
where: import("convex/values").
|
|
77
|
-
|
|
158
|
+
model: import("convex/values").VLiteral<"user", "required">;
|
|
159
|
+
where: import("convex/values").VArray<{
|
|
160
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
161
|
+
connector?: "AND" | "OR" | undefined;
|
|
162
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
163
|
+
field: string;
|
|
164
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
165
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
166
|
+
connector?: "AND" | "OR" | undefined;
|
|
167
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
78
168
|
field: string;
|
|
79
169
|
}, {
|
|
80
170
|
field: import("convex/values").VString<string, "required">;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
171
|
+
operator: import("convex/values").VUnion<"lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined, [import("convex/values").VLiteral<"lt", "required">, import("convex/values").VLiteral<"lte", "required">, import("convex/values").VLiteral<"gt", "required">, import("convex/values").VLiteral<"gte", "required">, import("convex/values").VLiteral<"eq", "required">, import("convex/values").VLiteral<"in", "required">, import("convex/values").VLiteral<"ne", "required">, import("convex/values").VLiteral<"contains", "required">, import("convex/values").VLiteral<"starts_with", "required">, import("convex/values").VLiteral<"ends_with", "required">], "optional", never>;
|
|
172
|
+
value: import("convex/values").VUnion<string | number | boolean | string[] | number[] | null, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">, import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VArray<number[], import("convex/values").VFloat64<number, "required">, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
173
|
+
connector: import("convex/values").VUnion<"AND" | "OR" | undefined, [import("convex/values").VLiteral<"AND", "required">, import("convex/values").VLiteral<"OR", "required">], "optional", never>;
|
|
174
|
+
}, "required", "value" | "field" | "operator" | "connector">, "optional">;
|
|
175
|
+
update: import("convex/values").VObject<{
|
|
176
|
+
name?: string | undefined;
|
|
177
|
+
email?: string | undefined;
|
|
178
|
+
emailVerified?: boolean | undefined;
|
|
179
|
+
image?: string | undefined;
|
|
180
|
+
createdAt?: number | undefined;
|
|
181
|
+
updatedAt?: number | undefined;
|
|
182
|
+
twoFactorEnabled?: boolean | undefined;
|
|
183
|
+
isAnonymous?: boolean | undefined;
|
|
184
|
+
username?: string | undefined;
|
|
185
|
+
displayUsername?: string | undefined;
|
|
186
|
+
phoneNumber?: string | undefined;
|
|
187
|
+
phoneNumberVerified?: boolean | undefined;
|
|
188
|
+
stripeCustomerId?: string | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
name: import("convex/values").VString<string | undefined, "optional">;
|
|
191
|
+
email: import("convex/values").VString<string | undefined, "optional">;
|
|
192
|
+
emailVerified: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
193
|
+
image: import("convex/values").VString<string | undefined, "optional">;
|
|
194
|
+
createdAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
195
|
+
updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
196
|
+
twoFactorEnabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
197
|
+
isAnonymous: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
198
|
+
username: import("convex/values").VString<string | undefined, "optional">;
|
|
199
|
+
displayUsername: import("convex/values").VString<string | undefined, "optional">;
|
|
200
|
+
phoneNumber: import("convex/values").VString<string | undefined, "optional">;
|
|
201
|
+
phoneNumberVerified: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
202
|
+
stripeCustomerId: import("convex/values").VString<string | undefined, "optional">;
|
|
203
|
+
}, "required", "name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt" | "twoFactorEnabled" | "isAnonymous" | "username" | "displayUsername" | "phoneNumber" | "phoneNumberVerified" | "stripeCustomerId">;
|
|
204
|
+
}, "required", "update" | "model" | "where" | "update.name" | "update.email" | "update.emailVerified" | "update.image" | "update.createdAt" | "update.updatedAt" | "update.twoFactorEnabled" | "update.isAnonymous" | "update.username" | "update.displayUsername" | "update.phoneNumber" | "update.phoneNumberVerified" | "update.stripeCustomerId">;
|
|
205
|
+
}, "required", "input" | "input.model" | "input.update" | "input.where" | "input.update.name" | "input.update.email" | "input.update.emailVerified" | "input.update.image" | "input.update.createdAt" | "input.update.updatedAt" | "input.update.twoFactorEnabled" | "input.update.isAnonymous" | "input.update.username" | "input.update.displayUsername" | "input.update.phoneNumber" | "input.update.phoneNumberVerified" | "input.update.stripeCustomerId">;
|
|
97
206
|
declare const createSessionArgsValidator: import("convex/values").VObject<{
|
|
98
207
|
input: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
208
|
+
model: "session";
|
|
209
|
+
data: {
|
|
210
|
+
ipAddress?: string | undefined;
|
|
211
|
+
userAgent?: string | undefined;
|
|
212
|
+
activeOrganizationId?: string | undefined;
|
|
213
|
+
createdAt: number;
|
|
214
|
+
updatedAt: number;
|
|
215
|
+
userId: string;
|
|
216
|
+
expiresAt: number;
|
|
217
|
+
token: string;
|
|
218
|
+
};
|
|
107
219
|
};
|
|
108
220
|
}, {
|
|
109
221
|
input: import("convex/values").VObject<{
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
222
|
+
model: "session";
|
|
223
|
+
data: {
|
|
224
|
+
ipAddress?: string | undefined;
|
|
225
|
+
userAgent?: string | undefined;
|
|
226
|
+
activeOrganizationId?: string | undefined;
|
|
227
|
+
createdAt: number;
|
|
228
|
+
updatedAt: number;
|
|
229
|
+
userId: string;
|
|
230
|
+
expiresAt: number;
|
|
231
|
+
token: string;
|
|
232
|
+
};
|
|
118
233
|
}, {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
234
|
+
model: import("convex/values").VLiteral<"session", "required">;
|
|
235
|
+
data: import("convex/values").VObject<{
|
|
236
|
+
ipAddress?: string | undefined;
|
|
237
|
+
userAgent?: string | undefined;
|
|
238
|
+
activeOrganizationId?: string | undefined;
|
|
239
|
+
createdAt: number;
|
|
240
|
+
updatedAt: number;
|
|
241
|
+
userId: string;
|
|
242
|
+
expiresAt: number;
|
|
243
|
+
token: string;
|
|
244
|
+
}, {
|
|
245
|
+
expiresAt: import("convex/values").VFloat64<number, "required">;
|
|
246
|
+
token: import("convex/values").VString<string, "required">;
|
|
247
|
+
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
248
|
+
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
249
|
+
ipAddress: import("convex/values").VString<string | undefined, "optional">;
|
|
250
|
+
userAgent: import("convex/values").VString<string | undefined, "optional">;
|
|
251
|
+
userId: import("convex/values").VString<string, "required">;
|
|
252
|
+
activeOrganizationId: import("convex/values").VString<string | undefined, "optional">;
|
|
253
|
+
}, "required", "createdAt" | "updatedAt" | "userId" | "expiresAt" | "token" | "ipAddress" | "userAgent" | "activeOrganizationId">;
|
|
254
|
+
}, "required", "model" | "data" | "data.createdAt" | "data.updatedAt" | "data.userId" | "data.expiresAt" | "data.token" | "data.ipAddress" | "data.userAgent" | "data.activeOrganizationId">;
|
|
255
|
+
}, "required", "input" | "input.model" | "input.data" | "input.data.createdAt" | "input.data.updatedAt" | "input.data.userId" | "input.data.expiresAt" | "input.data.token" | "input.data.ipAddress" | "input.data.userAgent" | "input.data.activeOrganizationId">;
|
|
129
256
|
export type EventFunction<T extends DefaultFunctionArgs> = FunctionReference<"mutation", "internal" | "public", T>;
|
|
130
257
|
export type AuthFunctions = {
|
|
131
258
|
createUser: FunctionReference<"mutation", "internal", Infer<typeof createUserArgsValidator>>;
|
|
132
|
-
deleteUser: FunctionReference<"mutation", "internal", Infer<typeof
|
|
259
|
+
deleteUser: FunctionReference<"mutation", "internal", Infer<typeof adapterArgsValidator>>;
|
|
133
260
|
updateUser: FunctionReference<"mutation", "internal", Infer<typeof updateUserArgsValidator>>;
|
|
134
261
|
createSession: FunctionReference<"mutation", "internal", Infer<typeof createSessionArgsValidator>>;
|
|
135
262
|
};
|
|
@@ -157,16 +284,7 @@ export declare class BetterAuth<UserId extends string = string> {
|
|
|
157
284
|
}): Promise<UserId | null>;
|
|
158
285
|
getAuthUser(ctx: RunQueryCtx & {
|
|
159
286
|
auth: ConvexAuth;
|
|
160
|
-
}): Promise<
|
|
161
|
-
image?: string | undefined;
|
|
162
|
-
twoFactorEnabled?: boolean | undefined;
|
|
163
|
-
name: string;
|
|
164
|
-
email: string;
|
|
165
|
-
emailVerified: boolean;
|
|
166
|
-
userId: string;
|
|
167
|
-
createdAt: number;
|
|
168
|
-
updatedAt: number;
|
|
169
|
-
} | null>;
|
|
287
|
+
}): Promise<any>;
|
|
170
288
|
getIdTokenCookieName(createAuth: (ctx: GenericActionCtx<any>) => ReturnType<typeof betterAuth>): Promise<string>;
|
|
171
289
|
createAuthFunctions<DataModel extends GenericDataModel>(opts: {
|
|
172
290
|
onCreateUser: (ctx: GenericMutationCtx<DataModel>, user: Infer<typeof createUserValidator>) => Promise<UserId>;
|
|
@@ -177,113 +295,99 @@ export declare class BetterAuth<UserId extends string = string> {
|
|
|
177
295
|
isAuthenticated: import("convex/server").RegisteredQuery<"public", {}, Promise<boolean>>;
|
|
178
296
|
createUser: import("convex/server").RegisteredMutation<"internal", {
|
|
179
297
|
input: {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
298
|
+
model: "user";
|
|
299
|
+
data: {
|
|
300
|
+
image?: string | undefined;
|
|
301
|
+
twoFactorEnabled?: boolean | undefined;
|
|
302
|
+
isAnonymous?: boolean | undefined;
|
|
303
|
+
username?: string | undefined;
|
|
304
|
+
displayUsername?: string | undefined;
|
|
305
|
+
phoneNumber?: string | undefined;
|
|
306
|
+
phoneNumberVerified?: boolean | undefined;
|
|
307
|
+
stripeCustomerId?: string | undefined;
|
|
308
|
+
name: string;
|
|
309
|
+
email: string;
|
|
310
|
+
emailVerified: boolean;
|
|
311
|
+
createdAt: number;
|
|
312
|
+
updatedAt: number;
|
|
313
|
+
};
|
|
188
314
|
};
|
|
189
|
-
}, Promise<
|
|
190
|
-
image?: string | undefined;
|
|
191
|
-
twoFactorEnabled?: boolean | undefined;
|
|
192
|
-
name: string;
|
|
193
|
-
email: string;
|
|
194
|
-
emailVerified: boolean;
|
|
195
|
-
userId: string;
|
|
196
|
-
createdAt: number;
|
|
197
|
-
updatedAt: number;
|
|
198
|
-
id: string;
|
|
199
|
-
} | {
|
|
200
|
-
ipAddress?: string | undefined;
|
|
201
|
-
userAgent?: string | undefined;
|
|
202
|
-
userId: string;
|
|
203
|
-
createdAt: number;
|
|
204
|
-
updatedAt: number;
|
|
205
|
-
expiresAt: number;
|
|
206
|
-
token: string;
|
|
207
|
-
id: string;
|
|
208
|
-
} | {
|
|
209
|
-
accessToken?: string | undefined;
|
|
210
|
-
refreshToken?: string | undefined;
|
|
211
|
-
idToken?: string | undefined;
|
|
212
|
-
accessTokenExpiresAt?: number | undefined;
|
|
213
|
-
refreshTokenExpiresAt?: number | undefined;
|
|
214
|
-
scope?: string | undefined;
|
|
215
|
-
password?: string | undefined;
|
|
216
|
-
userId: string;
|
|
217
|
-
createdAt: number;
|
|
218
|
-
updatedAt: number;
|
|
219
|
-
accountId: string;
|
|
220
|
-
providerId: string;
|
|
221
|
-
id: string;
|
|
222
|
-
} | {
|
|
223
|
-
userId: string;
|
|
224
|
-
secret: string;
|
|
225
|
-
backupCodes: string;
|
|
226
|
-
id: string;
|
|
227
|
-
} | {
|
|
228
|
-
createdAt?: number | undefined;
|
|
229
|
-
updatedAt?: number | undefined;
|
|
230
|
-
expiresAt: number;
|
|
231
|
-
identifier: string;
|
|
232
|
-
value: string;
|
|
233
|
-
id: string;
|
|
234
|
-
} | {
|
|
235
|
-
id: string;
|
|
236
|
-
createdAt: number;
|
|
237
|
-
publicKey: string;
|
|
238
|
-
privateKey: string;
|
|
239
|
-
}>>;
|
|
315
|
+
}, Promise<any>>;
|
|
240
316
|
deleteUser: import("convex/server").RegisteredMutation<"internal", {
|
|
317
|
+
where?: {
|
|
318
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
319
|
+
connector?: "AND" | "OR" | undefined;
|
|
320
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
321
|
+
field: string;
|
|
322
|
+
}[] | undefined;
|
|
323
|
+
sortBy?: {
|
|
324
|
+
field: string;
|
|
325
|
+
direction: "asc" | "desc";
|
|
326
|
+
} | undefined;
|
|
327
|
+
select?: string[] | undefined;
|
|
328
|
+
limit?: number | undefined;
|
|
329
|
+
offset?: number | undefined;
|
|
241
330
|
unique?: boolean | undefined;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
field: string;
|
|
245
|
-
}, Promise<void>>;
|
|
331
|
+
model: string;
|
|
332
|
+
}, Promise<any>>;
|
|
246
333
|
updateUser: import("convex/server").RegisteredMutation<"internal", {
|
|
247
334
|
input: {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
value: string | number | boolean |
|
|
335
|
+
where?: {
|
|
336
|
+
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
337
|
+
connector?: "AND" | "OR" | undefined;
|
|
338
|
+
value: string | number | boolean | string[] | number[] | null;
|
|
252
339
|
field: string;
|
|
340
|
+
}[] | undefined;
|
|
341
|
+
update: {
|
|
342
|
+
name?: string | undefined;
|
|
343
|
+
email?: string | undefined;
|
|
344
|
+
emailVerified?: boolean | undefined;
|
|
345
|
+
image?: string | undefined;
|
|
346
|
+
createdAt?: number | undefined;
|
|
347
|
+
updatedAt?: number | undefined;
|
|
348
|
+
twoFactorEnabled?: boolean | undefined;
|
|
349
|
+
isAnonymous?: boolean | undefined;
|
|
350
|
+
username?: string | undefined;
|
|
351
|
+
displayUsername?: string | undefined;
|
|
352
|
+
phoneNumber?: string | undefined;
|
|
353
|
+
phoneNumberVerified?: boolean | undefined;
|
|
354
|
+
stripeCustomerId?: string | undefined;
|
|
253
355
|
};
|
|
356
|
+
model: "user";
|
|
254
357
|
};
|
|
255
358
|
}, Promise<{
|
|
359
|
+
_id: string;
|
|
360
|
+
_creationTime: number;
|
|
256
361
|
image?: string | undefined;
|
|
257
362
|
twoFactorEnabled?: boolean | undefined;
|
|
363
|
+
isAnonymous?: boolean | undefined;
|
|
364
|
+
username?: string | undefined;
|
|
365
|
+
displayUsername?: string | undefined;
|
|
366
|
+
phoneNumber?: string | undefined;
|
|
367
|
+
phoneNumberVerified?: boolean | undefined;
|
|
368
|
+
stripeCustomerId?: string | undefined;
|
|
369
|
+
userId?: string | undefined;
|
|
258
370
|
name: string;
|
|
259
371
|
email: string;
|
|
260
372
|
emailVerified: boolean;
|
|
261
|
-
userId: string;
|
|
262
373
|
createdAt: number;
|
|
263
374
|
updatedAt: number;
|
|
264
|
-
id: string;
|
|
265
375
|
}>>;
|
|
266
376
|
createSession: import("convex/server").RegisteredMutation<"internal", {
|
|
267
377
|
input: {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
378
|
+
model: "session";
|
|
379
|
+
data: {
|
|
380
|
+
ipAddress?: string | undefined;
|
|
381
|
+
userAgent?: string | undefined;
|
|
382
|
+
activeOrganizationId?: string | undefined;
|
|
383
|
+
createdAt: number;
|
|
384
|
+
updatedAt: number;
|
|
385
|
+
userId: string;
|
|
386
|
+
expiresAt: number;
|
|
387
|
+
token: string;
|
|
388
|
+
};
|
|
276
389
|
};
|
|
277
|
-
}, Promise<
|
|
278
|
-
ipAddress?: string | undefined;
|
|
279
|
-
userAgent?: string | undefined;
|
|
280
|
-
userId: string;
|
|
281
|
-
createdAt: number;
|
|
282
|
-
updatedAt: number;
|
|
283
|
-
expiresAt: number;
|
|
284
|
-
token: string;
|
|
285
|
-
id: string;
|
|
286
|
-
}>>;
|
|
390
|
+
}, Promise<any>>;
|
|
287
391
|
};
|
|
288
392
|
registerRoutes(http: HttpRouter, createAuth: (ctx: GenericActionCtx<any>) => ReturnType<typeof betterAuth>, opts?: {
|
|
289
393
|
cors: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO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