@convex-dev/better-auth 0.6.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/LICENSE +201 -0
- package/README.md +44 -0
- package/dist/commonjs/client/adapter.d.ts +4 -0
- package/dist/commonjs/client/adapter.d.ts.map +1 -0
- package/dist/commonjs/client/adapter.js +189 -0
- package/dist/commonjs/client/adapter.js.map +1 -0
- package/dist/commonjs/client/cors.d.ts +72 -0
- package/dist/commonjs/client/cors.d.ts.map +1 -0
- package/dist/commonjs/client/cors.js +281 -0
- package/dist/commonjs/client/cors.js.map +1 -0
- package/dist/commonjs/client/index.d.ts +302 -0
- package/dist/commonjs/client/index.d.ts.map +1 -0
- package/dist/commonjs/client/index.js +232 -0
- package/dist/commonjs/client/index.js.map +1 -0
- package/dist/commonjs/client/plugins/index.d.ts +3 -0
- package/dist/commonjs/client/plugins/index.d.ts.map +1 -0
- package/dist/commonjs/client/plugins/index.js +3 -0
- package/dist/commonjs/client/plugins/index.js.map +1 -0
- package/dist/commonjs/component/_generated/api.d.ts +12 -0
- package/dist/commonjs/component/_generated/api.d.ts.map +1 -0
- package/dist/commonjs/component/_generated/api.js +22 -0
- package/dist/commonjs/component/_generated/api.js.map +1 -0
- package/dist/commonjs/component/_generated/server.d.ts +64 -0
- package/dist/commonjs/component/_generated/server.d.ts.map +1 -0
- package/dist/commonjs/component/_generated/server.js +74 -0
- package/dist/commonjs/component/_generated/server.js.map +1 -0
- package/dist/commonjs/component/convex.config.d.ts +3 -0
- package/dist/commonjs/component/convex.config.d.ts.map +1 -0
- package/dist/commonjs/component/convex.config.js +4 -0
- package/dist/commonjs/component/convex.config.js.map +1 -0
- package/dist/commonjs/component/lib.d.ts +584 -0
- package/dist/commonjs/component/lib.d.ts.map +1 -0
- package/dist/commonjs/component/lib.js +323 -0
- package/dist/commonjs/component/lib.js.map +1 -0
- package/dist/commonjs/component/schema.d.ts +116 -0
- package/dist/commonjs/component/schema.d.ts.map +1 -0
- package/dist/commonjs/component/schema.js +68 -0
- package/dist/commonjs/component/schema.js.map +1 -0
- package/dist/commonjs/component/util.d.ts +394 -0
- package/dist/commonjs/component/util.d.ts.map +1 -0
- package/dist/commonjs/component/util.js +4 -0
- package/dist/commonjs/component/util.js.map +1 -0
- package/dist/commonjs/nextjs/index.d.ts +10 -0
- package/dist/commonjs/nextjs/index.d.ts.map +1 -0
- package/dist/commonjs/nextjs/index.js +23 -0
- package/dist/commonjs/nextjs/index.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/plugins/convex/client.d.ts +6 -0
- package/dist/commonjs/plugins/convex/client.d.ts.map +1 -0
- package/dist/commonjs/plugins/convex/client.js +7 -0
- package/dist/commonjs/plugins/convex/client.js.map +1 -0
- package/dist/commonjs/plugins/convex/index.d.ts +280 -0
- package/dist/commonjs/plugins/convex/index.d.ts.map +1 -0
- package/dist/commonjs/plugins/convex/index.js +253 -0
- package/dist/commonjs/plugins/convex/index.js.map +1 -0
- package/dist/commonjs/plugins/cross-domain/client.d.ts +123 -0
- package/dist/commonjs/plugins/cross-domain/client.d.ts.map +1 -0
- package/dist/commonjs/plugins/cross-domain/client.js +164 -0
- package/dist/commonjs/plugins/cross-domain/client.js.map +1 -0
- package/dist/commonjs/plugins/cross-domain/index.d.ts +81 -0
- package/dist/commonjs/plugins/cross-domain/index.d.ts.map +1 -0
- package/dist/commonjs/plugins/cross-domain/index.js +135 -0
- package/dist/commonjs/plugins/cross-domain/index.js.map +1 -0
- package/dist/commonjs/plugins/index.d.ts +3 -0
- package/dist/commonjs/plugins/index.d.ts.map +1 -0
- package/dist/commonjs/plugins/index.js +3 -0
- package/dist/commonjs/plugins/index.js.map +1 -0
- package/dist/commonjs/react/client.d.ts +31 -0
- package/dist/commonjs/react/client.d.ts.map +1 -0
- package/dist/commonjs/react/client.js +102 -0
- package/dist/commonjs/react/client.js.map +1 -0
- package/dist/commonjs/react/index.d.ts +9 -0
- package/dist/commonjs/react/index.d.ts.map +1 -0
- package/dist/commonjs/react/index.js +15 -0
- package/dist/commonjs/react/index.js.map +1 -0
- package/dist/commonjs/react-start/index.d.ts +10 -0
- package/dist/commonjs/react-start/index.d.ts.map +1 -0
- package/dist/commonjs/react-start/index.js +32 -0
- package/dist/commonjs/react-start/index.js.map +1 -0
- package/dist/esm/client/adapter.d.ts +4 -0
- package/dist/esm/client/adapter.d.ts.map +1 -0
- package/dist/esm/client/adapter.js +189 -0
- package/dist/esm/client/adapter.js.map +1 -0
- package/dist/esm/client/cors.d.ts +72 -0
- package/dist/esm/client/cors.d.ts.map +1 -0
- package/dist/esm/client/cors.js +281 -0
- package/dist/esm/client/cors.js.map +1 -0
- package/dist/esm/client/index.d.ts +302 -0
- package/dist/esm/client/index.d.ts.map +1 -0
- package/dist/esm/client/index.js +232 -0
- package/dist/esm/client/index.js.map +1 -0
- package/dist/esm/client/plugins/index.d.ts +3 -0
- package/dist/esm/client/plugins/index.d.ts.map +1 -0
- package/dist/esm/client/plugins/index.js +3 -0
- package/dist/esm/client/plugins/index.js.map +1 -0
- package/dist/esm/component/_generated/api.d.ts +12 -0
- package/dist/esm/component/_generated/api.d.ts.map +1 -0
- package/dist/esm/component/_generated/api.js +22 -0
- package/dist/esm/component/_generated/api.js.map +1 -0
- package/dist/esm/component/_generated/server.d.ts +64 -0
- package/dist/esm/component/_generated/server.d.ts.map +1 -0
- package/dist/esm/component/_generated/server.js +74 -0
- package/dist/esm/component/_generated/server.js.map +1 -0
- package/dist/esm/component/convex.config.d.ts +3 -0
- package/dist/esm/component/convex.config.d.ts.map +1 -0
- package/dist/esm/component/convex.config.js +4 -0
- package/dist/esm/component/convex.config.js.map +1 -0
- package/dist/esm/component/lib.d.ts +584 -0
- package/dist/esm/component/lib.d.ts.map +1 -0
- package/dist/esm/component/lib.js +323 -0
- package/dist/esm/component/lib.js.map +1 -0
- package/dist/esm/component/schema.d.ts +116 -0
- package/dist/esm/component/schema.d.ts.map +1 -0
- package/dist/esm/component/schema.js +68 -0
- package/dist/esm/component/schema.js.map +1 -0
- package/dist/esm/component/util.d.ts +394 -0
- package/dist/esm/component/util.d.ts.map +1 -0
- package/dist/esm/component/util.js +4 -0
- package/dist/esm/component/util.js.map +1 -0
- package/dist/esm/nextjs/index.d.ts +10 -0
- package/dist/esm/nextjs/index.d.ts.map +1 -0
- package/dist/esm/nextjs/index.js +23 -0
- package/dist/esm/nextjs/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/plugins/convex/client.d.ts +6 -0
- package/dist/esm/plugins/convex/client.d.ts.map +1 -0
- package/dist/esm/plugins/convex/client.js +7 -0
- package/dist/esm/plugins/convex/client.js.map +1 -0
- package/dist/esm/plugins/convex/index.d.ts +280 -0
- package/dist/esm/plugins/convex/index.d.ts.map +1 -0
- package/dist/esm/plugins/convex/index.js +253 -0
- package/dist/esm/plugins/convex/index.js.map +1 -0
- package/dist/esm/plugins/cross-domain/client.d.ts +123 -0
- package/dist/esm/plugins/cross-domain/client.d.ts.map +1 -0
- package/dist/esm/plugins/cross-domain/client.js +164 -0
- package/dist/esm/plugins/cross-domain/client.js.map +1 -0
- package/dist/esm/plugins/cross-domain/index.d.ts +81 -0
- package/dist/esm/plugins/cross-domain/index.d.ts.map +1 -0
- package/dist/esm/plugins/cross-domain/index.js +135 -0
- package/dist/esm/plugins/cross-domain/index.js.map +1 -0
- package/dist/esm/plugins/index.d.ts +3 -0
- package/dist/esm/plugins/index.d.ts.map +1 -0
- package/dist/esm/plugins/index.js +3 -0
- package/dist/esm/plugins/index.js.map +1 -0
- package/dist/esm/react/client.d.ts +31 -0
- package/dist/esm/react/client.d.ts.map +1 -0
- package/dist/esm/react/client.js +102 -0
- package/dist/esm/react/client.js.map +1 -0
- package/dist/esm/react/index.d.ts +9 -0
- package/dist/esm/react/index.d.ts.map +1 -0
- package/dist/esm/react/index.js +15 -0
- package/dist/esm/react/index.js.map +1 -0
- package/dist/esm/react-start/index.d.ts +10 -0
- package/dist/esm/react-start/index.d.ts.map +1 -0
- package/dist/esm/react-start/index.js +32 -0
- package/dist/esm/react-start/index.js.map +1 -0
- package/package.json +161 -0
- package/plugins/package.json +5 -0
- package/react/package.json +5 -0
- package/src/client/adapter.ts +236 -0
- package/src/client/cors.ts +403 -0
- package/src/client/index.ts +381 -0
- package/src/client/plugins/index.ts +2 -0
- package/src/component/_generated/api.d.ts +313 -0
- package/src/component/_generated/api.js +23 -0
- package/src/component/_generated/dataModel.d.ts +60 -0
- package/src/component/_generated/server.d.ts +149 -0
- package/src/component/_generated/server.js +90 -0
- package/src/component/convex.config.ts +5 -0
- package/src/component/lib.ts +391 -0
- package/src/component/schema.ts +74 -0
- package/src/component/util.ts +4 -0
- package/src/nextjs/index.ts +30 -0
- package/src/plugins/convex/client.ts +9 -0
- package/src/plugins/convex/index.ts +296 -0
- package/src/plugins/cross-domain/client.ts +209 -0
- package/src/plugins/cross-domain/index.ts +156 -0
- package/src/plugins/index.ts +2 -0
- package/src/react/client.tsx +184 -0
- package/src/react/index.tsx +38 -0
- package/src/react-start/index.ts +51 -0
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
export declare const vv: {
|
|
2
|
+
id: <TableName extends import("convex/server").TableNamesInDataModel<{
|
|
3
|
+
user: {
|
|
4
|
+
document: {
|
|
5
|
+
_id: import("convex/values").GenericId<"user">;
|
|
6
|
+
_creationTime: number;
|
|
7
|
+
image?: string | undefined;
|
|
8
|
+
twoFactorEnabled?: boolean | undefined;
|
|
9
|
+
name: string;
|
|
10
|
+
email: string;
|
|
11
|
+
emailVerified: boolean;
|
|
12
|
+
userId: string;
|
|
13
|
+
createdAt: number;
|
|
14
|
+
updatedAt: number;
|
|
15
|
+
};
|
|
16
|
+
fieldPaths: ("name" | "email" | "emailVerified" | "image" | "twoFactorEnabled" | "userId" | "createdAt" | "updatedAt" | "_creationTime") | "_id";
|
|
17
|
+
indexes: {
|
|
18
|
+
email: ["email", "_creationTime"];
|
|
19
|
+
userId: ["userId", "_creationTime"];
|
|
20
|
+
by_id: ["_id"];
|
|
21
|
+
by_creation_time: ["_creationTime"];
|
|
22
|
+
};
|
|
23
|
+
searchIndexes: {};
|
|
24
|
+
vectorIndexes: {};
|
|
25
|
+
};
|
|
26
|
+
session: {
|
|
27
|
+
document: {
|
|
28
|
+
_id: import("convex/values").GenericId<"session">;
|
|
29
|
+
_creationTime: number;
|
|
30
|
+
ipAddress?: string | undefined;
|
|
31
|
+
userAgent?: string | undefined;
|
|
32
|
+
userId: string;
|
|
33
|
+
createdAt: number;
|
|
34
|
+
updatedAt: number;
|
|
35
|
+
expiresAt: number;
|
|
36
|
+
token: string;
|
|
37
|
+
};
|
|
38
|
+
fieldPaths: ("userId" | "createdAt" | "updatedAt" | "_creationTime" | "expiresAt" | "token" | "ipAddress" | "userAgent") | "_id";
|
|
39
|
+
indexes: {
|
|
40
|
+
token: ["token", "_creationTime"];
|
|
41
|
+
userId: ["userId", "_creationTime"];
|
|
42
|
+
by_id: ["_id"];
|
|
43
|
+
by_creation_time: ["_creationTime"];
|
|
44
|
+
};
|
|
45
|
+
searchIndexes: {};
|
|
46
|
+
vectorIndexes: {};
|
|
47
|
+
};
|
|
48
|
+
account: {
|
|
49
|
+
document: {
|
|
50
|
+
_id: import("convex/values").GenericId<"account">;
|
|
51
|
+
_creationTime: number;
|
|
52
|
+
accessToken?: string | undefined;
|
|
53
|
+
refreshToken?: string | undefined;
|
|
54
|
+
idToken?: string | undefined;
|
|
55
|
+
accessTokenExpiresAt?: number | undefined;
|
|
56
|
+
refreshTokenExpiresAt?: number | undefined;
|
|
57
|
+
scope?: string | undefined;
|
|
58
|
+
password?: string | undefined;
|
|
59
|
+
userId: string;
|
|
60
|
+
createdAt: number;
|
|
61
|
+
updatedAt: number;
|
|
62
|
+
accountId: string;
|
|
63
|
+
providerId: string;
|
|
64
|
+
};
|
|
65
|
+
fieldPaths: ("userId" | "createdAt" | "updatedAt" | "_creationTime" | "accountId" | "providerId" | "accessToken" | "refreshToken" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope" | "password") | "_id";
|
|
66
|
+
indexes: {
|
|
67
|
+
userId: ["userId", "_creationTime"];
|
|
68
|
+
accountId: ["accountId", "_creationTime"];
|
|
69
|
+
providerId_accountId: ["providerId", "accountId", "_creationTime"];
|
|
70
|
+
userId_providerId: ["userId", "providerId", "_creationTime"];
|
|
71
|
+
by_id: ["_id"];
|
|
72
|
+
by_creation_time: ["_creationTime"];
|
|
73
|
+
};
|
|
74
|
+
searchIndexes: {};
|
|
75
|
+
vectorIndexes: {};
|
|
76
|
+
};
|
|
77
|
+
twoFactor: {
|
|
78
|
+
document: {
|
|
79
|
+
_id: import("convex/values").GenericId<"twoFactor">;
|
|
80
|
+
_creationTime: number;
|
|
81
|
+
userId: string;
|
|
82
|
+
secret: string;
|
|
83
|
+
backupCodes: string;
|
|
84
|
+
};
|
|
85
|
+
fieldPaths: ("userId" | "_creationTime" | "secret" | "backupCodes") | "_id";
|
|
86
|
+
indexes: {
|
|
87
|
+
userId: ["userId", "_creationTime"];
|
|
88
|
+
by_id: ["_id"];
|
|
89
|
+
by_creation_time: ["_creationTime"];
|
|
90
|
+
};
|
|
91
|
+
searchIndexes: {};
|
|
92
|
+
vectorIndexes: {};
|
|
93
|
+
};
|
|
94
|
+
verification: {
|
|
95
|
+
document: {
|
|
96
|
+
_id: import("convex/values").GenericId<"verification">;
|
|
97
|
+
_creationTime: number;
|
|
98
|
+
createdAt?: number | undefined;
|
|
99
|
+
updatedAt?: number | undefined;
|
|
100
|
+
expiresAt: number;
|
|
101
|
+
identifier: string;
|
|
102
|
+
value: string;
|
|
103
|
+
};
|
|
104
|
+
fieldPaths: ("createdAt" | "updatedAt" | "_creationTime" | "expiresAt" | "identifier" | "value") | "_id";
|
|
105
|
+
indexes: {
|
|
106
|
+
identifier: ["identifier", "_creationTime"];
|
|
107
|
+
expiresAt: ["expiresAt", "_creationTime"];
|
|
108
|
+
by_id: ["_id"];
|
|
109
|
+
by_creation_time: ["_creationTime"];
|
|
110
|
+
};
|
|
111
|
+
searchIndexes: {};
|
|
112
|
+
vectorIndexes: {};
|
|
113
|
+
};
|
|
114
|
+
jwks: {
|
|
115
|
+
document: {
|
|
116
|
+
_id: import("convex/values").GenericId<"jwks">;
|
|
117
|
+
_creationTime: number;
|
|
118
|
+
id?: string | undefined;
|
|
119
|
+
createdAt: number;
|
|
120
|
+
publicKey: string;
|
|
121
|
+
privateKey: string;
|
|
122
|
+
};
|
|
123
|
+
fieldPaths: "_id" | ("id" | "createdAt" | "_creationTime" | "publicKey" | "privateKey");
|
|
124
|
+
indexes: {
|
|
125
|
+
by_id: ["_id"];
|
|
126
|
+
by_creation_time: ["_creationTime"];
|
|
127
|
+
};
|
|
128
|
+
searchIndexes: {};
|
|
129
|
+
vectorIndexes: {};
|
|
130
|
+
};
|
|
131
|
+
}>>(tableName: TableName) => import("convex/values").VId<import("convex/values").GenericId<TableName>, "required">;
|
|
132
|
+
doc: <TableName extends import("convex/server").TableNamesInDataModel<{
|
|
133
|
+
user: {
|
|
134
|
+
document: {
|
|
135
|
+
_id: import("convex/values").GenericId<"user">;
|
|
136
|
+
_creationTime: number;
|
|
137
|
+
image?: string | undefined;
|
|
138
|
+
twoFactorEnabled?: boolean | undefined;
|
|
139
|
+
name: string;
|
|
140
|
+
email: string;
|
|
141
|
+
emailVerified: boolean;
|
|
142
|
+
userId: string;
|
|
143
|
+
createdAt: number;
|
|
144
|
+
updatedAt: number;
|
|
145
|
+
};
|
|
146
|
+
fieldPaths: ("name" | "email" | "emailVerified" | "image" | "twoFactorEnabled" | "userId" | "createdAt" | "updatedAt" | "_creationTime") | "_id";
|
|
147
|
+
indexes: {
|
|
148
|
+
email: ["email", "_creationTime"];
|
|
149
|
+
userId: ["userId", "_creationTime"];
|
|
150
|
+
by_id: ["_id"];
|
|
151
|
+
by_creation_time: ["_creationTime"];
|
|
152
|
+
};
|
|
153
|
+
searchIndexes: {};
|
|
154
|
+
vectorIndexes: {};
|
|
155
|
+
};
|
|
156
|
+
session: {
|
|
157
|
+
document: {
|
|
158
|
+
_id: import("convex/values").GenericId<"session">;
|
|
159
|
+
_creationTime: number;
|
|
160
|
+
ipAddress?: string | undefined;
|
|
161
|
+
userAgent?: string | undefined;
|
|
162
|
+
userId: string;
|
|
163
|
+
createdAt: number;
|
|
164
|
+
updatedAt: number;
|
|
165
|
+
expiresAt: number;
|
|
166
|
+
token: string;
|
|
167
|
+
};
|
|
168
|
+
fieldPaths: ("userId" | "createdAt" | "updatedAt" | "_creationTime" | "expiresAt" | "token" | "ipAddress" | "userAgent") | "_id";
|
|
169
|
+
indexes: {
|
|
170
|
+
token: ["token", "_creationTime"];
|
|
171
|
+
userId: ["userId", "_creationTime"];
|
|
172
|
+
by_id: ["_id"];
|
|
173
|
+
by_creation_time: ["_creationTime"];
|
|
174
|
+
};
|
|
175
|
+
searchIndexes: {};
|
|
176
|
+
vectorIndexes: {};
|
|
177
|
+
};
|
|
178
|
+
account: {
|
|
179
|
+
document: {
|
|
180
|
+
_id: import("convex/values").GenericId<"account">;
|
|
181
|
+
_creationTime: number;
|
|
182
|
+
accessToken?: string | undefined;
|
|
183
|
+
refreshToken?: string | undefined;
|
|
184
|
+
idToken?: string | undefined;
|
|
185
|
+
accessTokenExpiresAt?: number | undefined;
|
|
186
|
+
refreshTokenExpiresAt?: number | undefined;
|
|
187
|
+
scope?: string | undefined;
|
|
188
|
+
password?: string | undefined;
|
|
189
|
+
userId: string;
|
|
190
|
+
createdAt: number;
|
|
191
|
+
updatedAt: number;
|
|
192
|
+
accountId: string;
|
|
193
|
+
providerId: string;
|
|
194
|
+
};
|
|
195
|
+
fieldPaths: ("userId" | "createdAt" | "updatedAt" | "_creationTime" | "accountId" | "providerId" | "accessToken" | "refreshToken" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope" | "password") | "_id";
|
|
196
|
+
indexes: {
|
|
197
|
+
userId: ["userId", "_creationTime"];
|
|
198
|
+
accountId: ["accountId", "_creationTime"];
|
|
199
|
+
providerId_accountId: ["providerId", "accountId", "_creationTime"];
|
|
200
|
+
userId_providerId: ["userId", "providerId", "_creationTime"];
|
|
201
|
+
by_id: ["_id"];
|
|
202
|
+
by_creation_time: ["_creationTime"];
|
|
203
|
+
};
|
|
204
|
+
searchIndexes: {};
|
|
205
|
+
vectorIndexes: {};
|
|
206
|
+
};
|
|
207
|
+
twoFactor: {
|
|
208
|
+
document: {
|
|
209
|
+
_id: import("convex/values").GenericId<"twoFactor">;
|
|
210
|
+
_creationTime: number;
|
|
211
|
+
userId: string;
|
|
212
|
+
secret: string;
|
|
213
|
+
backupCodes: string;
|
|
214
|
+
};
|
|
215
|
+
fieldPaths: ("userId" | "_creationTime" | "secret" | "backupCodes") | "_id";
|
|
216
|
+
indexes: {
|
|
217
|
+
userId: ["userId", "_creationTime"];
|
|
218
|
+
by_id: ["_id"];
|
|
219
|
+
by_creation_time: ["_creationTime"];
|
|
220
|
+
};
|
|
221
|
+
searchIndexes: {};
|
|
222
|
+
vectorIndexes: {};
|
|
223
|
+
};
|
|
224
|
+
verification: {
|
|
225
|
+
document: {
|
|
226
|
+
_id: import("convex/values").GenericId<"verification">;
|
|
227
|
+
_creationTime: number;
|
|
228
|
+
createdAt?: number | undefined;
|
|
229
|
+
updatedAt?: number | undefined;
|
|
230
|
+
expiresAt: number;
|
|
231
|
+
identifier: string;
|
|
232
|
+
value: string;
|
|
233
|
+
};
|
|
234
|
+
fieldPaths: ("createdAt" | "updatedAt" | "_creationTime" | "expiresAt" | "identifier" | "value") | "_id";
|
|
235
|
+
indexes: {
|
|
236
|
+
identifier: ["identifier", "_creationTime"];
|
|
237
|
+
expiresAt: ["expiresAt", "_creationTime"];
|
|
238
|
+
by_id: ["_id"];
|
|
239
|
+
by_creation_time: ["_creationTime"];
|
|
240
|
+
};
|
|
241
|
+
searchIndexes: {};
|
|
242
|
+
vectorIndexes: {};
|
|
243
|
+
};
|
|
244
|
+
jwks: {
|
|
245
|
+
document: {
|
|
246
|
+
_id: import("convex/values").GenericId<"jwks">;
|
|
247
|
+
_creationTime: number;
|
|
248
|
+
id?: string | undefined;
|
|
249
|
+
createdAt: number;
|
|
250
|
+
publicKey: string;
|
|
251
|
+
privateKey: string;
|
|
252
|
+
};
|
|
253
|
+
fieldPaths: "_id" | ("id" | "createdAt" | "_creationTime" | "publicKey" | "privateKey");
|
|
254
|
+
indexes: {
|
|
255
|
+
by_id: ["_id"];
|
|
256
|
+
by_creation_time: ["_creationTime"];
|
|
257
|
+
};
|
|
258
|
+
searchIndexes: {};
|
|
259
|
+
vectorIndexes: {};
|
|
260
|
+
};
|
|
261
|
+
}>>(tableName: TableName) => import("convex-helpers/validators").AddFieldsToValidator<{
|
|
262
|
+
user: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
263
|
+
image?: string | undefined;
|
|
264
|
+
twoFactorEnabled?: boolean | undefined;
|
|
265
|
+
name: string;
|
|
266
|
+
email: string;
|
|
267
|
+
emailVerified: boolean;
|
|
268
|
+
userId: string;
|
|
269
|
+
createdAt: number;
|
|
270
|
+
updatedAt: number;
|
|
271
|
+
}, {
|
|
272
|
+
name: import("convex/values").VString<string, "required">;
|
|
273
|
+
email: import("convex/values").VString<string, "required">;
|
|
274
|
+
emailVerified: import("convex/values").VBoolean<boolean, "required">;
|
|
275
|
+
image: import("convex/values").VString<string | undefined, "optional">;
|
|
276
|
+
twoFactorEnabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
277
|
+
userId: import("convex/values").VString<string, "required">;
|
|
278
|
+
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
279
|
+
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
280
|
+
}, "required", "name" | "email" | "emailVerified" | "image" | "twoFactorEnabled" | "userId" | "createdAt" | "updatedAt">, {
|
|
281
|
+
email: ["email", "_creationTime"];
|
|
282
|
+
userId: ["userId", "_creationTime"];
|
|
283
|
+
}, {}, {}>;
|
|
284
|
+
session: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
285
|
+
ipAddress?: string | undefined;
|
|
286
|
+
userAgent?: string | undefined;
|
|
287
|
+
userId: string;
|
|
288
|
+
createdAt: number;
|
|
289
|
+
updatedAt: number;
|
|
290
|
+
expiresAt: number;
|
|
291
|
+
token: string;
|
|
292
|
+
}, {
|
|
293
|
+
expiresAt: import("convex/values").VFloat64<number, "required">;
|
|
294
|
+
token: import("convex/values").VString<string, "required">;
|
|
295
|
+
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
296
|
+
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
297
|
+
ipAddress: import("convex/values").VString<string | undefined, "optional">;
|
|
298
|
+
userAgent: import("convex/values").VString<string | undefined, "optional">;
|
|
299
|
+
userId: import("convex/values").VString<string, "required">;
|
|
300
|
+
}, "required", "userId" | "createdAt" | "updatedAt" | "expiresAt" | "token" | "ipAddress" | "userAgent">, {
|
|
301
|
+
token: ["token", "_creationTime"];
|
|
302
|
+
userId: ["userId", "_creationTime"];
|
|
303
|
+
}, {}, {}>;
|
|
304
|
+
account: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
305
|
+
accessToken?: string | undefined;
|
|
306
|
+
refreshToken?: string | undefined;
|
|
307
|
+
idToken?: string | undefined;
|
|
308
|
+
accessTokenExpiresAt?: number | undefined;
|
|
309
|
+
refreshTokenExpiresAt?: number | undefined;
|
|
310
|
+
scope?: string | undefined;
|
|
311
|
+
password?: string | undefined;
|
|
312
|
+
userId: string;
|
|
313
|
+
createdAt: number;
|
|
314
|
+
updatedAt: number;
|
|
315
|
+
accountId: string;
|
|
316
|
+
providerId: string;
|
|
317
|
+
}, {
|
|
318
|
+
accountId: import("convex/values").VString<string, "required">;
|
|
319
|
+
providerId: import("convex/values").VString<string, "required">;
|
|
320
|
+
userId: import("convex/values").VString<string, "required">;
|
|
321
|
+
accessToken: import("convex/values").VString<string | undefined, "optional">;
|
|
322
|
+
refreshToken: import("convex/values").VString<string | undefined, "optional">;
|
|
323
|
+
idToken: import("convex/values").VString<string | undefined, "optional">;
|
|
324
|
+
accessTokenExpiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
325
|
+
refreshTokenExpiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
326
|
+
scope: import("convex/values").VString<string | undefined, "optional">;
|
|
327
|
+
password: import("convex/values").VString<string | undefined, "optional">;
|
|
328
|
+
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
329
|
+
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
330
|
+
}, "required", "userId" | "createdAt" | "updatedAt" | "accountId" | "providerId" | "accessToken" | "refreshToken" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope" | "password">, {
|
|
331
|
+
userId: ["userId", "_creationTime"];
|
|
332
|
+
accountId: ["accountId", "_creationTime"];
|
|
333
|
+
providerId_accountId: ["providerId", "accountId", "_creationTime"];
|
|
334
|
+
userId_providerId: ["userId", "providerId", "_creationTime"];
|
|
335
|
+
}, {}, {}>;
|
|
336
|
+
twoFactor: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
337
|
+
userId: string;
|
|
338
|
+
secret: string;
|
|
339
|
+
backupCodes: string;
|
|
340
|
+
}, {
|
|
341
|
+
secret: import("convex/values").VString<string, "required">;
|
|
342
|
+
backupCodes: import("convex/values").VString<string, "required">;
|
|
343
|
+
userId: import("convex/values").VString<string, "required">;
|
|
344
|
+
}, "required", "userId" | "secret" | "backupCodes">, {
|
|
345
|
+
userId: ["userId", "_creationTime"];
|
|
346
|
+
}, {}, {}>;
|
|
347
|
+
verification: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
348
|
+
createdAt?: number | undefined;
|
|
349
|
+
updatedAt?: number | undefined;
|
|
350
|
+
expiresAt: number;
|
|
351
|
+
identifier: string;
|
|
352
|
+
value: string;
|
|
353
|
+
}, {
|
|
354
|
+
identifier: import("convex/values").VString<string, "required">;
|
|
355
|
+
value: import("convex/values").VString<string, "required">;
|
|
356
|
+
expiresAt: import("convex/values").VFloat64<number, "required">;
|
|
357
|
+
createdAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
358
|
+
updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
359
|
+
}, "required", "createdAt" | "updatedAt" | "expiresAt" | "identifier" | "value">, {
|
|
360
|
+
identifier: ["identifier", "_creationTime"];
|
|
361
|
+
expiresAt: ["expiresAt", "_creationTime"];
|
|
362
|
+
}, {}, {}>;
|
|
363
|
+
jwks: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
364
|
+
id?: string | undefined;
|
|
365
|
+
createdAt: number;
|
|
366
|
+
publicKey: string;
|
|
367
|
+
privateKey: string;
|
|
368
|
+
}, {
|
|
369
|
+
publicKey: import("convex/values").VString<string, "required">;
|
|
370
|
+
privateKey: import("convex/values").VString<string, "required">;
|
|
371
|
+
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
372
|
+
id: import("convex/values").VString<string | undefined, "optional">;
|
|
373
|
+
}, "required", "id" | "createdAt" | "publicKey" | "privateKey">, {}, {}, {}>;
|
|
374
|
+
}[TableName]["validator"], {
|
|
375
|
+
_id: import("convex/values").VId<import("convex/values").GenericId<TableName>, "required">;
|
|
376
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
377
|
+
}>;
|
|
378
|
+
null: () => import("convex/values").VNull<null, "required">;
|
|
379
|
+
number: () => import("convex/values").VFloat64<number, "required">;
|
|
380
|
+
float64: () => import("convex/values").VFloat64<number, "required">;
|
|
381
|
+
bigint: () => import("convex/values").VInt64<bigint, "required">;
|
|
382
|
+
int64: () => import("convex/values").VInt64<bigint, "required">;
|
|
383
|
+
boolean: () => import("convex/values").VBoolean<boolean, "required">;
|
|
384
|
+
string: () => import("convex/values").VString<string, "required">;
|
|
385
|
+
bytes: () => import("convex/values").VBytes<ArrayBuffer, "required">;
|
|
386
|
+
literal: <T extends string | number | bigint | boolean>(literal: T) => import("convex/values").VLiteral<T, "required">;
|
|
387
|
+
array: <T_1 extends import("convex/values").Validator<any, "required", any>>(element: T_1) => import("convex/values").VArray<T_1["type"][], T_1, "required">;
|
|
388
|
+
object: <T_2 extends import("convex/values").PropertyValidators>(fields: T_2) => import("convex/values").VObject<import("convex/server").Expand<{ [Property in { [Property_1 in keyof T_2]: T_2[Property_1]["isOptional"] extends "optional" ? Property_1 : never; }[keyof T_2]]?: Exclude<import("convex/values").Infer<T_2[Property]>, undefined> | undefined; } & { [Property_1 in Exclude<keyof T_2, { [Property in keyof T_2]: T_2[Property]["isOptional"] extends "optional" ? Property : never; }[keyof T_2]>]: import("convex/values").Infer<T_2[Property_1]>; }>, T_2, "required", { [Property_2 in keyof T_2]: Property_2 | `${Property_2 & string}.${T_2[Property_2]["fieldPaths"]}`; }[keyof T_2] & string>;
|
|
389
|
+
record: <Key extends import("convex/values").Validator<string, "required", any>, Value extends import("convex/values").Validator<any, "required", any>>(keys: Key, values: Value) => import("convex/values").VRecord<Record<import("convex/values").Infer<Key>, Value["type"]>, Key, Value, "required", string>;
|
|
390
|
+
union: <T_3 extends import("convex/values").Validator<any, "required", any>[]>(...members: T_3) => import("convex/values").VUnion<T_3[number]["type"], T_3, "required", T_3[number]["fieldPaths"]>;
|
|
391
|
+
any: () => import("convex/values").VAny<any, "required", string>;
|
|
392
|
+
optional: <T_4 extends import("convex/values").GenericValidator>(value: T_4) => import("convex/values").VOptional<T_4>;
|
|
393
|
+
};
|
|
394
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/component/util.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gMACstS,eAAgB,qEAAqE,CAAC,mJAA0H,aAAc,+MAAuL,eAAe;;mFAAkV,GAAG,gDAAwB,WAAW,2BAA0B,WAAY;;;CADvgU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/component/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { betterAuth } from "better-auth";
|
|
2
|
+
import { GenericActionCtx } from "convex/server";
|
|
3
|
+
export declare const getToken: (createAuth: (ctx: GenericActionCtx<any>) => ReturnType<typeof betterAuth>) => Promise<string | undefined>;
|
|
4
|
+
export declare const nextJsHandler: (opts?: {
|
|
5
|
+
convexSiteUrl?: string;
|
|
6
|
+
}) => {
|
|
7
|
+
GET: (request: Request) => Promise<Response>;
|
|
8
|
+
POST: (request: Request) => Promise<Response>;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/nextjs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,eAAO,MAAM,QAAQ,GACnB,YAAY,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,KAAK,UAAU,CAAC,OAAO,UAAU,CAAC,gCAS1E,CAAC;AAYF,eAAO,MAAM,aAAa,GAAI,OAAO;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE;mBAC9C,OAAO;oBACN,OAAO;CACvB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createCookieGetter } from "better-auth/cookies";
|
|
2
|
+
export const getToken = async (createAuth) => {
|
|
3
|
+
const { cookies } = await import("next/headers");
|
|
4
|
+
const cookieStore = await cookies();
|
|
5
|
+
const auth = createAuth({});
|
|
6
|
+
const createCookie = createCookieGetter(auth.options);
|
|
7
|
+
const cookie = createCookie("convex_jwt");
|
|
8
|
+
const token = cookieStore.get(cookie.name);
|
|
9
|
+
return typeof token === "string" ? token : token?.value;
|
|
10
|
+
};
|
|
11
|
+
const handler = (request, opts) => {
|
|
12
|
+
const requestUrl = new URL(request.url);
|
|
13
|
+
const convexSiteUrl = opts?.convexSiteUrl ?? process.env.NEXT_PUBLIC_CONVEX_SITE_URL;
|
|
14
|
+
const nextUrl = `${convexSiteUrl}${requestUrl.pathname}${requestUrl.search}`;
|
|
15
|
+
const newRequest = new Request(nextUrl, request);
|
|
16
|
+
newRequest.headers.set("accept-encoding", "application/json");
|
|
17
|
+
return fetch(newRequest, { method: request.method, redirect: "manual" });
|
|
18
|
+
};
|
|
19
|
+
export const nextJsHandler = (opts) => ({
|
|
20
|
+
GET: (request) => handler(request, opts),
|
|
21
|
+
POST: (request) => handler(request, opts),
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nextjs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAC3B,UAAyE,EACzE,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,CAAC;IACpC,MAAM,IAAI,GAAG,UAAU,CAAC,EAAS,CAAC,CAAC;IACnC,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC;AAC1D,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,OAAgB,EAAE,IAAiC,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,aAAa,GACjB,IAAI,EAAE,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;IACjE,MAAM,OAAO,GAAG,GAAG,aAAa,GAAG,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;IAC7E,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;IAC9D,OAAO,KAAK,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAiC,EAAE,EAAE,CAAC,CAAC;IACnE,GAAG,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;IACjD,IAAI,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;CACnD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/plugins/convex/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAE3B,eAAO,MAAM,YAAY;;wBAGK,UAAU,CAAC,OAAO,MAAM,CAAC;CAEtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/plugins/convex/client.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,OAAO;QACL,EAAE,EAAE,QAAQ;QACZ,kBAAkB,EAAE,EAA+B;KACnB,CAAC;AACrC,CAAC,CAAC"}
|