@better-auth/core 1.4.0-beta.18 → 1.4.0-beta.19
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/.turbo/turbo-build.log +11 -11
- package/dist/api/index.d.mts +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/context/index.d.mts +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/{context-DS_VYja7.mjs → context-CioNtOxg.mjs} +1 -1
- package/dist/db/adapter/index.d.mts +1 -1
- package/dist/db/index.d.mts +1 -1
- package/dist/db/index.mjs +31 -31
- package/dist/{index-_O87hA7T.d.mts → index-DfNcDLXx.d.mts} +78 -64
- package/dist/index.d.mts +1 -1
- package/dist/oauth2/index.d.mts +1 -1
- package/dist/social-providers/index.d.mts +1 -1
- package/dist/social-providers/index.mjs +2 -2
- package/package.json +13 -13
- package/src/context/request-state.test.ts +1 -1
- package/src/context/request-state.ts +1 -1
- package/src/db/schema/account.ts +1 -1
- package/src/db/schema/rate-limit.ts +1 -1
- package/src/db/schema/session.ts +1 -1
- package/src/db/schema/shared.ts +1 -1
- package/src/db/schema/user.ts +1 -1
- package/src/db/schema/verification.ts +1 -1
- package/src/social-providers/index.ts +1 -1
- package/src/types/init-options.ts +18 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/core@1.4.0-beta.
|
|
2
|
+
> @better-auth/core@1.4.0-beta.19 build /home/runner/work/better-auth/better-auth/packages/core
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
5
|
[34mℹ[39m tsdown [2mv0.16.0[22m powered by rolldown [2mv1.0.0-beta.46[22m
|
|
6
6
|
[34mℹ[39m Using tsdown config: [4m/home/runner/work/better-auth/better-auth/packages/core/tsdown.config.ts[24m
|
|
7
|
-
[34mℹ[39m entry: [34msrc/index.ts, src/api/index.ts, src/
|
|
7
|
+
[34mℹ[39m entry: [34msrc/index.ts, src/api/index.ts, src/context/index.ts, src/db/index.ts, src/env/index.ts, src/async_hooks/index.ts, src/error/index.ts, src/oauth2/index.ts, src/social-providers/index.ts, src/utils/index.ts, src/db/adapter/index.ts[39m
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
9
|
[34mℹ[39m Build start
|
|
10
|
-
[34mℹ[39m [2mdist/[22m[1msocial-providers/index.mjs[22m [2m 77.
|
|
11
|
-
[34mℹ[39m [2mdist/[22m[1mdb/index.mjs[22m [2m 1.
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1msocial-providers/index.mjs[22m [2m 77.61 kB[22m [2m│ gzip: 10.11 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mdb/index.mjs[22m [2m 1.57 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
12
12
|
[34mℹ[39m [2mdist/[22m[1mapi/index.mjs[22m [2m 0.83 kB[22m [2m│ gzip: 0.40 kB[22m
|
|
13
13
|
[34mℹ[39m [2mdist/[22m[1mcontext/index.mjs[22m [2m 0.74 kB[22m [2m│ gzip: 0.27 kB[22m
|
|
14
14
|
[34mℹ[39m [2mdist/[22m[1moauth2/index.mjs[22m [2m 0.61 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
@@ -20,23 +20,23 @@
|
|
|
20
20
|
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
21
21
|
[34mℹ[39m [2mdist/[22moauth2-D4PPavcA.mjs [2m 9.16 kB[22m [2m│ gzip: 2.12 kB[22m
|
|
22
22
|
[34mℹ[39m [2mdist/[22menv-YhoEXwYv.mjs [2m 7.67 kB[22m [2m│ gzip: 2.54 kB[22m
|
|
23
|
-
[34mℹ[39m [2mdist/[22mcontext-
|
|
23
|
+
[34mℹ[39m [2mdist/[22mcontext-CioNtOxg.mjs [2m 3.91 kB[22m [2m│ gzip: 1.03 kB[22m
|
|
24
24
|
[34mℹ[39m [2mdist/[22merror-D6EqgOXr.mjs [2m 1.77 kB[22m [2m│ gzip: 0.79 kB[22m
|
|
25
25
|
[34mℹ[39m [2mdist/[22masync_hooks-BQqSywfV.mjs [2m 0.87 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
26
26
|
[34mℹ[39m [2mdist/[22mutils-BFQCAfNW.mjs [2m 0.13 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
27
27
|
[34mℹ[39m [2mdist/[22m[32m[1msocial-providers/index.d.mts[22m[39m [2m 3.78 kB[22m [2m│ gzip: 1.17 kB[22m
|
|
28
|
-
[34mℹ[39m [2mdist/[22m[32m[1mcontext/index.d.mts[22m[39m [2m 2.74 kB[22m [2m│ gzip: 0.
|
|
28
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcontext/index.d.mts[22m[39m [2m 2.74 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
29
29
|
[34mℹ[39m [2mdist/[22m[32m[1merror/index.d.mts[22m[39m [2m 1.84 kB[22m [2m│ gzip: 0.72 kB[22m
|
|
30
30
|
[34mℹ[39m [2mdist/[22m[32m[1mdb/index.d.mts[22m[39m [2m 1.01 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
31
31
|
[34mℹ[39m [2mdist/[22m[32m[1mutils/index.d.mts[22m[39m [2m 0.84 kB[22m [2m│ gzip: 0.43 kB[22m
|
|
32
32
|
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m 0.83 kB[22m [2m│ gzip: 0.32 kB[22m
|
|
33
|
-
[34mℹ[39m [2mdist/[22m[32m[1moauth2/index.d.mts[22m[39m [2m 0.79 kB[22m [2m│ gzip: 0.
|
|
33
|
+
[34mℹ[39m [2mdist/[22m[32m[1moauth2/index.d.mts[22m[39m [2m 0.79 kB[22m [2m│ gzip: 0.29 kB[22m
|
|
34
34
|
[34mℹ[39m [2mdist/[22m[32m[1menv/index.d.mts[22m[39m [2m 0.59 kB[22m [2m│ gzip: 0.30 kB[22m
|
|
35
|
-
[34mℹ[39m [2mdist/[22m[32m[1mdb/adapter/index.d.mts[22m[39m [2m 0.47 kB[22m [2m│ gzip: 0.
|
|
35
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdb/adapter/index.d.mts[22m[39m [2m 0.47 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
36
36
|
[34mℹ[39m [2mdist/[22m[32m[1mapi/index.d.mts[22m[39m [2m 0.29 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
37
37
|
[34mℹ[39m [2mdist/[22m[32m[1masync_hooks/index.d.mts[22m[39m [2m 0.14 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
38
|
-
[34mℹ[39m [2mdist/[22m[32mindex-
|
|
38
|
+
[34mℹ[39m [2mdist/[22m[32mindex-DfNcDLXx.d.mts[39m [2m201.29 kB[22m [2m│ gzip: 31.53 kB[22m
|
|
39
39
|
[34mℹ[39m [2mdist/[22m[32mindex-JSfspfWW.d.mts[39m [2m 3.31 kB[22m [2m│ gzip: 1.11 kB[22m
|
|
40
40
|
[34mℹ[39m [2mdist/[22m[32mindex-CRg-E-VF.d.mts[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
41
|
-
[34mℹ[39m 31 files, total: 323.
|
|
42
|
-
[32m✔[39m Build complete in [
|
|
41
|
+
[34mℹ[39m 31 files, total: 323.88 kB
|
|
42
|
+
[32m✔[39m Build complete in [32m4555ms[39m
|
package/dist/api/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-
|
|
1
|
+
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-DfNcDLXx.mjs";
|
|
2
2
|
import "../index-JSfspfWW.mjs";
|
|
3
3
|
export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
|
package/dist/api/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../async_hooks-BQqSywfV.mjs";
|
|
2
|
-
import { f as runWithEndpointContext } from "../context-
|
|
2
|
+
import { f as runWithEndpointContext } from "../context-CioNtOxg.mjs";
|
|
3
3
|
import { createEndpoint, createMiddleware } from "better-call";
|
|
4
4
|
|
|
5
5
|
//#region src/api/index.ts
|
package/dist/context/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Jn as DBTransactionAdapter, Un as DBAdapter, d as AuthContext } from "../index-
|
|
1
|
+
import { Jn as DBTransactionAdapter, Un as DBAdapter, d as AuthContext } from "../index-DfNcDLXx.mjs";
|
|
2
2
|
import "../index-JSfspfWW.mjs";
|
|
3
3
|
import { t as AsyncLocalStorage } from "../index-CRg-E-VF.mjs";
|
|
4
4
|
import { EndpointContext, InputContext } from "better-call";
|
package/dist/context/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../async_hooks-BQqSywfV.mjs";
|
|
2
|
-
import { a as defineRequestState, c as hasRequestState, d as getCurrentAuthContextAsyncLocalStorage, f as runWithEndpointContext, i as runWithTransaction, l as runWithRequestState, n as getCurrentDBAdapterAsyncLocalStorage, o as getCurrentRequestState, r as runWithAdapter, s as getRequestStateAsyncLocalStorage, t as getCurrentAdapter, u as getCurrentAuthContext } from "../context-
|
|
2
|
+
import { a as defineRequestState, c as hasRequestState, d as getCurrentAuthContextAsyncLocalStorage, f as runWithEndpointContext, i as runWithTransaction, l as runWithRequestState, n as getCurrentDBAdapterAsyncLocalStorage, o as getCurrentRequestState, r as runWithAdapter, s as getRequestStateAsyncLocalStorage, t as getCurrentAdapter, u as getCurrentAuthContext } from "../context-CioNtOxg.mjs";
|
|
3
3
|
|
|
4
4
|
export { defineRequestState, getCurrentAdapter, getCurrentAuthContext, getCurrentAuthContextAsyncLocalStorage, getCurrentDBAdapterAsyncLocalStorage, getCurrentRequestState, getRequestStateAsyncLocalStorage, hasRequestState, runWithAdapter, runWithEndpointContext, runWithRequestState, runWithTransaction };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Gn as DBAdapterFactoryConfig, Hn as CustomAdapter, Jn as DBTransactionAdapter, Kn as DBAdapterInstance, Un as DBAdapter, Vn as CleanedWhere, Wn as DBAdapterDebugLogOption, Yn as Where, qn as DBAdapterSchemaCreation } from "../../index-
|
|
1
|
+
import { Gn as DBAdapterFactoryConfig, Hn as CustomAdapter, Jn as DBTransactionAdapter, Kn as DBAdapterInstance, Un as DBAdapter, Vn as CleanedWhere, Wn as DBAdapterDebugLogOption, Yn as Where, qn as DBAdapterSchemaCreation } from "../../index-DfNcDLXx.mjs";
|
|
2
2
|
import "../../index-JSfspfWW.mjs";
|
|
3
3
|
export { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, Where };
|
package/dist/db/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $n as FieldAttributeConfig, Qn as FieldAttribute, Xn as AuthPluginSchema, Zn as BetterAuthDbSchema, _r as DBFieldType, ar as userSchema, br as SecondaryStorage, cr as sessionSchema, dr as Account, er as FieldType, fr as accountSchema, gr as DBFieldAttributeConfig, hr as DBFieldAttribute, ir as User, lr as RateLimit, mr as BetterAuthDBSchema, nr as Verification, or as coreSchema, pr as BetterAuthPluginDBSchema, rr as verificationSchema, sr as Session, tr as Primitive, ur as rateLimitSchema, vr as DBPreservedModels, yr as DBPrimitive } from "../index-
|
|
1
|
+
import { $n as FieldAttributeConfig, Qn as FieldAttribute, Xn as AuthPluginSchema, Zn as BetterAuthDbSchema, _r as DBFieldType, ar as userSchema, br as SecondaryStorage, cr as sessionSchema, dr as Account, er as FieldType, fr as accountSchema, gr as DBFieldAttributeConfig, hr as DBFieldAttribute, ir as User, lr as RateLimit, mr as BetterAuthDBSchema, nr as Verification, or as coreSchema, pr as BetterAuthPluginDBSchema, rr as verificationSchema, sr as Session, tr as Primitive, ur as rateLimitSchema, vr as DBPreservedModels, yr as DBPrimitive } from "../index-DfNcDLXx.mjs";
|
|
2
2
|
import "../index-JSfspfWW.mjs";
|
|
3
3
|
export { Account, AuthPluginSchema, BetterAuthDBSchema, BetterAuthDbSchema, BetterAuthPluginDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPreservedModels, DBPrimitive, FieldAttribute, FieldAttributeConfig, FieldType, Primitive, RateLimit, SecondaryStorage, Session, User, Verification, accountSchema, coreSchema, rateLimitSchema, sessionSchema, userSchema, verificationSchema };
|
package/dist/db/index.mjs
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/db/schema/shared.ts
|
|
4
|
-
const coreSchema = z
|
|
5
|
-
id: z
|
|
6
|
-
createdAt: z
|
|
7
|
-
updatedAt: z
|
|
4
|
+
const coreSchema = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
createdAt: z.date().default(() => /* @__PURE__ */ new Date()),
|
|
7
|
+
updatedAt: z.date().default(() => /* @__PURE__ */ new Date())
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/db/schema/account.ts
|
|
12
12
|
const accountSchema = coreSchema.extend({
|
|
13
|
-
providerId: z
|
|
14
|
-
accountId: z
|
|
15
|
-
userId: z
|
|
16
|
-
accessToken: z
|
|
17
|
-
refreshToken: z
|
|
18
|
-
idToken: z
|
|
19
|
-
accessTokenExpiresAt: z
|
|
20
|
-
refreshTokenExpiresAt: z
|
|
21
|
-
scope: z
|
|
22
|
-
password: z
|
|
13
|
+
providerId: z.string(),
|
|
14
|
+
accountId: z.string(),
|
|
15
|
+
userId: z.coerce.string(),
|
|
16
|
+
accessToken: z.string().nullish(),
|
|
17
|
+
refreshToken: z.string().nullish(),
|
|
18
|
+
idToken: z.string().nullish(),
|
|
19
|
+
accessTokenExpiresAt: z.date().nullish(),
|
|
20
|
+
refreshTokenExpiresAt: z.date().nullish(),
|
|
21
|
+
scope: z.string().nullish(),
|
|
22
|
+
password: z.string().nullish()
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/db/schema/rate-limit.ts
|
|
27
|
-
const rateLimitSchema = z
|
|
28
|
-
key: z
|
|
29
|
-
count: z
|
|
30
|
-
lastRequest: z
|
|
27
|
+
const rateLimitSchema = z.object({
|
|
28
|
+
key: z.string(),
|
|
29
|
+
count: z.number(),
|
|
30
|
+
lastRequest: z.number()
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/db/schema/session.ts
|
|
35
35
|
const sessionSchema = coreSchema.extend({
|
|
36
|
-
userId: z
|
|
37
|
-
expiresAt: z
|
|
38
|
-
token: z
|
|
39
|
-
ipAddress: z
|
|
40
|
-
userAgent: z
|
|
36
|
+
userId: z.coerce.string(),
|
|
37
|
+
expiresAt: z.date(),
|
|
38
|
+
token: z.string(),
|
|
39
|
+
ipAddress: z.string().nullish(),
|
|
40
|
+
userAgent: z.string().nullish()
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/db/schema/user.ts
|
|
45
45
|
const userSchema = coreSchema.extend({
|
|
46
|
-
email: z
|
|
47
|
-
emailVerified: z
|
|
48
|
-
name: z
|
|
49
|
-
image: z
|
|
46
|
+
email: z.string().transform((val) => val.toLowerCase()),
|
|
47
|
+
emailVerified: z.boolean().default(false),
|
|
48
|
+
name: z.string(),
|
|
49
|
+
image: z.string().nullish()
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/db/schema/verification.ts
|
|
54
54
|
const verificationSchema = coreSchema.extend({
|
|
55
|
-
value: z
|
|
56
|
-
expiresAt: z
|
|
57
|
-
identifier: z
|
|
55
|
+
value: z.string(),
|
|
56
|
+
expiresAt: z.date(),
|
|
57
|
+
identifier: z.string()
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as Logger, o as createLogger } from "./index-JSfspfWW.mjs";
|
|
2
2
|
import * as better_call0 from "better-call";
|
|
3
3
|
import { CookieOptions, Endpoint, EndpointContext, EndpointOptions, InputContext, Middleware } from "better-call";
|
|
4
|
-
import
|
|
4
|
+
import { z } from "zod";
|
|
5
5
|
import { BetterFetch, BetterFetchOption, BetterFetchPlugin } from "@better-fetch/fetch";
|
|
6
6
|
import * as jose0 from "jose";
|
|
7
7
|
import { StandardSchemaV1, StandardSchemaV1 as StandardSchemaV1$1 } from "@standard-schema/spec";
|
|
@@ -152,96 +152,96 @@ type BetterAuthPluginDBSchema = { [table in string]: {
|
|
|
152
152
|
} };
|
|
153
153
|
//#endregion
|
|
154
154
|
//#region src/db/schema/account.d.ts
|
|
155
|
-
declare const accountSchema: z
|
|
156
|
-
id: z
|
|
157
|
-
createdAt: z
|
|
158
|
-
updatedAt: z
|
|
159
|
-
providerId: z
|
|
160
|
-
accountId: z
|
|
161
|
-
userId: z
|
|
162
|
-
accessToken: z
|
|
163
|
-
refreshToken: z
|
|
164
|
-
idToken: z
|
|
165
|
-
accessTokenExpiresAt: z
|
|
166
|
-
refreshTokenExpiresAt: z
|
|
167
|
-
scope: z
|
|
168
|
-
password: z
|
|
169
|
-
}, z
|
|
155
|
+
declare const accountSchema: z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
158
|
+
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
159
|
+
providerId: z.ZodString;
|
|
160
|
+
accountId: z.ZodString;
|
|
161
|
+
userId: z.ZodCoercedString<unknown>;
|
|
162
|
+
accessToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
163
|
+
refreshToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
164
|
+
idToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
165
|
+
accessTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
166
|
+
refreshTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
167
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
|
+
password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
170
|
/**
|
|
171
171
|
* Account schema type used by better-auth, note that it's possible that account could have additional fields
|
|
172
172
|
*
|
|
173
173
|
* todo: we should use generics to extend this type with additional fields from plugins and options in the future
|
|
174
174
|
*/
|
|
175
|
-
type Account = z
|
|
175
|
+
type Account = z.infer<typeof accountSchema>;
|
|
176
176
|
//#endregion
|
|
177
177
|
//#region src/db/schema/rate-limit.d.ts
|
|
178
|
-
declare const rateLimitSchema: z
|
|
179
|
-
key: z
|
|
180
|
-
count: z
|
|
181
|
-
lastRequest: z
|
|
182
|
-
}, z
|
|
178
|
+
declare const rateLimitSchema: z.ZodObject<{
|
|
179
|
+
key: z.ZodString;
|
|
180
|
+
count: z.ZodNumber;
|
|
181
|
+
lastRequest: z.ZodNumber;
|
|
182
|
+
}, z.core.$strip>;
|
|
183
183
|
/**
|
|
184
184
|
* Rate limit schema type used by better-auth for rate limiting
|
|
185
185
|
*/
|
|
186
|
-
type RateLimit = z
|
|
186
|
+
type RateLimit = z.infer<typeof rateLimitSchema>;
|
|
187
187
|
//#endregion
|
|
188
188
|
//#region src/db/schema/session.d.ts
|
|
189
|
-
declare const sessionSchema: z
|
|
190
|
-
id: z
|
|
191
|
-
createdAt: z
|
|
192
|
-
updatedAt: z
|
|
193
|
-
userId: z
|
|
194
|
-
expiresAt: z
|
|
195
|
-
token: z
|
|
196
|
-
ipAddress: z
|
|
197
|
-
userAgent: z
|
|
198
|
-
}, z
|
|
189
|
+
declare const sessionSchema: z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
192
|
+
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
193
|
+
userId: z.ZodCoercedString<unknown>;
|
|
194
|
+
expiresAt: z.ZodDate;
|
|
195
|
+
token: z.ZodString;
|
|
196
|
+
ipAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
197
|
+
userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
199
|
/**
|
|
200
200
|
* Session schema type used by better-auth, note that it's possible that session could have additional fields
|
|
201
201
|
*
|
|
202
202
|
* todo: we should use generics to extend this type with additional fields from plugins and options in the future
|
|
203
203
|
*/
|
|
204
|
-
type Session = z
|
|
204
|
+
type Session = z.infer<typeof sessionSchema>;
|
|
205
205
|
//#endregion
|
|
206
206
|
//#region src/db/schema/shared.d.ts
|
|
207
|
-
declare const coreSchema: z
|
|
208
|
-
id: z
|
|
209
|
-
createdAt: z
|
|
210
|
-
updatedAt: z
|
|
211
|
-
}, z
|
|
207
|
+
declare const coreSchema: z.ZodObject<{
|
|
208
|
+
id: z.ZodString;
|
|
209
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
210
|
+
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region src/db/schema/user.d.ts
|
|
214
|
-
declare const userSchema: z
|
|
215
|
-
id: z
|
|
216
|
-
createdAt: z
|
|
217
|
-
updatedAt: z
|
|
218
|
-
email: z
|
|
219
|
-
emailVerified: z
|
|
220
|
-
name: z
|
|
221
|
-
image: z
|
|
222
|
-
}, z
|
|
214
|
+
declare const userSchema: z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
217
|
+
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
218
|
+
email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
219
|
+
emailVerified: z.ZodDefault<z.ZodBoolean>;
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
223
|
/**
|
|
224
224
|
* User schema type used by better-auth, note that it's possible that user could have additional fields
|
|
225
225
|
*
|
|
226
226
|
* todo: we should use generics to extend this type with additional fields from plugins and options in the future
|
|
227
227
|
*/
|
|
228
|
-
type User = z
|
|
228
|
+
type User = z.infer<typeof userSchema>;
|
|
229
229
|
//#endregion
|
|
230
230
|
//#region src/db/schema/verification.d.ts
|
|
231
|
-
declare const verificationSchema: z
|
|
232
|
-
id: z
|
|
233
|
-
createdAt: z
|
|
234
|
-
updatedAt: z
|
|
235
|
-
value: z
|
|
236
|
-
expiresAt: z
|
|
237
|
-
identifier: z
|
|
238
|
-
}, z
|
|
231
|
+
declare const verificationSchema: z.ZodObject<{
|
|
232
|
+
id: z.ZodString;
|
|
233
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
234
|
+
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
235
|
+
value: z.ZodString;
|
|
236
|
+
expiresAt: z.ZodDate;
|
|
237
|
+
identifier: z.ZodString;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
239
|
/**
|
|
240
240
|
* Verification schema type used by better-auth, note that it's possible that verification could have additional fields
|
|
241
241
|
*
|
|
242
242
|
* todo: we should use generics to extend this type with additional fields from plugins and options in the future
|
|
243
243
|
*/
|
|
244
|
-
type Verification = z
|
|
244
|
+
type Verification = z.infer<typeof verificationSchema>;
|
|
245
245
|
//#endregion
|
|
246
246
|
//#region src/db/index.d.ts
|
|
247
247
|
/**
|
|
@@ -5689,8 +5689,8 @@ declare const socialProviders: {
|
|
|
5689
5689
|
};
|
|
5690
5690
|
};
|
|
5691
5691
|
declare const socialProviderList: ["github", ...(keyof typeof socialProviders)[]];
|
|
5692
|
-
declare const SocialProviderListEnum: z
|
|
5693
|
-
type SocialProvider = z
|
|
5692
|
+
declare const SocialProviderListEnum: z.ZodType<SocialProviderList[number] | (string & {})>;
|
|
5693
|
+
type SocialProvider = z.infer<typeof SocialProviderListEnum>;
|
|
5694
5694
|
type SocialProviders = { [K in SocialProviderList[number]]?: Parameters<(typeof socialProviders)[K]>[0] & {
|
|
5695
5695
|
enabled?: boolean | undefined;
|
|
5696
5696
|
} };
|
|
@@ -5988,15 +5988,27 @@ type BetterAuthAdvancedOptions = {
|
|
|
5988
5988
|
* Note: If enabled, we will not handle ID generation (including if you use `generateId`), and it would be expected that your database will provide the ID automatically.
|
|
5989
5989
|
*
|
|
5990
5990
|
* @default false
|
|
5991
|
+
*
|
|
5992
|
+
* @deprecated Please use `generateId` instead. This will be removed in future
|
|
5993
|
+
* releases.
|
|
5991
5994
|
*/
|
|
5992
5995
|
useNumberId?: boolean;
|
|
5993
5996
|
/**
|
|
5994
5997
|
* Custom generateId function.
|
|
5995
5998
|
*
|
|
5996
5999
|
* If not provided, random ids will be generated.
|
|
5997
|
-
* If set to false, the database's auto generated id
|
|
6000
|
+
* If set to false, the database's auto generated id
|
|
6001
|
+
* will be used.
|
|
6002
|
+
*
|
|
6003
|
+
* If set to "serial", the database's auto generated
|
|
6004
|
+
* id will be used.
|
|
6005
|
+
*
|
|
6006
|
+
* If set to "uuid", we generate a random UUID for
|
|
6007
|
+
* the id. If postgres, we use the `gen_random_uuid()
|
|
6008
|
+
* ` function. If mysql or mssql, we use the `uuid()`
|
|
6009
|
+
* function.
|
|
5998
6010
|
*/
|
|
5999
|
-
generateId?: GenerateIdFn | false;
|
|
6011
|
+
generateId?: GenerateIdFn | false | "serial" | "uuid";
|
|
6000
6012
|
} | undefined;
|
|
6001
6013
|
/**
|
|
6002
6014
|
* OAuth configuration
|
|
@@ -6092,7 +6104,8 @@ type BetterAuthOptions = {
|
|
|
6092
6104
|
* Whether to execute multiple operations in a transaction.
|
|
6093
6105
|
* If the database doesn't support transactions,
|
|
6094
6106
|
* set this to `false` and operations will be executed sequentially.
|
|
6095
|
-
*
|
|
6107
|
+
*
|
|
6108
|
+
* @default false
|
|
6096
6109
|
*/
|
|
6097
6110
|
transaction?: boolean;
|
|
6098
6111
|
} | {
|
|
@@ -6120,7 +6133,8 @@ type BetterAuthOptions = {
|
|
|
6120
6133
|
* Whether to execute multiple operations in a transaction.
|
|
6121
6134
|
* If the database doesn't support transactions,
|
|
6122
6135
|
* set this to `false` and operations will be executed sequentially.
|
|
6123
|
-
*
|
|
6136
|
+
*
|
|
6137
|
+
* @default false
|
|
6124
6138
|
*/
|
|
6125
6139
|
transaction?: boolean;
|
|
6126
6140
|
}) | undefined;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { En as BetterAuthCookies, Tn as LiteralUnion, _ as GenerateIdFn, c as BetterAuthClientPlugin, d as AuthContext, f as GenericEndpointContext, g as BetterAuthRateLimitOptions, h as BetterAuthOptions, l as ClientAtomListener, m as BetterAuthAdvancedOptions, o as StandardSchemaV1, p as InternalAdapter, s as BetterAuthClientOptions, u as ClientStore, v as BetterAuthPlugin, wn as LiteralString, y as HookEndpointContext } from "./index-
|
|
1
|
+
import { En as BetterAuthCookies, Tn as LiteralUnion, _ as GenerateIdFn, c as BetterAuthClientPlugin, d as AuthContext, f as GenericEndpointContext, g as BetterAuthRateLimitOptions, h as BetterAuthOptions, l as ClientAtomListener, m as BetterAuthAdvancedOptions, o as StandardSchemaV1, p as InternalAdapter, s as BetterAuthClientOptions, u as ClientStore, v as BetterAuthPlugin, wn as LiteralString, y as HookEndpointContext } from "./index-DfNcDLXx.mjs";
|
|
2
2
|
import "./index-JSfspfWW.mjs";
|
|
3
3
|
export { AuthContext, BetterAuthAdvancedOptions, BetterAuthClientOptions, BetterAuthClientPlugin, BetterAuthCookies, BetterAuthOptions, BetterAuthPlugin, BetterAuthRateLimitOptions, ClientAtomListener, ClientStore, GenerateIdFn, GenericEndpointContext, HookEndpointContext, InternalAdapter, LiteralString, LiteralUnion, StandardSchemaV1 };
|
package/dist/oauth2/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { An as generateCodeChallenge, Bn as ProviderOptions, Dn as createAuthorizationCodeRequest, Fn as clientCredentialsToken, In as createClientCredentialsTokenRequest, Ln as OAuth2Tokens, Mn as createRefreshAccessTokenRequest, Nn as refreshAccessToken, On as validateAuthorizationCode, Pn as createAuthorizationURL, Rn as OAuth2UserInfo, jn as getOAuth2Tokens, kn as validateToken, zn as OAuthProvider } from "../index-
|
|
1
|
+
import { An as generateCodeChallenge, Bn as ProviderOptions, Dn as createAuthorizationCodeRequest, Fn as clientCredentialsToken, In as createClientCredentialsTokenRequest, Ln as OAuth2Tokens, Mn as createRefreshAccessTokenRequest, Nn as refreshAccessToken, On as validateAuthorizationCode, Pn as createAuthorizationURL, Rn as OAuth2UserInfo, jn as getOAuth2Tokens, kn as validateToken, zn as OAuthProvider } from "../index-DfNcDLXx.mjs";
|
|
2
2
|
import "../index-JSfspfWW.mjs";
|
|
3
3
|
export { OAuth2Tokens, OAuth2UserInfo, OAuthProvider, ProviderOptions, clientCredentialsToken, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as ZoomOptions, $t as microsoft, A as PayPalProfile, At as DropboxOptions, B as NaverOptions, Bt as SpotifyProfile, C as SocialProviders, Cn as getApplePublicKey, Ct as LinearOptions, D as PolarProfile, Dt as KickOptions, E as PolarOptions, Et as linear, F as paybin, Ft as twitter, G as kakao, Gt as HuggingFaceOptions, H as naver, Ht as SlackOptions, I as LineIdTokenPayload, It as TwitchOptions, J as notion, Jt as GoogleOptions, K as NotionOptions, Kt as HuggingFaceProfile, L as LineOptions, Lt as TwitchProfile, M as paypal, Mt as dropbox, N as PaybinOptions, Nt as TwitterOption, O as polar, Ot as KickProfile, P as PaybinProfile, Pt as TwitterProfile, Q as PronounOption, Qt as MicrosoftOptions, R as LineUserInfo, Rt as twitch, S as SocialProviderListEnum, Sn as apple, St as linkedin, T as socialProviders, Tt as LinearUser, U as KakaoOptions, Ut as SlackProfile, V as NaverProfile, Vt as spotify, W as KakaoProfile, Wt as slack, X as LoginType, Xt as google, Y as AccountStatus, Yt as GoogleProfile, Z as PhoneNumber, Zt as MicrosoftEntraIDProfile, _n as AtlassianProfile, _t as GitlabOptions, an as figma, at as SalesforceOptions, b as SocialProvider, bn as AppleOptions, bt as LinkedInOptions, cn as facebook, ct as RobloxOptions, dn as discord, dt as RedditOptions, en as GithubOptions, et as ZoomProfile, fn as CognitoOptions, ft as RedditProfile, gn as AtlassianOptions, gt as tiktok, hn as getCognitoPublicKey, ht as TiktokProfile, in as FigmaProfile, it as vk, j as PayPalTokenResponse, jt as DropboxProfile, k as PayPalOptions, kt as kick, ln as DiscordOptions, lt as RobloxProfile, mn as cognito, mt as TiktokOptions, nn as github, nt as VkOption, on as FacebookOptions, ot as SalesforceProfile, pn as CognitoProfile, pt as reddit, q as NotionProfile, qt as huggingface, rn as FigmaOptions, rt as VkProfile, sn as FacebookProfile, st as salesforce, tn as GithubProfile, tt as zoom, un as DiscordProfile, ut as roblox, vn as atlassian, vt as GitlabProfile, w as socialProviderList, wt as LinearProfile, x as SocialProviderList, xn as AppleProfile, xt as LinkedInProfile, yn as AppleNonConformUser, yt as gitlab, z as line, zt as SpotifyOptions } from "../index-
|
|
1
|
+
import { $ as ZoomOptions, $t as microsoft, A as PayPalProfile, At as DropboxOptions, B as NaverOptions, Bt as SpotifyProfile, C as SocialProviders, Cn as getApplePublicKey, Ct as LinearOptions, D as PolarProfile, Dt as KickOptions, E as PolarOptions, Et as linear, F as paybin, Ft as twitter, G as kakao, Gt as HuggingFaceOptions, H as naver, Ht as SlackOptions, I as LineIdTokenPayload, It as TwitchOptions, J as notion, Jt as GoogleOptions, K as NotionOptions, Kt as HuggingFaceProfile, L as LineOptions, Lt as TwitchProfile, M as paypal, Mt as dropbox, N as PaybinOptions, Nt as TwitterOption, O as polar, Ot as KickProfile, P as PaybinProfile, Pt as TwitterProfile, Q as PronounOption, Qt as MicrosoftOptions, R as LineUserInfo, Rt as twitch, S as SocialProviderListEnum, Sn as apple, St as linkedin, T as socialProviders, Tt as LinearUser, U as KakaoOptions, Ut as SlackProfile, V as NaverProfile, Vt as spotify, W as KakaoProfile, Wt as slack, X as LoginType, Xt as google, Y as AccountStatus, Yt as GoogleProfile, Z as PhoneNumber, Zt as MicrosoftEntraIDProfile, _n as AtlassianProfile, _t as GitlabOptions, an as figma, at as SalesforceOptions, b as SocialProvider, bn as AppleOptions, bt as LinkedInOptions, cn as facebook, ct as RobloxOptions, dn as discord, dt as RedditOptions, en as GithubOptions, et as ZoomProfile, fn as CognitoOptions, ft as RedditProfile, gn as AtlassianOptions, gt as tiktok, hn as getCognitoPublicKey, ht as TiktokProfile, in as FigmaProfile, it as vk, j as PayPalTokenResponse, jt as DropboxProfile, k as PayPalOptions, kt as kick, ln as DiscordOptions, lt as RobloxProfile, mn as cognito, mt as TiktokOptions, nn as github, nt as VkOption, on as FacebookOptions, ot as SalesforceProfile, pn as CognitoProfile, pt as reddit, q as NotionProfile, qt as huggingface, rn as FigmaOptions, rt as VkProfile, sn as FacebookProfile, st as salesforce, tn as GithubProfile, tt as zoom, un as DiscordProfile, ut as roblox, vn as atlassian, vt as GitlabProfile, w as socialProviderList, wt as LinearProfile, x as SocialProviderList, xn as AppleProfile, xt as LinkedInProfile, yn as AppleNonConformUser, yt as gitlab, z as line, zt as SpotifyOptions } from "../index-DfNcDLXx.mjs";
|
|
2
2
|
import "../index-JSfspfWW.mjs";
|
|
3
3
|
export { AccountStatus, AppleNonConformUser, AppleOptions, AppleProfile, AtlassianOptions, AtlassianProfile, CognitoOptions, CognitoProfile, DiscordOptions, DiscordProfile, DropboxOptions, DropboxProfile, FacebookOptions, FacebookProfile, FigmaOptions, FigmaProfile, GithubOptions, GithubProfile, GitlabOptions, GitlabProfile, GoogleOptions, GoogleProfile, HuggingFaceOptions, HuggingFaceProfile, KakaoOptions, KakaoProfile, KickOptions, KickProfile, LineIdTokenPayload, LineOptions, LineUserInfo, LinearOptions, LinearProfile, LinearUser, LinkedInOptions, LinkedInProfile, LoginType, MicrosoftEntraIDProfile, MicrosoftOptions, NaverOptions, NaverProfile, NotionOptions, NotionProfile, PayPalOptions, PayPalProfile, PayPalTokenResponse, PaybinOptions, PaybinProfile, PhoneNumber, PolarOptions, PolarProfile, PronounOption, RedditOptions, RedditProfile, RobloxOptions, RobloxProfile, SalesforceOptions, SalesforceProfile, SlackOptions, SlackProfile, SocialProvider, SocialProviderList, SocialProviderListEnum, SocialProviders, SpotifyOptions, SpotifyProfile, TiktokOptions, TiktokProfile, TwitchOptions, TwitchProfile, TwitterOption, TwitterProfile, VkOption, VkProfile, ZoomOptions, ZoomProfile, apple, atlassian, cognito, discord, dropbox, facebook, figma, getApplePublicKey, getCognitoPublicKey, github, gitlab, google, huggingface, kakao, kick, line, linear, linkedin, microsoft, naver, notion, paybin, paypal, polar, reddit, roblox, salesforce, slack, socialProviderList, socialProviders, spotify, tiktok, twitch, twitter, vk, zoom };
|
|
@@ -3,7 +3,7 @@ import "../utils-BFQCAfNW.mjs";
|
|
|
3
3
|
import { t as BetterAuthError } from "../error-D6EqgOXr.mjs";
|
|
4
4
|
import { a as refreshAccessToken, c as getOAuth2Tokens, n as validateAuthorizationCode, o as createAuthorizationURL, s as generateCodeChallenge } from "../oauth2-D4PPavcA.mjs";
|
|
5
5
|
import { APIError } from "better-call";
|
|
6
|
-
import
|
|
6
|
+
import { z } from "zod";
|
|
7
7
|
import { base64 } from "@better-auth/utils/base64";
|
|
8
8
|
import { betterFetch } from "@better-fetch/fetch";
|
|
9
9
|
import { createRemoteJWKSet, decodeJwt, decodeProtectedHeader, importJWK, jwtVerify } from "jose";
|
|
@@ -2507,7 +2507,7 @@ const socialProviders = {
|
|
|
2507
2507
|
polar
|
|
2508
2508
|
};
|
|
2509
2509
|
const socialProviderList = Object.keys(socialProviders);
|
|
2510
|
-
const SocialProviderListEnum = z
|
|
2510
|
+
const SocialProviderListEnum = z.enum(socialProviderList).or(z.string());
|
|
2511
2511
|
|
|
2512
2512
|
//#endregion
|
|
2513
2513
|
export { SocialProviderListEnum, apple, atlassian, cognito, discord, dropbox, facebook, figma, getApplePublicKey, getCognitoPublicKey, github, gitlab, google, huggingface, kakao, kick, line, linear, linkedin, microsoft, naver, notion, paybin, paypal, polar, reddit, roblox, salesforce, slack, socialProviderList, socialProviders, spotify, tiktok, twitch, twitter, vk, zoom };
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/core",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.19",
|
|
4
4
|
"description": "The most comprehensive authentication framework for TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
10
|
+
"dev-source": "./src/index.ts",
|
|
11
11
|
"types": "./dist/index.d.mts",
|
|
12
12
|
"default": "./dist/index.mjs"
|
|
13
13
|
},
|
|
14
14
|
"./api": {
|
|
15
|
-
"
|
|
15
|
+
"dev-source": "./src/api/index.ts",
|
|
16
16
|
"types": "./dist/api/index.d.mts",
|
|
17
17
|
"default": "./dist/api/index.mjs"
|
|
18
18
|
},
|
|
19
19
|
"./async_hooks": {
|
|
20
|
-
"
|
|
20
|
+
"dev-source": "./src/async_hooks/index.ts",
|
|
21
21
|
"types": "./dist/async_hooks/index.d.mts",
|
|
22
22
|
"default": "./dist/async_hooks/index.mjs"
|
|
23
23
|
},
|
|
24
24
|
"./context": {
|
|
25
|
-
"
|
|
25
|
+
"dev-source": "./src/context/index.ts",
|
|
26
26
|
"types": "./dist/context/index.d.mts",
|
|
27
27
|
"default": "./dist/context/index.mjs"
|
|
28
28
|
},
|
|
29
29
|
"./env": {
|
|
30
|
-
"
|
|
30
|
+
"dev-source": "./src/env/index.ts",
|
|
31
31
|
"types": "./dist/env/index.d.mts",
|
|
32
32
|
"default": "./dist/env/index.mjs"
|
|
33
33
|
},
|
|
34
34
|
"./error": {
|
|
35
|
-
"
|
|
35
|
+
"dev-source": "./src/error/index.ts",
|
|
36
36
|
"types": "./dist/error/index.d.mts",
|
|
37
37
|
"default": "./dist/error/index.mjs"
|
|
38
38
|
},
|
|
39
39
|
"./utils": {
|
|
40
|
-
"
|
|
40
|
+
"dev-source": "./src/utils/index.ts",
|
|
41
41
|
"types": "./dist/utils/index.d.mts",
|
|
42
42
|
"default": "./dist/utils/index.mjs"
|
|
43
43
|
},
|
|
44
44
|
"./social-providers": {
|
|
45
|
-
"
|
|
45
|
+
"dev-source": "./src/social-providers/index.ts",
|
|
46
46
|
"types": "./dist/social-providers/index.d.mts",
|
|
47
47
|
"default": "./dist/social-providers/index.mjs"
|
|
48
48
|
},
|
|
49
49
|
"./db": {
|
|
50
|
-
"
|
|
50
|
+
"dev-source": "./src/db/index.ts",
|
|
51
51
|
"types": "./dist/db/index.d.mts",
|
|
52
52
|
"default": "./dist/db/index.mjs"
|
|
53
53
|
},
|
|
54
54
|
"./db/adapter": {
|
|
55
|
-
"
|
|
55
|
+
"dev-source": "./src/db/adapter/index.ts",
|
|
56
56
|
"types": "./dist/db/adapter/index.d.mts",
|
|
57
57
|
"default": "./dist/db/adapter/index.mjs"
|
|
58
58
|
},
|
|
59
59
|
"./oauth2": {
|
|
60
|
-
"
|
|
60
|
+
"dev-source": "./src/oauth2/index.ts",
|
|
61
61
|
"types": "./dist/oauth2/index.d.mts",
|
|
62
62
|
"default": "./dist/oauth2/index.mjs"
|
|
63
63
|
}
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"@standard-schema/spec": "^1.0.0",
|
|
115
|
-
"zod": "^4.1.
|
|
115
|
+
"zod": "^4.1.12"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
118
|
"@better-auth/utils": "0.3.0",
|
package/src/db/schema/account.ts
CHANGED
package/src/db/schema/session.ts
CHANGED
package/src/db/schema/shared.ts
CHANGED
package/src/db/schema/user.ts
CHANGED
|
@@ -233,15 +233,27 @@ export type BetterAuthAdvancedOptions = {
|
|
|
233
233
|
* Note: If enabled, we will not handle ID generation (including if you use `generateId`), and it would be expected that your database will provide the ID automatically.
|
|
234
234
|
*
|
|
235
235
|
* @default false
|
|
236
|
+
*
|
|
237
|
+
* @deprecated Please use `generateId` instead. This will be removed in future
|
|
238
|
+
* releases.
|
|
236
239
|
*/
|
|
237
240
|
useNumberId?: boolean;
|
|
238
241
|
/**
|
|
239
242
|
* Custom generateId function.
|
|
240
243
|
*
|
|
241
244
|
* If not provided, random ids will be generated.
|
|
242
|
-
* If set to false, the database's auto generated id
|
|
245
|
+
* If set to false, the database's auto generated id
|
|
246
|
+
* will be used.
|
|
247
|
+
*
|
|
248
|
+
* If set to "serial", the database's auto generated
|
|
249
|
+
* id will be used.
|
|
250
|
+
*
|
|
251
|
+
* If set to "uuid", we generate a random UUID for
|
|
252
|
+
* the id. If postgres, we use the `gen_random_uuid()
|
|
253
|
+
* ` function. If mysql or mssql, we use the `uuid()`
|
|
254
|
+
* function.
|
|
243
255
|
*/
|
|
244
|
-
generateId?: GenerateIdFn | false;
|
|
256
|
+
generateId?: GenerateIdFn | false | "serial" | "uuid";
|
|
245
257
|
}
|
|
246
258
|
| undefined;
|
|
247
259
|
/**
|
|
@@ -350,7 +362,8 @@ export type BetterAuthOptions = {
|
|
|
350
362
|
* Whether to execute multiple operations in a transaction.
|
|
351
363
|
* If the database doesn't support transactions,
|
|
352
364
|
* set this to `false` and operations will be executed sequentially.
|
|
353
|
-
*
|
|
365
|
+
*
|
|
366
|
+
* @default false
|
|
354
367
|
*/
|
|
355
368
|
transaction?: boolean;
|
|
356
369
|
}
|
|
@@ -379,7 +392,8 @@ export type BetterAuthOptions = {
|
|
|
379
392
|
* Whether to execute multiple operations in a transaction.
|
|
380
393
|
* If the database doesn't support transactions,
|
|
381
394
|
* set this to `false` and operations will be executed sequentially.
|
|
382
|
-
*
|
|
395
|
+
*
|
|
396
|
+
* @default false
|
|
383
397
|
*/
|
|
384
398
|
transaction?: boolean;
|
|
385
399
|
}
|