@better-auth/core 1.4.4 → 1.4.5
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 +8 -8
- package/dist/api/index.d.mts +1 -1
- package/dist/context/index.d.mts +1 -1
- package/dist/db/adapter/index.d.mts +1 -1
- package/dist/db/index.d.mts +2 -2
- package/dist/{index-DRwH9Qxo.d.mts → index-D_XSRX55.d.mts} +12 -12
- 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/package.json +9 -5
- package/src/db/adapter/index.ts +1 -1
- package/src/db/index.ts +2 -1
- package/src/db/type.ts +6 -12
- package/src/social-providers/zoom.ts +7 -2
- package/src/types/context.ts +2 -3
- package/src/types/init-options.ts +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/core@1.4.
|
|
2
|
+
> @better-auth/core@1.4.5 build /home/runner/work/better-auth/better-auth/packages/core
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
|
-
[34mℹ[39m tsdown [2mv0.16.
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.16.6[22m powered by rolldown [2mv1.0.0-beta.51[22m
|
|
6
6
|
[34mℹ[39m Using tsdown config: [4m/home/runner/work/better-auth/better-auth/packages/core/tsdown.config.ts[24m
|
|
7
7
|
[34mℹ[39m entry: [34msrc/index.ts, src/db/index.ts, src/db/adapter/index.ts, src/async_hooks/index.ts, src/context/index.ts, src/env/index.ts, src/oauth2/index.ts, src/api/index.ts, src/social-providers/index.ts, src/utils/index.ts, src/error/index.ts[39m
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
@@ -24,10 +24,10 @@
|
|
|
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.05 kB[22m [2m│ gzip: 0.
|
|
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-
|
|
38
|
+
[34mℹ[39m [2mdist/[22m[32mindex-D_XSRX55.d.mts[39m [2m208.73 kB[22m [2m│ gzip: 32.73 kB[22m
|
|
39
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: 334.
|
|
42
|
-
[32m✔[39m Build complete in [
|
|
41
|
+
[34mℹ[39m 31 files, total: 334.11 kB
|
|
42
|
+
[32m✔[39m Build complete in [32m4687ms[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-D_XSRX55.mjs";
|
|
2
2
|
import "../index-X1Fs3IbM.mjs";
|
|
3
3
|
export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
|
package/dist/context/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Qn as DBTransactionAdapter, f as AuthContext, qn as DBAdapter } from "../index-
|
|
1
|
+
import { Qn as DBTransactionAdapter, f as AuthContext, qn as DBAdapter } from "../index-D_XSRX55.mjs";
|
|
2
2
|
import "../index-X1Fs3IbM.mjs";
|
|
3
3
|
import { t as AsyncLocalStorage } from "../index-DgwIISs7.mjs";
|
|
4
4
|
import { EndpointContext, InputContext } from "better-call";
|
|
@@ -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-
|
|
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
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
|
|
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
2
|
import "../index-X1Fs3IbM.mjs";
|
|
3
|
-
export { Account, AuthPluginSchema, BetterAuthDBSchema, BetterAuthDbSchema, BetterAuthPluginDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType,
|
|
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 };
|
|
@@ -11,7 +11,8 @@ import { Dialect, Kysely, Migration, MysqlPool, PostgresPool, SqliteDatabase } f
|
|
|
11
11
|
import { Atom, WritableAtom } from "nanostores";
|
|
12
12
|
|
|
13
13
|
//#region src/db/type.d.ts
|
|
14
|
-
type
|
|
14
|
+
type BaseModelNames = "user" | "account" | "session" | "verification";
|
|
15
|
+
type ModelNames<T extends string = LiteralString> = BaseModelNames | T | "rate-limit";
|
|
15
16
|
type DBFieldType = "string" | "number" | "boolean" | "date" | "json" | `${"string" | "number"}[]` | Array<LiteralString>;
|
|
16
17
|
type DBPrimitive = string | number | boolean | Date | null | undefined | string[] | number[] | (Record<string, unknown> | unknown[]);
|
|
17
18
|
type DBFieldAttributeConfig = {
|
|
@@ -593,7 +594,7 @@ type JoinConfig = {
|
|
|
593
594
|
*/
|
|
594
595
|
limit?: number;
|
|
595
596
|
/**
|
|
596
|
-
* The relation type. Determines the
|
|
597
|
+
* The relation type. Determines the output joined model data.
|
|
597
598
|
*
|
|
598
599
|
* `one-to-one` would have a single object in the output.
|
|
599
600
|
* `one-to-many` would have an array of objects in the output.
|
|
@@ -1131,11 +1132,6 @@ type BetterAuthCookies = {
|
|
|
1131
1132
|
};
|
|
1132
1133
|
};
|
|
1133
1134
|
//#endregion
|
|
1134
|
-
//#region src/types/helper.d.ts
|
|
1135
|
-
type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
1136
|
-
type LiteralString = "" | (string & Record<never, never>);
|
|
1137
|
-
type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
1138
|
-
//#endregion
|
|
1139
1135
|
//#region src/social-providers/apple.d.ts
|
|
1140
1136
|
interface AppleProfile {
|
|
1141
1137
|
/**
|
|
@@ -3388,8 +3384,7 @@ interface ZoomProfile extends Record<string, any> {
|
|
|
3388
3384
|
name: string;
|
|
3389
3385
|
value: string;
|
|
3390
3386
|
}[] | undefined;
|
|
3391
|
-
/** The employee's unique ID. This field only returns when SAML single sign-on (SSO) is enabled.
|
|
3392
|
-
* 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") */
|
|
3393
3388
|
employee_unique_id?: string | undefined;
|
|
3394
3389
|
/** The manager for the user (Example: "thill@example.com") */
|
|
3395
3390
|
manager?: string | undefined;
|
|
@@ -5904,6 +5899,11 @@ type SocialProviders = { [K in SocialProviderList[number]]?: Parameters<(typeof
|
|
|
5904
5899
|
} };
|
|
5905
5900
|
type SocialProviderList = typeof socialProviderList;
|
|
5906
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
|
|
5907
5907
|
//#region src/types/plugin.d.ts
|
|
5908
5908
|
type Awaitable<T> = T | Promise<T>;
|
|
5909
5909
|
type DeepPartial<T> = T extends Function ? T : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T;
|
|
@@ -6023,7 +6023,7 @@ type OmitId<T extends {
|
|
|
6023
6023
|
}> = Omit<T, "id">;
|
|
6024
6024
|
type Optional<T> = { [P in keyof T]?: T[P] | undefined };
|
|
6025
6025
|
type GenerateIdFn = (options: {
|
|
6026
|
-
model:
|
|
6026
|
+
model: ModelNames;
|
|
6027
6027
|
size?: number | undefined;
|
|
6028
6028
|
}) => string | false;
|
|
6029
6029
|
type BetterAuthRateLimitOptions = {
|
|
@@ -7313,7 +7313,7 @@ type AuthContext<Options extends BetterAuthOptions = BetterAuthOptions> = {
|
|
|
7313
7313
|
};
|
|
7314
7314
|
};
|
|
7315
7315
|
generateId: (options: {
|
|
7316
|
-
model:
|
|
7316
|
+
model: ModelNames;
|
|
7317
7317
|
size?: number | undefined;
|
|
7318
7318
|
}) => string | false;
|
|
7319
7319
|
secondaryStorage: SecondaryStorage | undefined;
|
|
@@ -7473,4 +7473,4 @@ declare const createAuthEndpoint: <Path extends string, Opts extends EndpointOpt
|
|
|
7473
7473
|
type AuthEndpoint = ReturnType<typeof createAuthEndpoint>;
|
|
7474
7474
|
type AuthMiddleware = ReturnType<typeof createAuthMiddleware>;
|
|
7475
7475
|
//#endregion
|
|
7476
|
-
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 };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { An as BetterAuthCookies,
|
|
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
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-
|
|
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
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
|
|
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
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 };
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "The most comprehensive authentication framework for TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/better-auth/better-auth",
|
|
9
|
+
"directory": "packages/core"
|
|
10
|
+
},
|
|
6
11
|
"main": "./dist/index.mjs",
|
|
7
12
|
"module": "./dist/index.mjs",
|
|
8
13
|
"exports": {
|
|
@@ -102,9 +107,7 @@
|
|
|
102
107
|
"devDependencies": {
|
|
103
108
|
"@better-auth/utils": "0.3.0",
|
|
104
109
|
"@better-fetch/fetch": "1.1.18",
|
|
105
|
-
"
|
|
106
|
-
"better-call": "1.1.3",
|
|
107
|
-
"better-sqlite3": "^12.4.1",
|
|
110
|
+
"better-call": "1.1.4",
|
|
108
111
|
"jose": "^6.1.0",
|
|
109
112
|
"kysely": "^0.28.5",
|
|
110
113
|
"nanostores": "^1.0.1",
|
|
@@ -117,7 +120,7 @@
|
|
|
117
120
|
"peerDependencies": {
|
|
118
121
|
"@better-auth/utils": "0.3.0",
|
|
119
122
|
"@better-fetch/fetch": "1.1.18",
|
|
120
|
-
"better-call": "1.1.
|
|
123
|
+
"better-call": "1.1.4",
|
|
121
124
|
"jose": "^6.1.0",
|
|
122
125
|
"kysely": "^0.28.5",
|
|
123
126
|
"nanostores": "^1.0.1"
|
|
@@ -125,6 +128,7 @@
|
|
|
125
128
|
"scripts": {
|
|
126
129
|
"build": "tsdown",
|
|
127
130
|
"dev": "tsdown --watch",
|
|
131
|
+
"lint:package": "publint run --strict",
|
|
128
132
|
"typecheck": "tsc --project tsconfig.json",
|
|
129
133
|
"test": "vitest"
|
|
130
134
|
}
|
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"
|
|
@@ -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
|
|