@better-auth/core 1.4.4-beta.1 → 1.4.4-beta.3
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 +9 -9
- package/dist/api/index.d.mts +2 -2
- package/dist/context/index.d.mts +3 -3
- package/dist/db/adapter/index.d.mts +2 -2
- package/dist/db/index.d.mts +3 -3
- package/dist/env/index.d.mts +1 -1
- package/dist/env/index.mjs +1 -1
- package/dist/{env-DwlNAN_D.mjs → env-8yWFh7b8.mjs} +3 -3
- package/dist/{index-B3xax_KQ.d.mts → index-D_XSRX55.d.mts} +29 -17
- package/dist/{index-CdubV7uy.d.mts → index-X1Fs3IbM.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/oauth2/index.d.mts +2 -2
- package/dist/social-providers/index.d.mts +2 -2
- package/dist/social-providers/index.mjs +1 -1
- package/package.json +4 -6
- package/src/db/adapter/index.ts +1 -1
- package/src/db/index.ts +2 -1
- package/src/db/type.ts +6 -12
- package/src/env/logger.test.ts +13 -13
- package/src/env/logger.ts +3 -3
- package/src/social-providers/zoom.ts +7 -2
- package/src/types/context.ts +2 -3
- package/src/types/init-options.ts +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/core@1.4.4-beta.
|
|
2
|
+
> @better-auth/core@1.4.4-beta.3 build /home/runner/work/better-auth/better-auth/packages/core
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
5
|
[34mℹ[39m tsdown [2mv0.16.6[22m powered by rolldown [2mv1.0.0-beta.51[22m
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
[34mℹ[39m [2mdist/[22m[1mdb/adapter/index.mjs[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
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-B2XPHgx5.mjs [2m 9.19 kB[22m [2m│ gzip: 2.13 kB[22m
|
|
22
|
-
[34mℹ[39m [2mdist/[22menv-
|
|
22
|
+
[34mℹ[39m [2mdist/[22menv-8yWFh7b8.mjs [2m 7.67 kB[22m [2m│ gzip: 2.54 kB[22m
|
|
23
23
|
[34mℹ[39m [2mdist/[22mcontext-DgQ9XGBl.mjs [2m 3.89 kB[22m [2m│ gzip: 1.00 kB[22m
|
|
24
24
|
[34mℹ[39m [2mdist/[22merror-BhAKg8LX.mjs [2m 1.77 kB[22m [2m│ gzip: 0.79 kB[22m
|
|
25
25
|
[34mℹ[39m [2mdist/[22masync_hooks-BfRfbd1J.mjs [2m 0.87 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
26
26
|
[34mℹ[39m [2mdist/[22mutils-C5EN75oV.mjs [2m 0.13 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
27
|
-
[34mℹ[39m [2mdist/[22m[32m[1msocial-providers/index.d.mts[22m[39m [2m 3.87 kB[22m [2m│ gzip: 1.
|
|
28
|
-
[34mℹ[39m [2mdist/[22m[32m[1mcontext/index.d.mts[22m[39m [2m 3.
|
|
27
|
+
[34mℹ[39m [2mdist/[22m[32m[1msocial-providers/index.d.mts[22m[39m [2m 3.87 kB[22m [2m│ gzip: 1.19 kB[22m
|
|
28
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcontext/index.d.mts[22m[39m [2m 3.05 kB[22m [2m│ gzip: 0.97 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
|
-
[34mℹ[39m [2mdist/[22m[32m[1mdb/index.d.mts[22m[39m [2m 1.
|
|
30
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdb/index.d.mts[22m[39m [2m 1.03 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
31
31
|
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m 0.87 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
32
32
|
[34mℹ[39m [2mdist/[22m[32m[1mutils/index.d.mts[22m[39m [2m 0.84 kB[22m [2m│ gzip: 0.43 kB[22m
|
|
33
33
|
[34mℹ[39m [2mdist/[22m[32m[1moauth2/index.d.mts[22m[39m [2m 0.79 kB[22m [2m│ gzip: 0.30 kB[22m
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
[34mℹ[39m [2mdist/[22m[32m[1mdb/adapter/index.d.mts[22m[39m [2m 0.53 kB[22m [2m│ gzip: 0.25 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-
|
|
39
|
-
[34mℹ[39m [2mdist/[22m[32mindex-
|
|
38
|
+
[34mℹ[39m [2mdist/[22m[32mindex-D_XSRX55.d.mts[39m [2m208.73 kB[22m [2m│ gzip: 32.73 kB[22m
|
|
39
|
+
[34mℹ[39m [2mdist/[22m[32mindex-X1Fs3IbM.d.mts[39m [2m 3.31 kB[22m [2m│ gzip: 1.11 kB[22m
|
|
40
40
|
[34mℹ[39m [2mdist/[22m[32mindex-DgwIISs7.d.mts[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
41
|
-
[34mℹ[39m 31 files, total:
|
|
42
|
-
[32m✔[39m Build complete in [
|
|
41
|
+
[34mℹ[39m 31 files, total: 334.11 kB
|
|
42
|
+
[32m✔[39m Build complete in [32m4562ms[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-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-D_XSRX55.mjs";
|
|
2
|
+
import "../index-X1Fs3IbM.mjs";
|
|
3
3
|
export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
|
package/dist/context/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Qn as DBTransactionAdapter, f as AuthContext, qn as DBAdapter } from "../index-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { Qn as DBTransactionAdapter, f as AuthContext, qn as DBAdapter } from "../index-D_XSRX55.mjs";
|
|
2
|
+
import "../index-X1Fs3IbM.mjs";
|
|
3
3
|
import { t as AsyncLocalStorage } from "../index-DgwIISs7.mjs";
|
|
4
4
|
import { EndpointContext, InputContext } from "better-call";
|
|
5
5
|
|
|
@@ -12,7 +12,7 @@ type AuthEndpointContext = Partial<InputContext<string, any> & EndpointContext<s
|
|
|
12
12
|
*
|
|
13
13
|
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
14
14
|
*/
|
|
15
|
-
declare function getCurrentAuthContextAsyncLocalStorage(): Promise<AsyncLocalStorage<
|
|
15
|
+
declare function getCurrentAuthContextAsyncLocalStorage(): Promise<AsyncLocalStorage<AuthEndpointContext>>;
|
|
16
16
|
declare function getCurrentAuthContext(): Promise<AuthEndpointContext>;
|
|
17
17
|
declare function runWithEndpointContext<T>(context: AuthEndpointContext, fn: () => T): Promise<T>;
|
|
18
18
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $n as JoinConfig, Gn as CleanedWhere, Jn as DBAdapterDebugLogOption, Kn as CustomAdapter, Qn as DBTransactionAdapter, Xn as DBAdapterInstance, Yn as DBAdapterFactoryConfig, Zn as DBAdapterSchemaCreation, er as JoinOption, qn as DBAdapter, tr as Where } from "../../index-
|
|
2
|
-
import "../../index-
|
|
1
|
+
import { $n as JoinConfig, Gn as CleanedWhere, Jn as DBAdapterDebugLogOption, Kn as CustomAdapter, Qn as DBTransactionAdapter, Xn as DBAdapterInstance, Yn as DBAdapterFactoryConfig, Zn as DBAdapterSchemaCreation, er as JoinOption, qn as DBAdapter, tr as Where } from "../../index-D_XSRX55.mjs";
|
|
2
|
+
import "../../index-X1Fs3IbM.mjs";
|
|
3
3
|
export { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, JoinConfig, JoinOption, Where };
|
package/dist/db/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Cr as
|
|
2
|
-
import "../index-
|
|
3
|
-
export { Account, AuthPluginSchema, BetterAuthDBSchema, BetterAuthDbSchema, BetterAuthPluginDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType,
|
|
1
|
+
import { Cr as DBFieldAttributeConfig, Dr as SecondaryStorage, Er as ModelNames, Sr as DBFieldAttribute, Tr as DBPrimitive, _r as Account, ar as FieldAttributeConfig, br as BaseModelNames, cr as Verification, dr as userSchema, fr as coreSchema, gr as rateLimitSchema, hr as RateLimit, ir as FieldAttribute, lr as verificationSchema, mr as sessionSchema, nr as AuthPluginSchema, or as FieldType, pr as Session, rr as BetterAuthDbSchema, sr as Primitive, ur as User, vr as accountSchema, wr as DBFieldType, xr as BetterAuthDBSchema, yr as BetterAuthPluginDBSchema } from "../index-D_XSRX55.mjs";
|
|
2
|
+
import "../index-X1Fs3IbM.mjs";
|
|
3
|
+
export { Account, AuthPluginSchema, BaseModelNames, BetterAuthDBSchema, BetterAuthDbSchema, BetterAuthPluginDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPrimitive, FieldAttribute, FieldAttributeConfig, FieldType, ModelNames, Primitive, RateLimit, SecondaryStorage, Session, User, Verification, accountSchema, coreSchema, rateLimitSchema, sessionSchema, userSchema, verificationSchema };
|
package/dist/env/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as isTest, a as TTY_COLORS, c as logger, d as EnvObject, f as env, g as isProduction, h as isDevelopment, i as Logger, l as shouldPublishLog, m as getEnvVar, n as LogHandlerParams, o as createLogger, p as getBooleanEnvVar, r as LogLevel, s as levels, t as InternalLogger, u as ENV, v as nodeENV, y as getColorDepth } from "../index-
|
|
1
|
+
import { _ as isTest, a as TTY_COLORS, c as logger, d as EnvObject, f as env, g as isProduction, h as isDevelopment, i as Logger, l as shouldPublishLog, m as getEnvVar, n as LogHandlerParams, o as createLogger, p as getBooleanEnvVar, r as LogLevel, s as levels, t as InternalLogger, u as ENV, v as nodeENV, y as getColorDepth } from "../index-X1Fs3IbM.mjs";
|
|
2
2
|
export { ENV, EnvObject, InternalLogger, LogHandlerParams, LogLevel, Logger, TTY_COLORS, createLogger, env, getBooleanEnvVar, getColorDepth, getEnvVar, isDevelopment, isProduction, isTest, levels, logger, nodeENV, shouldPublishLog };
|
package/dist/env/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as shouldPublishLog, c as env, d as isDevelopment, f as isProduction, i as logger, l as getBooleanEnvVar, m as nodeENV, n as createLogger, o as getColorDepth, p as isTest, r as levels, s as ENV, t as TTY_COLORS, u as getEnvVar } from "../env-
|
|
1
|
+
import { a as shouldPublishLog, c as env, d as isDevelopment, f as isProduction, i as logger, l as getBooleanEnvVar, m as nodeENV, n as createLogger, o as getColorDepth, p as isTest, r as levels, s as ENV, t as TTY_COLORS, u as getEnvVar } from "../env-8yWFh7b8.mjs";
|
|
2
2
|
|
|
3
3
|
export { ENV, TTY_COLORS, createLogger, env, getBooleanEnvVar, getColorDepth, getEnvVar, isDevelopment, isProduction, isTest, levels, logger, nodeENV, shouldPublishLog };
|
|
@@ -196,14 +196,14 @@ const TTY_COLORS = {
|
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
198
|
const levels = [
|
|
199
|
+
"debug",
|
|
199
200
|
"info",
|
|
200
201
|
"success",
|
|
201
202
|
"warn",
|
|
202
|
-
"error"
|
|
203
|
-
"debug"
|
|
203
|
+
"error"
|
|
204
204
|
];
|
|
205
205
|
function shouldPublishLog(currentLogLevel, logLevel) {
|
|
206
|
-
return levels.indexOf(logLevel)
|
|
206
|
+
return levels.indexOf(logLevel) >= levels.indexOf(currentLogLevel);
|
|
207
207
|
}
|
|
208
208
|
const levelColors = {
|
|
209
209
|
info: TTY_COLORS.fg.blue,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { i as Logger, o as createLogger } from "./index-
|
|
1
|
+
import { i as Logger, o as createLogger } from "./index-X1Fs3IbM.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { BetterFetch, BetterFetchOption, BetterFetchPlugin } from "@better-fetch/fetch";
|
|
4
4
|
import * as jose0 from "jose";
|
|
5
|
+
import * as better_call0 from "better-call";
|
|
5
6
|
import { CookieOptions, Endpoint, EndpointContext, EndpointOptions, InputContext, Middleware } from "better-call";
|
|
6
7
|
import { StandardSchemaV1, StandardSchemaV1 as StandardSchemaV1$1 } from "@standard-schema/spec";
|
|
7
8
|
import { Database } from "bun:sqlite";
|
|
@@ -10,7 +11,8 @@ import { Dialect, Kysely, Migration, MysqlPool, PostgresPool, SqliteDatabase } f
|
|
|
10
11
|
import { Atom, WritableAtom } from "nanostores";
|
|
11
12
|
|
|
12
13
|
//#region src/db/type.d.ts
|
|
13
|
-
type
|
|
14
|
+
type BaseModelNames = "user" | "account" | "session" | "verification";
|
|
15
|
+
type ModelNames<T extends string = LiteralString> = BaseModelNames | T | "rate-limit";
|
|
14
16
|
type DBFieldType = "string" | "number" | "boolean" | "date" | "json" | `${"string" | "number"}[]` | Array<LiteralString>;
|
|
15
17
|
type DBPrimitive = string | number | boolean | Date | null | undefined | string[] | number[] | (Record<string, unknown> | unknown[]);
|
|
16
18
|
type DBFieldAttributeConfig = {
|
|
@@ -592,7 +594,7 @@ type JoinConfig = {
|
|
|
592
594
|
*/
|
|
593
595
|
limit?: number;
|
|
594
596
|
/**
|
|
595
|
-
* The relation type. Determines the
|
|
597
|
+
* The relation type. Determines the output joined model data.
|
|
596
598
|
*
|
|
597
599
|
* `one-to-one` would have a single object in the output.
|
|
598
600
|
* `one-to-many` would have an array of objects in the output.
|
|
@@ -1130,11 +1132,6 @@ type BetterAuthCookies = {
|
|
|
1130
1132
|
};
|
|
1131
1133
|
};
|
|
1132
1134
|
//#endregion
|
|
1133
|
-
//#region src/types/helper.d.ts
|
|
1134
|
-
type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
1135
|
-
type LiteralString = "" | (string & Record<never, never>);
|
|
1136
|
-
type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
1137
|
-
//#endregion
|
|
1138
1135
|
//#region src/social-providers/apple.d.ts
|
|
1139
1136
|
interface AppleProfile {
|
|
1140
1137
|
/**
|
|
@@ -3387,8 +3384,7 @@ interface ZoomProfile extends Record<string, any> {
|
|
|
3387
3384
|
name: string;
|
|
3388
3385
|
value: string;
|
|
3389
3386
|
}[] | undefined;
|
|
3390
|
-
/** The employee's unique ID. This field only returns when SAML single sign-on (SSO) is enabled.
|
|
3391
|
-
* The `login_type` value is `101` (SSO) (Example: "HqDyI037Qjili1kNsSIrIg") */
|
|
3387
|
+
/** The employee's unique ID. This field only returns when SAML single sign-on (SSO) is enabled. The `login_type` value is `101` (SSO) (Example: "HqDyI037Qjili1kNsSIrIg") */
|
|
3392
3388
|
employee_unique_id?: string | undefined;
|
|
3393
3389
|
/** The manager for the user (Example: "thill@example.com") */
|
|
3394
3390
|
manager?: string | undefined;
|
|
@@ -5903,6 +5899,11 @@ type SocialProviders = { [K in SocialProviderList[number]]?: Parameters<(typeof
|
|
|
5903
5899
|
} };
|
|
5904
5900
|
type SocialProviderList = typeof socialProviderList;
|
|
5905
5901
|
//#endregion
|
|
5902
|
+
//#region src/types/helper.d.ts
|
|
5903
|
+
type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
5904
|
+
type LiteralString = "" | (string & Record<never, never>);
|
|
5905
|
+
type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
5906
|
+
//#endregion
|
|
5906
5907
|
//#region src/types/plugin.d.ts
|
|
5907
5908
|
type Awaitable<T> = T | Promise<T>;
|
|
5908
5909
|
type DeepPartial<T> = T extends Function ? T : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T;
|
|
@@ -6022,7 +6023,7 @@ type OmitId<T extends {
|
|
|
6022
6023
|
}> = Omit<T, "id">;
|
|
6023
6024
|
type Optional<T> = { [P in keyof T]?: T[P] | undefined };
|
|
6024
6025
|
type GenerateIdFn = (options: {
|
|
6025
|
-
model:
|
|
6026
|
+
model: ModelNames;
|
|
6026
6027
|
size?: number | undefined;
|
|
6027
6028
|
}) => string | false;
|
|
6028
6029
|
type BetterAuthRateLimitOptions = {
|
|
@@ -6086,7 +6087,7 @@ type BetterAuthRateLimitOptions = {
|
|
|
6086
6087
|
/**
|
|
6087
6088
|
* Custom field names for the rate limit table
|
|
6088
6089
|
*/
|
|
6089
|
-
fields?: Record<keyof RateLimit, string
|
|
6090
|
+
fields?: Partial<Record<keyof RateLimit, string>> | undefined;
|
|
6090
6091
|
/**
|
|
6091
6092
|
* custom storage configuration.
|
|
6092
6093
|
*
|
|
@@ -7312,7 +7313,7 @@ type AuthContext<Options extends BetterAuthOptions = BetterAuthOptions> = {
|
|
|
7312
7313
|
};
|
|
7313
7314
|
};
|
|
7314
7315
|
generateId: (options: {
|
|
7315
|
-
model:
|
|
7316
|
+
model: ModelNames;
|
|
7316
7317
|
size?: number | undefined;
|
|
7317
7318
|
}) => string | false;
|
|
7318
7319
|
secondaryStorage: SecondaryStorage | undefined;
|
|
@@ -7455,10 +7456,21 @@ interface BetterAuthClientPlugin {
|
|
|
7455
7456
|
}
|
|
7456
7457
|
//#endregion
|
|
7457
7458
|
//#region src/api/index.d.ts
|
|
7458
|
-
declare const optionsMiddleware:
|
|
7459
|
-
declare const createAuthMiddleware:
|
|
7460
|
-
|
|
7459
|
+
declare const optionsMiddleware: <InputCtx extends better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>>(inputContext: InputCtx) => Promise<AuthContext>;
|
|
7460
|
+
declare const createAuthMiddleware: {
|
|
7461
|
+
<Options extends better_call0.MiddlewareOptions, R>(options: Options, handler: (ctx: better_call0.MiddlewareContext<Options, AuthContext & {
|
|
7462
|
+
returned?: unknown | undefined;
|
|
7463
|
+
responseHeaders?: Headers | undefined;
|
|
7464
|
+
}>) => Promise<R>): (inputContext: better_call0.MiddlewareInputContext<Options>) => Promise<R>;
|
|
7465
|
+
<Options extends better_call0.MiddlewareOptions, R_1>(handler: (ctx: better_call0.MiddlewareContext<Options, AuthContext & {
|
|
7466
|
+
returned?: unknown | undefined;
|
|
7467
|
+
responseHeaders?: Headers | undefined;
|
|
7468
|
+
}>) => Promise<R_1>): (inputContext: better_call0.MiddlewareInputContext<Options>) => Promise<R_1>;
|
|
7469
|
+
};
|
|
7470
|
+
declare const createAuthEndpoint: <Path extends string, Opts extends EndpointOptions, R>(path: Path, options: Opts, handler: (ctx: EndpointContext<Path, Opts, AuthContext>) => Promise<R>) => better_call0.StrictEndpoint<Path, Opts & {
|
|
7471
|
+
use: any[];
|
|
7472
|
+
}, R>;
|
|
7461
7473
|
type AuthEndpoint = ReturnType<typeof createAuthEndpoint>;
|
|
7462
7474
|
type AuthMiddleware = ReturnType<typeof createAuthMiddleware>;
|
|
7463
7475
|
//#endregion
|
|
7464
|
-
export {
|
|
7476
|
+
export { NotionProfile as $, JoinConfig as $n, huggingface as $t, VercelProfile as A, BetterAuthCookies as An, LinearProfile as At, PaybinProfile as B, createClientCredentialsTokenRequest as Bn, TwitterProfile as Bt, SocialProvider as C, AtlassianProfile as Cn, DBFieldAttributeConfig as Cr, GitlabOptions as Ct, socialProviderList as D, AppleProfile as Dn, SecondaryStorage as Dr, LinkedInProfile as Dt, SocialProviders as E, AppleOptions as En, ModelNames as Er, LinkedInOptions as Et, PayPalOptions as F, getOAuth2Tokens as Fn, kick as Ft, line as G, CleanedWhere as Gn, SpotifyOptions as Gt, LineIdTokenPayload as H, OAuth2UserInfo as Hn, TwitchOptions as Ht, PayPalProfile as I, createRefreshAccessTokenRequest as In, DropboxOptions as It, naver as J, DBAdapterDebugLogOption as Jn, SlackOptions as Jt, NaverOptions as K, CustomAdapter as Kn, SpotifyProfile as Kt, PayPalTokenResponse as L, refreshAccessToken as Ln, DropboxProfile as Lt, PolarOptions as M, validateAuthorizationCode as Mn, linear as Mt, PolarProfile as N, validateToken as Nn, KickOptions as Nt, socialProviders as O, apple as On, linkedin as Ot, polar as P, generateCodeChallenge as Pn, KickProfile as Pt, NotionOptions as Q, DBTransactionAdapter as Qn, HuggingFaceProfile as Qt, paypal as R, createAuthorizationURL as Rn, dropbox as Rt, LiteralUnion as S, AtlassianOptions as Sn, DBFieldAttribute as Sr, tiktok as St, SocialProviderListEnum as T, AppleNonConformUser as Tn, DBPrimitive as Tr, gitlab as Tt, LineOptions as U, OAuthProvider as Un, TwitchProfile as Ut, paybin as V, OAuth2Tokens as Vn, twitter as Vt, LineUserInfo as W, ProviderOptions as Wn, twitch as Wt, KakaoProfile as X, DBAdapterInstance as Xn, slack as Xt, KakaoOptions as Y, DBAdapterFactoryConfig as Yn, SlackProfile as Yt, kakao as Z, DBAdapterSchemaCreation as Zn, HuggingFaceOptions as Zt, BetterAuthRateLimitOptions as _, discord as _n, Account as _r, RedditOptions as _t, optionsMiddleware as a, microsoft as an, FieldAttributeConfig as ar, ZoomOptions as at, HookEndpointContext as b, cognito as bn, BaseModelNames as br, TiktokOptions as bt, BetterAuthClientPlugin as c, github as cn, Verification as cr, VkOption as ct, ClientStore as d, figma as dn, userSchema as dr, SalesforceOptions as dt, GoogleOptions as en, JoinOption as er, notion as et, AuthContext as f, FacebookOptions as fn, coreSchema as fr, SalesforceProfile as ft, BetterAuthOptions as g, DiscordProfile as gn, rateLimitSchema as gr, roblox as gt, BetterAuthAdvancedOptions as h, DiscordOptions as hn, RateLimit as hr, RobloxProfile as ht, createAuthMiddleware as i, MicrosoftOptions as in, FieldAttribute as ir, PronounOption as it, vercel as j, createAuthorizationCodeRequest as jn, LinearUser as jt, VercelOptions as k, getApplePublicKey as kn, LinearOptions as kt, ClientAtomListener as l, FigmaOptions as ln, verificationSchema as lr, VkProfile as lt, InternalAdapter as m, facebook as mn, sessionSchema as mr, RobloxOptions as mt, AuthMiddleware as n, google as nn, AuthPluginSchema as nr, LoginType as nt, StandardSchemaV1$1 as o, GithubOptions as on, FieldType as or, ZoomProfile as ot, GenericEndpointContext as p, FacebookProfile as pn, Session as pr, salesforce as pt, NaverProfile as q, DBAdapter as qn, spotify as qt, createAuthEndpoint as r, MicrosoftEntraIDProfile as rn, BetterAuthDbSchema as rr, PhoneNumber as rt, BetterAuthClientOptions as s, GithubProfile as sn, Primitive$1 as sr, zoom as st, AuthEndpoint as t, GoogleProfile as tn, Where as tr, AccountStatus as tt, ClientFetchOption as u, FigmaProfile as un, User as ur, vk as ut, GenerateIdFn as v, CognitoOptions as vn, accountSchema as vr, RedditProfile as vt, SocialProviderList as w, atlassian as wn, DBFieldType as wr, GitlabProfile as wt, LiteralString as x, getCognitoPublicKey as xn, BetterAuthDBSchema as xr, TiktokProfile as xt, BetterAuthPlugin as y, CognitoProfile as yn, BetterAuthPluginDBSchema as yr, reddit as yt, PaybinOptions as z, clientCredentialsToken as zn, TwitterOption as zt };
|
|
@@ -63,8 +63,8 @@ declare const TTY_COLORS: {
|
|
|
63
63
|
readonly white: "\u001B[47m";
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
-
type LogLevel = "
|
|
67
|
-
declare const levels: readonly ["info", "success", "warn", "error"
|
|
66
|
+
type LogLevel = "debug" | "info" | "success" | "warn" | "error";
|
|
67
|
+
declare const levels: readonly ["debug", "info", "success", "warn", "error"];
|
|
68
68
|
declare function shouldPublishLog(currentLogLevel: LogLevel, logLevel: LogLevel): boolean;
|
|
69
69
|
interface Logger {
|
|
70
70
|
disabled?: boolean | undefined;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { An as BetterAuthCookies,
|
|
2
|
-
import "./index-
|
|
1
|
+
import { An as BetterAuthCookies, S as LiteralUnion, _ as BetterAuthRateLimitOptions, b as HookEndpointContext, c as BetterAuthClientPlugin, d as ClientStore, f as AuthContext, g as BetterAuthOptions, h as BetterAuthAdvancedOptions, l as ClientAtomListener, m as InternalAdapter, o as StandardSchemaV1, p as GenericEndpointContext, s as BetterAuthClientOptions, u as ClientFetchOption, v as GenerateIdFn, x as LiteralString, y as BetterAuthPlugin } from "./index-D_XSRX55.mjs";
|
|
2
|
+
import "./index-X1Fs3IbM.mjs";
|
|
3
3
|
export { AuthContext, BetterAuthAdvancedOptions, BetterAuthClientOptions, BetterAuthClientPlugin, BetterAuthCookies, BetterAuthOptions, BetterAuthPlugin, BetterAuthRateLimitOptions, ClientAtomListener, ClientFetchOption, ClientStore, GenerateIdFn, GenericEndpointContext, HookEndpointContext, InternalAdapter, LiteralString, LiteralUnion, StandardSchemaV1 };
|
package/dist/oauth2/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Bn as createClientCredentialsTokenRequest, Fn as getOAuth2Tokens, Hn as OAuth2UserInfo, In as createRefreshAccessTokenRequest, Ln as refreshAccessToken, Mn as validateAuthorizationCode, Nn as validateToken, Pn as generateCodeChallenge, Rn as createAuthorizationURL, Un as OAuthProvider, Vn as OAuth2Tokens, Wn as ProviderOptions, jn as createAuthorizationCodeRequest, zn as clientCredentialsToken } from "../index-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { Bn as createClientCredentialsTokenRequest, Fn as getOAuth2Tokens, Hn as OAuth2UserInfo, In as createRefreshAccessTokenRequest, Ln as refreshAccessToken, Mn as validateAuthorizationCode, Nn as validateToken, Pn as generateCodeChallenge, Rn as createAuthorizationURL, Un as OAuthProvider, Vn as OAuth2Tokens, Wn as ProviderOptions, jn as createAuthorizationCodeRequest, zn as clientCredentialsToken } from "../index-D_XSRX55.mjs";
|
|
2
|
+
import "../index-X1Fs3IbM.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
|
|
2
|
-
import "../index-
|
|
1
|
+
import { $ as NotionProfile, $t as huggingface, A as VercelProfile, At as LinearProfile, B as PaybinProfile, Bt as TwitterProfile, C as SocialProvider, Cn as AtlassianProfile, Ct as GitlabOptions, D as socialProviderList, Dn as AppleProfile, Dt as LinkedInProfile, E as SocialProviders, En as AppleOptions, Et as LinkedInOptions, F as PayPalOptions, Ft as kick, G as line, Gt as SpotifyOptions, H as LineIdTokenPayload, Ht as TwitchOptions, I as PayPalProfile, It as DropboxOptions, J as naver, Jt as SlackOptions, K as NaverOptions, Kt as SpotifyProfile, L as PayPalTokenResponse, Lt as DropboxProfile, M as PolarOptions, Mt as linear, N as PolarProfile, Nt as KickOptions, O as socialProviders, On as apple, Ot as linkedin, P as polar, Pt as KickProfile, Q as NotionOptions, Qt as HuggingFaceProfile, R as paypal, Rt as dropbox, Sn as AtlassianOptions, St as tiktok, T as SocialProviderListEnum, Tn as AppleNonConformUser, Tt as gitlab, U as LineOptions, Ut as TwitchProfile, V as paybin, Vt as twitter, W as LineUserInfo, Wt as twitch, X as KakaoProfile, Xt as slack, Y as KakaoOptions, Yt as SlackProfile, Z as kakao, Zt as HuggingFaceOptions, _n as discord, _t as RedditOptions, an as microsoft, at as ZoomOptions, bn as cognito, bt as TiktokOptions, cn as github, ct as VkOption, dn as figma, dt as SalesforceOptions, en as GoogleOptions, et as notion, fn as FacebookOptions, ft as SalesforceProfile, gn as DiscordProfile, gt as roblox, hn as DiscordOptions, ht as RobloxProfile, in as MicrosoftOptions, it as PronounOption, j as vercel, jt as LinearUser, k as VercelOptions, kn as getApplePublicKey, kt as LinearOptions, ln as FigmaOptions, lt as VkProfile, mn as facebook, mt as RobloxOptions, nn as google, nt as LoginType, on as GithubOptions, ot as ZoomProfile, pn as FacebookProfile, pt as salesforce, q as NaverProfile, qt as spotify, rn as MicrosoftEntraIDProfile, rt as PhoneNumber, sn as GithubProfile, st as zoom, tn as GoogleProfile, tt as AccountStatus, un as FigmaProfile, ut as vk, vn as CognitoOptions, vt as RedditProfile, w as SocialProviderList, wn as atlassian, wt as GitlabProfile, xn as getCognitoPublicKey, xt as TiktokProfile, yn as CognitoProfile, yt as reddit, z as PaybinOptions, zt as TwitterOption } from "../index-D_XSRX55.mjs";
|
|
2
|
+
import "../index-X1Fs3IbM.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, VercelOptions, VercelProfile, 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, vercel, vk, zoom };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as logger } from "../env-
|
|
1
|
+
import { i as logger } from "../env-8yWFh7b8.mjs";
|
|
2
2
|
import { a as refreshAccessToken, c as getOAuth2Tokens, n as validateAuthorizationCode, o as createAuthorizationURL, s as generateCodeChallenge } from "../oauth2-B2XPHgx5.mjs";
|
|
3
3
|
import "../utils-C5EN75oV.mjs";
|
|
4
4
|
import { t as BetterAuthError } from "../error-BhAKg8LX.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/core",
|
|
3
|
-
"version": "1.4.4-beta.
|
|
3
|
+
"version": "1.4.4-beta.3",
|
|
4
4
|
"description": "The most comprehensive authentication framework for TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -107,13 +107,11 @@
|
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@better-auth/utils": "0.3.0",
|
|
109
109
|
"@better-fetch/fetch": "1.1.18",
|
|
110
|
-
"
|
|
111
|
-
"better-call": "1.1.1",
|
|
112
|
-
"better-sqlite3": "^12.4.1",
|
|
110
|
+
"better-call": "1.1.4",
|
|
113
111
|
"jose": "^6.1.0",
|
|
114
112
|
"kysely": "^0.28.5",
|
|
115
113
|
"nanostores": "^1.0.1",
|
|
116
|
-
"tsdown": "^0.16.
|
|
114
|
+
"tsdown": "^0.16.0"
|
|
117
115
|
},
|
|
118
116
|
"dependencies": {
|
|
119
117
|
"@standard-schema/spec": "^1.0.0",
|
|
@@ -122,7 +120,7 @@
|
|
|
122
120
|
"peerDependencies": {
|
|
123
121
|
"@better-auth/utils": "0.3.0",
|
|
124
122
|
"@better-fetch/fetch": "1.1.18",
|
|
125
|
-
"better-call": "1.1.
|
|
123
|
+
"better-call": "1.1.4",
|
|
126
124
|
"jose": "^6.1.0",
|
|
127
125
|
"kysely": "^0.28.5",
|
|
128
126
|
"nanostores": "^1.0.1"
|
package/src/db/adapter/index.ts
CHANGED
|
@@ -350,7 +350,7 @@ export type JoinConfig = {
|
|
|
350
350
|
*/
|
|
351
351
|
limit?: number;
|
|
352
352
|
/**
|
|
353
|
-
* The relation type. Determines the
|
|
353
|
+
* The relation type. Determines the output joined model data.
|
|
354
354
|
*
|
|
355
355
|
* `one-to-one` would have a single object in the output.
|
|
356
356
|
* `one-to-many` would have an array of objects in the output.
|
package/src/db/index.ts
CHANGED
|
@@ -15,12 +15,13 @@ export { coreSchema } from "./schema/shared";
|
|
|
15
15
|
export { type User, userSchema } from "./schema/user";
|
|
16
16
|
export { type Verification, verificationSchema } from "./schema/verification";
|
|
17
17
|
export type {
|
|
18
|
+
BaseModelNames,
|
|
18
19
|
BetterAuthDBSchema,
|
|
19
20
|
DBFieldAttribute,
|
|
20
21
|
DBFieldAttributeConfig,
|
|
21
22
|
DBFieldType,
|
|
22
|
-
DBPreservedModels,
|
|
23
23
|
DBPrimitive,
|
|
24
|
+
ModelNames,
|
|
24
25
|
SecondaryStorage,
|
|
25
26
|
} from "./type";
|
|
26
27
|
|
package/src/db/type.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
2
|
import type { LiteralString } from "../types";
|
|
3
3
|
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
| "rate-limit"
|
|
10
|
-
| "organization"
|
|
11
|
-
| "member"
|
|
12
|
-
| "invitation"
|
|
13
|
-
| "jwks"
|
|
14
|
-
| "passkey"
|
|
15
|
-
| "two-factor";
|
|
4
|
+
export type BaseModelNames = "user" | "account" | "session" | "verification";
|
|
5
|
+
|
|
6
|
+
export type ModelNames<T extends string = LiteralString> =
|
|
7
|
+
| BaseModelNames
|
|
8
|
+
| T
|
|
9
|
+
| "rate-limit";
|
|
16
10
|
|
|
17
11
|
export type DBFieldType =
|
|
18
12
|
| "string"
|
package/src/env/logger.test.ts
CHANGED
|
@@ -8,22 +8,22 @@ describe("shouldPublishLog", () => {
|
|
|
8
8
|
logLevel: LogLevel;
|
|
9
9
|
expected: boolean;
|
|
10
10
|
}[] = [
|
|
11
|
-
{ currentLogLevel: "
|
|
12
|
-
{ currentLogLevel: "info", logLevel: "warn", expected: false },
|
|
13
|
-
{ currentLogLevel: "info", logLevel: "error", expected: false },
|
|
14
|
-
{ currentLogLevel: "info", logLevel: "debug", expected: false },
|
|
15
|
-
{ currentLogLevel: "warn", logLevel: "info", expected: true },
|
|
16
|
-
{ currentLogLevel: "warn", logLevel: "warn", expected: true },
|
|
17
|
-
{ currentLogLevel: "warn", logLevel: "error", expected: false },
|
|
18
|
-
{ currentLogLevel: "warn", logLevel: "debug", expected: false },
|
|
19
|
-
{ currentLogLevel: "error", logLevel: "info", expected: true },
|
|
20
|
-
{ currentLogLevel: "error", logLevel: "warn", expected: true },
|
|
21
|
-
{ currentLogLevel: "error", logLevel: "error", expected: true },
|
|
22
|
-
{ currentLogLevel: "error", logLevel: "debug", expected: false },
|
|
11
|
+
{ currentLogLevel: "debug", logLevel: "debug", expected: true },
|
|
23
12
|
{ currentLogLevel: "debug", logLevel: "info", expected: true },
|
|
24
13
|
{ currentLogLevel: "debug", logLevel: "warn", expected: true },
|
|
25
14
|
{ currentLogLevel: "debug", logLevel: "error", expected: true },
|
|
26
|
-
{ currentLogLevel: "
|
|
15
|
+
{ currentLogLevel: "info", logLevel: "debug", expected: false },
|
|
16
|
+
{ currentLogLevel: "info", logLevel: "info", expected: true },
|
|
17
|
+
{ currentLogLevel: "info", logLevel: "warn", expected: true },
|
|
18
|
+
{ currentLogLevel: "info", logLevel: "error", expected: true },
|
|
19
|
+
{ currentLogLevel: "warn", logLevel: "debug", expected: false },
|
|
20
|
+
{ currentLogLevel: "warn", logLevel: "info", expected: false },
|
|
21
|
+
{ currentLogLevel: "warn", logLevel: "warn", expected: true },
|
|
22
|
+
{ currentLogLevel: "warn", logLevel: "error", expected: true },
|
|
23
|
+
{ currentLogLevel: "error", logLevel: "debug", expected: false },
|
|
24
|
+
{ currentLogLevel: "error", logLevel: "info", expected: false },
|
|
25
|
+
{ currentLogLevel: "error", logLevel: "warn", expected: false },
|
|
26
|
+
{ currentLogLevel: "error", logLevel: "error", expected: true },
|
|
27
27
|
];
|
|
28
28
|
|
|
29
29
|
testCases.forEach(({ currentLogLevel, logLevel, expected }) => {
|
package/src/env/logger.ts
CHANGED
|
@@ -31,15 +31,15 @@ export const TTY_COLORS = {
|
|
|
31
31
|
},
|
|
32
32
|
} as const;
|
|
33
33
|
|
|
34
|
-
export type LogLevel = "
|
|
34
|
+
export type LogLevel = "debug" | "info" | "success" | "warn" | "error";
|
|
35
35
|
|
|
36
|
-
export const levels = ["info", "success", "warn", "error"
|
|
36
|
+
export const levels = ["debug", "info", "success", "warn", "error"] as const;
|
|
37
37
|
|
|
38
38
|
export function shouldPublishLog(
|
|
39
39
|
currentLogLevel: LogLevel,
|
|
40
40
|
logLevel: LogLevel,
|
|
41
41
|
): boolean {
|
|
42
|
-
return levels.indexOf(logLevel)
|
|
42
|
+
return levels.indexOf(logLevel) >= levels.indexOf(currentLogLevel);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export interface Logger {
|
|
@@ -46,6 +46,7 @@ export interface PhoneNumber {
|
|
|
46
46
|
* https://developers.zoom.us/docs/api/users/#tag/users/GET/users/{userId}
|
|
47
47
|
*/
|
|
48
48
|
export interface ZoomProfile extends Record<string, any> {
|
|
49
|
+
/* cspell:disable-next-line */
|
|
49
50
|
/** The user's account ID (Example: "q6gBJVO5TzexKYTb_I2rpg") */
|
|
50
51
|
account_id: string;
|
|
51
52
|
/** The user's account number (Example: 10009239) */
|
|
@@ -66,10 +67,13 @@ export interface ZoomProfile extends Record<string, any> {
|
|
|
66
67
|
email: string;
|
|
67
68
|
/** User's first name (Example: "Jill") */
|
|
68
69
|
first_name: string;
|
|
70
|
+
/* cspell:disable-next-line */
|
|
69
71
|
/** IDs of the web groups that the user belongs to (Example: ["RSMaSp8sTEGK0_oamiA2_w"]) */
|
|
70
72
|
group_ids: string[];
|
|
73
|
+
/* cspell:disable-next-line */
|
|
71
74
|
/** User ID (Example: "zJKyaiAyTNC-MWjiWC18KQ") */
|
|
72
75
|
id: string;
|
|
76
|
+
/* cspell:disable-next-line */
|
|
73
77
|
/** IM IDs of the groups that the user belongs to (Example: ["t-_-d56CSWG-7BF15LLrOw"]) */
|
|
74
78
|
im_group_ids: string[];
|
|
75
79
|
/** The user's JID (Example: "jchill@example.com") */
|
|
@@ -117,12 +121,13 @@ export interface ZoomProfile extends Record<string, any> {
|
|
|
117
121
|
zoom_one_type: number;
|
|
118
122
|
/** The user's company (Example: "Jill") */
|
|
119
123
|
company?: string | undefined;
|
|
124
|
+
/* cspell:disable-next-line */
|
|
120
125
|
/** Custom attributes that have been assigned to the user (Example: [{ "key": "cbf_cywdkexrtqc73f97gd4w6g", "name": "A1", "value": "1" }]) */
|
|
121
126
|
custom_attributes?:
|
|
122
127
|
| { key: string; name: string; value: string }[]
|
|
123
128
|
| undefined;
|
|
124
|
-
|
|
125
|
-
|
|
129
|
+
/* cspell:disable-next-line */
|
|
130
|
+
/** The employee's unique ID. This field only returns when SAML single sign-on (SSO) is enabled. The `login_type` value is `101` (SSO) (Example: "HqDyI037Qjili1kNsSIrIg") */
|
|
126
131
|
employee_unique_id?: string | undefined;
|
|
127
132
|
/** The manager for the user (Example: "thill@example.com") */
|
|
128
133
|
manager?: string | undefined;
|
package/src/types/context.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { CookieOptions, EndpointContext } from "better-call";
|
|
|
2
2
|
import type {
|
|
3
3
|
Account,
|
|
4
4
|
BetterAuthDBSchema,
|
|
5
|
-
|
|
5
|
+
ModelNames,
|
|
6
6
|
SecondaryStorage,
|
|
7
7
|
Session,
|
|
8
8
|
User,
|
|
@@ -12,7 +12,6 @@ import type { DBAdapter, Where } from "../db/adapter";
|
|
|
12
12
|
import type { createLogger } from "../env";
|
|
13
13
|
import type { OAuthProvider } from "../oauth2";
|
|
14
14
|
import type { BetterAuthCookies } from "./cookie";
|
|
15
|
-
import type { LiteralUnion } from "./helper";
|
|
16
15
|
import type {
|
|
17
16
|
BetterAuthOptions,
|
|
18
17
|
BetterAuthRateLimitOptions,
|
|
@@ -226,7 +225,7 @@ export type AuthContext<Options extends BetterAuthOptions = BetterAuthOptions> =
|
|
|
226
225
|
};
|
|
227
226
|
};
|
|
228
227
|
generateId: (options: {
|
|
229
|
-
model:
|
|
228
|
+
model: ModelNames;
|
|
230
229
|
size?: number | undefined;
|
|
231
230
|
}) => string | false;
|
|
232
231
|
secondaryStorage: SecondaryStorage | undefined;
|
|
@@ -12,7 +12,7 @@ import type { AuthMiddleware } from "../api";
|
|
|
12
12
|
import type {
|
|
13
13
|
Account,
|
|
14
14
|
DBFieldAttribute,
|
|
15
|
-
|
|
15
|
+
ModelNames,
|
|
16
16
|
RateLimit,
|
|
17
17
|
SecondaryStorage,
|
|
18
18
|
Session,
|
|
@@ -33,7 +33,7 @@ type Optional<T> = {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export type GenerateIdFn = (options: {
|
|
36
|
-
model:
|
|
36
|
+
model: ModelNames;
|
|
37
37
|
size?: number | undefined;
|
|
38
38
|
}) => string | false;
|
|
39
39
|
|
|
@@ -106,7 +106,7 @@ export type BetterAuthRateLimitOptions = {
|
|
|
106
106
|
/**
|
|
107
107
|
* Custom field names for the rate limit table
|
|
108
108
|
*/
|
|
109
|
-
fields?: Record<keyof RateLimit, string
|
|
109
|
+
fields?: Partial<Record<keyof RateLimit, string>> | undefined;
|
|
110
110
|
/**
|
|
111
111
|
* custom storage configuration.
|
|
112
112
|
*
|