@agentuity/auth 0.0.109 → 0.0.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/AGENTS.md +82 -28
  2. package/README.md +259 -236
  3. package/dist/agentuity/config.d.ts +2386 -0
  4. package/dist/agentuity/config.d.ts.map +1 -0
  5. package/dist/agentuity/config.js +220 -0
  6. package/dist/agentuity/config.js.map +1 -0
  7. package/dist/agentuity/plugins/api-key.d.ts +152 -0
  8. package/dist/agentuity/plugins/api-key.d.ts.map +1 -0
  9. package/dist/agentuity/plugins/api-key.js +21 -0
  10. package/dist/agentuity/plugins/api-key.js.map +1 -0
  11. package/dist/agentuity/plugins/index.d.ts +23 -0
  12. package/dist/agentuity/plugins/index.d.ts.map +1 -0
  13. package/dist/agentuity/plugins/index.js +10 -0
  14. package/dist/agentuity/plugins/index.js.map +1 -0
  15. package/dist/agentuity/plugins/jwt.d.ts +34 -0
  16. package/dist/agentuity/plugins/jwt.d.ts.map +1 -0
  17. package/dist/agentuity/plugins/jwt.js +11 -0
  18. package/dist/agentuity/plugins/jwt.js.map +1 -0
  19. package/dist/agentuity/plugins/organization.d.ts +355 -0
  20. package/dist/agentuity/plugins/organization.d.ts.map +1 -0
  21. package/dist/agentuity/plugins/organization.js +12 -0
  22. package/dist/agentuity/plugins/organization.js.map +1 -0
  23. package/dist/agentuity/react.d.ts +1375 -0
  24. package/dist/agentuity/react.d.ts.map +1 -0
  25. package/dist/agentuity/react.js +206 -0
  26. package/dist/agentuity/react.js.map +1 -0
  27. package/dist/agentuity/server.d.ts +220 -0
  28. package/dist/agentuity/server.d.ts.map +1 -0
  29. package/dist/agentuity/server.js +505 -0
  30. package/dist/agentuity/server.js.map +1 -0
  31. package/dist/agentuity/types.d.ts +172 -0
  32. package/dist/agentuity/types.d.ts.map +1 -0
  33. package/dist/agentuity/types.js +7 -0
  34. package/dist/agentuity/types.js.map +1 -0
  35. package/dist/index.d.ts +31 -8
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +33 -8
  38. package/dist/index.js.map +1 -1
  39. package/dist/schema.d.ts +2922 -0
  40. package/dist/schema.d.ts.map +1 -0
  41. package/dist/schema.js +223 -0
  42. package/dist/schema.js.map +1 -0
  43. package/dist/types.d.ts +14 -18
  44. package/dist/types.d.ts.map +1 -1
  45. package/dist/types.js +1 -1
  46. package/package.json +15 -39
  47. package/src/agentuity/config.ts +401 -0
  48. package/src/agentuity/plugins/api-key.ts +158 -0
  49. package/src/agentuity/plugins/index.ts +35 -0
  50. package/src/agentuity/plugins/jwt.ts +30 -0
  51. package/src/agentuity/plugins/organization.ts +345 -0
  52. package/src/agentuity/react.tsx +328 -0
  53. package/src/agentuity/server.ts +734 -0
  54. package/src/agentuity/types.ts +201 -0
  55. package/src/index.ts +76 -8
  56. package/src/schema.ts +270 -0
  57. package/src/types.ts +14 -22
  58. package/test/agentuity/config.test.ts +621 -0
  59. package/test/agentuity/server.test.ts +537 -0
  60. package/test/schema.test.ts +147 -0
  61. package/tsconfig.json +3 -2
  62. package/tsconfig.tsbuildinfo +1 -1
  63. package/dist/auth0/client.d.ts +0 -44
  64. package/dist/auth0/client.d.ts.map +0 -1
  65. package/dist/auth0/client.js +0 -79
  66. package/dist/auth0/client.js.map +0 -1
  67. package/dist/auth0/index.d.ts +0 -35
  68. package/dist/auth0/index.d.ts.map +0 -1
  69. package/dist/auth0/index.js +0 -38
  70. package/dist/auth0/index.js.map +0 -1
  71. package/dist/auth0/server.d.ts +0 -91
  72. package/dist/auth0/server.d.ts.map +0 -1
  73. package/dist/auth0/server.js +0 -237
  74. package/dist/auth0/server.js.map +0 -1
  75. package/dist/clerk/client.d.ts +0 -42
  76. package/dist/clerk/client.d.ts.map +0 -1
  77. package/dist/clerk/client.js +0 -65
  78. package/dist/clerk/client.js.map +0 -1
  79. package/dist/clerk/index.d.ts +0 -37
  80. package/dist/clerk/index.d.ts.map +0 -1
  81. package/dist/clerk/index.js +0 -35
  82. package/dist/clerk/index.js.map +0 -1
  83. package/dist/clerk/server.d.ts +0 -55
  84. package/dist/clerk/server.d.ts.map +0 -1
  85. package/dist/clerk/server.js +0 -111
  86. package/dist/clerk/server.js.map +0 -1
  87. package/docs/adding-providers.md +0 -261
  88. package/src/auth0/client.tsx +0 -109
  89. package/src/auth0/index.ts +0 -40
  90. package/src/auth0/server.ts +0 -378
  91. package/src/clerk/client.tsx +0 -86
  92. package/src/clerk/index.ts +0 -37
  93. package/src/clerk/server.ts +0 -168
  94. package/test/clerk-client.test.tsx +0 -21
  95. package/test/clerk-server.test.ts +0 -51
