better-auth 1.4.7-beta.3 → 1.4.7-beta.4

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.
Files changed (61) hide show
  1. package/dist/api/index.d.mts +91 -91
  2. package/dist/api/index.mjs +1 -1
  3. package/dist/api/index.mjs.map +1 -1
  4. package/dist/api/middlewares/origin-check.d.mts +3 -3
  5. package/dist/api/routes/account.d.mts +11 -11
  6. package/dist/api/routes/callback.d.mts +2 -2
  7. package/dist/api/routes/email-verification.d.mts +4 -4
  8. package/dist/api/routes/error.d.mts +2 -2
  9. package/dist/api/routes/ok.d.mts +2 -2
  10. package/dist/api/routes/reset-password.d.mts +5 -5
  11. package/dist/api/routes/session.d.mts +14 -14
  12. package/dist/api/routes/sign-in.d.mts +3 -3
  13. package/dist/api/routes/sign-out.d.mts +2 -2
  14. package/dist/api/routes/sign-up.d.mts +2 -2
  15. package/dist/api/routes/update-user.d.mts +13 -13
  16. package/dist/client/lynx/index.d.mts +15 -15
  17. package/dist/client/solid/index.d.mts +13 -13
  18. package/dist/client/svelte/index.d.mts +15 -15
  19. package/dist/client/vanilla.d.mts +15 -15
  20. package/dist/db/field.d.mts +5 -5
  21. package/dist/integrations/next-js.d.mts +4 -4
  22. package/dist/integrations/svelte-kit.d.mts +2 -2
  23. package/dist/integrations/tanstack-start.d.mts +4 -4
  24. package/dist/plugins/admin/admin.d.mts +116 -116
  25. package/dist/plugins/anonymous/index.d.mts +3 -3
  26. package/dist/plugins/api-key/index.d.mts +18 -18
  27. package/dist/plugins/bearer/index.d.mts +6 -6
  28. package/dist/plugins/captcha/index.d.mts +2 -2
  29. package/dist/plugins/custom-session/index.d.mts +3 -3
  30. package/dist/plugins/device-authorization/index.d.mts +6 -6
  31. package/dist/plugins/email-otp/index.d.mts +13 -13
  32. package/dist/plugins/generic-oauth/index.d.mts +5 -5
  33. package/dist/plugins/haveibeenpwned/index.d.mts +3 -3
  34. package/dist/plugins/jwt/client.d.mts +2 -2
  35. package/dist/plugins/jwt/index.d.mts +9 -9
  36. package/dist/plugins/last-login-method/index.d.mts +4 -4
  37. package/dist/plugins/magic-link/index.d.mts +4 -4
  38. package/dist/plugins/mcp/index.d.mts +10 -10
  39. package/dist/plugins/multi-session/index.d.mts +14 -14
  40. package/dist/plugins/oauth-proxy/index.d.mts +8 -8
  41. package/dist/plugins/oidc-provider/index.d.mts +15 -15
  42. package/dist/plugins/one-tap/client.d.mts +5 -5
  43. package/dist/plugins/one-tap/index.d.mts +2 -2
  44. package/dist/plugins/one-time-token/index.d.mts +4 -4
  45. package/dist/plugins/open-api/index.d.mts +3 -3
  46. package/dist/plugins/organization/client.d.mts +17 -17
  47. package/dist/plugins/organization/organization.d.mts +7 -7
  48. package/dist/plugins/organization/routes/crud-access-control.d.mts +22 -22
  49. package/dist/plugins/organization/routes/crud-invites.d.mts +58 -58
  50. package/dist/plugins/organization/routes/crud-members.d.mts +62 -62
  51. package/dist/plugins/organization/routes/crud-org.d.mts +22 -22
  52. package/dist/plugins/organization/routes/crud-team.d.mts +76 -76
  53. package/dist/plugins/phone-number/index.d.mts +9 -9
  54. package/dist/plugins/siwe/index.d.mts +3 -3
  55. package/dist/plugins/two-factor/backup-codes/index.d.mts +5 -5
  56. package/dist/plugins/two-factor/index.d.mts +18 -18
  57. package/dist/plugins/two-factor/otp/index.d.mts +3 -3
  58. package/dist/plugins/username/index.d.mts +12 -12
  59. package/dist/plugins/username/schema.d.mts +3 -3
  60. package/dist/test-utils/test-instance.d.mts +1149 -1149
  61. package/package.json +4 -4
