@better-auth/core 1.4.4 → 1.4.6-beta.2

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.
@@ -1,8 +1,8 @@
1
1
 
2
- > @better-auth/core@1.4.4 build /home/runner/work/better-auth/better-auth/packages/core
2
+ > @better-auth/core@1.4.6-beta.2 build /home/runner/work/better-auth/better-auth/packages/core
3
3
  > tsdown
4
4
 
5
- ℹ tsdown v0.16.5 powered by rolldown v1.0.0-beta.50
5
+ ℹ tsdown v0.16.6 powered by rolldown v1.0.0-beta.51
6
6
  ℹ Using tsdown config: /home/runner/work/better-auth/better-auth/packages/core/tsdown.config.ts
7
7
  ℹ entry: src/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
8
8
  ℹ tsconfig: tsconfig.json
@@ -24,10 +24,10 @@
24
24
  ℹ dist/error-BhAKg8LX.mjs  1.77 kB │ gzip: 0.79 kB
25
25
  ℹ dist/async_hooks-BfRfbd1J.mjs  0.87 kB │ gzip: 0.46 kB
26
26
  ℹ dist/utils-C5EN75oV.mjs  0.13 kB │ gzip: 0.12 kB
27
- ℹ dist/social-providers/index.d.mts  3.87 kB │ gzip: 1.20 kB
28
- ℹ dist/context/index.d.mts  3.05 kB │ gzip: 0.96 kB
27
+ ℹ dist/social-providers/index.d.mts  3.87 kB │ gzip: 1.19 kB
28
+ ℹ dist/context/index.d.mts  3.05 kB │ gzip: 0.97 kB
29
29
  ℹ dist/error/index.d.mts  1.84 kB │ gzip: 0.72 kB
30
- ℹ dist/db/index.d.mts  1.01 kB │ gzip: 0.38 kB
30
+ ℹ dist/db/index.d.mts  1.03 kB │ gzip: 0.38 kB
31
31
  ℹ dist/index.d.mts  0.87 kB │ gzip: 0.34 kB
32
32
  ℹ dist/utils/index.d.mts  0.84 kB │ gzip: 0.43 kB
33
33
  ℹ dist/oauth2/index.d.mts  0.79 kB │ gzip: 0.30 kB
@@ -35,8 +35,8 @@
35
35
  ℹ dist/db/adapter/index.d.mts  0.53 kB │ gzip: 0.25 kB
36
36
  ℹ dist/api/index.d.mts  0.29 kB │ gzip: 0.16 kB
37
37
  ℹ dist/async_hooks/index.d.mts  0.14 kB │ gzip: 0.10 kB
38
- ℹ dist/index-DRwH9Qxo.d.mts 208.78 kB │ gzip: 32.75 kB
38
+ ℹ dist/index-D_XSRX55.d.mts 208.73 kB │ gzip: 32.73 kB
39
39
  ℹ dist/index-X1Fs3IbM.d.mts  3.31 kB │ gzip: 1.11 kB
40
40
  ℹ dist/index-DgwIISs7.d.mts  0.24 kB │ gzip: 0.16 kB