@@ -0,0 +1,2386 @@
1
+ /**
2
+ * Auth configuration for @agentuity/auth.
3
+ *
4
+ * Provides sensible defaults and wraps BetterAuth with Agentuity-specific helpers.
5
+ *
6
+ * @module agentuity/config
7
+ */
8
+ import { type BetterAuthOptions } from 'better-auth';
9
+ export type { Organization, OrganizationMember, OrganizationInvitation, OrganizationApiMethods, ApiKey, ApiKeyPluginOptions, ApiKeyApiMethods, JwtApiMethods, DefaultPluginApiMethods, } from './plugins';
10
+ export { DEFAULT_API_KEY_OPTIONS } from './plugins';
11
+ import type { ApiKeyPluginOptions, DefaultPluginApiMethods } from './plugins';
12
+ /**
13
+ * Type for BetterAuth trustedOrigins option.
14
+ * Matches the signature expected by BetterAuthOptions.trustedOrigins.
15
+ */
16
+ type TrustedOrigins = string[] | ((request?: Request) => string[] | Promise<string[]>);
17
+ /**
18
+ * Base interface for the auth instance used by middleware and route handlers.
19
+ *
20
+ * This interface defines the core authentication APIs that Agentuity middleware
21
+ * relies on. It's designed to be stable and middleware-friendly while the full
22
+ * auth instance provides additional type-safe APIs for your application code.
23
+ *
24
+ * @remarks
25
+ * You typically don't interact with this interface directly. Instead, use
26
+ * `createAuth()` to create an auth instance which implements this interface.
27
+ *
28
+ * @see {@link createAuth} - Create an auth instance
29
+ * @see {@link createSessionMiddleware} - Session-based authentication middleware
30
+ * @see {@link createApiKeyMiddleware} - API key authentication middleware
31
+ */
32
+ export interface AuthBase {
33
+ /**
34
+ * HTTP request handler for auth routes.
35
+ *
36
+ * Handles all auth-related endpoints like sign-in, sign-up, sign-out,
37
+ * password reset, OAuth callbacks, and session management.
38
+ *
39
+ * @param request - The incoming HTTP request
40
+ * @returns Response for the auth endpoint
41
+ */
42
+ handler: (request: Request) => Promise<Response>;
43
+ /**
44
+ * Server-side API methods for authentication operations.
45
+ *
46
+ * These methods are used internally by middleware and can also be called
47
+ * directly in your route handlers for custom authentication logic.
48
+ */
49
+ api: {
50
+ /**
51
+ * Get the current session from request headers.
52
+ *
53
+ * @param params - Object containing the request headers
54
+ * @returns The session with user info, or null if not authenticated
55
+ */
56
+ getSession: (params: {
57
+ headers: Headers;
58
+ }) => Promise<{
59
+ user: {
60
+ id: string;
61
+ name?: string | null;
62
+ email: string;
63
+ };
64
+ session: {
65
+ id: string;
66
+ userId: string;
67
+ activeOrganizationId?: string;
68
+ };
69
+ } | null>;
70
+ /**
71
+ * Get full organization details including members.
72
+ *
73
+ * @param params - Object containing the request headers
74
+ * @returns Full organization details, or null if no active org
75
+ */
76
+ getFullOrganization: (params: {
77
+ query?: {
78
+ organizationId?: string;
79
+ organizationSlug?: string;
80
+ membersLimit?: number;
81
+ };
82
+ headers?: Headers;
83
+ }) => Promise<{
84
+ id: string;
85
+ name?: string;
86
+ slug?: string;
87
+ members?: Array<{
88
+ userId: string;
89
+ role: string;
90
+ id?: string;
91
+ }>;
92
+ } | null>;
93
+ /**
94
+ * Verify an API key and get its metadata.
95
+ *
96
+ * @param params - Object containing the API key to verify
97
+ * @returns Validation result with key details if valid
98
+ */
99
+ verifyApiKey: (params: {
100
+ body: {
101
+ key: string;
102
+ };
103
+ }) => Promise<{
104
+ valid: boolean;
105
+ error?: {
106
+ message: string;
107
+ code: string;
108
+ } | null;
109
+ key?: {
110
+ id: string;
111
+ name?: string;
112
+ userId?: string;
113
+ permissions?: Record<string, string[]> | null;
114
+ } | null;
115
+ }>;
116
+ } & DefaultPluginApiMethods;
117
+ }
118
+ /**
119
+ * Configuration options for auth.
120
+ * Extends BetterAuth options with Agentuity-specific settings.
121
+ */
122
+ export interface AuthOptions extends BetterAuthOptions {
123
+ /**
124
+ * PostgreSQL connection string.
125
+ * When provided, we create a Bun SQL connection and Drizzle instance internally.
126
+ * This is the simplest path - just provide the connection string.
127
+ *
128
+ * @example
129
+ * ```typescript
130
+ * createAuth({
131
+ * connectionString: process.env.DATABASE_URL,
132
+ * });
133
+ * ```
134
+ */
135
+ connectionString?: string;
136
+ /**
137
+ * Skip default plugins (organization, jwt, bearer, apiKey).
138
+ * Use this if you want full control over plugins.
139
+ */
140
+ skipDefaultPlugins?: boolean;
141
+ /**
142
+ * API Key plugin configuration.
143
+ * Set to false to disable the API key plugin entirely.
144
+ */
145
+ apiKey?: ApiKeyPluginOptions | false;
146
+ }
147
+ /**
148
+ * Default plugins included with Agentuity auth.
149
+ *
150
+ * @param apiKeyOptions - API key plugin options, or false to disable
151
+ */
152
+ export declare function getDefaultPlugins(apiKeyOptions?: ApiKeyPluginOptions | false): any[];
153
+ /**
154
+ * Create an Auth instance.
155
+ *
156
+ * This wraps BetterAuth with sensible defaults for Agentuity projects:
157
+ * - Default basePath: '/api/auth'
158
+ * - Email/password authentication enabled by default
159
+ * - Organization plugin for multi-tenancy
160
+ * - JWT plugin for token-based auth
161
+ * - Bearer plugin for API auth
162
+ * - API Key plugin for programmatic access
163
+ * - Experimental joins enabled by default for better performance
164
+ *
165
+ * @example Option A: Connection string (simplest)
166
+ * ```typescript
167
+ * import { createAuth } from '@agentuity/auth';
168
+ *
169
+ * export const auth = createAuth({
170
+ * connectionString: process.env.DATABASE_URL,
171
+ * });
172
+ * ```
173
+ *
174
+ * @example Option B: Bring your own Drizzle
175
+ * ```typescript
176
+ * import { drizzle } from 'drizzle-orm/bun-sql';
177
+ * import { drizzleAdapter } from 'better-auth/adapters/drizzle';
178
+ * import * as authSchema from '@agentuity/auth/schema';
179
+ *
180
+ * const schema = { ...authSchema, ...myAppSchema };
181
+ * const db = drizzle(connectionString, { schema });
182
+ *
183
+ * export const auth = createAuth({
184
+ * database: drizzleAdapter(db, { provider: 'pg', schema: authSchema }),
185
+ * });
186
+ * ```
187
+ *
188
+ * @example Option C: Other adapters (Prisma, MongoDB, etc.)
189
+ * ```typescript
190
+ * import { prismaAdapter } from 'better-auth/adapters/prisma';
191
+ *
192
+ * export const auth = createAuth({
193
+ * database: prismaAdapter(new PrismaClient()),
194
+ * });
195
+ * ```
196
+ */
197
+ export declare function createAuth<T extends AuthOptions>(options: T): AuthBase & import("better-auth").Auth<Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
198
+ trustedOrigins: TrustedOrigins;
199
+ plugins: any[];
200
+ secret?: string | undefined;
201
+ baseURL?: string | undefined;
202
+ database: T["database"] | undefined;
203
+ basePath: NonNullable<T["basePath"]>;
204
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
205
+ enabled: true;
206
+ };
207
+ experimental: {
208
+ joins: boolean;
209
+ };
210
+ }> & {
211
+ api: import("better-auth").InferAPI<{
212
+ readonly ok: import("better-auth").StrictEndpoint<"/ok", {
213
+ method: "GET";
214
+ metadata: {
215
+ openapi: {
216
+ description: string;
217
+ responses: {
218
+ "200": {
219
+ description: string;
220
+ content: {
221
+ "application/json": {
222
+ schema: {
223
+ type: "object";
224
+ properties: {
225
+ ok: {
226
+ type: string;
227
+ description: string;
228
+ };
229
+ };
230
+ required: string[];
231
+ };
232
+ };
233
+ };
234
+ };
235
+ };
236
+ };
237
+ scope: "server";
238
+ };
239
+ }, {
240
+ ok: boolean;
241
+ }>;
242
+ readonly error: import("better-auth").StrictEndpoint<"/error", {
243
+ method: "GET";
244
+ metadata: {
245
+ openapi: {
246
+ description: string;
247
+ responses: {
248
+ "200": {
249
+ description: string;
250
+ content: {
251
+ "text/html": {
252
+ schema: {
253
+ type: "string";
254
+ description: string;
255
+ };
256
+ };
257
+ };
258
+ };
259
+ };
260
+ };
261
+ scope: "server";
262
+ };
263
+ }, Response>;
264
+ readonly signInSocial: import("better-auth").StrictEndpoint<"/sign-in/social", {
265
+ method: "POST";
266
+ operationId: string;
267
+ body: import("better-auth").ZodObject<{
268
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
269
+ newUserCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
270
+ errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
271
+ provider: import("better-auth").ZodType<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown, import("better-auth").$ZodTypeInternals<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown>>;
272
+ disableRedirect: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
273
+ idToken: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
274
+ token: import("better-auth").ZodString;
275
+ nonce: import("better-auth").ZodOptional<import("better-auth").ZodString>;
276
+ accessToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
277
+ refreshToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
278
+ expiresAt: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
279
+ }, import("better-auth").$strip>>;
280
+ scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
281
+ requestSignUp: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
282
+ loginHint: import("better-auth").ZodOptional<import("better-auth").ZodString>;
283
+ additionalData: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
284
+ }, import("better-auth").$strip>;
285
+ metadata: {
286
+ $Infer: {
287
+ body: import("better-auth").infer<import("better-auth").ZodObject<{
288
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
289
+ newUserCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
290
+ errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
291
+ provider: import("better-auth").ZodType<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown, import("better-auth").$ZodTypeInternals<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown>>;
292
+ disableRedirect: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
293
+ idToken: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
294
+ token: import("better-auth").ZodString;
295
+ nonce: import("better-auth").ZodOptional<import("better-auth").ZodString>;
296
+ accessToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
297
+ refreshToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
298
+ expiresAt: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
299
+ }, import("better-auth").$strip>>;
300
+ scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
301
+ requestSignUp: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
302
+ loginHint: import("better-auth").ZodOptional<import("better-auth").ZodString>;
303
+ additionalData: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
304
+ }, import("better-auth").$strip>>;
305
+ returned: {
306
+ redirect: boolean;
307
+ token?: string | undefined;
308
+ url?: string | undefined;
309
+ user?: import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
310
+ id: string;
311
+ createdAt: Date;
312
+ updatedAt: Date;
313
+ email: string;
314
+ emailVerified: boolean;
315
+ name: string;
316
+ image?: string | null | undefined;
317
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
318
+ trustedOrigins: TrustedOrigins;
319
+ plugins: any[];
320
+ secret?: string | undefined;
321
+ baseURL?: string | undefined;
322
+ database: T["database"] | undefined;
323
+ basePath: NonNullable<T["basePath"]>;
324
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
325
+ enabled: true;
326
+ };
327
+ experimental: {
328
+ joins: boolean;
329
+ };
330
+ } extends infer T_1 ? T_1 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
331
+ trustedOrigins: TrustedOrigins;
332
+ plugins: any[];
333
+ secret?: string | undefined;
334
+ baseURL?: string | undefined;
335
+ database: T["database"] | undefined;
336
+ basePath: NonNullable<T["basePath"]>;
337
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
338
+ enabled: true;
339
+ };
340
+ experimental: {
341
+ joins: boolean;
342
+ };
343
+ } ? T_1 extends BetterAuthOptions ? import("better-auth").AdditionalUserFieldsOutput<T_1> : T_1 extends import("better-auth").Auth ? import("better-auth").AdditionalUserFieldsOutput<T_1["options"]> : {} : never : never)>> | undefined;
344
+ };
345
+ };
346
+ openapi: {
347
+ description: string;
348
+ operationId: string;
349
+ responses: {
350
+ "200": {
351
+ description: string;
352
+ content: {
353
+ "application/json": {
354
+ schema: {
355
+ type: "object";
356
+ description: string;
357
+ properties: {
358
+ token: {
359
+ type: string;
360
+ };
361
+ user: {
362
+ type: string;
363
+ $ref: string;
364
+ };
365
+ url: {
366
+ type: string;
367
+ };
368
+ redirect: {
369
+ type: string;
370
+ enum: boolean[];
371
+ };
372
+ };
373
+ required: string[];
374
+ };
375
+ };
376
+ };
377
+ };
378
+ };
379
+ };
380
+ };
381
+ }, {
382
+ redirect: boolean;
383
+ url: string;
384
+ } | {
385
+ redirect: boolean;
386
+ token: string;
387
+ url: undefined;
388
+ user: import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
389
+ id: string;
390
+ createdAt: Date;
391
+ updatedAt: Date;
392
+ email: string;
393
+ emailVerified: boolean;
394
+ name: string;
395
+ image?: string | null | undefined;
396
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
397
+ trustedOrigins: TrustedOrigins;
398
+ plugins: any[];
399
+ secret?: string | undefined;
400
+ baseURL?: string | undefined;
401
+ database: T["database"] | undefined;
402
+ basePath: NonNullable<T["basePath"]>;
403
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
404
+ enabled: true;
405
+ };
406
+ experimental: {
407
+ joins: boolean;
408
+ };
409
+ } extends infer T_2 ? T_2 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
410
+ trustedOrigins: TrustedOrigins;
411
+ plugins: any[];
412
+ secret?: string | undefined;
413
+ baseURL?: string | undefined;
414
+ database: T["database"] | undefined;
415
+ basePath: NonNullable<T["basePath"]>;
416
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
417
+ enabled: true;
418
+ };
419
+ experimental: {
420
+ joins: boolean;
421
+ };
422
+ } ? T_2 extends BetterAuthOptions ? import("better-auth").AdditionalUserFieldsOutput<T_2> : T_2 extends import("better-auth").Auth ? import("better-auth").AdditionalUserFieldsOutput<T_2["options"]> : {} : never : never)>>;
423
+ }>;
424
+ readonly callbackOAuth: import("better-auth").StrictEndpoint<"/callback/:id", {
425
+ method: ("GET" | "POST")[];
426
+ operationId: string;
427
+ body: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
428
+ code: import("better-auth").ZodOptional<import("better-auth").ZodString>;
429
+ error: import("better-auth").ZodOptional<import("better-auth").ZodString>;
430
+ device_id: import("better-auth").ZodOptional<import("better-auth").ZodString>;
431
+ error_description: import("better-auth").ZodOptional<import("better-auth").ZodString>;
432
+ state: import("better-auth").ZodOptional<import("better-auth").ZodString>;
433
+ user: import("better-auth").ZodOptional<import("better-auth").ZodString>;
434
+ }, import("better-auth").$strip>>;
435
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
436
+ code: import("better-auth").ZodOptional<import("better-auth").ZodString>;
437
+ error: import("better-auth").ZodOptional<import("better-auth").ZodString>;
438
+ device_id: import("better-auth").ZodOptional<import("better-auth").ZodString>;
439
+ error_description: import("better-auth").ZodOptional<import("better-auth").ZodString>;
440
+ state: import("better-auth").ZodOptional<import("better-auth").ZodString>;
441
+ user: import("better-auth").ZodOptional<import("better-auth").ZodString>;
442
+ }, import("better-auth").$strip>>;
443
+ metadata: {
444
+ allowedMediaTypes: string[];
445
+ scope: "server";
446
+ };
447
+ }, void>;
448
+ readonly getSession: import("better-auth").StrictEndpoint<"/get-session", {
449
+ method: "GET";
450
+ operationId: string;
451
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
452
+ disableCookieCache: import("better-auth").ZodOptional<import("better-auth").ZodCoercedBoolean<unknown>>;
453
+ disableRefresh: import("better-auth").ZodOptional<import("better-auth").ZodCoercedBoolean<unknown>>;
454
+ }, import("better-auth").$strip>>;
455
+ requireHeaders: true;
456
+ metadata: {
457
+ openapi: {
458
+ operationId: string;
459
+ description: string;
460
+ responses: {
461
+ "200": {
462
+ description: string;
463
+ content: {
464
+ "application/json": {
465
+ schema: {
466
+ type: "object";
467
+ nullable: boolean;
468
+ properties: {
469
+ session: {
470
+ $ref: string;
471
+ };
472
+ user: {
473
+ $ref: string;
474
+ };
475
+ };
476
+ required: string[];
477
+ };
478
+ };
479
+ };
480
+ };
481
+ };
482
+ };
483
+ };
484
+ }, {
485
+ session: import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
486
+ id: string;
487
+ createdAt: Date;
488
+ updatedAt: Date;
489
+ userId: string;
490
+ expiresAt: Date;
491
+ token: string;
492
+ ipAddress?: string | null | undefined;
493
+ userAgent?: string | null | undefined;
494
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
495
+ trustedOrigins: TrustedOrigins;
496
+ plugins: any[];
497
+ secret?: string | undefined;
498
+ baseURL?: string | undefined;
499
+ database: T["database"] | undefined;
500
+ basePath: NonNullable<T["basePath"]>;
501
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
502
+ enabled: true;
503
+ };
504
+ experimental: {
505
+ joins: boolean;
506
+ };
507
+ } extends infer T_3 ? T_3 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
508
+ trustedOrigins: TrustedOrigins;
509
+ plugins: any[];
510
+ secret?: string | undefined;
511
+ baseURL?: string | undefined;
512
+ database: T["database"] | undefined;
513
+ basePath: NonNullable<T["basePath"]>;
514
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
515
+ enabled: true;
516
+ };
517
+ experimental: {
518
+ joins: boolean;
519
+ };
520
+ } ? T_3 extends BetterAuthOptions ? import("better-auth").AdditionalSessionFieldsOutput<T_3> : T_3 extends import("better-auth").Auth ? import("better-auth").AdditionalSessionFieldsOutput<T_3["options"]> : {} : never : never)>>;
521
+ user: import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
522
+ id: string;
523
+ createdAt: Date;
524
+ updatedAt: Date;
525
+ email: string;
526
+ emailVerified: boolean;
527
+ name: string;
528
+ image?: string | null | undefined;
529
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
530
+ trustedOrigins: TrustedOrigins;
531
+ plugins: any[];
532
+ secret?: string | undefined;
533
+ baseURL?: string | undefined;
534
+ database: T["database"] | undefined;
535
+ basePath: NonNullable<T["basePath"]>;
536
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
537
+ enabled: true;
538
+ };
539
+ experimental: {
540
+ joins: boolean;
541
+ };
542
+ } extends infer T_4 ? T_4 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
543
+ trustedOrigins: TrustedOrigins;
544
+ plugins: any[];
545
+ secret?: string | undefined;
546
+ baseURL?: string | undefined;
547
+ database: T["database"] | undefined;
548
+ basePath: NonNullable<T["basePath"]>;
549
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
550
+ enabled: true;
551
+ };
552
+ experimental: {
553
+ joins: boolean;
554
+ };
555
+ } ? T_4 extends BetterAuthOptions ? import("better-auth").AdditionalUserFieldsOutput<T_4> : T_4 extends import("better-auth").Auth ? import("better-auth").AdditionalUserFieldsOutput<T_4["options"]> : {} : never : never)>>;
556
+ } | null>;
557
+ readonly signOut: import("better-auth").StrictEndpoint<"/sign-out", {
558
+ method: "POST";
559
+ operationId: string;
560
+ requireHeaders: true;
561
+ metadata: {
562
+ openapi: {
563
+ operationId: string;
564
+ description: string;
565
+ responses: {
566
+ "200": {
567
+ description: string;
568
+ content: {
569
+ "application/json": {
570
+ schema: {
571
+ type: "object";
572
+ properties: {
573
+ success: {
574
+ type: string;
575
+ };
576
+ };
577
+ };
578
+ };
579
+ };
580
+ };
581
+ };
582
+ };
583
+ };
584
+ }, {
585
+ success: boolean;
586
+ }>;
587
+ readonly signUpEmail: import("better-auth").StrictEndpoint<"/sign-up/email", {
588
+ method: "POST";
589
+ operationId: string;
590
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
591
+ body: import("better-auth").ZodIntersection<import("better-auth").ZodObject<{
592
+ name: import("better-auth").ZodString;
593
+ email: import("better-auth").ZodEmail;
594
+ password: import("better-auth").ZodString;
595
+ image: import("better-auth").ZodOptional<import("better-auth").ZodString>;
596
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
597
+ rememberMe: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
598
+ }, import("better-auth").$strip>, import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
599
+ metadata: {
600
+ allowedMediaTypes: string[];
601
+ $Infer: {
602
+ body: {
603
+ name: string;
604
+ email: string;
605
+ password: string;
606
+ image?: string | undefined;
607
+ callbackURL?: string | undefined;
608
+ rememberMe?: boolean | undefined;
609
+ } & import("better-auth/db").InferFieldsFromPlugins<Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
610
+ trustedOrigins: TrustedOrigins;
611
+ plugins: any[];
612
+ secret?: string | undefined;
613
+ baseURL?: string | undefined;
614
+ database: T["database"] | undefined;
615
+ basePath: NonNullable<T["basePath"]>;
616
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
617
+ enabled: true;
618
+ };
619
+ experimental: {
620
+ joins: boolean;
621
+ };
622
+ }, "user", "input"> & import("better-auth/db").InferFieldsFromOptions<Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
623
+ trustedOrigins: TrustedOrigins;
624
+ plugins: any[];
625
+ secret?: string | undefined;
626
+ baseURL?: string | undefined;
627
+ database: T["database"] | undefined;
628
+ basePath: NonNullable<T["basePath"]>;
629
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
630
+ enabled: true;
631
+ };
632
+ experimental: {
633
+ joins: boolean;
634
+ };
635
+ }, "user", "input">;
636
+ returned: {
637
+ token: string | null;
638
+ user: import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
639
+ id: string;
640
+ createdAt: Date;
641
+ updatedAt: Date;
642
+ email: string;
643
+ emailVerified: boolean;
644
+ name: string;
645
+ image?: string | null | undefined;
646
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
647
+ trustedOrigins: TrustedOrigins;
648
+ plugins: any[];
649
+ secret?: string | undefined;
650
+ baseURL?: string | undefined;
651
+ database: T["database"] | undefined;
652
+ basePath: NonNullable<T["basePath"]>;
653
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
654
+ enabled: true;
655
+ };
656
+ experimental: {
657
+ joins: boolean;
658
+ };
659
+ } extends infer T_5 ? T_5 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
660
+ trustedOrigins: TrustedOrigins;
661
+ plugins: any[];
662
+ secret?: string | undefined;
663
+ baseURL?: string | undefined;
664
+ database: T["database"] | undefined;
665
+ basePath: NonNullable<T["basePath"]>;
666
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
667
+ enabled: true;
668
+ };
669
+ experimental: {
670
+ joins: boolean;
671
+ };
672
+ } ? T_5 extends BetterAuthOptions ? import("better-auth").AdditionalUserFieldsOutput<T_5> : T_5 extends import("better-auth").Auth ? import("better-auth").AdditionalUserFieldsOutput<T_5["options"]> : {} : never : never)>>;
673
+ };
674
+ };
675
+ openapi: {
676
+ operationId: string;
677
+ description: string;
678
+ requestBody: {
679
+ content: {
680
+ "application/json": {
681
+ schema: {
682
+ type: "object";
683
+ properties: {
684
+ name: {
685
+ type: string;
686
+ description: string;
687
+ };
688
+ email: {
689
+ type: string;
690
+ description: string;
691
+ };
692
+ password: {
693
+ type: string;
694
+ description: string;
695
+ };
696
+ image: {
697
+ type: string;
698
+ description: string;
699
+ };
700
+ callbackURL: {
701
+ type: string;
702
+ description: string;
703
+ };
704
+ rememberMe: {
705
+ type: string;
706
+ description: string;
707
+ };
708
+ };
709
+ required: string[];
710
+ };
711
+ };
712
+ };
713
+ };
714
+ responses: {
715
+ "200": {
716
+ description: string;
717
+ content: {
718
+ "application/json": {
719
+ schema: {
720
+ type: "object";
721
+ properties: {
722
+ token: {
723
+ type: string;
724
+ nullable: boolean;
725
+ description: string;
726
+ };
727
+ user: {
728
+ type: string;
729
+ properties: {
730
+ id: {
731
+ type: string;
732
+ description: string;
733
+ };
734
+ email: {
735
+ type: string;
736
+ format: string;
737
+ description: string;
738
+ };
739
+ name: {
740
+ type: string;
741
+ description: string;
742
+ };
743
+ image: {
744
+ type: string;
745
+ format: string;
746
+ nullable: boolean;
747
+ description: string;
748
+ };
749
+ emailVerified: {
750
+ type: string;
751
+ description: string;
752
+ };
753
+ createdAt: {
754
+ type: string;
755
+ format: string;
756
+ description: string;
757
+ };
758
+ updatedAt: {
759
+ type: string;
760
+ format: string;
761
+ description: string;
762
+ };
763
+ };
764
+ required: string[];
765
+ };
766
+ };
767
+ required: string[];
768
+ };
769
+ };
770
+ };
771
+ };
772
+ "422": {
773
+ description: string;
774
+ content: {
775
+ "application/json": {
776
+ schema: {
777
+ type: "object";
778
+ properties: {
779
+ message: {
780
+ type: string;
781
+ };
782
+ };
783
+ };
784
+ };
785
+ };
786
+ };
787
+ };
788
+ };
789
+ };
790
+ }, {
791
+ token: null;
792
+ user: import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
793
+ id: string;
794
+ createdAt: Date;
795
+ updatedAt: Date;
796
+ email: string;
797
+ emailVerified: boolean;
798
+ name: string;
799
+ image?: string | null | undefined;
800
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
801
+ trustedOrigins: TrustedOrigins;
802
+ plugins: any[];
803
+ secret?: string | undefined;
804
+ baseURL?: string | undefined;
805
+ database: T["database"] | undefined;
806
+ basePath: NonNullable<T["basePath"]>;
807
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
808
+ enabled: true;
809
+ };
810
+ experimental: {
811
+ joins: boolean;
812
+ };
813
+ } extends infer T_6 ? T_6 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
814
+ trustedOrigins: TrustedOrigins;
815
+ plugins: any[];
816
+ secret?: string | undefined;
817
+ baseURL?: string | undefined;
818
+ database: T["database"] | undefined;
819
+ basePath: NonNullable<T["basePath"]>;
820
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
821
+ enabled: true;
822
+ };
823
+ experimental: {
824
+ joins: boolean;
825
+ };
826
+ } ? T_6 extends BetterAuthOptions ? import("better-auth").AdditionalUserFieldsOutput<T_6> : T_6 extends import("better-auth").Auth ? import("better-auth").AdditionalUserFieldsOutput<T_6["options"]> : {} : never : never)>>;
827
+ } | {
828
+ token: string;
829
+ user: import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
830
+ id: string;
831
+ createdAt: Date;
832
+ updatedAt: Date;
833
+ email: string;
834
+ emailVerified: boolean;
835
+ name: string;
836
+ image?: string | null | undefined;
837
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
838
+ trustedOrigins: TrustedOrigins;
839
+ plugins: any[];
840
+ secret?: string | undefined;
841
+ baseURL?: string | undefined;
842
+ database: T["database"] | undefined;
843
+ basePath: NonNullable<T["basePath"]>;
844
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
845
+ enabled: true;
846
+ };
847
+ experimental: {
848
+ joins: boolean;
849
+ };
850
+ } extends infer T_7 ? T_7 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
851
+ trustedOrigins: TrustedOrigins;
852
+ plugins: any[];
853
+ secret?: string | undefined;
854
+ baseURL?: string | undefined;
855
+ database: T["database"] | undefined;
856
+ basePath: NonNullable<T["basePath"]>;
857
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
858
+ enabled: true;
859
+ };
860
+ experimental: {
861
+ joins: boolean;
862
+ };
863
+ } ? T_7 extends BetterAuthOptions ? import("better-auth").AdditionalUserFieldsOutput<T_7> : T_7 extends import("better-auth").Auth ? import("better-auth").AdditionalUserFieldsOutput<T_7["options"]> : {} : never : never)>>;
864
+ }>;
865
+ readonly signInEmail: import("better-auth").StrictEndpoint<"/sign-in/email", {
866
+ method: "POST";
867
+ operationId: string;
868
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
869
+ body: import("better-auth").ZodObject<{
870
+ email: import("better-auth").ZodString;
871
+ password: import("better-auth").ZodString;
872
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
873
+ rememberMe: import("better-auth").ZodOptional<import("better-auth").ZodDefault<import("better-auth").ZodBoolean>>;
874
+ }, import("better-auth").$strip>;
875
+ metadata: {
876
+ allowedMediaTypes: string[];
877
+ $Infer: {
878
+ body: {
879
+ email: string;
880
+ password: string;
881
+ callbackURL?: string | undefined;
882
+ rememberMe?: boolean | undefined;
883
+ };
884
+ returned: {
885
+ redirect: boolean;
886
+ token: string;
887
+ url?: string | undefined;
888
+ user: import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
889
+ id: string;
890
+ createdAt: Date;
891
+ updatedAt: Date;
892
+ email: string;
893
+ emailVerified: boolean;
894
+ name: string;
895
+ image?: string | null | undefined;
896
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
897
+ trustedOrigins: TrustedOrigins;
898
+ plugins: any[];
899
+ secret?: string | undefined;
900
+ baseURL?: string | undefined;
901
+ database: T["database"] | undefined;
902
+ basePath: NonNullable<T["basePath"]>;
903
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
904
+ enabled: true;
905
+ };
906
+ experimental: {
907
+ joins: boolean;
908
+ };
909
+ } extends infer T_8 ? T_8 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
910
+ trustedOrigins: TrustedOrigins;
911
+ plugins: any[];
912
+ secret?: string | undefined;
913
+ baseURL?: string | undefined;
914
+ database: T["database"] | undefined;
915
+ basePath: NonNullable<T["basePath"]>;
916
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
917
+ enabled: true;
918
+ };
919
+ experimental: {
920
+ joins: boolean;
921
+ };
922
+ } ? T_8 extends BetterAuthOptions ? import("better-auth").AdditionalUserFieldsOutput<T_8> : T_8 extends import("better-auth").Auth ? import("better-auth").AdditionalUserFieldsOutput<T_8["options"]> : {} : never : never)>>;
923
+ };
924
+ };
925
+ openapi: {
926
+ operationId: string;
927
+ description: string;
928
+ responses: {
929
+ "200": {
930
+ description: string;
931
+ content: {
932
+ "application/json": {
933
+ schema: {
934
+ type: "object";
935
+ description: string;
936
+ properties: {
937
+ redirect: {
938
+ type: string;
939
+ enum: boolean[];
940
+ };
941
+ token: {
942
+ type: string;
943
+ description: string;
944
+ };
945
+ url: {
946
+ type: string;
947
+ nullable: boolean;
948
+ };
949
+ user: {
950
+ type: string;
951
+ $ref: string;
952
+ };
953
+ };
954
+ required: string[];
955
+ };
956
+ };
957
+ };
958
+ };
959
+ };
960
+ };
961
+ };
962
+ }, {
963
+ redirect: boolean;
964
+ token: string;
965
+ url?: string | undefined;
966
+ user: import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
967
+ id: string;
968
+ createdAt: Date;
969
+ updatedAt: Date;
970
+ email: string;
971
+ emailVerified: boolean;
972
+ name: string;
973
+ image?: string | null | undefined;
974
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
975
+ trustedOrigins: TrustedOrigins;
976
+ plugins: any[];
977
+ secret?: string | undefined;
978
+ baseURL?: string | undefined;
979
+ database: T["database"] | undefined;
980
+ basePath: NonNullable<T["basePath"]>;
981
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
982
+ enabled: true;
983
+ };
984
+ experimental: {
985
+ joins: boolean;
986
+ };
987
+ } extends infer T_9 ? T_9 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
988
+ trustedOrigins: TrustedOrigins;
989
+ plugins: any[];
990
+ secret?: string | undefined;
991
+ baseURL?: string | undefined;
992
+ database: T["database"] | undefined;
993
+ basePath: NonNullable<T["basePath"]>;
994
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
995
+ enabled: true;
996
+ };
997
+ experimental: {
998
+ joins: boolean;
999
+ };
1000
+ } ? T_9 extends BetterAuthOptions ? import("better-auth").AdditionalUserFieldsOutput<T_9> : T_9 extends import("better-auth").Auth ? import("better-auth").AdditionalUserFieldsOutput<T_9["options"]> : {} : never : never)>>;
1001
+ }>;
1002
+ readonly resetPassword: import("better-auth").StrictEndpoint<"/reset-password", {
1003
+ method: "POST";
1004
+ operationId: string;
1005
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
1006
+ token: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1007
+ }, import("better-auth").$strip>>;
1008
+ body: import("better-auth").ZodObject<{
1009
+ newPassword: import("better-auth").ZodString;
1010
+ token: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1011
+ }, import("better-auth").$strip>;
1012
+ metadata: {
1013
+ openapi: {
1014
+ operationId: string;
1015
+ description: string;
1016
+ responses: {
1017
+ "200": {
1018
+ description: string;
1019
+ content: {
1020
+ "application/json": {
1021
+ schema: {
1022
+ type: "object";
1023
+ properties: {
1024
+ status: {
1025
+ type: string;
1026
+ };
1027
+ };
1028
+ };
1029
+ };
1030
+ };
1031
+ };
1032
+ };
1033
+ };
1034
+ };
1035
+ }, {
1036
+ status: boolean;
1037
+ }>;
1038
+ readonly verifyEmail: import("better-auth").StrictEndpoint<"/verify-email", {
1039
+ method: "GET";
1040
+ operationId: string;
1041
+ query: import("better-auth").ZodObject<{
1042
+ token: import("better-auth").ZodString;
1043
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1044
+ }, import("better-auth").$strip>;
1045
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
1046
+ metadata: {
1047
+ openapi: {
1048
+ description: string;
1049
+ parameters: ({
1050
+ name: string;
1051
+ in: "query";
1052
+ description: string;
1053
+ required: true;
1054
+ schema: {
1055
+ type: "string";
1056
+ };
1057
+ } | {
1058
+ name: string;
1059
+ in: "query";
1060
+ description: string;
1061
+ required: false;
1062
+ schema: {
1063
+ type: "string";
1064
+ };
1065
+ })[];
1066
+ responses: {
1067
+ "200": {
1068
+ description: string;
1069
+ content: {
1070
+ "application/json": {
1071
+ schema: {
1072
+ type: "object";
1073
+ properties: {
1074
+ user: {
1075
+ type: string;
1076
+ $ref: string;
1077
+ };
1078
+ status: {
1079
+ type: string;
1080
+ description: string;
1081
+ };
1082
+ };
1083
+ required: string[];
1084
+ };
1085
+ };
1086
+ };
1087
+ };
1088
+ };
1089
+ };
1090
+ };
1091
+ }, void | {
1092
+ status: boolean;
1093
+ }>;
1094
+ readonly sendVerificationEmail: import("better-auth").StrictEndpoint<"/send-verification-email", {
1095
+ method: "POST";
1096
+ operationId: string;
1097
+ body: import("better-auth").ZodObject<{
1098
+ email: import("better-auth").ZodEmail;
1099
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1100
+ }, import("better-auth").$strip>;
1101
+ metadata: {
1102
+ openapi: {
1103
+ operationId: string;
1104
+ description: string;
1105
+ requestBody: {
1106
+ content: {
1107
+ "application/json": {
1108
+ schema: {
1109
+ type: "object";
1110
+ properties: {
1111
+ email: {
1112
+ type: string;
1113
+ description: string;
1114
+ example: string;
1115
+ };
1116
+ callbackURL: {
1117
+ type: string;
1118
+ description: string;
1119
+ example: string;
1120
+ nullable: boolean;
1121
+ };
1122
+ };
1123
+ required: string[];
1124
+ };
1125
+ };
1126
+ };
1127
+ };
1128
+ responses: {
1129
+ "200": {
1130
+ description: string;
1131
+ content: {
1132
+ "application/json": {
1133
+ schema: {
1134
+ type: "object";
1135
+ properties: {
1136
+ status: {
1137
+ type: string;
1138
+ description: string;
1139
+ example: boolean;
1140
+ };
1141
+ };
1142
+ };
1143
+ };
1144
+ };
1145
+ };
1146
+ "400": {
1147
+ description: string;
1148
+ content: {
1149
+ "application/json": {
1150
+ schema: {
1151
+ type: "object";
1152
+ properties: {
1153
+ message: {
1154
+ type: string;
1155
+ description: string;
1156
+ example: string;
1157
+ };
1158
+ };
1159
+ };
1160
+ };
1161
+ };
1162
+ };
1163
+ };
1164
+ };
1165
+ };
1166
+ }, {
1167
+ status: boolean;
1168
+ }>;
1169
+ readonly changeEmail: import("better-auth").StrictEndpoint<"/change-email", {
1170
+ method: "POST";
1171
+ body: import("better-auth").ZodObject<{
1172
+ newEmail: import("better-auth").ZodEmail;
1173
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1174
+ }, import("better-auth").$strip>;
1175
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1176
+ session: {
1177
+ session: Record<string, any> & {
1178
+ id: string;
1179
+ createdAt: Date;
1180
+ updatedAt: Date;
1181
+ userId: string;
1182
+ expiresAt: Date;
1183
+ token: string;
1184
+ ipAddress?: string | null | undefined;
1185
+ userAgent?: string | null | undefined;
1186
+ };
1187
+ user: Record<string, any> & {
1188
+ id: string;
1189
+ createdAt: Date;
1190
+ updatedAt: Date;
1191
+ email: string;
1192
+ emailVerified: boolean;
1193
+ name: string;
1194
+ image?: string | null | undefined;
1195
+ };
1196
+ };
1197
+ }>)[];
1198
+ metadata: {
1199
+ openapi: {
1200
+ operationId: string;
1201
+ responses: {
1202
+ "200": {
1203
+ description: string;
1204
+ content: {
1205
+ "application/json": {
1206
+ schema: {
1207
+ type: "object";
1208
+ properties: {
1209
+ user: {
1210
+ type: string;
1211
+ $ref: string;
1212
+ };
1213
+ status: {
1214
+ type: string;
1215
+ description: string;
1216
+ };
1217
+ message: {
1218
+ type: string;
1219
+ enum: string[];
1220
+ description: string;
1221
+ nullable: boolean;
1222
+ };
1223
+ };
1224
+ required: string[];
1225
+ };
1226
+ };
1227
+ };
1228
+ };
1229
+ "422": {
1230
+ description: string;
1231
+ content: {
1232
+ "application/json": {
1233
+ schema: {
1234
+ type: "object";
1235
+ properties: {
1236
+ message: {
1237
+ type: string;
1238
+ };
1239
+ };
1240
+ };
1241
+ };
1242
+ };
1243
+ };
1244
+ };
1245
+ };
1246
+ };
1247
+ }, {
1248
+ status: boolean;
1249
+ }>;
1250
+ readonly changePassword: import("better-auth").StrictEndpoint<"/change-password", {
1251
+ method: "POST";
1252
+ operationId: string;
1253
+ body: import("better-auth").ZodObject<{
1254
+ newPassword: import("better-auth").ZodString;
1255
+ currentPassword: import("better-auth").ZodString;
1256
+ revokeOtherSessions: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
1257
+ }, import("better-auth").$strip>;
1258
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1259
+ session: {
1260
+ session: Record<string, any> & {
1261
+ id: string;
1262
+ createdAt: Date;
1263
+ updatedAt: Date;
1264
+ userId: string;
1265
+ expiresAt: Date;
1266
+ token: string;
1267
+ ipAddress?: string | null | undefined;
1268
+ userAgent?: string | null | undefined;
1269
+ };
1270
+ user: Record<string, any> & {
1271
+ id: string;
1272
+ createdAt: Date;
1273
+ updatedAt: Date;
1274
+ email: string;
1275
+ emailVerified: boolean;
1276
+ name: string;
1277
+ image?: string | null | undefined;
1278
+ };
1279
+ };
1280
+ }>)[];
1281
+ metadata: {
1282
+ openapi: {
1283
+ operationId: string;
1284
+ description: string;
1285
+ responses: {
1286
+ "200": {
1287
+ description: string;
1288
+ content: {
1289
+ "application/json": {
1290
+ schema: {
1291
+ type: "object";
1292
+ properties: {
1293
+ token: {
1294
+ type: string;
1295
+ nullable: boolean;
1296
+ description: string;
1297
+ };
1298
+ user: {
1299
+ type: string;
1300
+ properties: {
1301
+ id: {
1302
+ type: string;
1303
+ description: string;
1304
+ };
1305
+ email: {
1306
+ type: string;
1307
+ format: string;
1308
+ description: string;
1309
+ };
1310
+ name: {
1311
+ type: string;
1312
+ description: string;
1313
+ };
1314
+ image: {
1315
+ type: string;
1316
+ format: string;
1317
+ nullable: boolean;
1318
+ description: string;
1319
+ };
1320
+ emailVerified: {
1321
+ type: string;
1322
+ description: string;
1323
+ };
1324
+ createdAt: {
1325
+ type: string;
1326
+ format: string;
1327
+ description: string;
1328
+ };
1329
+ updatedAt: {
1330
+ type: string;
1331
+ format: string;
1332
+ description: string;
1333
+ };
1334
+ };
1335
+ required: string[];
1336
+ };
1337
+ };
1338
+ required: string[];
1339
+ };
1340
+ };
1341
+ };
1342
+ };
1343
+ };
1344
+ };
1345
+ };
1346
+ }, {
1347
+ token: string | null;
1348
+ user: {
1349
+ id: string;
1350
+ email: string;
1351
+ name: string;
1352
+ image: string | null | undefined;
1353
+ emailVerified: boolean;
1354
+ createdAt: Date;
1355
+ updatedAt: Date;
1356
+ };
1357
+ }>;
1358
+ readonly setPassword: import("better-auth").StrictEndpoint<string, {
1359
+ method: "POST";
1360
+ body: import("better-auth").ZodObject<{
1361
+ newPassword: import("better-auth").ZodString;
1362
+ }, import("better-auth").$strip>;
1363
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1364
+ session: {
1365
+ session: Record<string, any> & {
1366
+ id: string;
1367
+ createdAt: Date;
1368
+ updatedAt: Date;
1369
+ userId: string;
1370
+ expiresAt: Date;
1371
+ token: string;
1372
+ ipAddress?: string | null | undefined;
1373
+ userAgent?: string | null | undefined;
1374
+ };
1375
+ user: Record<string, any> & {
1376
+ id: string;
1377
+ createdAt: Date;
1378
+ updatedAt: Date;
1379
+ email: string;
1380
+ emailVerified: boolean;
1381
+ name: string;
1382
+ image?: string | null | undefined;
1383
+ };
1384
+ };
1385
+ }>)[];
1386
+ }, {
1387
+ status: boolean;
1388
+ }>;
1389
+ readonly updateUser: import("better-auth").StrictEndpoint<"/update-user", {
1390
+ method: "POST";
1391
+ operationId: string;
1392
+ body: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>;
1393
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1394
+ session: {
1395
+ session: Record<string, any> & {
1396
+ id: string;
1397
+ createdAt: Date;
1398
+ updatedAt: Date;
1399
+ userId: string;
1400
+ expiresAt: Date;
1401
+ token: string;
1402
+ ipAddress?: string | null | undefined;
1403
+ userAgent?: string | null | undefined;
1404
+ };
1405
+ user: Record<string, any> & {
1406
+ id: string;
1407
+ createdAt: Date;
1408
+ updatedAt: Date;
1409
+ email: string;
1410
+ emailVerified: boolean;
1411
+ name: string;
1412
+ image?: string | null | undefined;
1413
+ };
1414
+ };
1415
+ }>)[];
1416
+ metadata: {
1417
+ $Infer: {
1418
+ body: Partial<import("better-auth").AdditionalUserFieldsInput<Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
1419
+ trustedOrigins: TrustedOrigins;
1420
+ plugins: any[];
1421
+ secret?: string | undefined;
1422
+ baseURL?: string | undefined;
1423
+ database: T["database"] | undefined;
1424
+ basePath: NonNullable<T["basePath"]>;
1425
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
1426
+ enabled: true;
1427
+ };
1428
+ experimental: {
1429
+ joins: boolean;
1430
+ };
1431
+ }>> & {
1432
+ name?: string | undefined;
1433
+ image?: string | undefined | null;
1434
+ };
1435
+ };
1436
+ openapi: {
1437
+ operationId: string;
1438
+ description: string;
1439
+ requestBody: {
1440
+ content: {
1441
+ "application/json": {
1442
+ schema: {
1443
+ type: "object";
1444
+ properties: {
1445
+ name: {
1446
+ type: string;
1447
+ description: string;
1448
+ };
1449
+ image: {
1450
+ type: string;
1451
+ description: string;
1452
+ nullable: boolean;
1453
+ };
1454
+ };
1455
+ };
1456
+ };
1457
+ };
1458
+ };
1459
+ responses: {
1460
+ "200": {
1461
+ description: string;
1462
+ content: {
1463
+ "application/json": {
1464
+ schema: {
1465
+ type: "object";
1466
+ properties: {
1467
+ user: {
1468
+ type: string;
1469
+ $ref: string;
1470
+ };
1471
+ };
1472
+ };
1473
+ };
1474
+ };
1475
+ };
1476
+ };
1477
+ };
1478
+ };
1479
+ }, {
1480
+ status: boolean;
1481
+ }>;
1482
+ readonly deleteUser: import("better-auth").StrictEndpoint<"/delete-user", {
1483
+ method: "POST";
1484
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1485
+ session: {
1486
+ session: Record<string, any> & {
1487
+ id: string;
1488
+ createdAt: Date;
1489
+ updatedAt: Date;
1490
+ userId: string;
1491
+ expiresAt: Date;
1492
+ token: string;
1493
+ ipAddress?: string | null | undefined;
1494
+ userAgent?: string | null | undefined;
1495
+ };
1496
+ user: Record<string, any> & {
1497
+ id: string;
1498
+ createdAt: Date;
1499
+ updatedAt: Date;
1500
+ email: string;
1501
+ emailVerified: boolean;
1502
+ name: string;
1503
+ image?: string | null | undefined;
1504
+ };
1505
+ };
1506
+ }>)[];
1507
+ body: import("better-auth").ZodObject<{
1508
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1509
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1510
+ token: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1511
+ }, import("better-auth").$strip>;
1512
+ metadata: {
1513
+ openapi: {
1514
+ operationId: string;
1515
+ description: string;
1516
+ requestBody: {
1517
+ content: {
1518
+ "application/json": {
1519
+ schema: {
1520
+ type: "object";
1521
+ properties: {
1522
+ callbackURL: {
1523
+ type: string;
1524
+ description: string;
1525
+ };
1526
+ password: {
1527
+ type: string;
1528
+ description: string;
1529
+ };
1530
+ token: {
1531
+ type: string;
1532
+ description: string;
1533
+ };
1534
+ };
1535
+ };
1536
+ };
1537
+ };
1538
+ };
1539
+ responses: {
1540
+ "200": {
1541
+ description: string;
1542
+ content: {
1543
+ "application/json": {
1544
+ schema: {
1545
+ type: "object";
1546
+ properties: {
1547
+ success: {
1548
+ type: string;
1549
+ description: string;
1550
+ };
1551
+ message: {
1552
+ type: string;
1553
+ enum: string[];
1554
+ description: string;
1555
+ };
1556
+ };
1557
+ required: string[];
1558
+ };
1559
+ };
1560
+ };
1561
+ };
1562
+ };
1563
+ };
1564
+ };
1565
+ }, {
1566
+ success: boolean;
1567
+ message: string;
1568
+ }>;
1569
+ readonly requestPasswordReset: import("better-auth").StrictEndpoint<"/request-password-reset", {
1570
+ method: "POST";
1571
+ body: import("better-auth").ZodObject<{
1572
+ email: import("better-auth").ZodEmail;
1573
+ redirectTo: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1574
+ }, import("better-auth").$strip>;
1575
+ metadata: {
1576
+ openapi: {
1577
+ operationId: string;
1578
+ description: string;
1579
+ responses: {
1580
+ "200": {
1581
+ description: string;
1582
+ content: {
1583
+ "application/json": {
1584
+ schema: {
1585
+ type: "object";
1586
+ properties: {
1587
+ status: {
1588
+ type: string;
1589
+ };
1590
+ message: {
1591
+ type: string;
1592
+ };
1593
+ };
1594
+ };
1595
+ };
1596
+ };
1597
+ };
1598
+ };
1599
+ };
1600
+ };
1601
+ }, {
1602
+ status: boolean;
1603
+ message: string;
1604
+ }>;
1605
+ readonly requestPasswordResetCallback: import("better-auth").StrictEndpoint<"/reset-password/:token", {
1606
+ method: "GET";
1607
+ operationId: string;
1608
+ query: import("better-auth").ZodObject<{
1609
+ callbackURL: import("better-auth").ZodString;
1610
+ }, import("better-auth").$strip>;
1611
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
1612
+ metadata: {
1613
+ openapi: {
1614
+ operationId: string;
1615
+ description: string;
1616
+ parameters: ({
1617
+ name: string;
1618
+ in: "path";
1619
+ required: true;
1620
+ description: string;
1621
+ schema: {
1622
+ type: "string";
1623
+ };
1624
+ } | {
1625
+ name: string;
1626
+ in: "query";
1627
+ required: true;
1628
+ description: string;
1629
+ schema: {
1630
+ type: "string";
1631
+ };
1632
+ })[];
1633
+ responses: {
1634
+ "200": {
1635
+ description: string;
1636
+ content: {
1637
+ "application/json": {
1638
+ schema: {
1639
+ type: "object";
1640
+ properties: {
1641
+ token: {
1642
+ type: string;
1643
+ };
1644
+ };
1645
+ };
1646
+ };
1647
+ };
1648
+ };
1649
+ };
1650
+ };
1651
+ };
1652
+ }, never>;
1653
+ readonly listSessions: import("better-auth").StrictEndpoint<"/list-sessions", {
1654
+ method: "GET";
1655
+ operationId: string;
1656
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1657
+ session: {
1658
+ session: Record<string, any> & {
1659
+ id: string;
1660
+ createdAt: Date;
1661
+ updatedAt: Date;
1662
+ userId: string;
1663
+ expiresAt: Date;
1664
+ token: string;
1665
+ ipAddress?: string | null | undefined;
1666
+ userAgent?: string | null | undefined;
1667
+ };
1668
+ user: Record<string, any> & {
1669
+ id: string;
1670
+ createdAt: Date;
1671
+ updatedAt: Date;
1672
+ email: string;
1673
+ emailVerified: boolean;
1674
+ name: string;
1675
+ image?: string | null | undefined;
1676
+ };
1677
+ };
1678
+ }>)[];
1679
+ requireHeaders: true;
1680
+ metadata: {
1681
+ openapi: {
1682
+ operationId: string;
1683
+ description: string;
1684
+ responses: {
1685
+ "200": {
1686
+ description: string;
1687
+ content: {
1688
+ "application/json": {
1689
+ schema: {
1690
+ type: "array";
1691
+ items: {
1692
+ $ref: string;
1693
+ };
1694
+ };
1695
+ };
1696
+ };
1697
+ };
1698
+ };
1699
+ };
1700
+ };
1701
+ }, import("better-auth").Prettify<import("better-auth").UnionToIntersection<import("better-auth").StripEmptyObjects<{
1702
+ id: string;
1703
+ createdAt: Date;
1704
+ updatedAt: Date;
1705
+ userId: string;
1706
+ expiresAt: Date;
1707
+ token: string;
1708
+ ipAddress?: string | null | undefined;
1709
+ userAgent?: string | null | undefined;
1710
+ } & (Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
1711
+ trustedOrigins: TrustedOrigins;
1712
+ plugins: any[];
1713
+ secret?: string | undefined;
1714
+ baseURL?: string | undefined;
1715
+ database: T["database"] | undefined;
1716
+ basePath: NonNullable<T["basePath"]>;
1717
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
1718
+ enabled: true;
1719
+ };
1720
+ experimental: {
1721
+ joins: boolean;
1722
+ };
1723
+ } extends infer T_10 ? T_10 extends Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
1724
+ trustedOrigins: TrustedOrigins;
1725
+ plugins: any[];
1726
+ secret?: string | undefined;
1727
+ baseURL?: string | undefined;
1728
+ database: T["database"] | undefined;
1729
+ basePath: NonNullable<T["basePath"]>;
1730
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
1731
+ enabled: true;
1732
+ };
1733
+ experimental: {
1734
+ joins: boolean;
1735
+ };
1736
+ } ? T_10 extends BetterAuthOptions ? import("better-auth").AdditionalSessionFieldsOutput<T_10> : T_10 extends import("better-auth").Auth ? import("better-auth").AdditionalSessionFieldsOutput<T_10["options"]> : {} : never : never)>>>[]>;
1737
+ readonly revokeSession: import("better-auth").StrictEndpoint<"/revoke-session", {
1738
+ method: "POST";
1739
+ body: import("better-auth").ZodObject<{
1740
+ token: import("better-auth").ZodString;
1741
+ }, import("better-auth").$strip>;
1742
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1743
+ session: {
1744
+ session: Record<string, any> & {
1745
+ id: string;
1746
+ createdAt: Date;
1747
+ updatedAt: Date;
1748
+ userId: string;
1749
+ expiresAt: Date;
1750
+ token: string;
1751
+ ipAddress?: string | null | undefined;
1752
+ userAgent?: string | null | undefined;
1753
+ };
1754
+ user: Record<string, any> & {
1755
+ id: string;
1756
+ createdAt: Date;
1757
+ updatedAt: Date;
1758
+ email: string;
1759
+ emailVerified: boolean;
1760
+ name: string;
1761
+ image?: string | null | undefined;
1762
+ };
1763
+ };
1764
+ }>)[];
1765
+ requireHeaders: true;
1766
+ metadata: {
1767
+ openapi: {
1768
+ description: string;
1769
+ requestBody: {
1770
+ content: {
1771
+ "application/json": {
1772
+ schema: {
1773
+ type: "object";
1774
+ properties: {
1775
+ token: {
1776
+ type: string;
1777
+ description: string;
1778
+ };
1779
+ };
1780
+ required: string[];
1781
+ };
1782
+ };
1783
+ };
1784
+ };
1785
+ responses: {
1786
+ "200": {
1787
+ description: string;
1788
+ content: {
1789
+ "application/json": {
1790
+ schema: {
1791
+ type: "object";
1792
+ properties: {
1793
+ status: {
1794
+ type: string;
1795
+ description: string;
1796
+ };
1797
+ };
1798
+ required: string[];
1799
+ };
1800
+ };
1801
+ };
1802
+ };
1803
+ };
1804
+ };
1805
+ };
1806
+ }, {
1807
+ status: boolean;
1808
+ }>;
1809
+ readonly revokeSessions: import("better-auth").StrictEndpoint<"/revoke-sessions", {
1810
+ method: "POST";
1811
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1812
+ session: {
1813
+ session: Record<string, any> & {
1814
+ id: string;
1815
+ createdAt: Date;
1816
+ updatedAt: Date;
1817
+ userId: string;
1818
+ expiresAt: Date;
1819
+ token: string;
1820
+ ipAddress?: string | null | undefined;
1821
+ userAgent?: string | null | undefined;
1822
+ };
1823
+ user: Record<string, any> & {
1824
+ id: string;
1825
+ createdAt: Date;
1826
+ updatedAt: Date;
1827
+ email: string;
1828
+ emailVerified: boolean;
1829
+ name: string;
1830
+ image?: string | null | undefined;
1831
+ };
1832
+ };
1833
+ }>)[];
1834
+ requireHeaders: true;
1835
+ metadata: {
1836
+ openapi: {
1837
+ description: string;
1838
+ responses: {
1839
+ "200": {
1840
+ description: string;
1841
+ content: {
1842
+ "application/json": {
1843
+ schema: {
1844
+ type: "object";
1845
+ properties: {
1846
+ status: {
1847
+ type: string;
1848
+ description: string;
1849
+ };
1850
+ };
1851
+ required: string[];
1852
+ };
1853
+ };
1854
+ };
1855
+ };
1856
+ };
1857
+ };
1858
+ };
1859
+ }, {
1860
+ status: boolean;
1861
+ }>;
1862
+ readonly revokeOtherSessions: import("better-auth").StrictEndpoint<"/revoke-other-sessions", {
1863
+ method: "POST";
1864
+ requireHeaders: true;
1865
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1866
+ session: {
1867
+ session: Record<string, any> & {
1868
+ id: string;
1869
+ createdAt: Date;
1870
+ updatedAt: Date;
1871
+ userId: string;
1872
+ expiresAt: Date;
1873
+ token: string;
1874
+ ipAddress?: string | null | undefined;
1875
+ userAgent?: string | null | undefined;
1876
+ };
1877
+ user: Record<string, any> & {
1878
+ id: string;
1879
+ createdAt: Date;
1880
+ updatedAt: Date;
1881
+ email: string;
1882
+ emailVerified: boolean;
1883
+ name: string;
1884
+ image?: string | null | undefined;
1885
+ };
1886
+ };
1887
+ }>)[];
1888
+ metadata: {
1889
+ openapi: {
1890
+ description: string;
1891
+ responses: {
1892
+ "200": {
1893
+ description: string;
1894
+ content: {
1895
+ "application/json": {
1896
+ schema: {
1897
+ type: "object";
1898
+ properties: {
1899
+ status: {
1900
+ type: string;
1901
+ description: string;
1902
+ };
1903
+ };
1904
+ required: string[];
1905
+ };
1906
+ };
1907
+ };
1908
+ };
1909
+ };
1910
+ };
1911
+ };
1912
+ }, {
1913
+ status: boolean;
1914
+ }>;
1915
+ readonly linkSocialAccount: import("better-auth").StrictEndpoint<"/link-social", {
1916
+ method: "POST";
1917
+ requireHeaders: true;
1918
+ body: import("better-auth").ZodObject<{
1919
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1920
+ provider: import("better-auth").ZodType<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown, import("better-auth").$ZodTypeInternals<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown>>;
1921
+ idToken: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
1922
+ token: import("better-auth").ZodString;
1923
+ nonce: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1924
+ accessToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1925
+ refreshToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1926
+ scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
1927
+ }, import("better-auth").$strip>>;
1928
+ requestSignUp: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
1929
+ scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
1930
+ errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1931
+ disableRedirect: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
1932
+ additionalData: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
1933
+ }, import("better-auth").$strip>;
1934
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1935
+ session: {
1936
+ session: Record<string, any> & {
1937
+ id: string;
1938
+ createdAt: Date;
1939
+ updatedAt: Date;
1940
+ userId: string;
1941
+ expiresAt: Date;
1942
+ token: string;
1943
+ ipAddress?: string | null | undefined;
1944
+ userAgent?: string | null | undefined;
1945
+ };
1946
+ user: Record<string, any> & {
1947
+ id: string;
1948
+ createdAt: Date;
1949
+ updatedAt: Date;
1950
+ email: string;
1951
+ emailVerified: boolean;
1952
+ name: string;
1953
+ image?: string | null | undefined;
1954
+ };
1955
+ };
1956
+ }>)[];
1957
+ metadata: {
1958
+ openapi: {
1959
+ description: string;
1960
+ operationId: string;
1961
+ responses: {
1962
+ "200": {
1963
+ description: string;
1964
+ content: {
1965
+ "application/json": {
1966
+ schema: {
1967
+ type: "object";
1968
+ properties: {
1969
+ url: {
1970
+ type: string;
1971
+ description: string;
1972
+ };
1973
+ redirect: {
1974
+ type: string;
1975
+ description: string;
1976
+ };
1977
+ status: {
1978
+ type: string;
1979
+ };
1980
+ };
1981
+ required: string[];
1982
+ };
1983
+ };
1984
+ };
1985
+ };
1986
+ };
1987
+ };
1988
+ };
1989
+ }, {
1990
+ url: string;
1991
+ redirect: boolean;
1992
+ }>;
1993
+ readonly listUserAccounts: import("better-auth").StrictEndpoint<"/list-accounts", {
1994
+ method: "GET";
1995
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1996
+ session: {
1997
+ session: Record<string, any> & {
1998
+ id: string;
1999
+ createdAt: Date;
2000
+ updatedAt: Date;
2001
+ userId: string;
2002
+ expiresAt: Date;
2003
+ token: string;
2004
+ ipAddress?: string | null | undefined;
2005
+ userAgent?: string | null | undefined;
2006
+ };
2007
+ user: Record<string, any> & {
2008
+ id: string;
2009
+ createdAt: Date;
2010
+ updatedAt: Date;
2011
+ email: string;
2012
+ emailVerified: boolean;
2013
+ name: string;
2014
+ image?: string | null | undefined;
2015
+ };
2016
+ };
2017
+ }>)[];
2018
+ metadata: {
2019
+ openapi: {
2020
+ operationId: string;
2021
+ description: string;
2022
+ responses: {
2023
+ "200": {
2024
+ description: string;
2025
+ content: {
2026
+ "application/json": {
2027
+ schema: {
2028
+ type: "array";
2029
+ items: {
2030
+ type: string;
2031
+ properties: {
2032
+ id: {
2033
+ type: string;
2034
+ };
2035
+ providerId: {
2036
+ type: string;
2037
+ };
2038
+ createdAt: {
2039
+ type: string;
2040
+ format: string;
2041
+ };
2042
+ updatedAt: {
2043
+ type: string;
2044
+ format: string;
2045
+ };
2046
+ accountId: {
2047
+ type: string;
2048
+ };
2049
+ userId: {
2050
+ type: string;
2051
+ };
2052
+ scopes: {
2053
+ type: string;
2054
+ items: {
2055
+ type: string;
2056
+ };
2057
+ };
2058
+ };
2059
+ required: string[];
2060
+ };
2061
+ };
2062
+ };
2063
+ };
2064
+ };
2065
+ };
2066
+ };
2067
+ };
2068
+ }, {
2069
+ id: string;
2070
+ providerId: string;
2071
+ createdAt: Date;
2072
+ updatedAt: Date;
2073
+ accountId: string;
2074
+ userId: string;
2075
+ scopes: string[];
2076
+ }[]>;
2077
+ readonly deleteUserCallback: import("better-auth").StrictEndpoint<"/delete-user/callback", {
2078
+ method: "GET";
2079
+ query: import("better-auth").ZodObject<{
2080
+ token: import("better-auth").ZodString;
2081
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2082
+ }, import("better-auth").$strip>;
2083
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
2084
+ metadata: {
2085
+ openapi: {
2086
+ description: string;
2087
+ responses: {
2088
+ "200": {
2089
+ description: string;
2090
+ content: {
2091
+ "application/json": {
2092
+ schema: {
2093
+ type: "object";
2094
+ properties: {
2095
+ success: {
2096
+ type: string;
2097
+ description: string;
2098
+ };
2099
+ message: {
2100
+ type: string;
2101
+ enum: string[];
2102
+ description: string;
2103
+ };
2104
+ };
2105
+ required: string[];
2106
+ };
2107
+ };
2108
+ };
2109
+ };
2110
+ };
2111
+ };
2112
+ };
2113
+ }, {
2114
+ success: boolean;
2115
+ message: string;
2116
+ }>;
2117
+ readonly unlinkAccount: import("better-auth").StrictEndpoint<"/unlink-account", {
2118
+ method: "POST";
2119
+ body: import("better-auth").ZodObject<{
2120
+ providerId: import("better-auth").ZodString;
2121
+ accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2122
+ }, import("better-auth").$strip>;
2123
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2124
+ session: {
2125
+ session: Record<string, any> & {
2126
+ id: string;
2127
+ createdAt: Date;
2128
+ updatedAt: Date;
2129
+ userId: string;
2130
+ expiresAt: Date;
2131
+ token: string;
2132
+ ipAddress?: string | null | undefined;
2133
+ userAgent?: string | null | undefined;
2134
+ };
2135
+ user: Record<string, any> & {
2136
+ id: string;
2137
+ createdAt: Date;
2138
+ updatedAt: Date;
2139
+ email: string;
2140
+ emailVerified: boolean;
2141
+ name: string;
2142
+ image?: string | null | undefined;
2143
+ };
2144
+ };
2145
+ }>)[];
2146
+ metadata: {
2147
+ openapi: {
2148
+ description: string;
2149
+ responses: {
2150
+ "200": {
2151
+ description: string;
2152
+ content: {
2153
+ "application/json": {
2154
+ schema: {
2155
+ type: "object";
2156
+ properties: {
2157
+ status: {
2158
+ type: string;
2159
+ };
2160
+ };
2161
+ };
2162
+ };
2163
+ };
2164
+ };
2165
+ };
2166
+ };
2167
+ };
2168
+ }, {
2169
+ status: boolean;
2170
+ }>;
2171
+ readonly refreshToken: import("better-auth").StrictEndpoint<"/refresh-token", {
2172
+ method: "POST";
2173
+ body: import("better-auth").ZodObject<{
2174
+ providerId: import("better-auth").ZodString;
2175
+ accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2176
+ userId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2177
+ }, import("better-auth").$strip>;
2178
+ metadata: {
2179
+ openapi: {
2180
+ description: string;
2181
+ responses: {
2182
+ 200: {
2183
+ description: string;
2184
+ content: {
2185
+ "application/json": {
2186
+ schema: {
2187
+ type: "object";
2188
+ properties: {
2189
+ tokenType: {
2190
+ type: string;
2191
+ };
2192
+ idToken: {
2193
+ type: string;
2194
+ };
2195
+ accessToken: {
2196
+ type: string;
2197
+ };
2198
+ refreshToken: {
2199
+ type: string;
2200
+ };
2201
+ accessTokenExpiresAt: {
2202
+ type: string;
2203
+ format: string;
2204
+ };
2205
+ refreshTokenExpiresAt: {
2206
+ type: string;
2207
+ format: string;
2208
+ };
2209
+ };
2210
+ };
2211
+ };
2212
+ };
2213
+ };
2214
+ 400: {
2215
+ description: string;
2216
+ };
2217
+ };
2218
+ };
2219
+ };
2220
+ }, {
2221
+ accessToken: string | undefined;
2222
+ refreshToken: string | undefined;
2223
+ accessTokenExpiresAt: Date | undefined;
2224
+ refreshTokenExpiresAt: Date | undefined;
2225
+ scope: string | null | undefined;
2226
+ idToken: string | null | undefined;
2227
+ providerId: string;
2228
+ accountId: string;
2229
+ }>;
2230
+ readonly getAccessToken: import("better-auth").StrictEndpoint<"/get-access-token", {
2231
+ method: "POST";
2232
+ body: import("better-auth").ZodObject<{
2233
+ providerId: import("better-auth").ZodString;
2234
+ accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2235
+ userId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2236
+ }, import("better-auth").$strip>;
2237
+ metadata: {
2238
+ openapi: {
2239
+ description: string;
2240
+ responses: {
2241
+ 200: {
2242
+ description: string;
2243
+ content: {
2244
+ "application/json": {
2245
+ schema: {
2246
+ type: "object";
2247
+ properties: {
2248
+ tokenType: {
2249
+ type: string;
2250
+ };
2251
+ idToken: {
2252
+ type: string;
2253
+ };
2254
+ accessToken: {
2255
+ type: string;
2256
+ };
2257
+ refreshToken: {
2258
+ type: string;
2259
+ };
2260
+ accessTokenExpiresAt: {
2261
+ type: string;
2262
+ format: string;
2263
+ };
2264
+ refreshTokenExpiresAt: {
2265
+ type: string;
2266
+ format: string;
2267
+ };
2268
+ };
2269
+ };
2270
+ };
2271
+ };
2272
+ };
2273
+ 400: {
2274
+ description: string;
2275
+ };
2276
+ };
2277
+ };
2278
+ };
2279
+ }, {
2280
+ accessToken: string;
2281
+ accessTokenExpiresAt: Date | undefined;
2282
+ scopes: string[];
2283
+ idToken: string | undefined;
2284
+ }>;
2285
+ readonly accountInfo: import("better-auth").StrictEndpoint<"/account-info", {
2286
+ method: "GET";
2287
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2288
+ session: {
2289
+ session: Record<string, any> & {
2290
+ id: string;
2291
+ createdAt: Date;
2292
+ updatedAt: Date;
2293
+ userId: string;
2294
+ expiresAt: Date;
2295
+ token: string;
2296
+ ipAddress?: string | null | undefined;
2297
+ userAgent?: string | null | undefined;
2298
+ };
2299
+ user: Record<string, any> & {
2300
+ id: string;
2301
+ createdAt: Date;
2302
+ updatedAt: Date;
2303
+ email: string;
2304
+ emailVerified: boolean;
2305
+ name: string;
2306
+ image?: string | null | undefined;
2307
+ };
2308
+ };
2309
+ }>)[];
2310
+ metadata: {
2311
+ openapi: {
2312
+ description: string;
2313
+ responses: {
2314
+ "200": {
2315
+ description: string;
2316
+ content: {
2317
+ "application/json": {
2318
+ schema: {
2319
+ type: "object";
2320
+ properties: {
2321
+ user: {
2322
+ type: string;
2323
+ properties: {
2324
+ id: {
2325
+ type: string;
2326
+ };
2327
+ name: {
2328
+ type: string;
2329
+ };
2330
+ email: {
2331
+ type: string;
2332
+ };
2333
+ image: {
2334
+ type: string;
2335
+ };
2336
+ emailVerified: {
2337
+ type: string;
2338
+ };
2339
+ };
2340
+ required: string[];
2341
+ };
2342
+ data: {
2343
+ type: string;
2344
+ properties: {};
2345
+ additionalProperties: boolean;
2346
+ };
2347
+ };
2348
+ required: string[];
2349
+ additionalProperties: boolean;
2350
+ };
2351
+ };
2352
+ };
2353
+ };
2354
+ };
2355
+ };
2356
+ };
2357
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
2358
+ accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2359
+ }, import("better-auth").$strip>>;
2360
+ }, {
2361
+ user: import("better-auth").OAuth2UserInfo;
2362
+ data: Record<string, any>;
2363
+ } | null>;
2364
+ } & import("better-auth").UnionToIntersection<(Omit<T, "connectionString" | "skipDefaultPlugins" | "apiKey" | "plugins"> & {
2365
+ trustedOrigins: TrustedOrigins;
2366
+ plugins: any[];
2367
+ secret?: string | undefined;
2368
+ baseURL?: string | undefined;
2369
+ database: T["database"] | undefined;
2370
+ basePath: NonNullable<T["basePath"]>;
2371
+ emailAndPassword: NonNullable<T["emailAndPassword"]> | {
2372
+ enabled: true;
2373
+ };
2374
+ experimental: {
2375
+ joins: boolean;
2376
+ };
2377
+ })["plugins"] extends (infer T_11)[] ? T_11 extends import("better-auth").BetterAuthPlugin ? T_11 extends {
2378
+ endpoints: infer E;
2379
+ } ? E : {} : {} : {}>> & DefaultPluginApiMethods;
2380
+ };
2381
+ /**
2382
+ * Type helper for the auth instance with default plugin methods.
2383
+ * Inferred from createAuth to stay in sync with BetterAuth.
2384
+ */
2385
+ export type AuthInstance = ReturnType<typeof createAuth>;
2386
+ //# sourceMappingURL=config.d.ts.map