better-auth 1.4.1 → 1.4.2-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.
- package/dist/adapters/drizzle-adapter/index.mjs +3 -3
- package/dist/adapters/index.d.mts +3 -2
- package/dist/{admin-BWblrERx.mjs → admin-Bi7mlrkM.mjs} +1 -1
- package/dist/{anonymous-B03YuGJE.mjs → anonymous-DEiy9zsZ.mjs} +1 -1
- package/dist/api/index.d.mts +3 -2
- package/dist/api/index.mjs +2 -2
- package/dist/{api-CE_W4rUg.mjs → api-BBILevFv.mjs} +1 -2
- package/dist/auth/minimal.d.mts +3 -2
- package/dist/auth/minimal.mjs +3 -3
- package/dist/{auth-COq2wuZq.mjs → auth-m-AuBECK.mjs} +2 -2
- package/dist/{base-C0S84LB0.mjs → base-BsxtIxo0.mjs} +2 -2
- package/dist/{chunk-09eW3CcW.mjs → chunk-DbI2OXuS.mjs} +27 -12
- package/dist/client/index.d.mts +5 -207
- package/dist/client/index.mjs +2 -2
- package/dist/client/lynx/index.d.mts +21 -20
- package/dist/client/lynx/index.mjs +1 -1
- package/dist/client/plugins/index.d.mts +62 -62
- package/dist/client/plugins/index.mjs +2 -2
- package/dist/client/react/index.d.mts +19 -18
- package/dist/client/react/index.mjs +1 -1
- package/dist/client/solid/index.d.mts +19 -18
- package/dist/client/solid/index.mjs +1 -1
- package/dist/client/svelte/index.d.mts +21 -20
- package/dist/client/svelte/index.mjs +1 -1
- package/dist/client/vue/index.d.mts +21 -20
- package/dist/client/vue/index.mjs +1 -1
- package/dist/{client-D6y29bCu.mjs → client-BikTMh-g.mjs} +1 -1
- package/dist/cookies/index.d.mts +4 -3
- package/dist/db/index.d.mts +3 -2
- package/dist/db/index.mjs +1 -1
- package/dist/{email-otp-fvjP9Km7.mjs → email-otp-Lt9kQQ7d.mjs} +4 -4
- package/dist/{esm-vGSrBWV-.mjs → esm-DkLFGBDk.mjs} +1 -1
- package/dist/{generic-oauth-qo6urBZS.mjs → generic-oauth-BtyrpDPE.mjs} +3 -3
- package/dist/{get-migration-C2PG4G2s.mjs → get-migration-6ewabxRC.mjs} +4 -1
- package/dist/{haveibeenpwned-1NCWtMXr.mjs → haveibeenpwned-Ae2A2oyJ.mjs} +1 -1
- package/dist/{index-BLJzuqKN.d.mts → index-3xdcOhdN.d.mts} +4 -4
- package/dist/{index-CXkIWFzZ.d.mts → index-4w_p-JEd.d.mts} +2 -2
- package/dist/{index-DVrXtIqH.d.mts → index-B8iZdexj.d.mts} +6 -6
- package/dist/{index-cYOD8ePR.d.mts → index-BIMkk_Is.d.mts} +10 -10
- package/dist/{index-DJHJraoc.d.mts → index-BiX0SvHm.d.mts} +1 -1
- package/dist/{index-PViBvM0U.d.mts → index-BnHKsXEx.d.mts} +2 -2
- package/dist/{index-CVhQCf8K.d.mts → index-C-9zeT9-.d.mts} +6 -6
- package/dist/{index-1ni_0_8A.d.mts → index-CF_nUlMh.d.mts} +11 -11
- package/dist/{index-CfImj7fH.d.mts → index-CJhWbySX.d.mts} +11 -11
- package/dist/{index-DNvaBD-J.d.mts → index-CQ1783c3.d.mts} +8 -8
- package/dist/{index-DflwMIEg.d.mts → index-CRLTcfaR.d.mts} +10 -10
- package/dist/{index-kmJy6lr-.d.mts → index-CYZkpU1a.d.mts} +617 -23
- package/dist/{index-74T5_IsI.d.mts → index-CgXEU_AF.d.mts} +6 -6
- package/dist/{index-BzgT8cQd.d.mts → index-CoEZS0aP.d.mts} +358 -163
- package/dist/{index-BLP8lbCx.d.mts → index-CpQt5ADy.d.mts} +362 -344
- package/dist/{index-hjj802-A.d.mts → index-D8lKwnHW.d.mts} +4 -4
- package/dist/{index-eghn_0Yh.d.mts → index-DjxXMbRL.d.mts} +6 -6
- package/dist/{index-BGVqvXfP.d.mts → index-DnXfdN_t.d.mts} +3 -3
- package/dist/{index-BGHbvBl4.d.mts → index-DxC0Oz-W.d.mts} +15 -15
- package/dist/{index-ClMi8Sht.d.mts → index-ZUjXNTd3.d.mts} +3 -3
- package/dist/{index-C7v0AYqh.d.mts → index-f6cpQBBQ.d.mts} +15 -15
- package/dist/{index-NYwYi8xD.d.mts → index-qbWQLec6.d.mts} +8 -8
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +4 -4
- package/dist/integrations/next-js.d.mts +4 -4
- package/dist/integrations/node.d.mts +3 -2
- package/dist/integrations/svelte-kit.d.mts +5 -4
- package/dist/integrations/tanstack-start.d.mts +4 -4
- package/dist/integrations/tanstack-start.mjs +1 -1
- package/dist/{jwt-COIliG0M.mjs → jwt-CE-bbtao.mjs} +1 -1
- package/dist/{magic-link-U7vFkXXA.mjs → magic-link-roSu5pJ8.mjs} +1 -1
- package/dist/{multi-session-C9LCNQiw.mjs → multi-session-CFEggx2h.mjs} +1 -1
- package/dist/{oauth-proxy-CZ_6azrG.mjs → oauth-proxy-CgdwJ38_.mjs} +1 -1
- package/dist/oauth2/index.d.mts +3 -2
- package/dist/oauth2/index.mjs +2 -2
- package/dist/{oidc-provider-DiyW2arC.mjs → oidc-provider-Bftdu4CU.mjs} +2 -2
- package/dist/{one-tap-Djbp5wgR.mjs → one-tap-C9eoXLPQ.mjs} +1 -1
- package/dist/{open-api-BDqC0qwL.mjs → open-api-KUgvAQ7C.mjs} +1 -1
- package/dist/{organization-CL4Xa8Vi.mjs → organization-C6ll8mYa.mjs} +24 -5
- package/dist/plugins/access/index.d.mts +1 -1
- package/dist/plugins/admin/access/index.d.mts +23 -23
- package/dist/plugins/admin/index.d.mts +23 -23
- package/dist/plugins/admin/index.mjs +3 -3
- package/dist/plugins/anonymous/index.d.mts +4 -3
- package/dist/plugins/anonymous/index.mjs +3 -3
- package/dist/plugins/bearer/index.d.mts +1 -1
- package/dist/plugins/captcha/index.d.mts +1 -1
- package/dist/plugins/custom-session/index.d.mts +4 -3
- package/dist/plugins/custom-session/index.mjs +2 -2
- package/dist/plugins/device-authorization/index.d.mts +1 -1
- package/dist/plugins/device-authorization/index.mjs +1 -1
- package/dist/plugins/email-otp/index.d.mts +1 -1
- package/dist/plugins/email-otp/index.mjs +3 -3
- package/dist/plugins/generic-oauth/index.d.mts +5 -4
- package/dist/plugins/generic-oauth/index.mjs +3 -3
- package/dist/plugins/haveibeenpwned/index.d.mts +1 -1
- package/dist/plugins/haveibeenpwned/index.mjs +3 -3
- package/dist/plugins/index.d.mts +24 -24
- package/dist/plugins/index.mjs +18 -18
- package/dist/plugins/jwt/index.d.mts +4 -3
- package/dist/plugins/jwt/index.mjs +3 -3
- package/dist/plugins/magic-link/index.d.mts +1 -1
- package/dist/plugins/magic-link/index.mjs +3 -3
- package/dist/plugins/multi-session/index.d.mts +2 -2
- package/dist/plugins/multi-session/index.mjs +3 -3
- package/dist/plugins/oauth-proxy/index.d.mts +1 -1
- package/dist/plugins/oauth-proxy/index.mjs +3 -3
- package/dist/plugins/oidc-provider/index.d.mts +23 -23
- package/dist/plugins/oidc-provider/index.mjs +4 -4
- package/dist/plugins/one-tap/index.d.mts +1 -1
- package/dist/plugins/one-tap/index.mjs +3 -3
- package/dist/plugins/one-time-token/index.d.mts +5 -4
- package/dist/plugins/one-time-token/index.mjs +18 -18
- package/dist/plugins/open-api/index.d.mts +1 -1
- package/dist/plugins/open-api/index.mjs +3 -3
- package/dist/plugins/organization/access/index.d.mts +23 -23
- package/dist/plugins/organization/index.d.mts +23 -23
- package/dist/plugins/organization/index.mjs +3 -3
- package/dist/plugins/phone-number/index.d.mts +4 -3
- package/dist/plugins/phone-number/index.mjs +2 -2
- package/dist/plugins/siwe/index.d.mts +4 -3
- package/dist/plugins/siwe/index.mjs +3 -3
- package/dist/plugins/two-factor/index.d.mts +5 -4
- package/dist/plugins/two-factor/index.mjs +2 -2
- package/dist/plugins/username/index.d.mts +2 -2
- package/dist/plugins/username/index.mjs +3 -3
- package/dist/{plugins-CBWTGEDd.mjs → plugins-BaEJeQbr.mjs} +6 -9
- package/dist/{promise-LNBdnXqN.mjs → promise-B9Mgup-x.mjs} +2 -1
- package/dist/{proxy-DZR0bcsP.mjs → proxy-BMMJa46T.mjs} +0 -3
- package/dist/server-B9SCp3Db.mjs +20933 -0
- package/dist/{siwe-DhIExJIr.mjs → siwe-Du6E2d40.mjs} +1 -1
- package/dist/test-utils/index.d.mts +23 -28
- package/dist/test-utils/index.mjs +25 -25
- package/dist/types/index.d.mts +3 -2
- package/dist/{username-Drs37y_f.mjs → username-Ca_VHiHV.mjs} +1 -1
- package/package.json +7 -6
- package/dist/server-mxQ3s5dx.mjs +0 -1912
- /package/dist/{index-B45xbAn7.d.mts → index-CNCxG_Zo.d.mts} +0 -0
- /package/dist/{plugins-ClXJF1tD.d.mts → plugins-Brc8BsoZ.d.mts} +0 -0
|
@@ -128,7 +128,7 @@ const drizzleAdapter = (db, config) => {
|
|
|
128
128
|
}
|
|
129
129
|
function checkMissingFields(schema, model, values) {
|
|
130
130
|
if (!schema) throw new BetterAuthError("Drizzle adapter failed to initialize. Drizzle Schema not found. Please provide a schema object in the adapter options object.");
|
|
131
|
-
for (const key in values) if (!schema[key]) throw new BetterAuthError(`The field "${key}" does not exist in the "${model}" Drizzle schema. Please update your drizzle schema or re-generate using "npx @better-auth/cli generate".`);
|
|
131
|
+
for (const key in values) if (!schema[key]) throw new BetterAuthError(`The field "${key}" does not exist in the "${model}" Drizzle schema. Please update your drizzle schema or re-generate using "npx @better-auth/cli@latest generate".`);
|
|
132
132
|
}
|
|
133
133
|
return {
|
|
134
134
|
async create({ model, data: values }) {
|
|
@@ -140,7 +140,7 @@ const drizzleAdapter = (db, config) => {
|
|
|
140
140
|
const schemaModel = getSchema(model);
|
|
141
141
|
const clause = convertWhereClause(where, model);
|
|
142
142
|
if (options.experimental?.joins) if (!db$1.query || !db$1.query[model]) {
|
|
143
|
-
logger.error(`[# Drizzle Adapter]: The model "${model}" was not found in the query object. Please update your Drizzle schema to include relations or re-generate using "npx auth generate".`);
|
|
143
|
+
logger.error(`[# Drizzle Adapter]: The model "${model}" was not found in the query object. Please update your Drizzle schema to include relations or re-generate using "npx @better-auth/cli@latest generate".`);
|
|
144
144
|
logger.info("Falling back to regular query");
|
|
145
145
|
} else {
|
|
146
146
|
let includes;
|
|
@@ -176,7 +176,7 @@ const drizzleAdapter = (db, config) => {
|
|
|
176
176
|
const clause = where ? convertWhereClause(where, model) : [];
|
|
177
177
|
const sortFn = sortBy?.direction === "desc" ? desc : asc;
|
|
178
178
|
if (options.experimental?.joins) if (!db$1.query[model]) {
|
|
179
|
-
logger.error(`[# Drizzle Adapter]: The model "${model}" was not found in the query object. Please update your Drizzle schema to include relations or re-generate using "npx auth generate".`);
|
|
179
|
+
logger.error(`[# Drizzle Adapter]: The model "${model}" was not found in the query object. Please update your Drizzle schema to include relations or re-generate using "npx @better-auth/cli@latest generate".`);
|
|
180
180
|
logger.info("Falling back to regular query");
|
|
181
181
|
} else {
|
|
182
182
|
let includes;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as AdapterSchemaCreation, an as Where$1, in as TransactionAdapter } from "../index-CoEZS0aP.mjs";
|
|
2
2
|
import "../types-CRiHq5rJ.mjs";
|
|
3
3
|
import { u as Prettify } from "../helper-DU33OcfW.mjs";
|
|
4
|
-
import "../
|
|
4
|
+
import "../index-CNCxG_Zo.mjs";
|
|
5
|
+
import "../plugins-Brc8BsoZ.mjs";
|
|
5
6
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
6
7
|
import * as _better_auth_core_db23 from "@better-auth/core/db";
|
|
7
8
|
import { BetterAuthDBSchema, DBFieldAttribute } from "@better-auth/core/db";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as parseUserOutput, t as mergeSchema, u as getDate } from "./schema-CSB7dlK0.mjs";
|
|
2
|
-
import { t as APIError } from "./api-
|
|
2
|
+
import { t as APIError } from "./api-BBILevFv.mjs";
|
|
3
3
|
import { c as setSessionCookie, n as deleteSessionCookie } from "./cookies-m6bKaTlj.mjs";
|
|
4
4
|
import { r as getSessionFromCtx } from "./session-BO-S7wVw.mjs";
|
|
5
5
|
import { t as hasPermission } from "./has-permission-DN8I_Icv.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as generateId } from "./utils-DBbaShi0.mjs";
|
|
2
2
|
import { t as mergeSchema } from "./schema-CSB7dlK0.mjs";
|
|
3
|
-
import { t as APIError } from "./api-
|
|
3
|
+
import { t as APIError } from "./api-BBILevFv.mjs";
|
|
4
4
|
import { c as setSessionCookie, l as parseSetCookieHeader } from "./cookies-m6bKaTlj.mjs";
|
|
5
5
|
import { r as getSessionFromCtx } from "./session-BO-S7wVw.mjs";
|
|
6
6
|
import { defineErrorCodes } from "@better-auth/core/utils";
|
package/dist/api/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { $ as createEmailVerificationToken, A as deleteUser, B as getSessionFromCtx, C as createAuthEndpoint, D as router, E as optionsMiddleware, F as signOut, G as revokeSessions, H as requestOnlySessionMiddleware, I as signInEmail, J as requestPasswordReset, K as sensitiveSessionMiddleware, L as signInSocial, M as setPassword, N as updateUser, O as changeEmail, P as signUpEmail, Q as error, R as freshSessionMiddleware, S as checkEndpointConflicts, T as getEndpoints, U as revokeOtherSessions, V as listSessions, W as revokeSession, X as resetPassword, Y as requestPasswordResetCallback, Z as ok, at as getAccessToken, b as AuthEndpoint, ct as refreshToken, dt as originCheckMiddleware, et as sendVerificationEmail, ft as getOAuthState, it as accountInfo, j as deleteUserCallback, k as changePassword, lt as unlinkAccount, nt as verifyEmail, ot as linkSocialAccount, pt as getIp, q as sessionMiddleware, rt as callbackOAuth, st as listUserAccounts, tt as sendVerificationEmailFn, ut as originCheck, w as createAuthMiddleware, x as AuthMiddleware, y as APIError, z as getSession } from "../index-
|
|
1
|
+
import { $ as createEmailVerificationToken, A as deleteUser, B as getSessionFromCtx, C as createAuthEndpoint, D as router, E as optionsMiddleware, F as signOut, G as revokeSessions, H as requestOnlySessionMiddleware, I as signInEmail, J as requestPasswordReset, K as sensitiveSessionMiddleware, L as signInSocial, M as setPassword, N as updateUser, O as changeEmail, P as signUpEmail, Q as error, R as freshSessionMiddleware, S as checkEndpointConflicts, T as getEndpoints, U as revokeOtherSessions, V as listSessions, W as revokeSession, X as resetPassword, Y as requestPasswordResetCallback, Z as ok, at as getAccessToken, b as AuthEndpoint, ct as refreshToken, dt as originCheckMiddleware, et as sendVerificationEmail, ft as getOAuthState, it as accountInfo, j as deleteUserCallback, k as changePassword, lt as unlinkAccount, nt as verifyEmail, ot as linkSocialAccount, pt as getIp, q as sessionMiddleware, rt as callbackOAuth, st as listUserAccounts, tt as sendVerificationEmailFn, ut as originCheck, w as createAuthMiddleware, x as AuthMiddleware, y as APIError, z as getSession } from "../index-CoEZS0aP.mjs";
|
|
2
2
|
import "../types-CRiHq5rJ.mjs";
|
|
3
3
|
import "../helper-DU33OcfW.mjs";
|
|
4
|
-
import "../
|
|
4
|
+
import "../index-CNCxG_Zo.mjs";
|
|
5
|
+
import "../plugins-Brc8BsoZ.mjs";
|
|
5
6
|
export { APIError, AuthEndpoint, AuthMiddleware, accountInfo, callbackOAuth, changeEmail, changePassword, checkEndpointConflicts, createAuthEndpoint, createAuthMiddleware, createEmailVerificationToken, deleteUser, deleteUserCallback, error, freshSessionMiddleware, getAccessToken, getEndpoints, getIp, getOAuthState, getSession, getSessionFromCtx, linkSocialAccount, listSessions, listUserAccounts, ok, optionsMiddleware, originCheck, originCheckMiddleware, refreshToken, requestOnlySessionMiddleware, requestPasswordReset, requestPasswordResetCallback, resetPassword, revokeOtherSessions, revokeSession, revokeSessions, router, sendVerificationEmail, sendVerificationEmailFn, sensitiveSessionMiddleware, sessionMiddleware, setPassword, signInEmail, signInSocial, signOut, signUpEmail, unlinkAccount, updateUser, verifyEmail };
|
package/dist/api/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../dialect-BvcuosDD.mjs";
|
|
2
2
|
import "../get-model-name-D4DUV7S2.mjs";
|
|
3
|
-
import "../get-migration-
|
|
3
|
+
import "../get-migration-6ewabxRC.mjs";
|
|
4
4
|
import { a as getOAuthState } from "../utils-DBbaShi0.mjs";
|
|
5
5
|
import "../crypto-BQxYXGGX.mjs";
|
|
6
6
|
import "../jwt-DzuIBp7t.mjs";
|
|
@@ -9,7 +9,7 @@ import "../schema-CSB7dlK0.mjs";
|
|
|
9
9
|
import { t as getIp } from "../get-request-ip-RYTz2Uba.mjs";
|
|
10
10
|
import "../json-_HMgPUVh.mjs";
|
|
11
11
|
import "../url-C4fqRUH1.mjs";
|
|
12
|
-
import { A as getAccessToken, C as createEmailVerificationToken, D as callbackOAuth, E as verifyEmail, L as originCheck, M as listUserAccounts, N as refreshToken, P as unlinkAccount, R as originCheckMiddleware, S as error, T as sendVerificationEmailFn, _ as signInSocial, a as getEndpoints, b as resetPassword, c as changeEmail, d as deleteUserCallback, f as setPassword, g as signInEmail, h as signOut, i as createAuthMiddleware, j as linkSocialAccount, k as accountInfo, l as changePassword, m as signUpEmail, n as checkEndpointConflicts, o as optionsMiddleware, p as updateUser, r as createAuthEndpoint, s as router, t as APIError, u as deleteUser, v as requestPasswordReset, w as sendVerificationEmail, x as ok, y as requestPasswordResetCallback } from "../api-
|
|
12
|
+
import { A as getAccessToken, C as createEmailVerificationToken, D as callbackOAuth, E as verifyEmail, L as originCheck, M as listUserAccounts, N as refreshToken, P as unlinkAccount, R as originCheckMiddleware, S as error, T as sendVerificationEmailFn, _ as signInSocial, a as getEndpoints, b as resetPassword, c as changeEmail, d as deleteUserCallback, f as setPassword, g as signInEmail, h as signOut, i as createAuthMiddleware, j as linkSocialAccount, k as accountInfo, l as changePassword, m as signUpEmail, n as checkEndpointConflicts, o as optionsMiddleware, p as updateUser, r as createAuthEndpoint, s as router, t as APIError, u as deleteUser, v as requestPasswordReset, w as sendVerificationEmail, x as ok, y as requestPasswordResetCallback } from "../api-BBILevFv.mjs";
|
|
13
13
|
import "../cookies-m6bKaTlj.mjs";
|
|
14
14
|
import { a as requestOnlySessionMiddleware, c as revokeSessions, i as listSessions, l as sensitiveSessionMiddleware, n as getSession, o as revokeOtherSessions, r as getSessionFromCtx, s as revokeSession, t as freshSessionMiddleware, u as sessionMiddleware } from "../session-BO-S7wVw.mjs";
|
|
15
15
|
|
|
@@ -1821,13 +1821,12 @@ function redirectCallback(ctx, callbackURL, query) {
|
|
|
1821
1821
|
}
|
|
1822
1822
|
const requestPasswordReset = createAuthEndpoint("/request-password-reset", {
|
|
1823
1823
|
method: "POST",
|
|
1824
|
-
operationId: "forgetPassword",
|
|
1825
1824
|
body: z.object({
|
|
1826
1825
|
email: z.email().meta({ description: "The email address of the user to send a password reset email to" }),
|
|
1827
1826
|
redirectTo: z.string().meta({ description: "The URL to redirect the user to reset their password. If the token isn't valid or expired, it'll be redirected with a query parameter `?error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN" }).optional()
|
|
1828
1827
|
}),
|
|
1829
1828
|
metadata: { openapi: {
|
|
1830
|
-
operationId: "
|
|
1829
|
+
operationId: "requestPasswordReset",
|
|
1831
1830
|
description: "Send a password reset email to the user",
|
|
1832
1831
|
responses: { "200": {
|
|
1833
1832
|
description: "Success",
|
package/dist/auth/minimal.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { o as Auth } from "../index-
|
|
1
|
+
import { o as Auth } from "../index-CoEZS0aP.mjs";
|
|
2
2
|
import "../types-CRiHq5rJ.mjs";
|
|
3
3
|
import "../helper-DU33OcfW.mjs";
|
|
4
|
-
import "../
|
|
4
|
+
import "../index-CNCxG_Zo.mjs";
|
|
5
|
+
import "../plugins-Brc8BsoZ.mjs";
|
|
5
6
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
6
7
|
|
|
7
8
|
//#region src/auth/minimal.d.ts
|
package/dist/auth/minimal.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../dialect-BvcuosDD.mjs";
|
|
2
2
|
import "../get-model-name-D4DUV7S2.mjs";
|
|
3
|
-
import { d as getBaseAdapter } from "../get-migration-
|
|
3
|
+
import { d as getBaseAdapter } from "../get-migration-6ewabxRC.mjs";
|
|
4
4
|
import "../utils-DBbaShi0.mjs";
|
|
5
5
|
import "../crypto-BQxYXGGX.mjs";
|
|
6
6
|
import "../jwt-DzuIBp7t.mjs";
|
|
@@ -9,10 +9,10 @@ import "../schema-CSB7dlK0.mjs";
|
|
|
9
9
|
import "../get-request-ip-RYTz2Uba.mjs";
|
|
10
10
|
import "../json-_HMgPUVh.mjs";
|
|
11
11
|
import "../url-C4fqRUH1.mjs";
|
|
12
|
-
import "../api-
|
|
12
|
+
import "../api-BBILevFv.mjs";
|
|
13
13
|
import "../cookies-m6bKaTlj.mjs";
|
|
14
14
|
import "../session-BO-S7wVw.mjs";
|
|
15
|
-
import { n as createAuthContext, t as createBetterAuth } from "../base-
|
|
15
|
+
import { n as createAuthContext, t as createBetterAuth } from "../base-BsxtIxo0.mjs";
|
|
16
16
|
import "../password-DBH2q5D6.mjs";
|
|
17
17
|
import { BetterAuthError } from "@better-auth/core/error";
|
|
18
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as getKyselyDatabaseType } from "./dialect-BvcuosDD.mjs";
|
|
2
|
-
import { t as getMigrations, u as getAdapter } from "./get-migration-
|
|
3
|
-
import { n as createAuthContext, t as createBetterAuth } from "./base-
|
|
2
|
+
import { t as getMigrations, u as getAdapter } from "./get-migration-6ewabxRC.mjs";
|
|
3
|
+
import { n as createAuthContext, t as createBetterAuth } from "./base-BsxtIxo0.mjs";
|
|
4
4
|
import { BetterAuthError } from "@better-auth/core/error";
|
|
5
5
|
|
|
6
6
|
//#region src/context/init.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as getAuthTables } from "./get-model-name-D4DUV7S2.mjs";
|
|
2
|
-
import { a as createInternalAdapter } from "./get-migration-
|
|
2
|
+
import { a as createInternalAdapter } from "./get-migration-6ewabxRC.mjs";
|
|
3
3
|
import { t as generateId } from "./utils-DBbaShi0.mjs";
|
|
4
4
|
import { a as verifyPassword, i as hashPassword } from "./crypto-BQxYXGGX.mjs";
|
|
5
5
|
import { r as getOrigin, t as getBaseURL } from "./url-C4fqRUH1.mjs";
|
|
6
|
-
import { a as getEndpoints, n as checkEndpointConflicts, s as router } from "./api-
|
|
6
|
+
import { a as getEndpoints, n as checkEndpointConflicts, s as router } from "./api-BBILevFv.mjs";
|
|
7
7
|
import { i as getCookies, t as createCookieGetter } from "./cookies-m6bKaTlj.mjs";
|
|
8
8
|
import { t as checkPassword } from "./password-DBH2q5D6.mjs";
|
|
9
9
|
import { runWithAdapter } from "@better-auth/core/context";
|
|
@@ -10,25 +10,40 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
10
10
|
var __commonJS = (cb, mod) => function() {
|
|
11
11
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
12
|
};
|
|
13
|
-
var __export = (all) => {
|
|
13
|
+
var __export = (all, symbols) => {
|
|
14
14
|
let target = {};
|
|
15
|
-
for (var name in all)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
for (var name in all) {
|
|
16
|
+
__defProp(target, name, {
|
|
17
|
+
get: all[name],
|
|
18
|
+
enumerable: true
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (symbols) {
|
|
22
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
|
+
}
|
|
19
24
|
return target;
|
|
20
25
|
};
|
|
21
26
|
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
29
|
+
key = keys[i];
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
31
|
+
__defProp(to, key, {
|
|
32
|
+
get: ((k) => from[k]).bind(null, key),
|
|
33
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
28
37
|
}
|
|
29
38
|
return to;
|
|
30
39
|
};
|
|
31
|
-
var __reExport = (target, mod, secondTarget
|
|
40
|
+
var __reExport = (target, mod, secondTarget, symbols) => {
|
|
41
|
+
if (symbols) {
|
|
42
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
43
|
+
secondTarget && __defProp(secondTarget, Symbol.toStringTag, { value: "Module" });
|
|
44
|
+
}
|
|
45
|
+
__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
|
|
46
|
+
};
|
|
32
47
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
33
48
|
value: mod,
|
|
34
49
|
enumerable: true
|
package/dist/client/index.d.mts
CHANGED
|
@@ -1,211 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as BroadcastMessage, Ct as OnlineManager, Dt as kFocusManager, Et as FocusManager, Mt as kBroadcastChannel, Ot as BroadcastChannel, St as OnlineListener, Tt as FocusListener, _n as InferSessionFromClient, _t as AuthClient, bn as SessionQueryParams, bt as createSessionRefreshManager, cn as BetterAuthClientPlugin, dn as ClientStore, fn as InferActions, gn as InferPluginsFromClient, gt as Primitive, hn as InferErrorCodes, ht as InferPlugin, jt as getGlobalBroadcastChannel, kt as BroadcastListener, ln as ClientAtomListener, mn as InferClientAPI, mt as InferAuth, on as AtomListener, pn as InferAdditionalFromClient, sn as BetterAuthClientOptions, un as ClientOptions, vn as InferUserFromClient, vt as createAuthClient, wt as kOnlineManager, xn as Store, xt as useAuthQuery, yn as IsSignal, yt as SessionRefreshOptions } from "../index-CoEZS0aP.mjs";
|
|
2
2
|
import "../types-CRiHq5rJ.mjs";
|
|
3
|
-
import { d as PrettifyDeep, h as UnionToIntersection } from "../helper-DU33OcfW.mjs";
|
|
4
|
-
import "../
|
|
5
|
-
import
|
|
6
|
-
import { BetterAuthClientOptions as BetterAuthClientOptions$1, BetterAuthClientPlugin as BetterAuthClientPlugin$1, BetterAuthOptions, BetterAuthPlugin, ClientFetchOption } from "@better-auth/core";
|
|
7
|
-
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
8
|
-
import * as nanostores5 from "nanostores";
|
|
9
|
-
import { Atom, PreinitializedWritableAtom, WritableAtom } from "nanostores";
|
|
10
|
-
import * as _better_fetch_fetch101 from "@better-fetch/fetch";
|
|
11
|
-
import { BetterFetch, BetterFetchError } from "@better-fetch/fetch";
|
|
3
|
+
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../helper-DU33OcfW.mjs";
|
|
4
|
+
import { a as Role, c as Subset, i as AccessControl, n as createAccessControl, o as Statements, r as role, s as SubArray, t as AuthorizeResponse } from "../index-CNCxG_Zo.mjs";
|
|
5
|
+
import "../plugins-Brc8BsoZ.mjs";
|
|
12
6
|
export * from "@better-auth/core/db";
|
|
13
7
|
export * from "nanostores";
|
|
14
8
|
export * from "@better-fetch/fetch";
|
|
15
|
-
|
|
16
|
-
//#region src/client/broadcast-channel.d.ts
|
|
17
|
-
interface BroadcastMessage {
|
|
18
|
-
event?: "session" | undefined;
|
|
19
|
-
data?: {
|
|
20
|
-
trigger?: "signout" | "getSession" | "updateUser";
|
|
21
|
-
} | undefined;
|
|
22
|
-
clientId: string;
|
|
23
|
-
timestamp: number;
|
|
24
|
-
}
|
|
25
|
-
type BroadcastListener = (message: BroadcastMessage) => void;
|
|
26
|
-
declare const kBroadcastChannel: unique symbol;
|
|
27
|
-
interface BroadcastChannel {
|
|
28
|
-
post(message: Record<string, unknown>): void;
|
|
29
|
-
subscribe(listener: BroadcastListener): () => void;
|
|
30
|
-
setup(): () => void;
|
|
31
|
-
}
|
|
32
|
-
declare function getGlobalBroadcastChannel(name?: string): BroadcastChannel;
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/client/focus-manager.d.ts
|
|
35
|
-
type FocusListener = (focused: boolean) => void;
|
|
36
|
-
declare const kFocusManager: unique symbol;
|
|
37
|
-
interface FocusManager {
|
|
38
|
-
setFocused(focused: boolean): void;
|
|
39
|
-
subscribe(listener: FocusListener): () => void;
|
|
40
|
-
setup(): () => void;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/client/online-manager.d.ts
|
|
44
|
-
type OnlineListener = (online: boolean) => void;
|
|
45
|
-
declare const kOnlineManager: unique symbol;
|
|
46
|
-
interface OnlineManager {
|
|
47
|
-
setOnline(online: boolean): void;
|
|
48
|
-
isOnline: boolean;
|
|
49
|
-
subscribe(listener: OnlineListener): () => void;
|
|
50
|
-
setup(): () => void;
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/client/query.d.ts
|
|
54
|
-
declare const useAuthQuery: <T>(initializedAtom: PreinitializedWritableAtom<any> | PreinitializedWritableAtom<any>[], path: string, $fetch: BetterFetch, options?: (((value: {
|
|
55
|
-
data: null | T;
|
|
56
|
-
error: null | BetterFetchError;
|
|
57
|
-
isPending: boolean;
|
|
58
|
-
}) => ClientFetchOption) | ClientFetchOption) | undefined) => PreinitializedWritableAtom<{
|
|
59
|
-
data: null | T;
|
|
60
|
-
error: null | BetterFetchError;
|
|
61
|
-
isPending: boolean;
|
|
62
|
-
isRefetching: boolean;
|
|
63
|
-
refetch: (queryParams?: {
|
|
64
|
-
query?: SessionQueryParams;
|
|
65
|
-
} | undefined) => Promise<void>;
|
|
66
|
-
}> & object;
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/client/session-refresh.d.ts
|
|
69
|
-
interface SessionRefreshOptions {
|
|
70
|
-
sessionAtom: WritableAtom<any>;
|
|
71
|
-
sessionSignal: WritableAtom<boolean>;
|
|
72
|
-
$fetch: BetterFetch;
|
|
73
|
-
options?: BetterAuthClientOptions$1 | undefined;
|
|
74
|
-
}
|
|
75
|
-
declare function createSessionRefreshManager(opts: SessionRefreshOptions): {
|
|
76
|
-
init: () => void;
|
|
77
|
-
cleanup: () => void;
|
|
78
|
-
triggerRefetch: (event?: {
|
|
79
|
-
event?: "poll" | "visibilitychange" | "storage";
|
|
80
|
-
} | undefined) => void;
|
|
81
|
-
broadcastSessionUpdate: (trigger: "signout" | "getSession" | "updateUser") => void;
|
|
82
|
-
};
|
|
83
|
-
//#endregion
|
|
84
|
-
//#region src/client/vanilla.d.ts
|
|
85
|
-
type InferResolvedHooks<O extends BetterAuthClientOptions$1> = O extends {
|
|
86
|
-
plugins: Array<infer Plugin>;
|
|
87
|
-
} ? UnionToIntersection<Plugin extends BetterAuthClientPlugin$1 ? Plugin["getAtoms"] extends ((fetch: any) => infer Atoms) ? Atoms extends Record<string, any> ? { [key in keyof Atoms as IsSignal<key> extends true ? never : key extends string ? `use${Capitalize<key>}` : never]: Atoms[key] } : {} : {} : {}> : {};
|
|
88
|
-
declare function createAuthClient<Option extends BetterAuthClientOptions$1>(options?: Option | undefined): UnionToIntersection<InferResolvedHooks<Option>> & InferClientAPI<Option> & InferActions<Option> & {
|
|
89
|
-
useSession: Atom<{
|
|
90
|
-
data: InferClientAPI<Option> extends {
|
|
91
|
-
getSession: () => Promise<infer Res>;
|
|
92
|
-
} ? Res extends {
|
|
93
|
-
data: null;
|
|
94
|
-
error: {
|
|
95
|
-
message?: string | undefined;
|
|
96
|
-
status: number;
|
|
97
|
-
statusText: string;
|
|
98
|
-
};
|
|
99
|
-
} | {
|
|
100
|
-
data: infer S;
|
|
101
|
-
error: null;
|
|
102
|
-
} ? S : Res extends Record<string, any> ? Res : never : never;
|
|
103
|
-
error: BetterFetchError | null;
|
|
104
|
-
isPending: boolean;
|
|
105
|
-
}>;
|
|
106
|
-
$fetch: _better_fetch_fetch101.BetterFetch<{
|
|
107
|
-
plugins: (_better_fetch_fetch101.BetterFetchPlugin | {
|
|
108
|
-
id: string;
|
|
109
|
-
name: string;
|
|
110
|
-
hooks: {
|
|
111
|
-
onSuccess(context: _better_fetch_fetch101.SuccessContext<any>): void;
|
|
112
|
-
};
|
|
113
|
-
} | {
|
|
114
|
-
id: string;
|
|
115
|
-
name: string;
|
|
116
|
-
hooks: {
|
|
117
|
-
onRequest<T extends Record<string, any>>(context: _better_fetch_fetch101.RequestContext<T>): void;
|
|
118
|
-
};
|
|
119
|
-
} | {
|
|
120
|
-
id: string;
|
|
121
|
-
name: string;
|
|
122
|
-
hooks: {
|
|
123
|
-
onSuccess: ((context: _better_fetch_fetch101.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
124
|
-
onError: ((context: _better_fetch_fetch101.ErrorContext) => Promise<void> | void) | undefined;
|
|
125
|
-
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch101.RequestContext<T>) => Promise<_better_fetch_fetch101.RequestContext | void> | _better_fetch_fetch101.RequestContext | void) | undefined;
|
|
126
|
-
onResponse: ((context: _better_fetch_fetch101.ResponseContext) => Promise<Response | void | _better_fetch_fetch101.ResponseContext> | Response | _better_fetch_fetch101.ResponseContext | void) | undefined;
|
|
127
|
-
};
|
|
128
|
-
})[];
|
|
129
|
-
cache?: RequestCache | undefined;
|
|
130
|
-
method: string;
|
|
131
|
-
headers?: (HeadersInit & (HeadersInit | {
|
|
132
|
-
accept: "application/json" | "text/plain" | "application/octet-stream";
|
|
133
|
-
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
134
|
-
authorization: "Bearer" | "Basic";
|
|
135
|
-
})) | undefined;
|
|
136
|
-
redirect?: RequestRedirect | undefined;
|
|
137
|
-
credentials?: RequestCredentials;
|
|
138
|
-
integrity?: string | undefined;
|
|
139
|
-
keepalive?: boolean | undefined;
|
|
140
|
-
mode?: RequestMode | undefined;
|
|
141
|
-
priority?: RequestPriority | undefined;
|
|
142
|
-
referrer?: string | undefined;
|
|
143
|
-
referrerPolicy?: ReferrerPolicy | undefined;
|
|
144
|
-
signal?: (AbortSignal | null) | undefined;
|
|
145
|
-
window?: null | undefined;
|
|
146
|
-
onRetry?: ((response: _better_fetch_fetch101.ResponseContext) => Promise<void> | void) | undefined;
|
|
147
|
-
hookOptions?: {
|
|
148
|
-
cloneResponse?: boolean;
|
|
149
|
-
} | undefined;
|
|
150
|
-
timeout?: number | undefined;
|
|
151
|
-
customFetchImpl: _better_fetch_fetch101.FetchEsque;
|
|
152
|
-
baseURL: string;
|
|
153
|
-
throw?: boolean | undefined;
|
|
154
|
-
auth?: ({
|
|
155
|
-
type: "Bearer";
|
|
156
|
-
token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
|
|
157
|
-
} | {
|
|
158
|
-
type: "Basic";
|
|
159
|
-
username: string | (() => string | undefined) | undefined;
|
|
160
|
-
password: string | (() => string | undefined) | undefined;
|
|
161
|
-
} | {
|
|
162
|
-
type: "Custom";
|
|
163
|
-
prefix: string | (() => string | undefined) | undefined;
|
|
164
|
-
value: string | (() => string | undefined) | undefined;
|
|
165
|
-
}) | undefined;
|
|
166
|
-
body?: any;
|
|
167
|
-
query?: any;
|
|
168
|
-
params?: any;
|
|
169
|
-
duplex?: "full" | "half" | undefined;
|
|
170
|
-
jsonParser: (text: string) => Promise<any> | any;
|
|
171
|
-
retry?: _better_fetch_fetch101.RetryOptions | undefined;
|
|
172
|
-
retryAttempt?: number | undefined;
|
|
173
|
-
output?: (_better_fetch_fetch101.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
174
|
-
errorSchema?: _better_fetch_fetch101.StandardSchemaV1 | undefined;
|
|
175
|
-
disableValidation?: boolean | undefined;
|
|
176
|
-
disableSignal?: boolean | undefined;
|
|
177
|
-
}, unknown, unknown, {}>;
|
|
178
|
-
$store: {
|
|
179
|
-
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
180
|
-
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
181
|
-
atoms: Record<string, nanostores5.WritableAtom<any>>;
|
|
182
|
-
};
|
|
183
|
-
$Infer: {
|
|
184
|
-
Session: NonNullable<InferClientAPI<Option> extends {
|
|
185
|
-
getSession: () => Promise<infer Res>;
|
|
186
|
-
} ? Res extends {
|
|
187
|
-
data: null;
|
|
188
|
-
error: {
|
|
189
|
-
message?: string | undefined;
|
|
190
|
-
status: number;
|
|
191
|
-
statusText: string;
|
|
192
|
-
};
|
|
193
|
-
} | {
|
|
194
|
-
data: infer S;
|
|
195
|
-
error: null;
|
|
196
|
-
} ? S : Res extends Record<string, any> ? Res : never : never>;
|
|
197
|
-
};
|
|
198
|
-
$ERROR_CODES: PrettifyDeep<InferErrorCodes<Option> & typeof BASE_ERROR_CODES>;
|
|
199
|
-
};
|
|
200
|
-
type AuthClient<Option extends BetterAuthClientOptions$1> = ReturnType<typeof createAuthClient<Option>>;
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region src/client/index.d.ts
|
|
203
|
-
declare const InferPlugin: <T extends BetterAuthPlugin>() => {
|
|
204
|
-
id: "infer-server-plugin";
|
|
205
|
-
$InferServerPlugin: T;
|
|
206
|
-
};
|
|
207
|
-
declare function InferAuth<O extends {
|
|
208
|
-
options: BetterAuthOptions;
|
|
209
|
-
}>(): O["options"];
|
|
210
|
-
//#endregion
|
|
211
|
-
export { AccessControl, AtomListener, AuthClient, AuthorizeResponse, BetterAuthClientOptions, BetterAuthClientPlugin, BroadcastChannel, BroadcastListener, BroadcastMessage, ClientAtomListener, ClientOptions, ClientStore, type FocusListener, type FocusManager, InferActions, InferAdditionalFromClient, InferAuth, InferClientAPI, InferErrorCodes, InferPlugin, InferPluginsFromClient, InferSessionFromClient, InferUserFromClient, IsSignal, type OnlineListener, type OnlineManager, Role, SessionQueryParams, SessionRefreshOptions, Statements, Store, SubArray, Subset, createAccessControl, createAuthClient, createSessionRefreshManager, getGlobalBroadcastChannel, kBroadcastChannel, kFocusManager, kOnlineManager, role, useAuthQuery };
|
|
9
|
+
export { AccessControl, AtomListener, AuthClient, AuthorizeResponse, Awaitable, BetterAuthClientOptions, BetterAuthClientPlugin, BroadcastChannel, BroadcastListener, BroadcastMessage, ClientAtomListener, ClientOptions, ClientStore, DeepPartial, Expand, FocusListener, FocusManager, HasRequiredKeys, InferActions, InferAdditionalFromClient, InferAuth, InferClientAPI, InferErrorCodes, InferPlugin, InferPluginsFromClient, InferSessionFromClient, InferUserFromClient, IsSignal, LiteralNumber, LiteralString, LiteralUnion, OmitId, OnlineListener, OnlineManager, PreserveJSDoc, Prettify, PrettifyDeep, Primitive, RequiredKeysOf, Role, SessionQueryParams, SessionRefreshOptions, Statements, Store, StripEmptyObjects, SubArray, Subset, UnionToIntersection, WithoutEmpty, createAccessControl, createAuthClient, createSessionRefreshManager, getGlobalBroadcastChannel, kBroadcastChannel, kFocusManager, kOnlineManager, role, useAuthQuery };
|
package/dist/client/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../misc-D8A8FGv2.mjs";
|
|
2
2
|
import "../url-C4fqRUH1.mjs";
|
|
3
|
-
import { a as kOnlineManager, c as kBroadcastChannel, i as useAuthQuery, o as kFocusManager, r as createSessionRefreshManager, s as getGlobalBroadcastChannel } from "../proxy-
|
|
3
|
+
import { a as kOnlineManager, c as kBroadcastChannel, i as useAuthQuery, o as kFocusManager, r as createSessionRefreshManager, s as getGlobalBroadcastChannel } from "../proxy-BMMJa46T.mjs";
|
|
4
4
|
import "../parser-kwbb5q_C.mjs";
|
|
5
|
-
import { n as InferPlugin, r as createAuthClient, t as InferAuth } from "../client-
|
|
5
|
+
import { n as InferPlugin, r as createAuthClient, t as InferAuth } from "../client-BikTMh-g.mjs";
|
|
6
6
|
|
|
7
7
|
export { InferAuth, InferPlugin, createAuthClient, createSessionRefreshManager, getGlobalBroadcastChannel, kBroadcastChannel, kFocusManager, kOnlineManager, useAuthQuery };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bn as SessionQueryParams, fn as InferActions, hn as InferErrorCodes, mn as InferClientAPI, yn as IsSignal } from "../../index-CoEZS0aP.mjs";
|
|
2
2
|
import "../../types-CRiHq5rJ.mjs";
|
|
3
|
-
import { d as PrettifyDeep, h as UnionToIntersection } from "../../helper-DU33OcfW.mjs";
|
|
4
|
-
import "../../
|
|
3
|
+
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-DU33OcfW.mjs";
|
|
4
|
+
import "../../index-CNCxG_Zo.mjs";
|
|
5
|
+
import "../../plugins-Brc8BsoZ.mjs";
|
|
5
6
|
import { BetterAuthClientOptions, BetterAuthClientPlugin } from "@better-auth/core";
|
|
6
7
|
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
7
|
-
import * as
|
|
8
|
+
import * as nanostores1 from "nanostores";
|
|
8
9
|
import { Store, StoreValue } from "nanostores";
|
|
9
|
-
import * as
|
|
10
|
+
import * as _better_fetch_fetch33 from "@better-fetch/fetch";
|
|
10
11
|
import { BetterFetchError } from "@better-fetch/fetch";
|
|
11
12
|
import { DependencyList } from "@lynx-js/react";
|
|
12
13
|
export * from "nanostores";
|
|
@@ -95,27 +96,27 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
95
96
|
error: null;
|
|
96
97
|
} ? S : Res : never>;
|
|
97
98
|
};
|
|
98
|
-
$fetch:
|
|
99
|
-
plugins: (
|
|
99
|
+
$fetch: _better_fetch_fetch33.BetterFetch<{
|
|
100
|
+
plugins: (_better_fetch_fetch33.BetterFetchPlugin | {
|
|
100
101
|
id: string;
|
|
101
102
|
name: string;
|
|
102
103
|
hooks: {
|
|
103
|
-
onSuccess(context:
|
|
104
|
+
onSuccess(context: _better_fetch_fetch33.SuccessContext<any>): void;
|
|
104
105
|
};
|
|
105
106
|
} | {
|
|
106
107
|
id: string;
|
|
107
108
|
name: string;
|
|
108
109
|
hooks: {
|
|
109
|
-
onRequest<T extends Record<string, any>>(context:
|
|
110
|
+
onRequest<T extends Record<string, any>>(context: _better_fetch_fetch33.RequestContext<T>): void;
|
|
110
111
|
};
|
|
111
112
|
} | {
|
|
112
113
|
id: string;
|
|
113
114
|
name: string;
|
|
114
115
|
hooks: {
|
|
115
|
-
onSuccess: ((context:
|
|
116
|
-
onError: ((context:
|
|
117
|
-
onRequest: (<T extends Record<string, any>>(context:
|
|
118
|
-
onResponse: ((context:
|
|
116
|
+
onSuccess: ((context: _better_fetch_fetch33.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
117
|
+
onError: ((context: _better_fetch_fetch33.ErrorContext) => Promise<void> | void) | undefined;
|
|
118
|
+
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch33.RequestContext<T>) => Promise<_better_fetch_fetch33.RequestContext | void> | _better_fetch_fetch33.RequestContext | void) | undefined;
|
|
119
|
+
onResponse: ((context: _better_fetch_fetch33.ResponseContext) => Promise<Response | void | _better_fetch_fetch33.ResponseContext> | Response | _better_fetch_fetch33.ResponseContext | void) | undefined;
|
|
119
120
|
};
|
|
120
121
|
})[];
|
|
121
122
|
cache?: RequestCache | undefined;
|
|
@@ -135,12 +136,12 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
135
136
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
136
137
|
signal?: (AbortSignal | null) | undefined;
|
|
137
138
|
window?: null | undefined;
|
|
138
|
-
onRetry?: ((response:
|
|
139
|
+
onRetry?: ((response: _better_fetch_fetch33.ResponseContext) => Promise<void> | void) | undefined;
|
|
139
140
|
hookOptions?: {
|
|
140
141
|
cloneResponse?: boolean;
|
|
141
142
|
} | undefined;
|
|
142
143
|
timeout?: number | undefined;
|
|
143
|
-
customFetchImpl:
|
|
144
|
+
customFetchImpl: _better_fetch_fetch33.FetchEsque;
|
|
144
145
|
baseURL: string;
|
|
145
146
|
throw?: boolean | undefined;
|
|
146
147
|
auth?: ({
|
|
@@ -160,19 +161,19 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
160
161
|
params?: any;
|
|
161
162
|
duplex?: "full" | "half" | undefined;
|
|
162
163
|
jsonParser: (text: string) => Promise<any> | any;
|
|
163
|
-
retry?:
|
|
164
|
+
retry?: _better_fetch_fetch33.RetryOptions | undefined;
|
|
164
165
|
retryAttempt?: number | undefined;
|
|
165
|
-
output?: (
|
|
166
|
-
errorSchema?:
|
|
166
|
+
output?: (_better_fetch_fetch33.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
167
|
+
errorSchema?: _better_fetch_fetch33.StandardSchemaV1 | undefined;
|
|
167
168
|
disableValidation?: boolean | undefined;
|
|
168
169
|
disableSignal?: boolean | undefined;
|
|
169
170
|
}, unknown, unknown, {}>;
|
|
170
171
|
$store: {
|
|
171
172
|
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
172
173
|
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
173
|
-
atoms: Record<string,
|
|
174
|
+
atoms: Record<string, nanostores1.WritableAtom<any>>;
|
|
174
175
|
};
|
|
175
176
|
$ERROR_CODES: PrettifyDeep<InferErrorCodes<Option> & typeof BASE_ERROR_CODES>;
|
|
176
177
|
};
|
|
177
178
|
//#endregion
|
|
178
|
-
export { capitalizeFirstLetter, createAuthClient, useStore };
|
|
179
|
+
export { Awaitable, DeepPartial, Expand, HasRequiredKeys, LiteralNumber, LiteralString, LiteralUnion, OmitId, PreserveJSDoc, Prettify, PrettifyDeep, Primitive, RequiredKeysOf, StripEmptyObjects, type UnionToIntersection, WithoutEmpty, capitalizeFirstLetter, createAuthClient, useStore };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../url-C4fqRUH1.mjs";
|
|
2
|
-
import { n as getClientConfig, t as createDynamicPathProxy } from "../../proxy-
|
|
2
|
+
import { n as getClientConfig, t as createDynamicPathProxy } from "../../proxy-BMMJa46T.mjs";
|
|
3
3
|
import "../../parser-kwbb5q_C.mjs";
|
|
4
4
|
import { listenKeys } from "nanostores";
|
|
5
5
|
import { useCallback, useRef, useSyncExternalStore } from "@lynx-js/react";
|