diff --git a/package.json b/package.json index d53621112..f5663afee 100644 --- a/package.json +++ b/package.json @@ -101,8 +101,8 @@ }, "overrides": { "@electron/node-gyp": "10.2.0-electron.2", - "is-core-module": "npm:@nolyfill/is-core-module@1", - "isarray": "npm:@nolyfill/isarray@1", + "is-core-module": "npm:@nolyfill/is-core-module@1.0.39", + "isarray": "npm:@nolyfill/isarray@1.0.44", "react": "18.3.1", "react-dom": "18.3.1", "unist-util-visit-parents": "5.1.3", diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts index 39d472e90..819a8dbe2 100644 --- a/packages/shared/src/hono.ts +++ b/packages/shared/src/hono.ts @@ -9,7 +9,6 @@ import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core'; import { AnyPgColumn } from 'drizzle-orm/pg-core'; import * as drizzle_orm from 'drizzle-orm'; import { InferInsertModel, SQL } from 'drizzle-orm'; -import * as better_auth_adapters_drizzle from 'better-auth/adapters/drizzle'; import * as better_auth_plugins from 'better-auth/plugins'; import * as better_auth from 'better-auth'; @@ -21,15 +20,27 @@ declare const authPlugins: ({ id: "customGetProviders"; endpoints: { customGetProviders: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: any; } : any>; @@ -45,15 +56,27 @@ declare const authPlugins: ({ id: "customCreateSession"; endpoints: { customCreateSession: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { ck: string; @@ -75,15 +98,27 @@ declare const authPlugins: ({ id: "getAccountInfo"; endpoints: { getAccountInfo: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { id: string; @@ -119,15 +154,27 @@ declare const authPlugins: ({ id: "customUpdateUser"; endpoints: { customUpdateUser: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: string | null; } : string | null>; @@ -7004,38 +7051,27 @@ declare const auth: { handler: (request: Request) => Promise; api: better_auth.InferAPI<{ ok: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { ok: boolean; @@ -7058,8 +7094,10 @@ declare const auth: { properties: { ok: { type: string; + description: string; }; }; + required: string[]; }; }; }; @@ -7074,33 +7112,27 @@ declare const auth: { path: "/ok"; }; error: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: Response; } : Response>; @@ -7116,6 +7148,7 @@ declare const auth: { "text/html": { schema: { type: "string"; + description: string; }; }; }; @@ -7130,38 +7163,9 @@ declare const auth: { path: "/error"; }; signInSocial: { - ; - newUserCallbackURL: zod.ZodOptional; - errorCallbackURL: zod.ZodOptional; - provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick")[]]>; - disableRedirect: zod.ZodOptional; - idToken: zod.ZodOptional; - accessToken: zod.ZodOptional; - refreshToken: zod.ZodOptional; - expiresAt: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - token: string; - refreshToken?: string | undefined; - accessToken?: string | undefined; - expiresAt?: number | undefined; - nonce?: string | undefined; - }, { - token: string; - refreshToken?: string | undefined; - accessToken?: string | undefined; - expiresAt?: number | undefined; - nonce?: string | undefined; - }>>; - scopes: zod.ZodOptional>; - requestSignUp: zod.ZodOptional; - loginHint: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick"; + (inputCtx_0: { + body: { + provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; scopes?: string[] | undefined; loginHint?: string | undefined; idToken?: { @@ -7176,63 +7180,26 @@ declare const auth: { errorCallbackURL?: string | undefined; newUserCallbackURL?: string | undefined; disableRedirect?: boolean | undefined; - }, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick"; - scopes?: string[] | undefined; - loginHint?: string | undefined; - idToken?: { - token: string; - refreshToken?: string | undefined; - accessToken?: string | undefined; - expiresAt?: number | undefined; - nonce?: string | undefined; - } | undefined; - callbackURL?: string | undefined; - requestSignUp?: boolean | undefined; - errorCallbackURL?: string | undefined; - newUserCallbackURL?: string | undefined; - disableRedirect?: boolean | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - }; - user: { - type: string; - ref: string; - }; - url: { - type: string; - }; - redirect: { - type: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { redirect: boolean; @@ -7274,7 +7241,7 @@ declare const auth: { callbackURL: zod.ZodOptional; newUserCallbackURL: zod.ZodOptional; errorCallbackURL: zod.ZodOptional; - provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick")[]]>; + provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom")[]]>; disableRedirect: zod.ZodOptional; idToken: zod.ZodOptional; loginHint: zod.ZodOptional; }, "strip", zod.ZodTypeAny, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick"; + provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; scopes?: string[] | undefined; loginHint?: string | undefined; idToken?: { @@ -7315,7 +7282,7 @@ declare const auth: { newUserCallbackURL?: string | undefined; disableRedirect?: boolean | undefined; }, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick"; + provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; scopes?: string[] | undefined; loginHint?: string | undefined; idToken?: { @@ -7334,6 +7301,7 @@ declare const auth: { metadata: { openapi: { description: string; + operationId: string; responses: { "200": { description: string; @@ -7341,22 +7309,53 @@ declare const auth: { "application/json": { schema: { type: "object"; + description: string; properties: { - token: { - type: string; - }; - user: { - type: string; - ref: string; - }; - url: { - type: string; - }; redirect: { type: string; + enum: boolean[]; }; + token: { + type: string; + description: string; + url: { + type: string; + nullable: boolean; + }; + user: { + type: string; + properties: { + id: { + type: string; + }; + email: { + type: string; + }; + name: { + type: string; + nullable: boolean; + }; + image: { + type: string; + nullable: boolean; + }; + emailVerified: { + type: string; + }; + createdAt: { + type: string; + format: string; + }; + updatedAt: { + type: string; + format: string; + }; + }; + required: string[]; + }; + }; + required: string[]; }; - required: string[]; }; }; }; @@ -7370,56 +7369,43 @@ declare const auth: { path: "/sign-in/social"; }; callbackOAuth: { - ; - error: zod.ZodOptional; - device_id: zod.ZodOptional; - error_description: zod.ZodOptional; - state: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body?: { state?: string | undefined; code?: string | undefined; device_id?: string | undefined; error?: string | undefined; + user?: string | undefined; error_description?: string | undefined; - }, { + } | undefined; + } & { + method: "GET" | "POST"; + } & { + query?: { state?: string | undefined; code?: string | undefined; device_id?: string | undefined; error?: string | undefined; + user?: string | undefined; error_description?: string | undefined; - }>>; - query: zod.ZodOptional; - error: zod.ZodOptional; - device_id: zod.ZodOptional; - error_description: zod.ZodOptional; - state: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - state?: string | undefined; - code?: string | undefined; - device_id?: string | undefined; - error?: string | undefined; - error_description?: string | undefined; - }, { - state?: string | undefined; - code?: string | undefined; - device_id?: string | undefined; - error?: string | undefined; - error_description?: string | undefined; - }>>; - metadata: { - isAction: false; + } | undefined; + } & { + params: { + id: string; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise; @@ -7431,17 +7417,20 @@ declare const auth: { device_id: zod.ZodOptional; error_description: zod.ZodOptional; state: zod.ZodOptional; + user: zod.ZodOptional; }, "strip", zod.ZodTypeAny, { state?: string | undefined; code?: string | undefined; device_id?: string | undefined; error?: string | undefined; + user?: string | undefined; error_description?: string | undefined; }, { state?: string | undefined; code?: string | undefined; device_id?: string | undefined; error?: string | undefined; + user?: string | undefined; error_description?: string | undefined; }>>; query: zod.ZodOptional; error_description: zod.ZodOptional; state: zod.ZodOptional; + user: zod.ZodOptional; }, "strip", zod.ZodTypeAny, { state?: string | undefined; code?: string | undefined; device_id?: string | undefined; error?: string | undefined; + user?: string | undefined; error_description?: string | undefined; }, { state?: string | undefined; code?: string | undefined; device_id?: string | undefined; error?: string | undefined; + user?: string | undefined; error_description?: string | undefined; }>>; metadata: { @@ -7472,53 +7464,30 @@ declare const auth: { path: "/callback/:id"; }; getSession: { - ]>>>; - disableRefresh: zod.ZodOptional]>>; - }, "strip", zod.ZodTypeAny, { - disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; - }, { + (inputCtx_0: { + body?: undefined; + } & { + method?: "GET" | undefined; + } & { + query?: { disableCookieCache?: string | boolean | undefined; disableRefresh?: string | boolean | undefined; - }>>; - requireHeaders: true; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - session: { - type: string; - $ref: string; - }; - user: { - type: string; - $ref: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; + } | undefined; } & { - use: any[]; - }>]>(...inputCtx: C): Promise; + } & { + request?: Request; + } & { + headers: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { session: { @@ -7550,16 +7519,6 @@ declare const auth: { image?: string | null | undefined | undefined; twoFactorEnabled: boolean | null | undefined; handle: string; - } & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - isAnonymous?: boolean | null | undefined; - handle: string; }; } | null; } : { @@ -7592,16 +7551,6 @@ declare const auth: { image?: string | null | undefined | undefined; twoFactorEnabled: boolean | null | undefined; handle: string; - } & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined | undefined; - isAnonymous?: boolean | null | undefined; - handle: string; }; } | null>; options: { @@ -7629,14 +7578,13 @@ declare const auth: { type: "object"; properties: { session: { - type: string; $ref: string; }; user: { - type: string; $ref: string; }; }; + required: string[]; }; }; }; @@ -7650,38 +7598,27 @@ declare const auth: { path: "/get-session"; }; signOut: { - (inputCtx_0: { + body?: undefined; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { success: boolean; @@ -7720,96 +7657,39 @@ declare const auth: { path: "/sign-out"; }; signUpEmail: { - ; - metadata: { - $Infer: { - body: ({ - name: string; - email: string; - password: string; - } & ({} | ({} & {}) | ({} & { - isAnonymous?: boolean | null | undefined; - }))) & { - handle: string; - } & { - handle?: string | null | undefined; - }; - }; - openapi: { - description: string; - requestBody: { - content: { - "application/json": { - schema: { - type: "object"; - properties: { - name: { - type: string; - description: string; - }; - email: { - type: string; - description: string; - }; - password: { - type: string; - description: string; - }; - callbackURL: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - id: { - type: string; - description: string; - }; - email: { - type: string; - description: string; - }; - name: { - type: string; - description: string; - }; - image: { - type: string; - description: string; - }; - emailVerified: { - type: string; - description: string; - }; - }; - }; - }; - }; - }; - }; - }; + (inputCtx_0: { + body: ({ + name: string; + email: string; + password: string; + } | ({ + name: string; + email: string; + password: string; + } & {} & {})) & { + handle: string; + } & { + handle?: string | null | undefined; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: null; @@ -7866,9 +7746,11 @@ declare const auth: { name: string; email: string; password: string; - } & ({} | ({} & {}) | ({} & { - isAnonymous?: boolean | null | undefined; - }))) & { + } | ({ + name: string; + email: string; + password: string; + } & {} & {})) & { handle: string; } & { handle?: string | null | undefined; @@ -7912,27 +7794,52 @@ declare const auth: { schema: { type: "object"; properties: { - id: { + token: { type: string; + nullable: boolean; description: string; }; - email: { + user: { type: string; - description: string; - }; - name: { - type: string; - description: string; - }; - image: { - type: string; - description: string; - }; - emailVerified: { - type: string; - description: string; + properties: { + id: { + type: string; + description: string; + }; + email: { + type: string; + format: string; + description: string; + }; + name: { + type: string; + description: string; + }; + image: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + emailVerified: { + type: string; + description: string; + }; + createdAt: { + type: string; + format: string; + description: string; + }; + updatedAt: { + type: string; + format: string; + description: string; + }; + }; + required: string[]; }; }; + required: string[]; }; }; }; @@ -7946,64 +7853,32 @@ declare const auth: { path: "/sign-up/email"; }; signInEmail: { - ; - rememberMe: zod.ZodOptional>; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { password: string; email: string; callbackURL?: string | undefined; rememberMe?: boolean | undefined; - }, { - password: string; - email: string; - callbackURL?: string | undefined; - rememberMe?: boolean | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - }; - user: { - type: string; - ref: string; - }; - url: { - type: string; - }; - redirect: { - type: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { redirect: boolean; @@ -8061,19 +7936,50 @@ declare const auth: { "application/json": { schema: { type: "object"; + description: string; properties: { + redirect: { + type: string; + enum: boolean[]; + }; token: { type: string; - }; - user: { - type: string; - ref: string; + description: string; }; url: { type: string; + nullable: boolean; }; - redirect: { + user: { type: string; + properties: { + id: { + type: string; + }; + email: { + type: string; + }; + name: { + type: string; + nullable: boolean; + }; + image: { + type: string; + nullable: boolean; + }; + emailVerified: { + type: string; + }; + createdAt: { + type: string; + format: string; + }; + updatedAt: { + type: string; + format: string; + }; + }; + required: string[]; }; }; required: string[]; @@ -8090,47 +7996,30 @@ declare const auth: { path: "/sign-in/email"; }; forgetPassword: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { email: string; redirectTo?: string | undefined; - }, { - email: string; - redirectTo?: string | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -8178,54 +8067,32 @@ declare const auth: { path: "/forget-password"; }; resetPassword: { - ; - }, "strip", zod.ZodTypeAny, { - token?: string | undefined; - }, { - token?: string | undefined; - }>>; - body: zod.ZodObject<{ - newPassword: zod.ZodString; - token: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { newPassword: string; token?: string | undefined; - }, { - newPassword: string; - token?: string | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -8280,53 +8147,30 @@ declare const auth: { path: "/reset-password"; }; verifyEmail: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body?: undefined; + } & { + method?: "GET" | undefined; + } & { + query: { token: string; callbackURL?: string | undefined; - }, { - token: string; - callbackURL?: string | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - type: string; - ref: string; - }; - status: { - type: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: void | { status: boolean; @@ -8374,6 +8218,23 @@ declare const auth: { metadata: { openapi: { description: string; + parameters: ({ + name: string; + in: "query"; + description: string; + required: true; + schema: { + type: "string"; + }; + } | { + name: string; + in: "query"; + description: string; + required: false; + schema: { + type: "string"; + }; + })[]; responses: { "200": { description: string; @@ -8384,13 +8245,44 @@ declare const auth: { properties: { user: { type: string; - ref: string; + properties: { + id: { + type: string; + description: string; + }; + email: { + type: string; + description: string; + }; + name: { + type: string; + description: string; + }; + image: { + type: string; + description: string; + }; + emailVerified: { + type: string; + description: string; + }; + createdAt: { + type: string; + description: string; + }; + updatedAt: { + type: string; + description: string; + }; + }; + required: string[]; }; status: { type: string; + description: string; }; + required: string[]; }; - required: string[]; }; }; }; @@ -8404,67 +8296,30 @@ declare const auth: { path: "/verify-email"; }; sendVerificationEmail: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { email: string; callbackURL?: string | undefined; - }, { - email: string; - callbackURL?: string | undefined; - }>; - metadata: { - openapi: { - description: string; - requestBody: { - content: { - "application/json": { - schema: { - type: "object"; - properties: { - email: { - type: string; - description: string; - }; - callbackURL: { - type: string; - description: string; - }; - }; - required: string[]; - }; - }; - }; - }; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -8496,10 +8351,13 @@ declare const auth: { email: { type: string; description: string; + example: string; }; callbackURL: { type: string; description: string; + example: string; + nullable: boolean; }; }; required: string[]; @@ -8517,6 +8375,25 @@ declare const auth: { properties: { status: { type: string; + description: string; + example: boolean; + }; + }; + }; + }; + }; + }; + "400": { + description: string; + content: { + "application/json": { + schema: { + type: "object"; + properties: { + message: { + type: string; + description: string; + example: string; }; }; }; @@ -8532,73 +8409,30 @@ declare const auth: { path: "/send-verification-email"; }; changeEmail: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { newEmail: string; callbackURL?: string | undefined; - }, { - newEmail: string; - callbackURL?: string | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - type: string; - ref: string; - }; - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -8651,14 +8485,18 @@ declare const auth: { schema: { type: "object"; properties: { - user: { - type: string; - ref: string; - }; status: { type: string; + description: string; + }; + message: { + type: string; + enum: string[]; + description: string; + nullable: boolean; }; }; + required: string[]; }; }; }; @@ -8672,74 +8510,31 @@ declare const auth: { path: "/change-email"; }; changePassword: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { newPassword: string; currentPassword: string; revokeOtherSessions?: boolean | undefined; - }, { - newPassword: string; - currentPassword: string; - revokeOtherSessions?: boolean | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - description: string; - $ref: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: string | null; @@ -8814,11 +8609,52 @@ declare const auth: { schema: { type: "object"; properties: { - user: { + token: { + type: string; + nullable: boolean; description: string; - $ref: string; + }; + user: { + type: string; + properties: { + id: { + type: string; + description: string; + }; + email: { + type: string; + format: string; + description: string; + }; + name: { + type: string; + description: string; + }; + image: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + emailVerified: { + type: string; + description: string; + }; + createdAt: { + type: string; + format: string; + description: string; + }; + updatedAt: { + type: string; + format: string; + description: string; + }; + }; + required: string[]; }; }; + required: string[]; }; }; }; @@ -8832,48 +8668,29 @@ declare const auth: { path: "/change-password"; }; setPassword: { - (inputCtx_0: { + body: { newPassword: string; - }, { - newPassword: string; - }>; - metadata: { - SERVER_ONLY: true; }; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -8922,93 +8739,36 @@ declare const auth: { path: "/set-password"; }; updateUser: { - ; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - $Infer: { - body: Partial>; - }; - openapi: { - description: string; - requestBody: { - content: { - "application/json": { - schema: { - type: "object"; - properties: { - name: { - type: string; - description: string; - }; - image: { - type: string; - description: string; - }; - }; - }; - }; - }; - }; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - type: string; - ref: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; + (inputCtx_0: { + body: Partial>; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -9044,11 +8804,11 @@ declare const auth: { }>)[]; metadata: { $Infer: { - body: Partial) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - body: zod.ZodObject<{ - callbackURL: zod.ZodOptional; - password: zod.ZodOptional; - token: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { password?: string | undefined; token?: string | undefined; callbackURL?: string | undefined; - }, { - password?: string | undefined; - token?: string | undefined; - callbackURL?: string | undefined; - }>; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { success: boolean; @@ -9221,6 +8944,18 @@ declare const auth: { "application/json": { schema: { type: "object"; + properties: { + success: { + type: string; + description: string; + }; + message: { + type: string; + enum: string[]; + description: string; + }; + }; + required: string[]; }; }; }; @@ -9234,45 +8969,31 @@ declare const auth: { path: "/delete-user"; }; forgetPasswordCallback: { - (inputCtx_0: { + body?: undefined; + } & { + method?: "GET" | undefined; + } & { + query: { callbackURL: string; - }, { - callbackURL: string; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise; @@ -9314,70 +9035,27 @@ declare const auth: { path: "/reset-password/:token"; }; listSessions: { - ) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - requireHeaders: true; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "array"; - items: { - type: string; - properties: { - token: { - type: string; - }; - userId: { - type: string; - }; - expiresAt: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; + (inputCtx_0: { + body?: undefined; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: better_auth.Prettify<{ id: string; @@ -9436,18 +9114,7 @@ declare const auth: { schema: { type: "array"; items: { - type: string; - properties: { - token: { - type: string; - }; - userId: { - type: string; - }; - expiresAt: { - type: string; - }; - }; + $ref: string; }; }; }; @@ -9462,66 +9129,29 @@ declare const auth: { path: "/list-sessions"; }; revokeSession: { - (inputCtx_0: { + body: { token: string; - }, { - token: string; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - requireHeaders: true; - metadata: { - openapi: { - description: string; - requestBody: { - content: { - "application/json": { - schema: { - type: "object"; - properties: { - token: { - type: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -9573,6 +9203,7 @@ declare const auth: { properties: { token: { type: string; + description: string; }; }; required: string[]; @@ -9580,43 +9211,6 @@ declare const auth: { }; }; }; - }; - }; - } & { - use: any[]; - }; - path: "/revoke-session"; - }; - revokeSessions: { - ) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - requireHeaders: true; - metadata: { - openapi: { - description: string; responses: { "200": { description: string; @@ -9627,6 +9221,7 @@ declare const auth: { properties: { status: { type: string; + description: string; }; }; required: string[]; @@ -9639,11 +9234,31 @@ declare const auth: { }; } & { use: any[]; - }>]>(...inputCtx: C): Promise(inputCtx_0: { + body?: undefined; + } & { + method?: "POST" | undefined; + } & { + query?: Record | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -9690,6 +9305,7 @@ declare const auth: { properties: { status: { type: string; + description: string; }; }; required: string[]; @@ -9706,61 +9322,27 @@ declare const auth: { path: "/revoke-sessions"; }; revokeOtherSessions: { - ) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; + (inputCtx_0: { + body?: undefined; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -9807,8 +9389,10 @@ declare const auth: { properties: { status: { type: string; + description: string; }; }; + required: string[]; }; }; }; @@ -9822,75 +9406,31 @@ declare const auth: { path: "/revoke-other-sessions"; }; linkSocialAccount: { - ; - provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick")[]]>; - }, "strip", zod.ZodTypeAny, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick"; + (inputCtx_0: { + body: { + provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; + scopes?: string[] | undefined; callbackURL?: string | undefined; - }, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick"; - callbackURL?: string | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - url: { - type: string; - }; - redirect: { - type: string; - }; - }; - required: string[]; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { url: string; @@ -9905,12 +9445,15 @@ declare const auth: { requireHeaders: true; body: zod.ZodObject<{ callbackURL: zod.ZodOptional; - provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick")[]]>; + provider: zod.ZodEnum<["github", ...("apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom")[]]>; + scopes: zod.ZodOptional>; }, "strip", zod.ZodTypeAny, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick"; + provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; + scopes?: string[] | undefined; callbackURL?: string | undefined; }, { - provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick"; + provider: "apple" | "discord" | "facebook" | "github" | "google" | "microsoft" | "spotify" | "twitch" | "twitter" | "dropbox" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "kick" | "zoom"; + scopes?: string[] | undefined; callbackURL?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ @@ -9949,9 +9492,11 @@ declare const auth: { properties: { url: { type: string; + description: string; }; redirect: { type: string; + description: string; }; }; required: string[]; @@ -9968,81 +9513,27 @@ declare const auth: { path: "/link-social"; }; listUserAccounts: { - ) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - description: string; - responses: { - "200": { - description: string; - content: { - "application/json": { - schema: { - type: "array"; - items: { - type: string; - properties: { - id: { - type: string; - }; - provider: { - type: string; - }; - createdAt: { - type: string; - }; - updatedAt: { - type: string; - }; - accountId: { - type: string; - }; - scopes: { - type: string; - items: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; + (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { id: string; @@ -10106,21 +9597,24 @@ declare const auth: { }; createdAt: { type: string; + format: string; }; updatedAt: { type: string; + format: string; }; - accountId: { + }; + accountId: { + type: string; + }; + scopes: { + type: string; + items: { type: string; }; - scopes: { - type: string; - items: { - type: string; - }; - }; }; }; + required: string[]; }; }; }; @@ -10134,26 +9628,30 @@ declare const auth: { path: "/list-accounts"; }; deleteUserCallback: { - ; - }, "strip", zod.ZodTypeAny, { - token: string; - callbackURL?: string | undefined; - }, { - token: string; - callbackURL?: string | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise)[]; + (inputCtx_0: { + body?: undefined; } & { - use: any[]; - }>]>(...inputCtx: C): Promise; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { success: boolean; @@ -10176,54 +9674,65 @@ declare const auth: { callbackURL?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise)[]; + metadata: { + openapi: { + description: string; + responses: { + "200": { + description: string; + content: { + "application/json": { + schema: { + type: "object"; + properties: { + success: { + type: string; + description: string; + }; + message: { + type: string; + enum: string[]; + description: string; + }; + }; + required: string[]; + }; + }; + }; + }; + }; + }; + }; } & { use: any[]; }; path: "/delete-user/callback"; }; unlinkAccount: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { providerId: string; accountId?: string | undefined; - }, { - providerId: string; - accountId?: string | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; + }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -10266,76 +9775,59 @@ declare const auth: { }; }; }>)[]; - } & { - use: any[]; - }; - path: "/unlink-account"; - }; - refreshToken: { - ; - userId: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - providerId: string; - accountId?: string | undefined; - userId?: string | undefined; - }, { - providerId: string; - accountId?: string | undefined; - userId?: string | undefined; - }>; metadata: { openapi: { description: string; responses: { - 200: { + "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { - tokenType: { + status: { type: string; }; - idToken: { - type: string; - }; - accessToken: { - type: string; - }; - refreshToken: { - type: string; - }; - accessTokenExpiresAt: { - type: string; - format: string; - }; - refreshTokenExpiresAt: { - type: string; - format: string; - }; }; }; }; }; }; - 400: { - description: string; - }; }; }; }; } & { use: any[]; - }>]>(...inputCtx: C): Promise(inputCtx_0: { + body: { + providerId: string; + accountId?: string | undefined; + userId?: string | undefined; + }; + } & { + method?: "POST" | undefined; + } & { + query?: Record | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: better_auth.OAuth2Tokens; } : better_auth.OAuth2Tokens>; @@ -10403,15 +9895,27 @@ declare const auth: { }; } & { customGetProviders: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: any; } : any>; @@ -10424,15 +9928,27 @@ declare const auth: { }; } & { customCreateSession: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { ck: string; @@ -10451,15 +9967,27 @@ declare const auth: { }; } & { getAccountInfo: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { id: string; @@ -10492,15 +10020,27 @@ declare const auth: { }; } & { customUpdateUser: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: string | null; } : string | null>; @@ -10513,76 +10053,30 @@ declare const auth: { }; } & { enableTwoFactor: { - (inputCtx_0: { + body: { password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - description: string; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - }; - }; - }; - }; - }; - }; + issuer?: string | undefined; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { totpURI: string; @@ -10596,10 +10090,13 @@ declare const auth: { method: "POST"; body: zod.ZodObject<{ password: zod.ZodString; + issuer: zod.ZodOptional; }, "strip", zod.ZodTypeAny, { password: string; + issuer?: string | undefined; }, { password: string; + issuer?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { @@ -10661,68 +10158,29 @@ declare const auth: { path: "/two-factor/enable"; }; disableTwoFactor: { - (inputCtx_0: { + body: { password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -10791,176 +10249,54 @@ declare const auth: { path: "/two-factor/disable"; }; verifyBackupCode: { - ; - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { code: string; trustDevice?: boolean | undefined; disableSession?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; + }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { - user: better_auth_plugins.UserWithTwoFactor; - session: { - session: better_auth.Session & Record; - user: better_auth.User & Record; - } & { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - } & { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; + token: string | undefined; + user: { + id: string; + email: string; + emailVerified: boolean; + name: string; + image: string | null | undefined; + createdAt: Date; + updatedAt: Date; }; }; } : { - user: better_auth_plugins.UserWithTwoFactor; - session: { - session: better_auth.Session & Record; - user: better_auth.User & Record; - } & { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - } & { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; + token: string | undefined; + user: { + id: string; + email: string; + emailVerified: boolean; + name: string; + image: string | null | undefined; + createdAt: Date; + updatedAt: Date; }; }>; options: { @@ -10978,122 +10314,127 @@ declare const auth: { trustDevice?: boolean | undefined; disableSession?: boolean | undefined; }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; + metadata: { + openapi: { + description: string; + responses: { + "200": { + description: string; + content: { + "application/json": { + schema: { + type: "object"; + properties: { + user: { + type: string; + properties: { + id: { + type: string; + description: string; + }; + email: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + emailVerified: { + type: string; + nullable: boolean; + description: string; + }; + name: { + type: string; + nullable: boolean; + description: string; + }; + image: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + twoFactorEnabled: { + type: string; + description: string; + }; + createdAt: { + type: string; + format: string; + description: string; + }; + updatedAt: { + type: string; + format: string; + description: string; + }; + }; + required: string[]; + description: string; + }; + session: { + type: string; + properties: { + token: { + type: string; + description: string; + }; + userId: { + type: string; + description: string; + }; + createdAt: { + type: string; + format: string; + description: string; + }; + expiresAt: { + type: string; + format: string; + description: string; + }; + }; + required: string[]; + description: string; + }; + }; + required: string[]; + }; + }; + }; + }; }; }; - }>)[]; + }; } & { use: any[]; }; path: "/two-factor/verify-backup-code"; }; generateBackupCodes: { - (inputCtx_0: { + body: { password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; + }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -11135,31 +10476,67 @@ declare const auth: { }; }; }>)[]; + metadata: { + openapi: { + description: string; + responses: { + "200": { + description: string; + content: { + "application/json": { + schema: { + type: "object"; + properties: { + status: { + type: string; + description: string; + enum: boolean[]; + }; + backupCodes: { + type: string; + items: { + type: string; + }; + description: string; + }; + }; + required: string[]; + }; + }; + }; + }; + }; + }; + }; } & { use: any[]; }; path: "/two-factor/generate-backup-codes"; }; viewBackupCodes: { - (inputCtx_0: { + body: { userId: string; - }, { - userId: string; - }>; - metadata: { - SERVER_ONLY: true; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -11187,116 +10564,29 @@ declare const auth: { path: "/two-factor/view-backup-codes"; }; sendTwoFactorOTP: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0?: ({ + body?: { trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; + } | undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -11313,77 +10603,6 @@ declare const auth: { }, { trustDevice?: boolean | undefined; }>>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; metadata: { openapi: { summary: string; @@ -11413,142 +10632,53 @@ declare const auth: { path: "/two-factor/send-otp"; }; verifyTwoFactorOTP: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { code: string; trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: string; user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; + id: any; + email: any; + emailVerified: any; + name: any; + image: any; + createdAt: any; + updatedAt: any; }; }; } : { token: string; user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; + id: any; + email: any; + emailVerified: any; + name: any; + image: any; + createdAt: any; + updatedAt: any; }; }>; options: { @@ -11563,93 +10693,67 @@ declare const auth: { code: string; trustDevice?: boolean | undefined; }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; metadata: { openapi: { summary: string; description: string; responses: { - 200: { + "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { - status: { + token: { type: string; + description: string; + }; + user: { + type: string; + properties: { + id: { + type: string; + description: string; + }; + email: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + emailVerified: { + type: string; + nullable: boolean; + description: string; + }; + name: { + type: string; + nullable: boolean; + description: string; + }; + image: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + createdAt: { + type: string; + format: string; + description: string; + }; + updatedAt: { + type: string; + format: string; + description: string; + }; + }; + required: string[]; + description: string; }; }; + required: string[]; }; }; }; @@ -11663,61 +10767,29 @@ declare const auth: { path: "/two-factor/verify-otp"; }; generateTOTP: { - ) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - code: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; + (inputCtx_0: { + body: { + secret: string; }; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { code: string; @@ -11727,89 +10799,12 @@ declare const auth: { }>; options: { method: "POST"; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - code: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/totp/generate"; - }; - getTOTPURI: { - ) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; body: zod.ZodObject<{ - password: zod.ZodString; + secret: zod.ZodString; }, "strip", zod.ZodTypeAny, { - password: string; + secret: string; }, { - password: string; + secret: string; }>; metadata: { openapi: { @@ -11823,7 +10818,7 @@ declare const auth: { schema: { type: "object"; properties: { - totpURI: { + code: { type: string; }; }; @@ -11833,14 +10828,37 @@ declare const auth: { }; }; }; + SERVER_ONLY: true; }; } & { use: any[]; - }>]>(...inputCtx: C): Promise(inputCtx_0: { + body: { + password: string; + }; + } & { + method?: "POST" | undefined; + } & { + query?: Record | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { totpURI: string; @@ -11909,119 +10927,30 @@ declare const auth: { path: "/two-factor/get-totp-uri"; }; verifyTOTP: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { code: string; trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: string; @@ -12059,77 +10988,6 @@ declare const auth: { code: string; trustDevice?: boolean | undefined; }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; metadata: { openapi: { summary: string; @@ -12159,120 +11017,138 @@ declare const auth: { path: "/two-factor/verify-totp"; }; } & { - signInAnonymous: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - createdAt: Date; - updatedAt: Date; - }; - } | null; + }; } : { token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - createdAt: Date; - updatedAt: Date; - }; - } | null>; + }>; options: { - method: "POST"; - metadata: { - openapi: { - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - $ref: string; - }; - session: { - $ref: string; - }; - }; - }; - }; - }; - }; + method: "GET"; + use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ + session: { + session: Record & { + id: string; + createdAt: Date; + updatedAt: Date; + userId: string; + expiresAt: Date; + token: string; + ipAddress?: string | null | undefined; + userAgent?: string | null | undefined; + }; + user: Record & { + id: string; + name: string; + email: string; + emailVerified: boolean; + createdAt: Date; + updatedAt: Date; + image?: string | null | undefined; }; }; - }; + }>)[]; } & { use: any[]; }; - path: "/sign-in/anonymous"; + path: "/one-time-token/generate"; + }; + verifyOneTimeToken: { + (inputCtx_0: { + body: { + token: string; + }; + } & { + method?: "POST" | undefined; + } & { + query?: Record | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { + headers: Headers; + response: { + session: better_auth.Session & Record; + user: better_auth.User & Record; + }; + } : { + session: better_auth.Session & Record; + user: better_auth.User & Record; + }>; + options: { + method: "POST"; + body: zod.ZodObject<{ + token: zod.ZodString; + }, "strip", zod.ZodTypeAny, { + token: string; + }, { + token: string; + }>; + } & { + use: any[]; + }; + path: "/one-time-token/verify"; }; } & { getSession: { - ]>>; - disableRefresh: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; - }, { + (inputCtx_0: { + body?: undefined; + } & { + method?: "GET" | undefined; + } & { + query?: { disableCookieCache?: string | boolean | undefined; disableRefresh?: boolean | undefined; - }>>; + } | undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise; + } & { + request?: Request; + } & { + headers: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { user: { @@ -12342,9 +11218,6 @@ declare const auth: { } | null>; options: { method: "GET"; - metadata: { - CUSTOM_SESSION: boolean; - }; query: zod.ZodOptional]>>; disableRefresh: zod.ZodOptional; @@ -12355,6 +11228,29 @@ declare const auth: { disableCookieCache?: string | boolean | undefined; disableRefresh?: boolean | undefined; }>>; + metadata: { + CUSTOM_SESSION: boolean; + openapi: { + description: string; + responses: { + "200": { + description: string; + content: { + "application/json": { + schema: { + type: "array"; + nullable: boolean; + items: { + $ref: string; + }; + }; + }; + }; + }; + }; + }; + }; + requireHeaders: true; } & { use: any[]; }; @@ -12363,52 +11259,7 @@ declare const auth: { }>; options: { appName: string; - database: (options: better_auth.BetterAuthOptions) => { - id: string; - create, R = T>(data: { - model: string; - data: T; - select?: string[]; - }): Promise; - findOne(data: { - model: string; - where: better_auth.Where[]; - select?: string[]; - }): Promise; - findMany(data: { - model: string; - where?: better_auth.Where[]; - limit?: number; - sortBy?: { - field: string; - direction: "asc" | "desc"; - }; - offset?: number; - }): Promise; - count(data: { - model: string; - where?: better_auth.Where[]; - }): Promise; - update(data: { - model: string; - where: better_auth.Where[]; - update: Record; - }): Promise; - updateMany(data: { - model: string; - where: better_auth.Where[]; - update: Record; - }): Promise; - delete(data: { - model: string; - where: better_auth.Where[]; - }): Promise; - deleteMany(data: { - model: string; - where: better_auth.Where[]; - }): Promise; - options: better_auth_adapters_drizzle.DrizzleAdapterConfig; - }; + database: (options: better_auth.BetterAuthOptions) => better_auth.Adapter; advanced: { generateId: false; defaultCookieAttributes: { @@ -12481,76 +11332,30 @@ declare const auth: { id: "two-factor"; endpoints: { enableTwoFactor: { - (inputCtx_0: { + body: { password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - totpURI: { - type: string; - description: string; - }; - backupCodes: { - type: string; - items: { - type: string; - }; - description: string; - }; - }; - }; - }; - }; - }; - }; - }; + issuer?: string | undefined; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { totpURI: string; @@ -12564,10 +11369,13 @@ declare const auth: { method: "POST"; body: zod.ZodObject<{ password: zod.ZodString; + issuer: zod.ZodOptional; }, "strip", zod.ZodTypeAny, { password: string; + issuer?: string | undefined; }, { password: string; + issuer?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { @@ -12629,68 +11437,29 @@ declare const auth: { path: "/two-factor/enable"; }; disableTwoFactor: { - (inputCtx_0: { + body: { password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -12759,176 +11528,54 @@ declare const auth: { path: "/two-factor/disable"; }; verifyBackupCode: { - ; - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { code: string; trustDevice?: boolean | undefined; disableSession?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - disableSession?: boolean | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; + }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { - user: better_auth_plugins.UserWithTwoFactor; - session: { - session: better_auth.Session & Record; - user: better_auth.User & Record; - } & { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - } & { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; + token: string | undefined; + user: { + id: string; + email: string; + emailVerified: boolean; + name: string; + image: string | null | undefined; + createdAt: Date; + updatedAt: Date; }; }; } : { - user: better_auth_plugins.UserWithTwoFactor; - session: { - session: better_auth.Session & Record; - user: better_auth.User & Record; - } & { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - } & { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; + token: string | undefined; + user: { + id: string; + email: string; + emailVerified: boolean; + name: string; + image: string | null | undefined; + createdAt: Date; + updatedAt: Date; }; }>; options: { @@ -12946,122 +11593,127 @@ declare const auth: { trustDevice?: boolean | undefined; disableSession?: boolean | undefined; }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; + metadata: { + openapi: { + description: string; + responses: { + "200": { + description: string; + content: { + "application/json": { + schema: { + type: "object"; + properties: { + user: { + type: string; + properties: { + id: { + type: string; + description: string; + }; + email: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + emailVerified: { + type: string; + nullable: boolean; + description: string; + }; + name: { + type: string; + nullable: boolean; + description: string; + }; + image: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + twoFactorEnabled: { + type: string; + description: string; + }; + createdAt: { + type: string; + format: string; + description: string; + }; + updatedAt: { + type: string; + format: string; + description: string; + }; + }; + required: string[]; + description: string; + }; + session: { + type: string; + properties: { + token: { + type: string; + description: string; + }; + userId: { + type: string; + description: string; + }; + createdAt: { + type: string; + format: string; + description: string; + }; + expiresAt: { + type: string; + format: string; + description: string; + }; + }; + required: string[]; + description: string; + }; + }; + required: string[]; + }; + }; + }; + }; }; }; - }>)[]; + }; } & { use: any[]; }; path: "/two-factor/verify-backup-code"; }; generateBackupCodes: { - (inputCtx_0: { + body: { password: string; - }, { - password: string; - }>; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; + }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -13103,31 +11755,67 @@ declare const auth: { }; }; }>)[]; + metadata: { + openapi: { + description: string; + responses: { + "200": { + description: string; + content: { + "application/json": { + schema: { + type: "object"; + properties: { + status: { + type: string; + description: string; + enum: boolean[]; + }; + backupCodes: { + type: string; + items: { + type: string; + }; + description: string; + }; + }; + required: string[]; + }; + }; + }; + }; + }; + }; + }; } & { use: any[]; }; path: "/two-factor/generate-backup-codes"; }; viewBackupCodes: { - (inputCtx_0: { + body: { userId: string; - }, { - userId: string; - }>; - metadata: { - SERVER_ONLY: true; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -13155,116 +11843,29 @@ declare const auth: { path: "/two-factor/view-backup-codes"; }; sendTwoFactorOTP: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0?: ({ + body?: { trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; + } | undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; @@ -13281,77 +11882,6 @@ declare const auth: { }, { trustDevice?: boolean | undefined; }>>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; metadata: { openapi: { summary: string; @@ -13381,142 +11911,53 @@ declare const auth: { path: "/two-factor/send-otp"; }; verifyTwoFactorOTP: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { code: string; trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: string; user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; + id: any; + email: any; + emailVerified: any; + name: any; + image: any; + createdAt: any; + updatedAt: any; }; }; } : { token: string; user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; + id: any; + email: any; + emailVerified: any; + name: any; + image: any; + createdAt: any; + updatedAt: any; }; }>; options: { @@ -13531,93 +11972,67 @@ declare const auth: { code: string; trustDevice?: boolean | undefined; }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; metadata: { openapi: { summary: string; description: string; responses: { - 200: { + "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { - status: { + token: { type: string; + description: string; + }; + user: { + type: string; + properties: { + id: { + type: string; + description: string; + }; + email: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + emailVerified: { + type: string; + nullable: boolean; + description: string; + }; + name: { + type: string; + nullable: boolean; + description: string; + }; + image: { + type: string; + format: string; + nullable: boolean; + description: string; + }; + createdAt: { + type: string; + format: string; + description: string; + }; + updatedAt: { + type: string; + format: string; + description: string; + }; + }; + required: string[]; + description: string; }; }; + required: string[]; }; }; }; @@ -13631,61 +12046,29 @@ declare const auth: { path: "/two-factor/verify-otp"; }; generateTOTP: { - ) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - code: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; + (inputCtx_0: { + body: { + secret: string; }; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { code: string; @@ -13695,89 +12078,12 @@ declare const auth: { }>; options: { method: "POST"; - use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - code: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } & { - use: any[]; - }; - path: "/totp/generate"; - }; - getTOTPURI: { - ) => Promise<{ - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; body: zod.ZodObject<{ - password: zod.ZodString; + secret: zod.ZodString; }, "strip", zod.ZodTypeAny, { - password: string; + secret: string; }, { - password: string; + secret: string; }>; metadata: { openapi: { @@ -13791,7 +12097,7 @@ declare const auth: { schema: { type: "object"; properties: { - totpURI: { + code: { type: string; }; }; @@ -13801,14 +12107,37 @@ declare const auth: { }; }; }; + SERVER_ONLY: true; }; } & { use: any[]; - }>]>(...inputCtx: C): Promise(inputCtx_0: { + body: { + password: string; + }; + } & { + method?: "POST" | undefined; + } & { + query?: Record | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { totpURI: string; @@ -13877,119 +12206,30 @@ declare const auth: { path: "/two-factor/get-totp-uri"; }; verifyTOTP: { - ; - }, "strip", zod.ZodTypeAny, { + (inputCtx_0: { + body: { code: string; trustDevice?: boolean | undefined; - }, { - code: string; - trustDevice?: boolean | undefined; - }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; - metadata: { - openapi: { - summary: string; - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - status: { - type: string; - }; - }; - }; - }; - }; - }; - }; - }; }; } & { - use: any[]; - }>]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: string; @@ -14027,77 +12267,6 @@ declare const auth: { code: string; trustDevice?: boolean | undefined; }>; - use: ((inputContext: better_call.MiddlewareInputContext<{ - body: zod.ZodObject<{ - trustDevice: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - trustDevice?: boolean | undefined; - }, { - trustDevice?: boolean | undefined; - }>; - }>) => Promise<{ - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: better_auth_plugins.UserWithTwoFactor; - }; - } | { - valid: (ctx: better_auth.GenericEndpointContext) => Promise<{ - token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - image: string | null | undefined; - createdAt: Date; - updatedAt: Date; - }; - }>; - invalid: () => Promise; - session: { - session: Record & { - id: string; - createdAt: Date; - updatedAt: Date; - userId: string; - expiresAt: Date; - token: string; - ipAddress?: string | null | undefined; - userAgent?: string | null | undefined; - }; - user: Record & { - id: string; - name: string; - email: string; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - image?: string | null | undefined; - }; - }; - }>)[]; metadata: { openapi: { summary: string; @@ -14176,6 +12345,17 @@ declare const auth: { window: number; max: number; }[]; + $ERROR_CODES: { + readonly OTP_NOT_ENABLED: "OTP not enabled"; + readonly OTP_HAS_EXPIRED: "OTP has expired"; + readonly TOTP_NOT_ENABLED: "TOTP not enabled"; + readonly TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled"; + readonly BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled"; + readonly INVALID_BACKUP_CODE: "Invalid backup code"; + readonly INVALID_CODE: "Invalid code"; + readonly TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: "Too many attempts. Please request a new code."; + readonly INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"; + }; } | { id: "expo"; init: (ctx: better_auth.AuthContext) => { @@ -14193,146 +12373,143 @@ declare const auth: { }[]; }; } | { - id: "anonymous"; + id: "one-time-token"; endpoints: { - signInAnonymous: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - createdAt: Date; - updatedAt: Date; - }; - } | null; + }; } : { token: string; - user: { - id: string; - email: string; - emailVerified: boolean; - name: string; - createdAt: Date; - updatedAt: Date; - }; - } | null>; + }>; options: { - method: "POST"; - metadata: { - openapi: { - description: string; - responses: { - 200: { - description: string; - content: { - "application/json": { - schema: { - type: "object"; - properties: { - user: { - $ref: string; - }; - session: { - $ref: string; - }; - }; - }; - }; - }; - }; + method: "GET"; + use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ + session: { + session: Record & { + id: string; + createdAt: Date; + updatedAt: Date; + userId: string; + expiresAt: Date; + token: string; + ipAddress?: string | null | undefined; + userAgent?: string | null | undefined; + }; + user: Record & { + id: string; + name: string; + email: string; + emailVerified: boolean; + createdAt: Date; + updatedAt: Date; + image?: string | null | undefined; }; }; - }; + }>)[]; } & { use: any[]; }; - path: "/sign-in/anonymous"; + path: "/one-time-token/generate"; }; - }; - hooks: { - after: { - matcher(ctx: better_auth.HookEndpointContext): boolean; - handler: (inputContext: better_call.MiddlewareInputContext) => Promise; - }[]; - }; - schema: { - user: { - fields: { - isAnonymous: { - type: "boolean"; - required: false; + verifyOneTimeToken: { + (inputCtx_0: { + body: { + token: string; }; + } & { + method?: "POST" | undefined; + } & { + query?: Record | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { + headers: Headers; + response: { + session: better_auth.Session & Record; + user: better_auth.User & Record; + }; + } : { + session: better_auth.Session & Record; + user: better_auth.User & Record; + }>; + options: { + method: "POST"; + body: zod.ZodObject<{ + token: zod.ZodString; + }, "strip", zod.ZodTypeAny, { + token: string; + }, { + token: string; + }>; + } & { + use: any[]; }; + path: "/one-time-token/verify"; }; }; - $ERROR_CODES: { - readonly FAILED_TO_CREATE_USER: "Failed to create user"; - readonly COULD_NOT_CREATE_SESSION: "Could not create session"; - readonly ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously"; - }; } | { id: "custom-session"; endpoints: { getSession: { - ]>>; - disableRefresh: zod.ZodOptional; - }, "strip", zod.ZodTypeAny, { - disableCookieCache?: boolean | undefined; - disableRefresh?: boolean | undefined; - }, { + (inputCtx_0: { + body?: undefined; + } & { + method?: "GET" | undefined; + } & { + query?: { disableCookieCache?: string | boolean | undefined; disableRefresh?: boolean | undefined; - }>>; + } | undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise; + } & { + request?: Request; + } & { + headers: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { user: { @@ -14402,9 +12579,6 @@ declare const auth: { } | null>; options: { method: "GET"; - metadata: { - CUSTOM_SESSION: boolean; - }; query: zod.ZodOptional]>>; disableRefresh: zod.ZodOptional; @@ -14415,6 +12589,29 @@ declare const auth: { disableCookieCache?: string | boolean | undefined; disableRefresh?: boolean | undefined; }>>; + metadata: { + CUSTOM_SESSION: boolean; + openapi: { + description: string; + responses: { + "200": { + description: string; + content: { + "application/json": { + schema: { + type: "array"; + nullable: boolean; + items: { + $ref: string; + }; + }; + }; + }; + }; + }; + }; + }; + requireHeaders: true; } & { use: any[]; }; @@ -14425,15 +12622,27 @@ declare const auth: { id: "customGetProviders"; endpoints: { customGetProviders: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: any; } : any>; @@ -14449,15 +12658,27 @@ declare const auth: { id: "customCreateSession"; endpoints: { customCreateSession: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { ck: string; @@ -14479,15 +12700,27 @@ declare const auth: { id: "getAccountInfo"; endpoints: { getAccountInfo: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { id: string; @@ -14523,15 +12756,27 @@ declare const auth: { id: "customUpdateUser"; endpoints: { customUpdateUser: { - (inputCtx_0?: ({ + body?: undefined; } & { - use: any[]; - }> | undefined)?]>(...inputCtx: C): Promise | undefined; + } & { + params?: Record; + } & { + request?: Request; + } & { + headers?: HeadersInit; + } & { + asResponse?: boolean; + returnHeaders?: boolean; + use?: better_call.Middleware[]; + path?: string; + } & { + asResponse?: AsResponse | undefined; + returnHeaders?: ReturnHeaders | undefined; + }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: string | null; } : string | null>; @@ -14568,14 +12813,19 @@ declare const auth: { image?: string | null | undefined | undefined; handle: string; twoFactorEnabled: boolean | null | undefined; - isAnonymous?: boolean | null | undefined; }; }; }; $ERROR_CODES: { - readonly FAILED_TO_CREATE_USER: "Failed to create user"; - readonly COULD_NOT_CREATE_SESSION: "Could not create session"; - readonly ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously"; + readonly OTP_NOT_ENABLED: "OTP not enabled"; + readonly OTP_HAS_EXPIRED: "OTP has expired"; + readonly TOTP_NOT_ENABLED: "TOTP not enabled"; + readonly TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled"; + readonly BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled"; + readonly INVALID_BACKUP_CODE: "Invalid backup code"; + readonly INVALID_CODE: "Invalid code"; + readonly TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: "Too many attempts. Please request a new code."; + readonly INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"; } & { USER_NOT_FOUND: string; FAILED_TO_CREATE_USER: string; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2cab40503..26b11c2d6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: overrides: '@electron/node-gyp': 10.2.0-electron.2 - is-core-module: npm:@nolyfill/is-core-module@1 - isarray: npm:@nolyfill/isarray@1 + is-core-module: npm:@nolyfill/is-core-module@1.0.39 + isarray: npm:@nolyfill/isarray@1.0.44 react: 18.3.1 react-dom: 18.3.1 unist-util-visit-parents: 5.1.3