@@ -25,7 +25,7 @@ function checkEndpointConflicts(options, logger$1) {
25
25
  const endpointRegistry = /* @__PURE__ */ new Map();
26
26
  options.plugins?.forEach((plugin) => {
27
27
  if (plugin.endpoints) {
28
- for (const [key, endpoint] of Object.entries(plugin.endpoints)) if (endpoint && "path" in endpoint) {
28
+ for (const [key, endpoint] of Object.entries(plugin.endpoints)) if (endpoint && "path" in endpoint && typeof endpoint.path === "string") {
29
29
  const path = endpoint.path;
30
30
  let methods = [];
31
31
  if (endpoint.options && "method" in endpoint.options) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["methods: string[]","conflicts: {\n\t\tpath: string;\n\t\tplugins: string[];\n\t\tconflictingMethods: string[];\n\t}[]","conflictingMethods: string[]","APIError"],"sources":["../../src/api/index.ts"],"sourcesContent":["import type {\n\tAuthContext,\n\tBetterAuthOptions,\n\tBetterAuthPlugin,\n} from \"@better-auth/core\";\nimport type { InternalLogger } from \"@better-auth/core/env\";\nimport { logger } from \"@better-auth/core/env\";\nimport type { Endpoint, Middleware } from \"better-call\";\nimport { APIError, createRouter } from \"better-call\";\nimport type { UnionToIntersection } from \"../types/helper\";\nimport { originCheckMiddleware } from \"./middlewares\";\nimport { onRequestRateLimit } from \"./rate-limiter\";\nimport {\n\taccountInfo,\n\tcallbackOAuth,\n\tchangeEmail,\n\tchangePassword,\n\tdeleteUser,\n\tdeleteUserCallback,\n\terror,\n\tgetAccessToken,\n\tgetSession,\n\tlinkSocialAccount,\n\tlistSessions,\n\tlistUserAccounts,\n\tok,\n\trefreshToken,\n\trequestPasswordReset,\n\trequestPasswordResetCallback,\n\tresetPassword,\n\trevokeOtherSessions,\n\trevokeSession,\n\trevokeSessions,\n\tsendVerificationEmail,\n\tsetPassword,\n\tsignInEmail,\n\tsignInSocial,\n\tsignOut,\n\tsignUpEmail,\n\tunlinkAccount,\n\tupdateUser,\n\tverifyEmail,\n} from \"./routes\";\nimport { toAuthEndpoints } from \"./to-auth-endpoints\";\n\nexport function checkEndpointConflicts(\n\toptions: BetterAuthOptions,\n\tlogger: InternalLogger,\n) {\n\tconst endpointRegistry = new Map<\n\t\tstring,\n\t\t{ pluginId: string; endpointKey: string; methods: string[] }[]\n\t>();\n\n\toptions.plugins?.forEach((plugin) => {\n\t\tif (plugin.endpoints) {\n\t\t\tfor (const [key, endpoint] of Object.entries(plugin.endpoints)) {\n\t\t\t\tif (endpoint && \"path\" in endpoint) {\n\t\t\t\t\tconst path = endpoint.path;\n\t\t\t\t\tlet methods: string[] = [];\n\t\t\t\t\tif (endpoint.options && \"method\" in endpoint.options) {\n\t\t\t\t\t\tif (Array.isArray(endpoint.options.method)) {\n\t\t\t\t\t\t\tmethods = endpoint.options.method;\n\t\t\t\t\t\t} else if (typeof endpoint.options.method === \"string\") {\n\t\t\t\t\t\t\tmethods = [endpoint.options.method];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (methods.length === 0) {\n\t\t\t\t\t\tmethods = [\"*\"];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!endpointRegistry.has(path)) {\n\t\t\t\t\t\tendpointRegistry.set(path, []);\n\t\t\t\t\t}\n\t\t\t\t\tendpointRegistry.get(path)!.push({\n\t\t\t\t\t\tpluginId: plugin.id,\n\t\t\t\t\t\tendpointKey: key,\n\t\t\t\t\t\tmethods,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tconst conflicts: {\n\t\tpath: string;\n\t\tplugins: string[];\n\t\tconflictingMethods: string[];\n\t}[] = [];\n\tfor (const [path, entries] of endpointRegistry.entries()) {\n\t\tif (entries.length > 1) {\n\t\t\tconst methodMap = new Map<string, string[]>();\n\t\t\tlet hasConflict = false;\n\n\t\t\tfor (const entry of entries) {\n\t\t\t\tfor (const method of entry.methods) {\n\t\t\t\t\tif (!methodMap.has(method)) {\n\t\t\t\t\t\tmethodMap.set(method, []);\n\t\t\t\t\t}\n\t\t\t\t\tmethodMap.get(method)!.push(entry.pluginId);\n\n\t\t\t\t\tif (methodMap.get(method)!.length > 1) {\n\t\t\t\t\t\thasConflict = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (method === \"*\" && entries.length > 1) {\n\t\t\t\t\t\thasConflict = true;\n\t\t\t\t\t} else if (method !== \"*\" && methodMap.has(\"*\")) {\n\t\t\t\t\t\thasConflict = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hasConflict) {\n\t\t\t\tconst uniquePlugins = [...new Set(entries.map((e) => e.pluginId))];\n\t\t\t\tconst conflictingMethods: string[] = [];\n\n\t\t\t\tfor (const [method, plugins] of methodMap.entries()) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tplugins.length > 1 ||\n\t\t\t\t\t\t(method === \"*\" && entries.length > 1) ||\n\t\t\t\t\t\t(method !== \"*\" && methodMap.has(\"*\"))\n\t\t\t\t\t) {\n\t\t\t\t\t\tconflictingMethods.push(method);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconflicts.push({\n\t\t\t\t\tpath,\n\t\t\t\t\tplugins: uniquePlugins,\n\t\t\t\t\tconflictingMethods,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tif (conflicts.length > 0) {\n\t\tconst conflictMessages = conflicts\n\t\t\t.map(\n\t\t\t\t(conflict) =>\n\t\t\t\t\t` - \"${conflict.path}\" [${conflict.conflictingMethods.join(\", \")}] used by plugins: ${conflict.plugins.join(\", \")}`,\n\t\t\t)\n\t\t\t.join(\"\\n\");\n\t\tlogger.error(\n\t\t\t`Endpoint path conflicts detected! Multiple plugins are trying to use the same endpoint paths with conflicting HTTP methods:\n${conflictMessages}\n\nTo resolve this, you can:\n\t1. Use only one of the conflicting plugins\n\t2. Configure the plugins to use different paths (if supported)\n\t3. Ensure plugins use different HTTP methods for the same path\n`,\n\t\t);\n\t}\n}\n\nexport function getEndpoints<Option extends BetterAuthOptions>(\n\tctx: Promise<AuthContext> | AuthContext,\n\toptions: Option,\n) {\n\tconst pluginEndpoints =\n\t\toptions.plugins?.reduce<Record<string, Endpoint>>((acc, plugin) => {\n\t\t\treturn {\n\t\t\t\t...acc,\n\t\t\t\t...plugin.endpoints,\n\t\t\t};\n\t\t}, {}) ?? {};\n\n\ttype PluginEndpoint = UnionToIntersection<\n\t\tOption[\"plugins\"] extends Array<infer T>\n\t\t\t? T extends BetterAuthPlugin\n\t\t\t\t? T extends {\n\t\t\t\t\t\tendpoints: infer E;\n\t\t\t\t\t}\n\t\t\t\t\t? E\n\t\t\t\t\t: {}\n\t\t\t\t: {}\n\t\t\t: {}\n\t>;\n\n\tconst middlewares =\n\t\toptions.plugins\n\t\t\t?.map((plugin) =>\n\t\t\t\tplugin.middlewares?.map((m) => {\n\t\t\t\t\tconst middleware = (async (context: any) => {\n\t\t\t\t\t\tconst authContext = await ctx;\n\t\t\t\t\t\treturn m.middleware({\n\t\t\t\t\t\t\t...context,\n\t\t\t\t\t\t\tcontext: {\n\t\t\t\t\t\t\t\t...authContext,\n\t\t\t\t\t\t\t\t...context.context,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}) as Middleware;\n\t\t\t\t\tmiddleware.options = m.middleware.options;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpath: m.path,\n\t\t\t\t\t\tmiddleware,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.filter((plugin) => plugin !== undefined)\n\t\t\t.flat() || [];\n\n\tconst baseEndpoints = {\n\t\tsignInSocial: signInSocial<Option>(),\n\t\tcallbackOAuth,\n\t\tgetSession: getSession<Option>(),\n\t\tsignOut,\n\t\tsignUpEmail: signUpEmail<Option>(),\n\t\tsignInEmail: signInEmail<Option>(),\n\t\tresetPassword,\n\t\tverifyEmail,\n\t\tsendVerificationEmail,\n\t\tchangeEmail,\n\t\tchangePassword,\n\t\tsetPassword,\n\t\tupdateUser: updateUser<Option>(),\n\t\tdeleteUser,\n\t\trequestPasswordReset,\n\t\trequestPasswordResetCallback,\n\t\tlistSessions: listSessions<Option>(),\n\t\trevokeSession,\n\t\trevokeSessions,\n\t\trevokeOtherSessions,\n\t\tlinkSocialAccount,\n\t\tlistUserAccounts,\n\t\tdeleteUserCallback,\n\t\tunlinkAccount,\n\t\trefreshToken,\n\t\tgetAccessToken,\n\t\taccountInfo,\n\t};\n\tconst endpoints = {\n\t\t...baseEndpoints,\n\t\t...pluginEndpoints,\n\t\tok,\n\t\terror,\n\t} as const;\n\tconst api = toAuthEndpoints(endpoints, ctx);\n\treturn {\n\t\tapi: api as typeof endpoints & PluginEndpoint,\n\t\tmiddlewares,\n\t};\n}\nexport const router = <Option extends BetterAuthOptions>(\n\tctx: AuthContext,\n\toptions: Option,\n) => {\n\tconst { api, middlewares } = getEndpoints(ctx, options);\n\tconst basePath = new URL(ctx.baseURL).pathname;\n\n\treturn createRouter(api, {\n\t\trouterContext: ctx,\n\t\topenapi: {\n\t\t\tdisabled: true,\n\t\t},\n\t\tbasePath,\n\t\trouterMiddleware: [\n\t\t\t{\n\t\t\t\tpath: \"/**\",\n\t\t\t\tmiddleware: originCheckMiddleware,\n\t\t\t},\n\t\t\t...middlewares,\n\t\t],\n\t\tallowedMediaTypes: [\"application/json\"],\n\t\tasync onRequest(req) {\n\t\t\t//handle disabled paths\n\t\t\tconst disabledPaths = ctx.options.disabledPaths || [];\n\t\t\tconst pathname = new URL(req.url).pathname.replace(/\\/+$/, \"\") || \"/\";\n\t\t\tconst normalizedPath =\n\t\t\t\tbasePath === \"/\"\n\t\t\t\t\t? pathname\n\t\t\t\t\t: pathname.startsWith(basePath)\n\t\t\t\t\t\t? pathname.slice(basePath.length).replace(/\\/+$/, \"\") || \"/\"\n\t\t\t\t\t\t: pathname;\n\t\t\tif (disabledPaths.includes(normalizedPath)) {\n\t\t\t\treturn new Response(\"Not Found\", { status: 404 });\n\t\t\t}\n\t\t\tfor (const plugin of ctx.options.plugins || []) {\n\t\t\t\tif (plugin.onRequest) {\n\t\t\t\t\tconst response = await plugin.onRequest(req, ctx);\n\t\t\t\t\tif (response && \"response\" in response) {\n\t\t\t\t\t\treturn response.response;\n\t\t\t\t\t}\n\t\t\t\t\tif (response && \"request\" in response) {\n\t\t\t\t\t\tconst rateLimitResponse = await onRequestRateLimit(\n\t\t\t\t\t\t\tresponse.request,\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (rateLimitResponse) {\n\t\t\t\t\t\t\treturn rateLimitResponse;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn response.request;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn onRequestRateLimit(req, ctx);\n\t\t},\n\t\tasync onResponse(res) {\n\t\t\tfor (const plugin of ctx.options.plugins || []) {\n\t\t\t\tif (plugin.onResponse) {\n\t\t\t\t\tconst response = await plugin.onResponse(res, ctx);\n\t\t\t\t\tif (response) {\n\t\t\t\t\t\treturn response.response;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\tonError(e) {\n\t\t\tif (e instanceof APIError && e.status === \"FOUND\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (options.onAPIError?.throw) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\tif (options.onAPIError?.onError) {\n\t\t\t\toptions.onAPIError.onError(e, ctx);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst optLogLevel = options.logger?.level;\n\t\t\tconst log =\n\t\t\t\toptLogLevel === \"error\" ||\n\t\t\t\toptLogLevel === \"warn\" ||\n\t\t\t\toptLogLevel === \"debug\"\n\t\t\t\t\t? logger\n\t\t\t\t\t: undefined;\n\t\t\tif (options.logger?.disabled !== true) {\n\t\t\t\tif (\n\t\t\t\t\te &&\n\t\t\t\t\ttypeof e === \"object\" &&\n\t\t\t\t\t\"message\" in e &&\n\t\t\t\t\ttypeof e.message === \"string\"\n\t\t\t\t) {\n\t\t\t\t\tif (\n\t\t\t\t\t\te.message.includes(\"no column\") ||\n\t\t\t\t\t\te.message.includes(\"column\") ||\n\t\t\t\t\t\te.message.includes(\"relation\") ||\n\t\t\t\t\t\te.message.includes(\"table\") ||\n\t\t\t\t\t\te.message.includes(\"does not exist\")\n\t\t\t\t\t) {\n\t\t\t\t\t\tctx.logger?.error(e.message);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (e instanceof APIError) {\n\t\t\t\t\tif (e.status === \"INTERNAL_SERVER_ERROR\") {\n\t\t\t\t\t\tctx.logger.error(e.status, e);\n\t\t\t\t\t}\n\t\t\t\t\tlog?.error(e.message);\n\t\t\t\t} else {\n\t\t\t\t\tctx.logger?.error(\n\t\t\t\t\t\te && typeof e === \"object\" && \"name\" in e ? (e.name as string) : \"\",\n\t\t\t\t\t\te,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n};\n\nexport {\n\ttype AuthEndpoint,\n\ttype AuthMiddleware,\n\tcreateAuthEndpoint,\n\tcreateAuthMiddleware,\n\toptionsMiddleware,\n} from \"@better-auth/core/api\";\nexport { APIError } from \"better-call\";\nexport { getIp } from \"../utils/get-request-ip\";\nexport * from \"./middlewares\";\nexport * from \"./routes\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAgB,uBACf,SACA,UACC;CACD,MAAM,mCAAmB,IAAI,KAG1B;AAEH,SAAQ,SAAS,SAAS,WAAW;AACpC,MAAI,OAAO,WACV;QAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QAAQ,OAAO,UAAU,CAC7D,KAAI,YAAY,UAAU,UAAU;IACnC,MAAM,OAAO,SAAS;IACtB,IAAIA,UAAoB,EAAE;AAC1B,QAAI,SAAS,WAAW,YAAY,SAAS,SAC5C;SAAI,MAAM,QAAQ,SAAS,QAAQ,OAAO,CACzC,WAAU,SAAS,QAAQ;cACjB,OAAO,SAAS,QAAQ,WAAW,SAC7C,WAAU,CAAC,SAAS,QAAQ,OAAO;;AAGrC,QAAI,QAAQ,WAAW,EACtB,WAAU,CAAC,IAAI;AAGhB,QAAI,CAAC,iBAAiB,IAAI,KAAK,CAC9B,kBAAiB,IAAI,MAAM,EAAE,CAAC;AAE/B,qBAAiB,IAAI,KAAK,CAAE,KAAK;KAChC,UAAU,OAAO;KACjB,aAAa;KACb;KACA,CAAC;;;GAIJ;CAEF,MAAMC,YAIA,EAAE;AACR,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;AAE9B,UAAK,MAAM,EAAE,QAAQ;UAErB,KAAI,QAAQ,MACX,KAAK,OAAO,MAAM,YAAY,UAAU,IAAK,EAAE,OAAkB,IACjE,EACA;;;EAIJ,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["methods: string[]","conflicts: {\n\t\tpath: string;\n\t\tplugins: string[];\n\t\tconflictingMethods: string[];\n\t}[]","conflictingMethods: string[]","APIError"],"sources":["../../src/api/index.ts"],"sourcesContent":["import type {\n\tAuthContext,\n\tBetterAuthOptions,\n\tBetterAuthPlugin,\n} from \"@better-auth/core\";\nimport type { InternalLogger } from \"@better-auth/core/env\";\nimport { logger } from \"@better-auth/core/env\";\nimport type { Endpoint, Middleware } from \"better-call\";\nimport { APIError, createRouter } from \"better-call\";\nimport type { UnionToIntersection } from \"../types/helper\";\nimport { originCheckMiddleware } from \"./middlewares\";\nimport { onRequestRateLimit } from \"./rate-limiter\";\nimport {\n\taccountInfo,\n\tcallbackOAuth,\n\tchangeEmail,\n\tchangePassword,\n\tdeleteUser,\n\tdeleteUserCallback,\n\terror,\n\tgetAccessToken,\n\tgetSession,\n\tlinkSocialAccount,\n\tlistSessions,\n\tlistUserAccounts,\n\tok,\n\trefreshToken,\n\trequestPasswordReset,\n\trequestPasswordResetCallback,\n\tresetPassword,\n\trevokeOtherSessions,\n\trevokeSession,\n\trevokeSessions,\n\tsendVerificationEmail,\n\tsetPassword,\n\tsignInEmail,\n\tsignInSocial,\n\tsignOut,\n\tsignUpEmail,\n\tunlinkAccount,\n\tupdateUser,\n\tverifyEmail,\n} from \"./routes\";\nimport { toAuthEndpoints } from \"./to-auth-endpoints\";\n\nexport function checkEndpointConflicts(\n\toptions: BetterAuthOptions,\n\tlogger: InternalLogger,\n) {\n\tconst endpointRegistry = new Map<\n\t\tstring,\n\t\t{ pluginId: string; endpointKey: string; methods: string[] }[]\n\t>();\n\n\toptions.plugins?.forEach((plugin) => {\n\t\tif (plugin.endpoints) {\n\t\t\tfor (const [key, endpoint] of Object.entries(plugin.endpoints)) {\n\t\t\t\tif (\n\t\t\t\t\tendpoint &&\n\t\t\t\t\t\"path\" in endpoint &&\n\t\t\t\t\ttypeof endpoint.path === \"string\"\n\t\t\t\t) {\n\t\t\t\t\tconst path = endpoint.path;\n\t\t\t\t\tlet methods: string[] = [];\n\t\t\t\t\tif (endpoint.options && \"method\" in endpoint.options) {\n\t\t\t\t\t\tif (Array.isArray(endpoint.options.method)) {\n\t\t\t\t\t\t\tmethods = endpoint.options.method;\n\t\t\t\t\t\t} else if (typeof endpoint.options.method === \"string\") {\n\t\t\t\t\t\t\tmethods = [endpoint.options.method];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (methods.length === 0) {\n\t\t\t\t\t\tmethods = [\"*\"];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!endpointRegistry.has(path)) {\n\t\t\t\t\t\tendpointRegistry.set(path, []);\n\t\t\t\t\t}\n\t\t\t\t\tendpointRegistry.get(path)!.push({\n\t\t\t\t\t\tpluginId: plugin.id,\n\t\t\t\t\t\tendpointKey: key,\n\t\t\t\t\t\tmethods,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tconst conflicts: {\n\t\tpath: string;\n\t\tplugins: string[];\n\t\tconflictingMethods: string[];\n\t}[] = [];\n\tfor (const [path, entries] of endpointRegistry.entries()) {\n\t\tif (entries.length > 1) {\n\t\t\tconst methodMap = new Map<string, string[]>();\n\t\t\tlet hasConflict = false;\n\n\t\t\tfor (const entry of entries) {\n\t\t\t\tfor (const method of entry.methods) {\n\t\t\t\t\tif (!methodMap.has(method)) {\n\t\t\t\t\t\tmethodMap.set(method, []);\n\t\t\t\t\t}\n\t\t\t\t\tmethodMap.get(method)!.push(entry.pluginId);\n\n\t\t\t\t\tif (methodMap.get(method)!.length > 1) {\n\t\t\t\t\t\thasConflict = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (method === \"*\" && entries.length > 1) {\n\t\t\t\t\t\thasConflict = true;\n\t\t\t\t\t} else if (method !== \"*\" && methodMap.has(\"*\")) {\n\t\t\t\t\t\thasConflict = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hasConflict) {\n\t\t\t\tconst uniquePlugins = [...new Set(entries.map((e) => e.pluginId))];\n\t\t\t\tconst conflictingMethods: string[] = [];\n\n\t\t\t\tfor (const [method, plugins] of methodMap.entries()) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tplugins.length > 1 ||\n\t\t\t\t\t\t(method === \"*\" && entries.length > 1) ||\n\t\t\t\t\t\t(method !== \"*\" && methodMap.has(\"*\"))\n\t\t\t\t\t) {\n\t\t\t\t\t\tconflictingMethods.push(method);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconflicts.push({\n\t\t\t\t\tpath,\n\t\t\t\t\tplugins: uniquePlugins,\n\t\t\t\t\tconflictingMethods,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tif (conflicts.length > 0) {\n\t\tconst conflictMessages = conflicts\n\t\t\t.map(\n\t\t\t\t(conflict) =>\n\t\t\t\t\t` - \"${conflict.path}\" [${conflict.conflictingMethods.join(\", \")}] used by plugins: ${conflict.plugins.join(\", \")}`,\n\t\t\t)\n\t\t\t.join(\"\\n\");\n\t\tlogger.error(\n\t\t\t`Endpoint path conflicts detected! Multiple plugins are trying to use the same endpoint paths with conflicting HTTP methods:\n${conflictMessages}\n\nTo resolve this, you can:\n\t1. Use only one of the conflicting plugins\n\t2. Configure the plugins to use different paths (if supported)\n\t3. Ensure plugins use different HTTP methods for the same path\n`,\n\t\t);\n\t}\n}\n\nexport function getEndpoints<Option extends BetterAuthOptions>(\n\tctx: Promise<AuthContext> | AuthContext,\n\toptions: Option,\n) {\n\tconst pluginEndpoints =\n\t\toptions.plugins?.reduce<Record<string, Endpoint>>((acc, plugin) => {\n\t\t\treturn {\n\t\t\t\t...acc,\n\t\t\t\t...plugin.endpoints,\n\t\t\t};\n\t\t}, {}) ?? {};\n\n\ttype PluginEndpoint = UnionToIntersection<\n\t\tOption[\"plugins\"] extends Array<infer T>\n\t\t\t? T extends BetterAuthPlugin\n\t\t\t\t? T extends {\n\t\t\t\t\t\tendpoints: infer E;\n\t\t\t\t\t}\n\t\t\t\t\t? E\n\t\t\t\t\t: {}\n\t\t\t\t: {}\n\t\t\t: {}\n\t>;\n\n\tconst middlewares =\n\t\toptions.plugins\n\t\t\t?.map((plugin) =>\n\t\t\t\tplugin.middlewares?.map((m) => {\n\t\t\t\t\tconst middleware = (async (context: any) => {\n\t\t\t\t\t\tconst authContext = await ctx;\n\t\t\t\t\t\treturn m.middleware({\n\t\t\t\t\t\t\t...context,\n\t\t\t\t\t\t\tcontext: {\n\t\t\t\t\t\t\t\t...authContext,\n\t\t\t\t\t\t\t\t...context.context,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}) as Middleware;\n\t\t\t\t\tmiddleware.options = m.middleware.options;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpath: m.path,\n\t\t\t\t\t\tmiddleware,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.filter((plugin) => plugin !== undefined)\n\t\t\t.flat() || [];\n\n\tconst baseEndpoints = {\n\t\tsignInSocial: signInSocial<Option>(),\n\t\tcallbackOAuth,\n\t\tgetSession: getSession<Option>(),\n\t\tsignOut,\n\t\tsignUpEmail: signUpEmail<Option>(),\n\t\tsignInEmail: signInEmail<Option>(),\n\t\tresetPassword,\n\t\tverifyEmail,\n\t\tsendVerificationEmail,\n\t\tchangeEmail,\n\t\tchangePassword,\n\t\tsetPassword,\n\t\tupdateUser: updateUser<Option>(),\n\t\tdeleteUser,\n\t\trequestPasswordReset,\n\t\trequestPasswordResetCallback,\n\t\tlistSessions: listSessions<Option>(),\n\t\trevokeSession,\n\t\trevokeSessions,\n\t\trevokeOtherSessions,\n\t\tlinkSocialAccount,\n\t\tlistUserAccounts,\n\t\tdeleteUserCallback,\n\t\tunlinkAccount,\n\t\trefreshToken,\n\t\tgetAccessToken,\n\t\taccountInfo,\n\t};\n\tconst endpoints = {\n\t\t...baseEndpoints,\n\t\t...pluginEndpoints,\n\t\tok,\n\t\terror,\n\t} as const;\n\tconst api = toAuthEndpoints(endpoints, ctx);\n\treturn {\n\t\tapi: api as typeof endpoints & PluginEndpoint,\n\t\tmiddlewares,\n\t};\n}\nexport const router = <Option extends BetterAuthOptions>(\n\tctx: AuthContext,\n\toptions: Option,\n) => {\n\tconst { api, middlewares } = getEndpoints(ctx, options);\n\tconst basePath = new URL(ctx.baseURL).pathname;\n\n\treturn createRouter(api, {\n\t\trouterContext: ctx,\n\t\topenapi: {\n\t\t\tdisabled: true,\n\t\t},\n\t\tbasePath,\n\t\trouterMiddleware: [\n\t\t\t{\n\t\t\t\tpath: \"/**\",\n\t\t\t\tmiddleware: originCheckMiddleware,\n\t\t\t},\n\t\t\t...middlewares,\n\t\t],\n\t\tallowedMediaTypes: [\"application/json\"],\n\t\tasync onRequest(req) {\n\t\t\t//handle disabled paths\n\t\t\tconst disabledPaths = ctx.options.disabledPaths || [];\n\t\t\tconst pathname = new URL(req.url).pathname.replace(/\\/+$/, \"\") || \"/\";\n\t\t\tconst normalizedPath =\n\t\t\t\tbasePath === \"/\"\n\t\t\t\t\t? pathname\n\t\t\t\t\t: pathname.startsWith(basePath)\n\t\t\t\t\t\t? pathname.slice(basePath.length).replace(/\\/+$/, \"\") || \"/\"\n\t\t\t\t\t\t: pathname;\n\t\t\tif (disabledPaths.includes(normalizedPath)) {\n\t\t\t\treturn new Response(\"Not Found\", { status: 404 });\n\t\t\t}\n\t\t\tfor (const plugin of ctx.options.plugins || []) {\n\t\t\t\tif (plugin.onRequest) {\n\t\t\t\t\tconst response = await plugin.onRequest(req, ctx);\n\t\t\t\t\tif (response && \"response\" in response) {\n\t\t\t\t\t\treturn response.response;\n\t\t\t\t\t}\n\t\t\t\t\tif (response && \"request\" in response) {\n\t\t\t\t\t\tconst rateLimitResponse = await onRequestRateLimit(\n\t\t\t\t\t\t\tresponse.request,\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (rateLimitResponse) {\n\t\t\t\t\t\t\treturn rateLimitResponse;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn response.request;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn onRequestRateLimit(req, ctx);\n\t\t},\n\t\tasync onResponse(res) {\n\t\t\tfor (const plugin of ctx.options.plugins || []) {\n\t\t\t\tif (plugin.onResponse) {\n\t\t\t\t\tconst response = await plugin.onResponse(res, ctx);\n\t\t\t\t\tif (response) {\n\t\t\t\t\t\treturn response.response;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\tonError(e) {\n\t\t\tif (e instanceof APIError && e.status === \"FOUND\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (options.onAPIError?.throw) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\tif (options.onAPIError?.onError) {\n\t\t\t\toptions.onAPIError.onError(e, ctx);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst optLogLevel = options.logger?.level;\n\t\t\tconst log =\n\t\t\t\toptLogLevel === \"error\" ||\n\t\t\t\toptLogLevel === \"warn\" ||\n\t\t\t\toptLogLevel === \"debug\"\n\t\t\t\t\t? logger\n\t\t\t\t\t: undefined;\n\t\t\tif (options.logger?.disabled !== true) {\n\t\t\t\tif (\n\t\t\t\t\te &&\n\t\t\t\t\ttypeof e === \"object\" &&\n\t\t\t\t\t\"message\" in e &&\n\t\t\t\t\ttypeof e.message === \"string\"\n\t\t\t\t) {\n\t\t\t\t\tif (\n\t\t\t\t\t\te.message.includes(\"no column\") ||\n\t\t\t\t\t\te.message.includes(\"column\") ||\n\t\t\t\t\t\te.message.includes(\"relation\") ||\n\t\t\t\t\t\te.message.includes(\"table\") ||\n\t\t\t\t\t\te.message.includes(\"does not exist\")\n\t\t\t\t\t) {\n\t\t\t\t\t\tctx.logger?.error(e.message);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (e instanceof APIError) {\n\t\t\t\t\tif (e.status === \"INTERNAL_SERVER_ERROR\") {\n\t\t\t\t\t\tctx.logger.error(e.status, e);\n\t\t\t\t\t}\n\t\t\t\t\tlog?.error(e.message);\n\t\t\t\t} else {\n\t\t\t\t\tctx.logger?.error(\n\t\t\t\t\t\te && typeof e === \"object\" && \"name\" in e ? (e.name as string) : \"\",\n\t\t\t\t\t\te,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n};\n\nexport {\n\ttype AuthEndpoint,\n\ttype AuthMiddleware,\n\tcreateAuthEndpoint,\n\tcreateAuthMiddleware,\n\toptionsMiddleware,\n} from \"@better-auth/core/api\";\nexport { APIError } from \"better-call\";\nexport { getIp } from \"../utils/get-request-ip\";\nexport * from \"./middlewares\";\nexport * from \"./routes\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAgB,uBACf,SACA,UACC;CACD,MAAM,mCAAmB,IAAI,KAG1B;AAEH,SAAQ,SAAS,SAAS,WAAW;AACpC,MAAI,OAAO,WACV;QAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QAAQ,OAAO,UAAU,CAC7D,KACC,YACA,UAAU,YACV,OAAO,SAAS,SAAS,UACxB;IACD,MAAM,OAAO,SAAS;IACtB,IAAIA,UAAoB,EAAE;AAC1B,QAAI,SAAS,WAAW,YAAY,SAAS,SAC5C;SAAI,MAAM,QAAQ,SAAS,QAAQ,OAAO,CACzC,WAAU,SAAS,QAAQ;cACjB,OAAO,SAAS,QAAQ,WAAW,SAC7C,WAAU,CAAC,SAAS,QAAQ,OAAO;;AAGrC,QAAI,QAAQ,WAAW,EACtB,WAAU,CAAC,IAAI;AAGhB,QAAI,CAAC,iBAAiB,IAAI,KAAK,CAC9B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AS,iBAAiB,EACnC;AACD,UAAI,QAAQ,MAAM,EAAE,QAAQ;AAC5B;;;AAIF,QAAI,aAAaA,YAAU;AAC1B,SAAI,EAAE,WAAW,wBAChB,KAAI,OAAO,MAAM,EAAE,QAAQ,EAAE;AAE9B,UAAK,MAAM,EAAE,QAAQ;UAErB,KAAI,QAAQ,MACX,KAAK,OAAO,MAAM,YAAY,UAAU,IAAK,EAAE,OAAkB,IACjE,EACA;;;EAIJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { GenericEndpointContext } from "@better-auth/core";
2
- import * as better_call936 from "better-call";
2
+ import * as better_call762 from "better-call";
3
3
 
4
4
  //#region src/api/middlewares/origin-check.d.ts
5
5
 
@@ -7,8 +7,8 @@ import * as better_call936 from "better-call";
7
7
  * A middleware to validate callbackURL and origin against
8
8
  * trustedOrigins.
9
9
  */
10
- declare const originCheckMiddleware: (inputContext: better_call936.MiddlewareInputContext<better_call936.MiddlewareOptions>) => Promise<void>;
11
- declare const originCheck: (getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_call936.MiddlewareInputContext<better_call936.MiddlewareOptions>) => Promise<void>;
10
+ declare const originCheckMiddleware: (inputContext: better_call762.MiddlewareInputContext<better_call762.MiddlewareOptions>) => Promise<void>;
11
+ declare const originCheck: (getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_call762.MiddlewareInputContext<better_call762.MiddlewareOptions>) => Promise<void>;
12
12
  //#endregion
13
13
  export { originCheck, originCheckMiddleware };
14
14
  //# sourceMappingURL=origin-check.d.mts.map
@@ -1,11 +1,11 @@
1
1
  import * as _better_auth_core_oauth28 from "@better-auth/core/oauth2";
2
2
  import * as z from "zod";
3
- import * as better_call889 from "better-call";
3
+ import * as better_call694 from "better-call";
4
4
 
5
5
  //#region src/api/routes/account.d.ts
6
- declare const listUserAccounts: better_call889.StrictEndpoint<"/list-accounts", {
6
+ declare const listUserAccounts: better_call694.StrictEndpoint<"/list-accounts", {
7
7
  method: "GET";
8
- use: ((inputContext: better_call889.MiddlewareInputContext<better_call889.MiddlewareOptions>) => Promise<{
8
+ use: ((inputContext: better_call694.MiddlewareInputContext<better_call694.MiddlewareOptions>) => Promise<{
9
9
  session: {
10
10
  session: Record<string, any> & {
11
11
  id: string;
@@ -87,7 +87,7 @@ declare const listUserAccounts: better_call889.StrictEndpoint<"/list-accounts",
87
87
  userId: string;
88
88
  scopes: string[];
89
89
  }[]>;
90
- declare const linkSocialAccount: better_call889.StrictEndpoint<"/link-social", {
90
+ declare const linkSocialAccount: better_call694.StrictEndpoint<"/link-social", {
91
91
  method: "POST";
92
92
  requireHeaders: true;
93
93
  body: z.ZodObject<{
@@ -106,7 +106,7 @@ declare const linkSocialAccount: better_call889.StrictEndpoint<"/link-social", {
106
106
  disableRedirect: z.ZodOptional<z.ZodBoolean>;
107
107
  additionalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
108
108
  }, z.core.$strip>;
109
- use: ((inputContext: better_call889.MiddlewareInputContext<better_call889.MiddlewareOptions>) => Promise<{
109
+ use: ((inputContext: better_call694.MiddlewareInputContext<better_call694.MiddlewareOptions>) => Promise<{
110
110
  session: {
111
111
  session: Record<string, any> & {
112
112
  id: string;
@@ -165,13 +165,13 @@ declare const linkSocialAccount: better_call889.StrictEndpoint<"/link-social", {
165
165
  url: string;
166
166
  redirect: boolean;
167
167
  }>;
168
- declare const unlinkAccount: better_call889.StrictEndpoint<"/unlink-account", {
168
+ declare const unlinkAccount: better_call694.StrictEndpoint<"/unlink-account", {
169
169
  method: "POST";
170
170
  body: z.ZodObject<{
171
171
  providerId: z.ZodString;
172
172
  accountId: z.ZodOptional<z.ZodString>;
173
173
  }, z.core.$strip>;
174
- use: ((inputContext: better_call889.MiddlewareInputContext<better_call889.MiddlewareOptions>) => Promise<{
174
+ use: ((inputContext: better_call694.MiddlewareInputContext<better_call694.MiddlewareOptions>) => Promise<{
175
175
  session: {
176
176
  session: Record<string, any> & {
177
177
  id: string;
@@ -219,7 +219,7 @@ declare const unlinkAccount: better_call889.StrictEndpoint<"/unlink-account", {
219
219
  }, {
220
220
  status: boolean;
221
221
  }>;
222
- declare const getAccessToken: better_call889.StrictEndpoint<"/get-access-token", {
222
+ declare const getAccessToken: better_call694.StrictEndpoint<"/get-access-token", {
223
223
  method: "POST";
224
224
  body: z.ZodObject<{
225
225
  providerId: z.ZodString;
@@ -274,7 +274,7 @@ declare const getAccessToken: better_call889.StrictEndpoint<"/get-access-token",
274
274
  scopes: string[];
275
275
  idToken: string | undefined;
276
276
  }>;
277
- declare const refreshToken: better_call889.StrictEndpoint<"/refresh-token", {
277
+ declare const refreshToken: better_call694.StrictEndpoint<"/refresh-token", {
278
278
  method: "POST";
279
279
  body: z.ZodObject<{
280
280
  providerId: z.ZodString;
@@ -333,9 +333,9 @@ declare const refreshToken: better_call889.StrictEndpoint<"/refresh-token", {
333
333
  providerId: string;
334
334
  accountId: string;
335
335
  }>;
336
- declare const accountInfo: better_call889.StrictEndpoint<"/account-info", {
336
+ declare const accountInfo: better_call694.StrictEndpoint<"/account-info", {
337
337
  method: "GET";
338
- use: ((inputContext: better_call889.MiddlewareInputContext<better_call889.MiddlewareOptions>) => Promise<{
338
+ use: ((inputContext: better_call694.MiddlewareInputContext<better_call694.MiddlewareOptions>) => Promise<{
339
339
  session: {
340
340
  session: Record<string, any> & {
341
341
  id: string;
@@ -1,8 +1,8 @@
1
1
  import * as z from "zod";
2
- import * as better_call904 from "better-call";
2
+ import * as better_call693 from "better-call";
3
3
 
4
4
  //#region src/api/routes/callback.d.ts
5
- declare const callbackOAuth: better_call904.StrictEndpoint<"/callback/:id", {
5
+ declare const callbackOAuth: better_call693.StrictEndpoint<"/callback/:id", {
6
6
  method: ("GET" | "POST")[];
7
7
  operationId: string;
8
8
  body: z.ZodOptional<z.ZodObject<{
@@ -2,7 +2,7 @@ import { User } from "../../types/models.mjs";
2
2
  import "../../types/index.mjs";
3
3
  import { GenericEndpointContext } from "@better-auth/core";
4
4
  import * as z from "zod";
5
- import * as better_call867 from "better-call";
5
+ import * as better_call757 from "better-call";
6
6
 
7
7
  //#region src/api/routes/email-verification.d.ts
8
8
  declare function createEmailVerificationToken(secret: string, email: string,
@@ -22,7 +22,7 @@ extraPayload?: Record<string, any>): Promise<string>;
22
22
  * A function to send a verification email to the user
23
23
  */
24
24
  declare function sendVerificationEmailFn(ctx: GenericEndpointContext, user: User): Promise<void>;
25
- declare const sendVerificationEmail: better_call867.StrictEndpoint<"/send-verification-email", {
25
+ declare const sendVerificationEmail: better_call757.StrictEndpoint<"/send-verification-email", {
26
26
  method: "POST";
27
27
  operationId: string;
28
28
  body: z.ZodObject<{
@@ -97,14 +97,14 @@ declare const sendVerificationEmail: better_call867.StrictEndpoint<"/send-verifi
97
97
  }, {
98
98
  status: boolean;
99
99
  }>;
100
- declare const verifyEmail: better_call867.StrictEndpoint<"/verify-email", {
100
+ declare const verifyEmail: better_call757.StrictEndpoint<"/verify-email", {
101
101
  method: "GET";
102
102
  operationId: string;
103
103
  query: z.ZodObject<{
104
104
  token: z.ZodString;
105
105
  callbackURL: z.ZodOptional<z.ZodString>;
106
106
  }, z.core.$strip>;
107
- use: ((inputContext: better_call867.MiddlewareInputContext<better_call867.MiddlewareOptions>) => Promise<void>)[];
107
+ use: ((inputContext: better_call757.MiddlewareInputContext<better_call757.MiddlewareOptions>) => Promise<void>)[];
108
108
  metadata: {
109
109
  openapi: {
110
110
  description: string;
@@ -1,7 +1,7 @@
1
- import * as better_call903 from "better-call";
1
+ import * as better_call750 from "better-call";
2
2
 
3
3
  //#region src/api/routes/error.d.ts
4
- declare const error: better_call903.StrictEndpoint<"/error", {
4
+ declare const error: better_call750.StrictEndpoint<"/error", {
5
5
  method: "GET";
6
6
  metadata: {
7
7
  openapi: {
@@ -1,7 +1,7 @@
1
- import * as better_call905 from "better-call";
1
+ import * as better_call761 from "better-call";
2
2
 
3
3
  //#region src/api/routes/ok.d.ts
4
- declare const ok: better_call905.StrictEndpoint<"/ok", {
4
+ declare const ok: better_call761.StrictEndpoint<"/ok", {
5
5
  method: "GET";
6
6
  metadata: {
7
7
  openapi: {
@@ -1,8 +1,8 @@
1
1
  import * as z from "zod";
2
- import * as better_call909 from "better-call";
2
+ import * as better_call752 from "better-call";
3
3
 
4
4
  //#region src/api/routes/reset-password.d.ts
5
- declare const requestPasswordReset: better_call909.StrictEndpoint<"/request-password-reset", {
5
+ declare const requestPasswordReset: better_call752.StrictEndpoint<"/request-password-reset", {
6
6
  method: "POST";
7
7
  body: z.ZodObject<{
8
8
  email: z.ZodEmail;
@@ -38,13 +38,13 @@ declare const requestPasswordReset: better_call909.StrictEndpoint<"/request-pass
38
38
  status: boolean;
39
39
  message: string;
40
40
  }>;
41
- declare const requestPasswordResetCallback: better_call909.StrictEndpoint<"/reset-password/:token", {
41
+ declare const requestPasswordResetCallback: better_call752.StrictEndpoint<"/reset-password/:token", {
42
42
  method: "GET";
43
43
  operationId: string;
44
44
  query: z.ZodObject<{
45
45
  callbackURL: z.ZodString;
46
46
  }, z.core.$strip>;
47
- use: ((inputContext: better_call909.MiddlewareInputContext<better_call909.MiddlewareOptions>) => Promise<void>)[];
47
+ use: ((inputContext: better_call752.MiddlewareInputContext<better_call752.MiddlewareOptions>) => Promise<void>)[];
48
48
  metadata: {
49
49
  openapi: {
50
50
  operationId: string;
@@ -86,7 +86,7 @@ declare const requestPasswordResetCallback: better_call909.StrictEndpoint<"/rese
86
86
  };
87
87
  };
88
88
  }, never>;
89
- declare const resetPassword: better_call909.StrictEndpoint<"/reset-password", {
89
+ declare const resetPassword: better_call752.StrictEndpoint<"/reset-password", {
90
90
  method: "POST";
91
91
  operationId: string;
92
92
  query: z.ZodOptional<z.ZodObject<{
@@ -3,10 +3,10 @@ import { InferSession, InferUser, Session, User } from "../../types/models.mjs";
3
3
  import "../../types/index.mjs";
4
4
  import { BetterAuthOptions, GenericEndpointContext } from "@better-auth/core";
5
5
  import * as z from "zod";
6
- import * as better_call915 from "better-call";
6
+ import * as better_call728 from "better-call";
7
7
 
8
8
  //#region src/api/routes/session.d.ts
9
- declare const getSession: <Option extends BetterAuthOptions>() => better_call915.StrictEndpoint<"/get-session", {
9
+ declare const getSession: <Option extends BetterAuthOptions>() => better_call728.StrictEndpoint<"/get-session", {
10
10
  method: "GET";
11
11
  operationId: string;
12
12
  query: z.ZodOptional<z.ZodObject<{
@@ -56,7 +56,7 @@ declare const getSessionFromCtx: <U extends Record<string, any> = Record<string,
56
56
  /**
57
57
  * The middleware forces the endpoint to require a valid session.
58
58
  */
59
- declare const sessionMiddleware: (inputContext: better_call915.MiddlewareInputContext<better_call915.MiddlewareOptions>) => Promise<{
59
+ declare const sessionMiddleware: (inputContext: better_call728.MiddlewareInputContext<better_call728.MiddlewareOptions>) => Promise<{
60
60
  session: {
61
61
  session: Record<string, any> & {
62
62
  id: string;
@@ -84,7 +84,7 @@ declare const sessionMiddleware: (inputContext: better_call915.MiddlewareInputCo
84
84
  * This should be used for sensitive operations like password changes, account deletion, etc.
85
85
  * to ensure that revoked sessions cannot be used even if they're still cached in cookies.
86
86
  */
87
- declare const sensitiveSessionMiddleware: (inputContext: better_call915.MiddlewareInputContext<better_call915.MiddlewareOptions>) => Promise<{
87
+ declare const sensitiveSessionMiddleware: (inputContext: better_call728.MiddlewareInputContext<better_call728.MiddlewareOptions>) => Promise<{
88
88
  session: {
89
89
  session: Record<string, any> & {
90
90
  id: string;
@@ -111,7 +111,7 @@ declare const sensitiveSessionMiddleware: (inputContext: better_call915.Middlewa
111
111
  * This middleware allows you to call the endpoint on the client if session is valid.
112
112
  * However, if called on the server, no session is required.
113
113
  */
114
- declare const requestOnlySessionMiddleware: (inputContext: better_call915.MiddlewareInputContext<better_call915.MiddlewareOptions>) => Promise<{
114
+ declare const requestOnlySessionMiddleware: (inputContext: better_call728.MiddlewareInputContext<better_call728.MiddlewareOptions>) => Promise<{
115
115
  session: {
116
116
  session: Record<string, any> & {
117
117
  id: string;
@@ -141,7 +141,7 @@ declare const requestOnlySessionMiddleware: (inputContext: better_call915.Middle
141
141
  * Session freshness check will be skipped if the session config's freshAge
142
142
  * is set to 0
143
143
  */
144
- declare const freshSessionMiddleware: (inputContext: better_call915.MiddlewareInputContext<better_call915.MiddlewareOptions>) => Promise<{
144
+ declare const freshSessionMiddleware: (inputContext: better_call728.MiddlewareInputContext<better_call728.MiddlewareOptions>) => Promise<{
145
145
  session: {
146
146
  session: Record<string, any> & {
147
147
  id: string;
@@ -167,10 +167,10 @@ declare const freshSessionMiddleware: (inputContext: better_call915.MiddlewareIn
167
167
  /**
168
168
  * user active sessions list
169
169
  */
170
- declare const listSessions: <Option extends BetterAuthOptions>() => better_call915.StrictEndpoint<"/list-sessions", {
170
+ declare const listSessions: <Option extends BetterAuthOptions>() => better_call728.StrictEndpoint<"/list-sessions", {
171
171
  method: "GET";
172
172
  operationId: string;
173
- use: ((inputContext: better_call915.MiddlewareInputContext<better_call915.MiddlewareOptions>) => Promise<{
173
+ use: ((inputContext: better_call728.MiddlewareInputContext<better_call728.MiddlewareOptions>) => Promise<{
174
174
  session: {
175
175
  session: Record<string, any> & {
176
176
  id: string;
@@ -221,12 +221,12 @@ declare const listSessions: <Option extends BetterAuthOptions>() => better_call9
221
221
  /**
222
222
  * revoke a single session
223
223
  */
224
- declare const revokeSession: better_call915.StrictEndpoint<"/revoke-session", {
224
+ declare const revokeSession: better_call728.StrictEndpoint<"/revoke-session", {
225
225
  method: "POST";
226
226
  body: z.ZodObject<{
227
227
  token: z.ZodString;
228
228
  }, z.core.$strip>;
229
- use: ((inputContext: better_call915.MiddlewareInputContext<better_call915.MiddlewareOptions>) => Promise<{
229
+ use: ((inputContext: better_call728.MiddlewareInputContext<better_call728.MiddlewareOptions>) => Promise<{
230
230
  session: {
231
231
  session: Record<string, any> & {
232
232
  id: string;
@@ -296,9 +296,9 @@ declare const revokeSession: better_call915.StrictEndpoint<"/revoke-session", {
296
296
  /**
297
297
  * revoke all user sessions
298
298
  */
299
- declare const revokeSessions: better_call915.StrictEndpoint<"/revoke-sessions", {
299
+ declare const revokeSessions: better_call728.StrictEndpoint<"/revoke-sessions", {
300
300
  method: "POST";
301
- use: ((inputContext: better_call915.MiddlewareInputContext<better_call915.MiddlewareOptions>) => Promise<{
301
+ use: ((inputContext: better_call728.MiddlewareInputContext<better_call728.MiddlewareOptions>) => Promise<{
302
302
  session: {
303
303
  session: Record<string, any> & {
304
304
  id: string;
@@ -349,10 +349,10 @@ declare const revokeSessions: better_call915.StrictEndpoint<"/revoke-sessions",
349
349
  }, {
350
350
  status: boolean;
351
351
  }>;
352
- declare const revokeOtherSessions: better_call915.StrictEndpoint<"/revoke-other-sessions", {
352
+ declare const revokeOtherSessions: better_call728.StrictEndpoint<"/revoke-other-sessions", {
353
353
  method: "POST";
354
354
  requireHeaders: true;
355
- use: ((inputContext: better_call915.MiddlewareInputContext<better_call915.MiddlewareOptions>) => Promise<{
355
+ use: ((inputContext: better_call728.MiddlewareInputContext<better_call728.MiddlewareOptions>) => Promise<{
356
356
  session: {
357
357
  session: Record<string, any> & {
358
358
  id: string;
@@ -2,7 +2,7 @@ import { InferUser } from "../../types/models.mjs";
2
2
  import "../../types/index.mjs";
3
3
  import { BetterAuthOptions } from "@better-auth/core";
4
4
  import * as z from "zod";
5
- import * as better_call906 from "better-call";
5
+ import * as better_call708 from "better-call";
6
6
 
7
7
  //#region src/api/routes/sign-in.d.ts
8
8
  declare const socialSignInBodySchema: z.ZodObject<{
@@ -23,7 +23,7 @@ declare const socialSignInBodySchema: z.ZodObject<{
23
23
  loginHint: z.ZodOptional<z.ZodString>;
24
24
  additionalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
25
25
  }, z.core.$strip>;
26
- declare const signInSocial: <O extends BetterAuthOptions>() => better_call906.StrictEndpoint<"/sign-in/social", {
26
+ declare const signInSocial: <O extends BetterAuthOptions>() => better_call708.StrictEndpoint<"/sign-in/social", {
27
27
  method: "POST";
28
28
  operationId: string;
29
29
  body: z.ZodObject<{
@@ -98,7 +98,7 @@ declare const signInSocial: <O extends BetterAuthOptions>() => better_call906.St
98
98
  url: undefined;
99
99
  user: InferUser<O>;
100
100
  }>;
101
- declare const signInEmail: <O extends BetterAuthOptions>() => better_call906.StrictEndpoint<"/sign-in/email", {
101
+ declare const signInEmail: <O extends BetterAuthOptions>() => better_call708.StrictEndpoint<"/sign-in/email", {
102
102
  method: "POST";
103
103
  operationId: string;
104
104
  body: z.ZodObject<{
@@ -1,7 +1,7 @@
1
- import * as better_call908 from "better-call";
1
+ import * as better_call749 from "better-call";
2
2
 
3
3
  //#region src/api/routes/sign-out.d.ts
4
- declare const signOut: better_call908.StrictEndpoint<"/sign-out", {
4
+ declare const signOut: better_call749.StrictEndpoint<"/sign-out", {
5
5
  method: "POST";
6
6
  operationId: string;
7
7
  requireHeaders: true;
@@ -2,10 +2,10 @@ import { AdditionalUserFieldsInput, InferUser } from "../../types/models.mjs";
2
2
  import "../../types/index.mjs";
3
3
  import { BetterAuthOptions } from "@better-auth/core";
4
4
  import * as z from "zod";
5
- import * as better_call914 from "better-call";
5
+ import * as better_call751 from "better-call";
6
6
 
7
7
  //#region src/api/routes/sign-up.d.ts
8
- declare const signUpEmail: <O extends BetterAuthOptions>() => better_call914.StrictEndpoint<"/sign-up/email", {
8
+ declare const signUpEmail: <O extends BetterAuthOptions>() => better_call751.StrictEndpoint<"/sign-up/email", {
9
9
  method: "POST";
10
10
  operationId: string;
11
11
  body: z.ZodRecord<z.ZodString, z.ZodAny>;
@@ -2,14 +2,14 @@ import { AdditionalUserFieldsInput } from "../../types/models.mjs";
2
2
  import "../../types/index.mjs";
3
3
  import { BetterAuthOptions } from "@better-auth/core";
4
4
  import * as z from "zod";
5
- import * as better_call871 from "better-call";
5
+ import * as better_call710 from "better-call";
6
6
 
7
7
  //#region src/api/routes/update-user.d.ts
8
- declare const updateUser: <O extends BetterAuthOptions>() => better_call871.StrictEndpoint<"/update-user", {
8
+ declare const updateUser: <O extends BetterAuthOptions>() => better_call710.StrictEndpoint<"/update-user", {
9
9
  method: "POST";
10
10
  operationId: string;
11
11
  body: z.ZodRecord<z.ZodString, z.ZodAny>;
12
- use: ((inputContext: better_call871.MiddlewareInputContext<better_call871.MiddlewareOptions>) => Promise<{
12
+ use: ((inputContext: better_call710.MiddlewareInputContext<better_call710.MiddlewareOptions>) => Promise<{
13
13
  session: {
14
14
  session: Record<string, any> & {
15
15
  id: string;
@@ -85,7 +85,7 @@ declare const updateUser: <O extends BetterAuthOptions>() => better_call871.Stri
85
85
  }, {
86
86
  status: boolean;
87
87
  }>;
88
- declare const changePassword: better_call871.StrictEndpoint<"/change-password", {
88
+ declare const changePassword: better_call710.StrictEndpoint<"/change-password", {
89
89
  method: "POST";
90
90
  operationId: string;
91
91
  body: z.ZodObject<{
@@ -93,7 +93,7 @@ declare const changePassword: better_call871.StrictEndpoint<"/change-password",
93
93
  currentPassword: z.ZodString;
94
94
  revokeOtherSessions: z.ZodOptional<z.ZodBoolean>;
95
95
  }, z.core.$strip>;
96
- use: ((inputContext: better_call871.MiddlewareInputContext<better_call871.MiddlewareOptions>) => Promise<{
96
+ use: ((inputContext: better_call710.MiddlewareInputContext<better_call710.MiddlewareOptions>) => Promise<{
97
97
  session: {
98
98
  session: Record<string, any> & {
99
99
  id: string;
@@ -193,12 +193,12 @@ declare const changePassword: better_call871.StrictEndpoint<"/change-password",
193
193
  updatedAt: Date;
194
194
  };
195
195
  }>;
196
- declare const setPassword: better_call871.StrictEndpoint<string, {
196
+ declare const setPassword: better_call710.StrictEndpoint<string, {
197
197
  method: "POST";
198
198
  body: z.ZodObject<{
199
199
  newPassword: z.ZodString;
200
200
  }, z.core.$strip>;
201
- use: ((inputContext: better_call871.MiddlewareInputContext<better_call871.MiddlewareOptions>) => Promise<{
201
+ use: ((inputContext: better_call710.MiddlewareInputContext<better_call710.MiddlewareOptions>) => Promise<{
202
202
  session: {
203
203
  session: Record<string, any> & {
204
204
  id: string;
@@ -224,9 +224,9 @@ declare const setPassword: better_call871.StrictEndpoint<string, {
224
224
  }, {
225
225
  status: boolean;
226
226
  }>;
227
- declare const deleteUser: better_call871.StrictEndpoint<"/delete-user", {
227
+ declare const deleteUser: better_call710.StrictEndpoint<"/delete-user", {
228
228
  method: "POST";
229
- use: ((inputContext: better_call871.MiddlewareInputContext<better_call871.MiddlewareOptions>) => Promise<{
229
+ use: ((inputContext: better_call710.MiddlewareInputContext<better_call710.MiddlewareOptions>) => Promise<{
230
230
  session: {
231
231
  session: Record<string, any> & {
232
232
  id: string;
@@ -311,13 +311,13 @@ declare const deleteUser: better_call871.StrictEndpoint<"/delete-user", {
311
311
  success: boolean;
312
312
  message: string;
313
313
  }>;
314
- declare const deleteUserCallback: better_call871.StrictEndpoint<"/delete-user/callback", {
314
+ declare const deleteUserCallback: better_call710.StrictEndpoint<"/delete-user/callback", {
315
315
  method: "GET";
316
316
  query: z.ZodObject<{
317
317
  token: z.ZodString;
318
318
  callbackURL: z.ZodOptional<z.ZodString>;
319
319
  }, z.core.$strip>;
320
- use: ((inputContext: better_call871.MiddlewareInputContext<better_call871.MiddlewareOptions>) => Promise<void>)[];
320
+ use: ((inputContext: better_call710.MiddlewareInputContext<better_call710.MiddlewareOptions>) => Promise<void>)[];
321
321
  metadata: {
322
322
  openapi: {
323
323
  description: string;
@@ -351,13 +351,13 @@ declare const deleteUserCallback: better_call871.StrictEndpoint<"/delete-user/ca
351
351
  success: boolean;
352
352
  message: string;
353
353
  }>;
354
- declare const changeEmail: better_call871.StrictEndpoint<"/change-email", {
354
+ declare const changeEmail: better_call710.StrictEndpoint<"/change-email", {
355
355
  method: "POST";
356
356
  body: z.ZodObject<{
357
357
  newEmail: z.ZodEmail;
358
358
  callbackURL: z.ZodOptional<z.ZodString>;
359
359
  }, z.core.$strip>;
360
- use: ((inputContext: better_call871.MiddlewareInputContext<better_call871.MiddlewareOptions>) => Promise<{
360
+ use: ((inputContext: better_call710.MiddlewareInputContext<better_call710.MiddlewareOptions>) => Promise<{
361
361
  session: {
362
362
  session: Record<string, any> & {
363
363
  id: string;
@@ -3,8 +3,8 @@ import { InferActions, InferClientAPI, InferErrorCodes, IsSignal, SessionQueryPa
3
3
  import { useStore } from "./lynx-store.mjs";
4
4
  import { BetterAuthClientOptions, BetterAuthClientPlugin } from "@better-auth/core";
5
5
  import { BASE_ERROR_CODES } from "@better-auth/core/error";
6
- import * as nanostores1 from "nanostores";
7
- import * as _better_fetch_fetch47 from "@better-fetch/fetch";
6
+ import * as nanostores2 from "nanostores";
7
+ import * as _better_fetch_fetch63 from "@better-fetch/fetch";
8
8
  import { BetterFetchError } from "@better-fetch/fetch";
9
9
  export * from "nanostores";
10
10
  export * from "@better-fetch/fetch";
@@ -49,21 +49,21 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
49
49
  error: null;
50
50
  } ? S : Res : never>;
51
51
  };
52
- $fetch: _better_fetch_fetch47.BetterFetch<{
53
- plugins: (_better_fetch_fetch47.BetterFetchPlugin<Record<string, any>> | {
52
+ $fetch: _better_fetch_fetch63.BetterFetch<{
53
+ plugins: (_better_fetch_fetch63.BetterFetchPlugin<Record<string, any>> | {
54
54
  id: string;
55
55
  name: string;
56
56
  hooks: {
57
- onSuccess(context: _better_fetch_fetch47.SuccessContext<any>): void;
57
+ onSuccess(context: _better_fetch_fetch63.SuccessContext<any>): void;
58
58
  };
59
59
  } | {
60
60
  id: string;
61
61
  name: string;
62
62
  hooks: {
63
- onSuccess: ((context: _better_fetch_fetch47.SuccessContext<any>) => Promise<void> | void) | undefined;
64
- onError: ((context: _better_fetch_fetch47.ErrorContext) => Promise<void> | void) | undefined;
65
- onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch47.RequestContext<T>) => Promise<_better_fetch_fetch47.RequestContext | void> | _better_fetch_fetch47.RequestContext | void) | undefined;
66
- onResponse: ((context: _better_fetch_fetch47.ResponseContext) => Promise<Response | void | _better_fetch_fetch47.ResponseContext> | Response | _better_fetch_fetch47.ResponseContext | void) | undefined;
63
+ onSuccess: ((context: _better_fetch_fetch63.SuccessContext<any>) => Promise<void> | void) | undefined;
64
+ onError: ((context: _better_fetch_fetch63.ErrorContext) => Promise<void> | void) | undefined;
65
+ onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch63.RequestContext<T>) => Promise<_better_fetch_fetch63.RequestContext | void> | _better_fetch_fetch63.RequestContext | void) | undefined;
66
+ onResponse: ((context: _better_fetch_fetch63.ResponseContext) => Promise<Response | void | _better_fetch_fetch63.ResponseContext> | Response | _better_fetch_fetch63.ResponseContext | void) | undefined;
67
67
  };
68
68
  })[];
69
69
  cache?: RequestCache | undefined;
@@ -83,12 +83,12 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
83
83
  referrerPolicy?: ReferrerPolicy | undefined;
84
84
  signal?: (AbortSignal | null) | undefined;
85
85
  window?: null | undefined;
86
- onRetry?: ((response: _better_fetch_fetch47.ResponseContext) => Promise<void> | void) | undefined;
86
+ onRetry?: ((response: _better_fetch_fetch63.ResponseContext) => Promise<void> | void) | undefined;
87
87
  hookOptions?: {
88
88
  cloneResponse?: boolean;
89
89
  } | undefined;
90
90
  timeout?: number | undefined;
91
- customFetchImpl: _better_fetch_fetch47.FetchEsque;
91
+ customFetchImpl: _better_fetch_fetch63.FetchEsque;
92
92
  baseURL: string;
93
93
  throw?: boolean | undefined;
94
94
  auth?: ({
@@ -108,17 +108,17 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
108
108
  params?: any;
109
109
  duplex?: "full" | "half" | undefined;
110
110
  jsonParser: (text: string) => Promise<any> | any;
111
- retry?: _better_fetch_fetch47.RetryOptions | undefined;
111
+ retry?: _better_fetch_fetch63.RetryOptions | undefined;
112
112
  retryAttempt?: number | undefined;
113
- output?: (_better_fetch_fetch47.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
114
- errorSchema?: _better_fetch_fetch47.StandardSchemaV1 | undefined;
113
+ output?: (_better_fetch_fetch63.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
114
+ errorSchema?: _better_fetch_fetch63.StandardSchemaV1 | undefined;
115
115
  disableValidation?: boolean | undefined;
116
116
  disableSignal?: boolean | undefined;
117
117
  }, unknown, unknown, {}>;
118
118
  $store: {
119
119
  notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
120
120
  listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
121
- atoms: Record<string, nanostores1.WritableAtom<any>>;
121
+ atoms: Record<string, nanostores2.WritableAtom<any>>;
122
122
  };
123
123
  $ERROR_CODES: PrettifyDeep<InferErrorCodes<Option> & typeof BASE_ERROR_CODES>;
124
124
  };