41
- ℹ 31 files, total: 334.14 kB
42
- ✔ Build complete in 4549ms
41
+ ℹ 31 files, total: 334.11 kB
42
+ ✔ Build complete in 4461ms
@@ -1,3 +1,3 @@
1
- import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-DRwH9Qxo.mjs";
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 };
@@ -1,4 +1,4 @@
1
- import { Qn as DBTransactionAdapter, f as AuthContext, qn as DBAdapter } from "../index-DRwH9Qxo.mjs";
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-DRwH9Qxo.mjs";
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 };
@@ -1,3 +1,3 @@
1
- import { Cr as DBFieldType, Er as SecondaryStorage, Sr as DBFieldAttributeConfig, Tr as DBPrimitive, _r as Account, ar as FieldAttributeConfig, br as BetterAuthDBSchema, 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 DBPreservedModels, xr as DBFieldAttribute, yr as BetterAuthPluginDBSchema } from "../index-DRwH9Qxo.mjs";
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, DBPreservedModels, DBPrimitive, FieldAttribute, FieldAttributeConfig, FieldType, Primitive, RateLimit, SecondaryStorage, Session, User, Verification, accountSchema, coreSchema, rateLimitSchema, sessionSchema, userSchema, verificationSchema };
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 DBPreservedModels = "user" | "account" | "session" | "verification" | "rate-limit" | "organization" | "member" | "invitation" | "jwks" | "passkey" | "two-factor";
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 ouput joined model data.
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: LiteralUnion<DBPreservedModels, string>;
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: LiteralUnion<DBPreservedModels, string>;
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 { AccountStatus as $, JoinConfig as $n, GoogleProfile as $t, PolarOptions as A, BetterAuthCookies as An, linear as At, LineIdTokenPayload as B, createClientCredentialsTokenRequest as Bn, TwitchOptions as Bt, SocialProviderListEnum as C, AppleNonConformUser as Cn, DBFieldType as Cr, gitlab as Ct, VercelOptions as D, getApplePublicKey as Dn, LinearOptions as Dt, socialProviders as E, apple as En, SecondaryStorage as Er, linkedin as Et, PayPalTokenResponse as F, getOAuth2Tokens as Fn, DropboxProfile as Ft, NaverProfile as G, CleanedWhere as Gn, spotify as Gt, LineUserInfo as H, OAuth2UserInfo as Hn, twitch as Ht, paypal as I, createRefreshAccessTokenRequest as In, dropbox as It, KakaoProfile as J, DBAdapterDebugLogOption as Jn, slack as Jt, naver as K, CustomAdapter as Kn, SlackOptions as Kt, PaybinOptions as L, refreshAccessToken as Ln, TwitterOption as Lt, polar as M, validateAuthorizationCode as Mn, KickProfile as Mt, PayPalOptions as N, validateToken as Nn, kick as Nt, VercelProfile as O, LiteralString as On, LinearProfile as Ot, PayPalProfile as P, generateCodeChallenge as Pn, DropboxOptions as Pt, notion as Q, DBTransactionAdapter as Qn, GoogleOptions as Qt, PaybinProfile as R, createAuthorizationURL as Rn, TwitterProfile as Rt, SocialProviderList as S, atlassian as Sn, DBFieldAttributeConfig as Sr, GitlabProfile as St, socialProviderList as T, AppleProfile as Tn, DBPrimitive as Tr, LinkedInProfile as Tt, line as U, OAuthProvider as Un, SpotifyOptions as Ut, LineOptions as V, OAuth2Tokens as Vn, TwitchProfile as Vt, NaverOptions as W, ProviderOptions as Wn, SpotifyProfile as Wt, NotionOptions as X, DBAdapterInstance as Xn, HuggingFaceProfile as Xt, kakao as Y, DBAdapterFactoryConfig as Yn, HuggingFaceOptions as Yt, NotionProfile as Z, DBAdapterSchemaCreation as Zn, huggingface as Zt, BetterAuthRateLimitOptions as _, CognitoProfile as _n, Account as _r, reddit as _t, optionsMiddleware as a, GithubProfile as an, FieldAttributeConfig as ar, zoom as at, HookEndpointContext as b, AtlassianOptions as bn, BetterAuthDBSchema as br, tiktok as bt, BetterAuthClientPlugin as c, FigmaProfile as cn, Verification as cr, vk as ct, ClientStore as d, FacebookProfile as dn, userSchema as dr, salesforce as dt, google as en, JoinOption as er, LoginType as et, AuthContext as f, facebook as fn, coreSchema as fr, RobloxOptions as ft, BetterAuthOptions as g, CognitoOptions as gn, rateLimitSchema as gr, RedditProfile as gt, BetterAuthAdvancedOptions as h, discord as hn, RateLimit as hr, RedditOptions as ht, createAuthMiddleware as i, GithubOptions as in, FieldAttribute as ir, ZoomProfile as it, PolarProfile as j, createAuthorizationCodeRequest as jn, KickOptions as jt, vercel as k, LiteralUnion as kn, LinearUser as kt, ClientAtomListener as l, figma as ln, verificationSchema as lr, SalesforceOptions as lt, InternalAdapter as m, DiscordProfile as mn, sessionSchema as mr, roblox as mt, AuthMiddleware as n, MicrosoftOptions as nn, AuthPluginSchema as nr, PronounOption as nt, StandardSchemaV1$1 as o, github as on, FieldType as or, VkOption as ot, GenericEndpointContext as p, DiscordOptions as pn, Session as pr, RobloxProfile as pt, KakaoOptions as q, DBAdapter as qn, SlackProfile as qt, createAuthEndpoint as r, microsoft as rn, BetterAuthDbSchema as rr, ZoomOptions as rt, BetterAuthClientOptions as s, FigmaOptions as sn, Primitive$1 as sr, VkProfile as st, AuthEndpoint as t, MicrosoftEntraIDProfile as tn, Where as tr, PhoneNumber as tt, ClientFetchOption as u, FacebookOptions as un, User as ur, SalesforceProfile as ut, GenerateIdFn as v, cognito as vn, accountSchema as vr, TiktokOptions as vt, SocialProviders as w, AppleOptions as wn, DBPreservedModels as wr, LinkedInOptions as wt, SocialProvider as x, AtlassianProfile as xn, DBFieldAttribute as xr, GitlabOptions as xt, BetterAuthPlugin as y, getCognitoPublicKey as yn, BetterAuthPluginDBSchema as yr, TiktokProfile as yt, paybin as z, clientCredentialsToken as zn, twitter as zt };
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, On as LiteralString, _ as BetterAuthRateLimitOptions, b as HookEndpointContext, c as BetterAuthClientPlugin, d as ClientStore, f as AuthContext, g as BetterAuthOptions, h as BetterAuthAdvancedOptions, kn as LiteralUnion, l as ClientAtomListener, m as InternalAdapter, o as StandardSchemaV1, p as GenericEndpointContext, s as BetterAuthClientOptions, u as ClientFetchOption, v as GenerateIdFn, y as BetterAuthPlugin } from "./index-DRwH9Qxo.mjs";
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 };
@@ -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-DRwH9Qxo.mjs";
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 AccountStatus, $t as GoogleProfile, A as PolarOptions, At as linear, B as LineIdTokenPayload, Bt as TwitchOptions, C as SocialProviderListEnum, Cn as AppleNonConformUser, Ct as gitlab, D as VercelOptions, Dn as getApplePublicKey, Dt as LinearOptions, E as socialProviders, En as apple, Et as linkedin, F as PayPalTokenResponse, Ft as DropboxProfile, G as NaverProfile, Gt as spotify, H as LineUserInfo, Ht as twitch, I as paypal, It as dropbox, J as KakaoProfile, Jt as slack, K as naver, Kt as SlackOptions, L as PaybinOptions, Lt as TwitterOption, M as polar, Mt as KickProfile, N as PayPalOptions, Nt as kick, O as VercelProfile, Ot as LinearProfile, P as PayPalProfile, Pt as DropboxOptions, Q as notion, Qt as GoogleOptions, R as PaybinProfile, Rt as TwitterProfile, S as SocialProviderList, Sn as atlassian, St as GitlabProfile, T as socialProviderList, Tn as AppleProfile, Tt as LinkedInProfile, U as line, Ut as SpotifyOptions, V as LineOptions, Vt as TwitchProfile, W as NaverOptions, Wt as SpotifyProfile, X as NotionOptions, Xt as HuggingFaceProfile, Y as kakao, Yt as HuggingFaceOptions, Z as NotionProfile, Zt as huggingface, _n as CognitoProfile, _t as reddit, an as GithubProfile, at as zoom, bn as AtlassianOptions, bt as tiktok, cn as FigmaProfile, ct as vk, dn as FacebookProfile, dt as salesforce, en as google, et as LoginType, fn as facebook, ft as RobloxOptions, gn as CognitoOptions, gt as RedditProfile, hn as discord, ht as RedditOptions, in as GithubOptions, it as ZoomProfile, j as PolarProfile, jt as KickOptions, k as vercel, kt as LinearUser, ln as figma, lt as SalesforceOptions, mn as DiscordProfile, mt as roblox, nn as MicrosoftOptions, nt as PronounOption, on as github, ot as VkOption, pn as DiscordOptions, pt as RobloxProfile, q as KakaoOptions, qt as SlackProfile, rn as microsoft, rt as ZoomOptions, sn as FigmaOptions, st as VkProfile, tn as MicrosoftEntraIDProfile, tt as PhoneNumber, un as FacebookOptions, ut as SalesforceProfile, vn as cognito, vt as TiktokOptions, w as SocialProviders, wn as AppleOptions, wt as LinkedInOptions, x as SocialProvider, xn as AtlassianProfile, xt as GitlabOptions, yn as getCognitoPublicKey, yt as TiktokProfile, z as paybin, zt as twitter } from "../index-DRwH9Qxo.mjs";
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.4",
3
+ "version": "1.4.6-beta.2",
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
- "@types/better-sqlite3": "^7.6.13",
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.3",
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
  }
@@ -350,7 +350,7 @@ export type JoinConfig = {
350
350
  */
351
351
  limit?: number;
352
352
  /**
353
- * The relation type. Determines the ouput joined model data.
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 DBPreservedModels =
5
- | "user"
6
- | "account"
7
- | "session"
8
- | "verification"
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
- /** The employee's unique ID. This field only returns when SAML single sign-on (SSO) is enabled.
125
- * The `login_type` value is `101` (SSO) (Example: "HqDyI037Qjili1kNsSIrIg") */
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;
@@ -2,7 +2,7 @@ import type { CookieOptions, EndpointContext } from "better-call";
2
2
  import type {
3
3
  Account,
4
4
  BetterAuthDBSchema,
5
- DBPreservedModels,
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: LiteralUnion<DBPreservedModels, string>;
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
- DBPreservedModels,
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: LiteralUnion<DBPreservedModels, string>;
36
+ model: ModelNames;
37
37
  size?: number | undefined;
38
38
  }) => string | false;
39
39