everything-dev 2.0.0-rc.0 → 2.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/auth-login.cjs +1 -1
  2. package/dist/auth-login.mjs +1 -1
  3. package/dist/build.cjs +2 -2
  4. package/dist/build.mjs +2 -2
  5. package/dist/bundle-fs-resolve.cjs +9 -17
  6. package/dist/bundle-fs-resolve.cjs.map +1 -1
  7. package/dist/bundle-fs-resolve.d.cts +6 -0
  8. package/dist/bundle-fs-resolve.d.mts +6 -0
  9. package/dist/bundle-fs-resolve.mjs +9 -17
  10. package/dist/bundle-fs-resolve.mjs.map +1 -1
  11. package/dist/bundle-path.cjs +48 -0
  12. package/dist/bundle-path.cjs.map +1 -0
  13. package/dist/bundle-path.mjs +45 -0
  14. package/dist/bundle-path.mjs.map +1 -0
  15. package/dist/cli/init.cjs +13 -13
  16. package/dist/cli/init.cjs.map +1 -1
  17. package/dist/cli/init.mjs +13 -13
  18. package/dist/cli/init.mjs.map +1 -1
  19. package/dist/cli/status.cjs +69 -3
  20. package/dist/cli/status.cjs.map +1 -1
  21. package/dist/cli/status.mjs +67 -4
  22. package/dist/cli/status.mjs.map +1 -1
  23. package/dist/cli/sync.cjs +1 -1
  24. package/dist/cli/sync.cjs.map +1 -1
  25. package/dist/cli/sync.mjs +1 -1
  26. package/dist/cli/sync.mjs.map +1 -1
  27. package/dist/cli/upgrade.cjs +2 -2
  28. package/dist/cli/upgrade.cjs.map +1 -1
  29. package/dist/cli/upgrade.mjs +2 -2
  30. package/dist/cli/upgrade.mjs.map +1 -1
  31. package/dist/cli.cjs +5 -7
  32. package/dist/cli.cjs.map +1 -1
  33. package/dist/cli.mjs +5 -7
  34. package/dist/cli.mjs.map +1 -1
  35. package/dist/commands/deploy.cjs +26 -16
  36. package/dist/commands/deploy.cjs.map +1 -1
  37. package/dist/commands/deploy.mjs +26 -16
  38. package/dist/commands/deploy.mjs.map +1 -1
  39. package/dist/commands/init.cjs +1 -1
  40. package/dist/commands/init.cjs.map +1 -1
  41. package/dist/commands/init.mjs +1 -1
  42. package/dist/commands/init.mjs.map +1 -1
  43. package/dist/commands/plugins.cjs +2 -2
  44. package/dist/commands/plugins.cjs.map +1 -1
  45. package/dist/commands/plugins.mjs +2 -2
  46. package/dist/commands/plugins.mjs.map +1 -1
  47. package/dist/commands/upgrade.cjs +1 -1
  48. package/dist/commands/upgrade.mjs +1 -1
  49. package/dist/components/dev-render.cjs +1 -1
  50. package/dist/components/dev-render.mjs +1 -1
  51. package/dist/config.cjs +3 -3
  52. package/dist/config.cjs.map +1 -1
  53. package/dist/config.mjs +3 -3
  54. package/dist/config.mjs.map +1 -1
  55. package/dist/contract.cjs +2 -0
  56. package/dist/contract.cjs.map +1 -1
  57. package/dist/contract.d.cts +3 -0
  58. package/dist/contract.d.mts +3 -0
  59. package/dist/contract.meta.cjs +2 -1
  60. package/dist/contract.meta.cjs.map +1 -1
  61. package/dist/contract.meta.d.cts +4 -1
  62. package/dist/contract.meta.d.mts +4 -1
  63. package/dist/contract.meta.mjs +2 -1
  64. package/dist/contract.meta.mjs.map +1 -1
  65. package/dist/contract.mjs +2 -0
  66. package/dist/contract.mjs.map +1 -1
  67. package/dist/db/driver.cjs +22 -2
  68. package/dist/db/driver.cjs.map +1 -1
  69. package/dist/db/driver.d.cts +13 -2
  70. package/dist/db/driver.d.mts +13 -2
  71. package/dist/db/driver.mjs +22 -3
  72. package/dist/db/driver.mjs.map +1 -1
  73. package/dist/db/index.cjs +1 -0
  74. package/dist/db/index.d.cts +2 -2
  75. package/dist/db/index.d.mts +2 -2
  76. package/dist/db/index.mjs +2 -2
  77. package/dist/deploy-diff.cjs +1 -1
  78. package/dist/deploy-diff.cjs.map +1 -1
  79. package/dist/deploy-diff.mjs +1 -1
  80. package/dist/deploy-diff.mjs.map +1 -1
  81. package/dist/dev-program.cjs +10 -2
  82. package/dist/dev-program.cjs.map +1 -1
  83. package/dist/dev-program.mjs +10 -2
  84. package/dist/dev-program.mjs.map +1 -1
  85. package/dist/image-deploy.cjs +65 -17
  86. package/dist/image-deploy.cjs.map +1 -1
  87. package/dist/image-deploy.mjs +64 -18
  88. package/dist/image-deploy.mjs.map +1 -1
  89. package/dist/internal/manifest-normalizer.cjs.map +1 -1
  90. package/dist/internal/manifest-normalizer.mjs.map +1 -1
  91. package/dist/plugin.d.cts +902 -1
  92. package/dist/plugin.d.mts +902 -1
  93. package/dist/publish.cjs +51 -2
  94. package/dist/publish.cjs.map +1 -1
  95. package/dist/publish.mjs +51 -4
  96. package/dist/publish.mjs.map +1 -1
  97. package/dist/resolution/session.cjs.map +1 -1
  98. package/dist/resolution/session.d.cts +5 -5
  99. package/dist/resolution/session.d.mts +5 -5
  100. package/dist/resolution/session.mjs.map +1 -1
  101. package/dist/types.d.cts +31 -1
  102. package/dist/types.d.mts +31 -1
  103. package/dist/ui/auth-guards.d.cts +78 -2
  104. package/dist/ui/auth-guards.d.mts +78 -2
  105. package/dist/ui/auth.cjs.map +1 -1
  106. package/dist/ui/auth.d.cts +4133 -7
  107. package/dist/ui/auth.d.mts +4133 -7
  108. package/dist/ui/auth.mjs.map +1 -1
  109. package/dist/ui/hydrate.cjs +2 -2
  110. package/dist/ui/hydrate.cjs.map +1 -1
  111. package/dist/ui/hydrate.mjs +2 -2
  112. package/dist/ui/hydrate.mjs.map +1 -1
  113. package/dist/utils/theme.cjs +2 -2
  114. package/dist/utils/theme.cjs.map +1 -1
  115. package/dist/utils/theme.mjs +2 -2
  116. package/dist/utils/theme.mjs.map +1 -1
  117. package/dist/version-manifest-resolve.cjs +55 -10
  118. package/dist/version-manifest-resolve.cjs.map +1 -1
  119. package/dist/version-manifest-resolve.mjs +53 -10
  120. package/dist/version-manifest-resolve.mjs.map +1 -1
  121. package/dist/workspace.cjs +26 -13
  122. package/dist/workspace.cjs.map +1 -1
  123. package/dist/workspace.mjs +26 -14
  124. package/dist/workspace.mjs.map +1 -1
  125. package/package.json +11 -10
@@ -1,4 +1,11 @@
1
1
  import { ClientRuntimeConfig } from "../types.mjs";
2
+ import { CookieOptions } from "../node_modules/better-call/dist/cookies.mjs";
3
+ import { StrictEndpoint } from "../node_modules/better-call/dist/endpoint.mjs";
4
+ import { MiddlewareContext, MiddlewareInputContext, MiddlewareOptions } from "../node_modules/better-call/dist/middleware.mjs";
5
+ import { AuthenticationExtensionsClientInputs, AuthenticationExtensionsClientOutputs } from "../node_modules/@simplewebauthn/server/esm/types/dom.mjs";
6
+ import { AuthenticationResponseJSON, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, RegistrationResponseJSON } from "../node_modules/@simplewebauthn/server/esm/types/index.mjs";
7
+ import { BetterFetch } from "../node_modules/@better-fetch/fetch/dist/index.mjs";
8
+ import { PreinitializedWritableAtom } from "../node_modules/nanostores/atom/index.mjs";
2
9
  import { AuthContext, clearAuthenticatedQueries, requireAdmin, requireSession } from "./auth-guards.mjs";
3
10
  import { pluginHref, pluginPath, pluginSearch } from "./plugin-path.mjs";
4
11
  import { QueryClient } from "@tanstack/react-query";
@@ -10,18 +17,4126 @@ type CreateAuthClientOptions = {
10
17
  cspNonce?: string;
11
18
  };
12
19
  declare function getDeviceLinkClientId(config?: Partial<ClientRuntimeConfig>): string;
13
- declare function createAuthClient(options?: CreateAuthClientOptions): any;
20
+ declare function createAuthClient(options?: CreateAuthClientOptions): import("better-auth/react").ReactAuthClient<{
21
+ baseURL: string;
22
+ fetchOptions: {
23
+ credentials: "include";
24
+ headers?: HeadersInit | undefined;
25
+ };
26
+ plugins: ({
27
+ id: "api-key";
28
+ version: string;
29
+ $InferServerPlugin: {
30
+ id: "api-key";
31
+ version: string;
32
+ $ERROR_CODES: {
33
+ INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
34
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
35
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
36
+ USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
37
+ UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
38
+ KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
39
+ KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
40
+ KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
41
+ USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
42
+ KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
43
+ EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
44
+ EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
45
+ INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
46
+ INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
47
+ INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
48
+ METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
49
+ RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
50
+ NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
51
+ KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
52
+ INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
53
+ INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
54
+ INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
55
+ INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
56
+ SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
57
+ FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
58
+ NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
59
+ ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
60
+ USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
61
+ INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
62
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
63
+ ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
64
+ };
65
+ hooks: {
66
+ before: {
67
+ matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
68
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
69
+ user: {
70
+ id: string;
71
+ createdAt: Date;
72
+ updatedAt: Date;
73
+ email: string;
74
+ emailVerified: boolean;
75
+ name: string;
76
+ image?: string | null | undefined;
77
+ };
78
+ session: {
79
+ id: string;
80
+ token: string;
81
+ userId: string;
82
+ userAgent: string | null;
83
+ ipAddress: string | null;
84
+ createdAt: Date;
85
+ updatedAt: Date;
86
+ expiresAt: Date;
87
+ };
88
+ } | {
89
+ context: MiddlewareContext<MiddlewareOptions, {
90
+ returned?: unknown | undefined;
91
+ responseHeaders?: Headers | undefined;
92
+ } & import("better-auth").PluginContext<import("better-auth").BetterAuthOptions> & import("better-auth").InfoContext & {
93
+ options: import("better-auth").BetterAuthOptions;
94
+ trustedOrigins: string[];
95
+ trustedProviders: string[];
96
+ isTrustedOrigin: (url: string, settings?: {
97
+ allowRelativePaths: boolean;
98
+ }) => boolean;
99
+ oauthConfig: {
100
+ skipStateCookieCheck?: boolean | undefined;
101
+ storeStateStrategy: "database" | "cookie";
102
+ };
103
+ newSession: {
104
+ session: {
105
+ id: string;
106
+ createdAt: Date;
107
+ updatedAt: Date;
108
+ userId: string;
109
+ expiresAt: Date;
110
+ token: string;
111
+ ipAddress?: string | null | undefined;
112
+ userAgent?: string | null | undefined;
113
+ } & Record<string, any>;
114
+ user: {
115
+ id: string;
116
+ createdAt: Date;
117
+ updatedAt: Date;
118
+ email: string;
119
+ emailVerified: boolean;
120
+ name: string;
121
+ image?: string | null | undefined;
122
+ } & Record<string, any>;
123
+ } | null;
124
+ session: {
125
+ session: {
126
+ id: string;
127
+ createdAt: Date;
128
+ updatedAt: Date;
129
+ userId: string;
130
+ expiresAt: Date;
131
+ token: string;
132
+ ipAddress?: string | null | undefined;
133
+ userAgent?: string | null | undefined;
134
+ } & Record<string, any>;
135
+ user: {
136
+ id: string;
137
+ createdAt: Date;
138
+ updatedAt: Date;
139
+ email: string;
140
+ emailVerified: boolean;
141
+ name: string;
142
+ image?: string | null | undefined;
143
+ } & Record<string, any>;
144
+ } | null;
145
+ setNewSession: (session: {
146
+ session: {
147
+ id: string;
148
+ createdAt: Date;
149
+ updatedAt: Date;
150
+ userId: string;
151
+ expiresAt: Date;
152
+ token: string;
153
+ ipAddress?: string | null | undefined;
154
+ userAgent?: string | null | undefined;
155
+ } & Record<string, any>;
156
+ user: {
157
+ id: string;
158
+ createdAt: Date;
159
+ updatedAt: Date;
160
+ email: string;
161
+ emailVerified: boolean;
162
+ name: string;
163
+ image?: string | null | undefined;
164
+ } & Record<string, any>;
165
+ } | null) => void;
166
+ socialProviders: import("better-auth").OAuthProvider[];
167
+ authCookies: import("better-auth").BetterAuthCookies;
168
+ logger: ReturnType<typeof import("better-auth").createLogger>;
169
+ rateLimit: {
170
+ enabled: boolean;
171
+ window: number;
172
+ max: number;
173
+ storage: "memory" | "database" | "secondary-storage";
174
+ } & Omit<import("better-auth").BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
175
+ adapter: import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
176
+ internalAdapter: import("better-auth").InternalAdapter<import("better-auth").BetterAuthOptions>;
177
+ createAuthCookie: (cookieName: string, overrideAttributes?: Partial<CookieOptions> | undefined) => import("better-auth").BetterAuthCookie;
178
+ secret: string;
179
+ secretConfig: string | import("better-auth").SecretConfig;
180
+ sessionConfig: {
181
+ updateAge: number;
182
+ expiresIn: number;
183
+ freshAge: number;
184
+ cookieRefreshCache: false | {
185
+ enabled: true;
186
+ updateAge: number;
187
+ };
188
+ };
189
+ generateId: (options: {
190
+ model: import("better-auth").ModelNames;
191
+ size?: number | undefined;
192
+ }) => string | false;
193
+ secondaryStorage: import("better-auth").SecondaryStorage | undefined;
194
+ password: {
195
+ hash: (password: string) => Promise<string>;
196
+ verify: (data: {
197
+ password: string;
198
+ hash: string;
199
+ }) => Promise<boolean>;
200
+ config: {
201
+ minPasswordLength: number;
202
+ maxPasswordLength: number;
203
+ };
204
+ checkPassword: (userId: string, ctx: import("better-auth").GenericEndpointContext<import("better-auth").BetterAuthOptions>) => Promise<boolean>;
205
+ };
206
+ tables: import("better-auth").BetterAuthDBSchema;
207
+ runMigrations: () => Promise<void>;
208
+ publishTelemetry: (event: {
209
+ type: string;
210
+ anonymousId?: string | undefined;
211
+ payload: Record<string, any>;
212
+ }) => Promise<void>;
213
+ skipOriginCheck: boolean | string[];
214
+ skipCSRFCheck: boolean;
215
+ runInBackground: (promise: Promise<unknown>) => void;
216
+ runInBackgroundOrAwait: (promise: Promise<unknown> | void) => import("better-auth").Awaitable<unknown>;
217
+ }>;
218
+ }>;
219
+ }[];
220
+ };
221
+ endpoints: {
222
+ createApiKey: StrictEndpoint<"/api-key/create", {
223
+ method: "POST";
224
+ body: import("zod").ZodObject<{
225
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
226
+ name: import("zod").ZodOptional<import("zod").ZodString>;
227
+ expiresIn: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
228
+ prefix: import("zod").ZodOptional<import("zod").ZodString>;
229
+ remaining: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
230
+ metadata: import("zod").ZodOptional<import("zod").ZodAny>;
231
+ refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
232
+ refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
233
+ rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
234
+ rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
235
+ rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
236
+ permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
237
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
238
+ organizationId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
239
+ }, import("zod/v4/core").$strip>;
240
+ metadata: {
241
+ openapi: {
242
+ description: string;
243
+ responses: {
244
+ "200": {
245
+ description: string;
246
+ content: {
247
+ "application/json": {
248
+ schema: {
249
+ type: "object";
250
+ properties: {
251
+ id: {
252
+ type: string;
253
+ description: string;
254
+ };
255
+ createdAt: {
256
+ type: string;
257
+ format: string;
258
+ description: string;
259
+ };
260
+ updatedAt: {
261
+ type: string;
262
+ format: string;
263
+ description: string;
264
+ };
265
+ name: {
266
+ type: string;
267
+ nullable: boolean;
268
+ description: string;
269
+ };
270
+ prefix: {
271
+ type: string;
272
+ nullable: boolean;
273
+ description: string;
274
+ };
275
+ start: {
276
+ type: string;
277
+ nullable: boolean;
278
+ description: string;
279
+ };
280
+ key: {
281
+ type: string;
282
+ description: string;
283
+ };
284
+ enabled: {
285
+ type: string;
286
+ description: string;
287
+ };
288
+ expiresAt: {
289
+ type: string;
290
+ format: string;
291
+ nullable: boolean;
292
+ description: string;
293
+ };
294
+ referenceId: {
295
+ type: string;
296
+ description: string;
297
+ };
298
+ lastRefillAt: {
299
+ type: string;
300
+ format: string;
301
+ nullable: boolean;
302
+ description: string;
303
+ };
304
+ lastRequest: {
305
+ type: string;
306
+ format: string;
307
+ nullable: boolean;
308
+ description: string;
309
+ };
310
+ metadata: {
311
+ type: string;
312
+ nullable: boolean;
313
+ additionalProperties: boolean;
314
+ description: string;
315
+ };
316
+ rateLimitMax: {
317
+ type: string;
318
+ nullable: boolean;
319
+ description: string;
320
+ };
321
+ rateLimitTimeWindow: {
322
+ type: string;
323
+ nullable: boolean;
324
+ description: string;
325
+ };
326
+ remaining: {
327
+ type: string;
328
+ nullable: boolean;
329
+ description: string;
330
+ };
331
+ refillAmount: {
332
+ type: string;
333
+ nullable: boolean;
334
+ description: string;
335
+ };
336
+ refillInterval: {
337
+ type: string;
338
+ nullable: boolean;
339
+ description: string;
340
+ };
341
+ rateLimitEnabled: {
342
+ type: string;
343
+ description: string;
344
+ };
345
+ requestCount: {
346
+ type: string;
347
+ description: string;
348
+ };
349
+ permissions: {
350
+ type: string;
351
+ nullable: boolean;
352
+ additionalProperties: {
353
+ type: string;
354
+ items: {
355
+ type: string;
356
+ };
357
+ };
358
+ description: string;
359
+ };
360
+ };
361
+ required: string[];
362
+ };
363
+ };
364
+ };
365
+ };
366
+ };
367
+ };
368
+ };
369
+ }, {
370
+ key: string;
371
+ metadata: any;
372
+ permissions: any;
373
+ id: string;
374
+ configId: string;
375
+ name: string | null;
376
+ start: string | null;
377
+ prefix: string | null;
378
+ referenceId: string;
379
+ refillInterval: number | null;
380
+ refillAmount: number | null;
381
+ lastRefillAt: Date | null;
382
+ enabled: boolean;
383
+ rateLimitEnabled: boolean;
384
+ rateLimitTimeWindow: number | null;
385
+ rateLimitMax: number | null;
386
+ requestCount: number;
387
+ remaining: number | null;
388
+ lastRequest: Date | null;
389
+ expiresAt: Date | null;
390
+ createdAt: Date;
391
+ updatedAt: Date;
392
+ }>;
393
+ verifyApiKey: StrictEndpoint<string, {
394
+ method: "POST";
395
+ body: import("zod").ZodObject<{
396
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
397
+ key: import("zod").ZodString;
398
+ permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
399
+ }, import("zod/v4/core").$strip>;
400
+ }, {
401
+ valid: boolean;
402
+ error: {
403
+ message: import("better-auth").RawError<"INVALID_API_KEY">;
404
+ code: "KEY_NOT_FOUND";
405
+ };
406
+ key: null;
407
+ } | {
408
+ valid: boolean;
409
+ error: {
410
+ message: string | undefined;
411
+ code: string;
412
+ cause?: unknown;
413
+ };
414
+ key: null;
415
+ } | {
416
+ valid: boolean;
417
+ error: {
418
+ message: import("better-auth").RawError<"INVALID_API_KEY">;
419
+ code: "INVALID_API_KEY";
420
+ };
421
+ key: null;
422
+ } | {
423
+ valid: boolean;
424
+ error: null;
425
+ key: Omit<import("@better-auth/api-key/client").ApiKey, "key"> | null;
426
+ }>;
427
+ getApiKey: StrictEndpoint<"/api-key/get", {
428
+ method: "GET";
429
+ query: import("zod").ZodObject<{
430
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
431
+ id: import("zod").ZodString;
432
+ }, import("zod/v4/core").$strip>;
433
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
434
+ session: {
435
+ session: Record<string, any> & {
436
+ id: string;
437
+ createdAt: Date;
438
+ updatedAt: Date;
439
+ userId: string;
440
+ expiresAt: Date;
441
+ token: string;
442
+ ipAddress?: string | null | undefined;
443
+ userAgent?: string | null | undefined;
444
+ };
445
+ user: Record<string, any> & {
446
+ id: string;
447
+ createdAt: Date;
448
+ updatedAt: Date;
449
+ email: string;
450
+ emailVerified: boolean;
451
+ name: string;
452
+ image?: string | null | undefined;
453
+ };
454
+ };
455
+ }>)[];
456
+ metadata: {
457
+ openapi: {
458
+ description: string;
459
+ responses: {
460
+ "200": {
461
+ description: string;
462
+ content: {
463
+ "application/json": {
464
+ schema: {
465
+ type: "object";
466
+ properties: {
467
+ id: {
468
+ type: string;
469
+ description: string;
470
+ };
471
+ name: {
472
+ type: string;
473
+ nullable: boolean;
474
+ description: string;
475
+ };
476
+ start: {
477
+ type: string;
478
+ nullable: boolean;
479
+ description: string;
480
+ };
481
+ prefix: {
482
+ type: string;
483
+ nullable: boolean;
484
+ description: string;
485
+ };
486
+ userId: {
487
+ type: string;
488
+ description: string;
489
+ };
490
+ refillInterval: {
491
+ type: string;
492
+ nullable: boolean;
493
+ description: string;
494
+ };
495
+ refillAmount: {
496
+ type: string;
497
+ nullable: boolean;
498
+ description: string;
499
+ };
500
+ lastRefillAt: {
501
+ type: string;
502
+ format: string;
503
+ nullable: boolean;
504
+ description: string;
505
+ };
506
+ enabled: {
507
+ type: string;
508
+ description: string;
509
+ default: boolean;
510
+ };
511
+ rateLimitEnabled: {
512
+ type: string;
513
+ description: string;
514
+ };
515
+ rateLimitTimeWindow: {
516
+ type: string;
517
+ nullable: boolean;
518
+ description: string;
519
+ };
520
+ rateLimitMax: {
521
+ type: string;
522
+ nullable: boolean;
523
+ description: string;
524
+ };
525
+ requestCount: {
526
+ type: string;
527
+ description: string;
528
+ };
529
+ remaining: {
530
+ type: string;
531
+ nullable: boolean;
532
+ description: string;
533
+ };
534
+ lastRequest: {
535
+ type: string;
536
+ format: string;
537
+ nullable: boolean;
538
+ description: string;
539
+ };
540
+ expiresAt: {
541
+ type: string;
542
+ format: string;
543
+ nullable: boolean;
544
+ description: string;
545
+ };
546
+ createdAt: {
547
+ type: string;
548
+ format: string;
549
+ description: string;
550
+ };
551
+ updatedAt: {
552
+ type: string;
553
+ format: string;
554
+ description: string;
555
+ };
556
+ metadata: {
557
+ type: string;
558
+ nullable: boolean;
559
+ additionalProperties: boolean;
560
+ description: string;
561
+ };
562
+ permissions: {
563
+ type: string;
564
+ nullable: boolean;
565
+ description: string;
566
+ };
567
+ };
568
+ required: string[];
569
+ };
570
+ };
571
+ };
572
+ };
573
+ };
574
+ };
575
+ };
576
+ }, {
577
+ metadata: Record<string, any> | null;
578
+ permissions: {
579
+ [key: string]: string[];
580
+ } | null;
581
+ id: string;
582
+ configId: string;
583
+ name: string | null;
584
+ start: string | null;
585
+ prefix: string | null;
586
+ referenceId: string;
587
+ refillInterval: number | null;
588
+ refillAmount: number | null;
589
+ lastRefillAt: Date | null;
590
+ enabled: boolean;
591
+ rateLimitEnabled: boolean;
592
+ rateLimitTimeWindow: number | null;
593
+ rateLimitMax: number | null;
594
+ requestCount: number;
595
+ remaining: number | null;
596
+ lastRequest: Date | null;
597
+ expiresAt: Date | null;
598
+ createdAt: Date;
599
+ updatedAt: Date;
600
+ }>;
601
+ updateApiKey: StrictEndpoint<"/api-key/update", {
602
+ method: "POST";
603
+ body: import("zod").ZodObject<{
604
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
605
+ keyId: import("zod").ZodString;
606
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
607
+ name: import("zod").ZodOptional<import("zod").ZodString>;
608
+ enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
609
+ remaining: import("zod").ZodOptional<import("zod").ZodNumber>;
610
+ refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
611
+ refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
612
+ metadata: import("zod").ZodOptional<import("zod").ZodAny>;
613
+ expiresIn: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
614
+ rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
615
+ rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
616
+ rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
617
+ permissions: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>>;
618
+ }, import("zod/v4/core").$strip>;
619
+ metadata: {
620
+ openapi: {
621
+ description: string;
622
+ responses: {
623
+ "200": {
624
+ description: string;
625
+ content: {
626
+ "application/json": {
627
+ schema: {
628
+ type: "object";
629
+ properties: {
630
+ id: {
631
+ type: string;
632
+ description: string;
633
+ };
634
+ name: {
635
+ type: string;
636
+ nullable: boolean;
637
+ description: string;
638
+ };
639
+ start: {
640
+ type: string;
641
+ nullable: boolean;
642
+ description: string;
643
+ };
644
+ prefix: {
645
+ type: string;
646
+ nullable: boolean;
647
+ description: string;
648
+ };
649
+ userId: {
650
+ type: string;
651
+ description: string;
652
+ };
653
+ refillInterval: {
654
+ type: string;
655
+ nullable: boolean;
656
+ description: string;
657
+ };
658
+ refillAmount: {
659
+ type: string;
660
+ nullable: boolean;
661
+ description: string;
662
+ };
663
+ lastRefillAt: {
664
+ type: string;
665
+ format: string;
666
+ nullable: boolean;
667
+ description: string;
668
+ };
669
+ enabled: {
670
+ type: string;
671
+ description: string;
672
+ default: boolean;
673
+ };
674
+ rateLimitEnabled: {
675
+ type: string;
676
+ description: string;
677
+ };
678
+ rateLimitTimeWindow: {
679
+ type: string;
680
+ nullable: boolean;
681
+ description: string;
682
+ };
683
+ rateLimitMax: {
684
+ type: string;
685
+ nullable: boolean;
686
+ description: string;
687
+ };
688
+ requestCount: {
689
+ type: string;
690
+ description: string;
691
+ };
692
+ remaining: {
693
+ type: string;
694
+ nullable: boolean;
695
+ description: string;
696
+ };
697
+ lastRequest: {
698
+ type: string;
699
+ format: string;
700
+ nullable: boolean;
701
+ description: string;
702
+ };
703
+ expiresAt: {
704
+ type: string;
705
+ format: string;
706
+ nullable: boolean;
707
+ description: string;
708
+ };
709
+ createdAt: {
710
+ type: string;
711
+ format: string;
712
+ description: string;
713
+ };
714
+ updatedAt: {
715
+ type: string;
716
+ format: string;
717
+ description: string;
718
+ };
719
+ metadata: {
720
+ type: string;
721
+ nullable: boolean;
722
+ additionalProperties: boolean;
723
+ description: string;
724
+ };
725
+ permissions: {
726
+ type: string;
727
+ nullable: boolean;
728
+ description: string;
729
+ };
730
+ };
731
+ required: string[];
732
+ };
733
+ };
734
+ };
735
+ };
736
+ };
737
+ };
738
+ };
739
+ }, {
740
+ metadata: Record<string, any> | null;
741
+ permissions: {
742
+ [key: string]: string[];
743
+ } | null;
744
+ id: string;
745
+ configId: string;
746
+ name: string | null;
747
+ start: string | null;
748
+ prefix: string | null;
749
+ referenceId: string;
750
+ refillInterval: number | null;
751
+ refillAmount: number | null;
752
+ lastRefillAt: Date | null;
753
+ enabled: boolean;
754
+ rateLimitEnabled: boolean;
755
+ rateLimitTimeWindow: number | null;
756
+ rateLimitMax: number | null;
757
+ requestCount: number;
758
+ remaining: number | null;
759
+ lastRequest: Date | null;
760
+ expiresAt: Date | null;
761
+ createdAt: Date;
762
+ updatedAt: Date;
763
+ }>;
764
+ deleteApiKey: StrictEndpoint<"/api-key/delete", {
765
+ method: "POST";
766
+ body: import("zod").ZodObject<{
767
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
768
+ keyId: import("zod").ZodString;
769
+ }, import("zod/v4/core").$strip>;
770
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
771
+ session: {
772
+ session: Record<string, any> & {
773
+ id: string;
774
+ createdAt: Date;
775
+ updatedAt: Date;
776
+ userId: string;
777
+ expiresAt: Date;
778
+ token: string;
779
+ ipAddress?: string | null | undefined;
780
+ userAgent?: string | null | undefined;
781
+ };
782
+ user: Record<string, any> & {
783
+ id: string;
784
+ createdAt: Date;
785
+ updatedAt: Date;
786
+ email: string;
787
+ emailVerified: boolean;
788
+ name: string;
789
+ image?: string | null | undefined;
790
+ };
791
+ };
792
+ }>)[];
793
+ metadata: {
794
+ openapi: {
795
+ description: string;
796
+ requestBody: {
797
+ content: {
798
+ "application/json": {
799
+ schema: {
800
+ type: "object";
801
+ properties: {
802
+ keyId: {
803
+ type: string;
804
+ description: string;
805
+ };
806
+ };
807
+ required: string[];
808
+ };
809
+ };
810
+ };
811
+ };
812
+ responses: {
813
+ "200": {
814
+ description: string;
815
+ content: {
816
+ "application/json": {
817
+ schema: {
818
+ type: "object";
819
+ properties: {
820
+ success: {
821
+ type: string;
822
+ description: string;
823
+ };
824
+ };
825
+ required: string[];
826
+ };
827
+ };
828
+ };
829
+ };
830
+ };
831
+ };
832
+ };
833
+ }, {
834
+ success: boolean;
835
+ }>;
836
+ listApiKeys: StrictEndpoint<"/api-key/list", {
837
+ method: "GET";
838
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
839
+ session: {
840
+ session: Record<string, any> & {
841
+ id: string;
842
+ createdAt: Date;
843
+ updatedAt: Date;
844
+ userId: string;
845
+ expiresAt: Date;
846
+ token: string;
847
+ ipAddress?: string | null | undefined;
848
+ userAgent?: string | null | undefined;
849
+ };
850
+ user: Record<string, any> & {
851
+ id: string;
852
+ createdAt: Date;
853
+ updatedAt: Date;
854
+ email: string;
855
+ emailVerified: boolean;
856
+ name: string;
857
+ image?: string | null | undefined;
858
+ };
859
+ };
860
+ }>)[];
861
+ query: import("zod").ZodOptional<import("zod").ZodObject<{
862
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
863
+ organizationId: import("zod").ZodOptional<import("zod").ZodString>;
864
+ limit: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
865
+ offset: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
866
+ sortBy: import("zod").ZodOptional<import("zod").ZodString>;
867
+ sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
868
+ asc: "asc";
869
+ desc: "desc";
870
+ }>>;
871
+ }, import("zod/v4/core").$strip>>;
872
+ metadata: {
873
+ openapi: {
874
+ description: string;
875
+ responses: {
876
+ "200": {
877
+ description: string;
878
+ content: {
879
+ "application/json": {
880
+ schema: {
881
+ type: "object";
882
+ properties: {
883
+ apiKeys: {
884
+ type: string;
885
+ items: {
886
+ type: string;
887
+ properties: {
888
+ id: {
889
+ type: string;
890
+ description: string;
891
+ };
892
+ name: {
893
+ type: string;
894
+ nullable: boolean;
895
+ description: string;
896
+ };
897
+ start: {
898
+ type: string;
899
+ nullable: boolean;
900
+ description: string;
901
+ };
902
+ prefix: {
903
+ type: string;
904
+ nullable: boolean;
905
+ description: string;
906
+ };
907
+ userId: {
908
+ type: string;
909
+ description: string;
910
+ };
911
+ refillInterval: {
912
+ type: string;
913
+ nullable: boolean;
914
+ description: string;
915
+ };
916
+ refillAmount: {
917
+ type: string;
918
+ nullable: boolean;
919
+ description: string;
920
+ };
921
+ lastRefillAt: {
922
+ type: string;
923
+ format: string;
924
+ nullable: boolean;
925
+ description: string;
926
+ };
927
+ enabled: {
928
+ type: string;
929
+ description: string;
930
+ default: boolean;
931
+ };
932
+ rateLimitEnabled: {
933
+ type: string;
934
+ description: string;
935
+ };
936
+ rateLimitTimeWindow: {
937
+ type: string;
938
+ nullable: boolean;
939
+ description: string;
940
+ };
941
+ rateLimitMax: {
942
+ type: string;
943
+ nullable: boolean;
944
+ description: string;
945
+ };
946
+ requestCount: {
947
+ type: string;
948
+ description: string;
949
+ };
950
+ remaining: {
951
+ type: string;
952
+ nullable: boolean;
953
+ description: string;
954
+ };
955
+ lastRequest: {
956
+ type: string;
957
+ format: string;
958
+ nullable: boolean;
959
+ description: string;
960
+ };
961
+ expiresAt: {
962
+ type: string;
963
+ format: string;
964
+ nullable: boolean;
965
+ description: string;
966
+ };
967
+ createdAt: {
968
+ type: string;
969
+ format: string;
970
+ description: string;
971
+ };
972
+ updatedAt: {
973
+ type: string;
974
+ format: string;
975
+ description: string;
976
+ };
977
+ metadata: {
978
+ type: string;
979
+ nullable: boolean;
980
+ additionalProperties: boolean;
981
+ description: string;
982
+ };
983
+ permissions: {
984
+ type: string;
985
+ nullable: boolean;
986
+ description: string;
987
+ };
988
+ };
989
+ required: string[];
990
+ };
991
+ };
992
+ total: {
993
+ type: string;
994
+ description: string;
995
+ };
996
+ limit: {
997
+ type: string;
998
+ nullable: boolean;
999
+ description: string;
1000
+ };
1001
+ offset: {
1002
+ type: string;
1003
+ nullable: boolean;
1004
+ description: string;
1005
+ };
1006
+ };
1007
+ required: string[];
1008
+ };
1009
+ };
1010
+ };
1011
+ };
1012
+ };
1013
+ };
1014
+ };
1015
+ }, {
1016
+ apiKeys: {
1017
+ metadata: Record<string, any> | null;
1018
+ permissions: {
1019
+ [key: string]: string[];
1020
+ } | null;
1021
+ id: string;
1022
+ configId: string;
1023
+ name: string | null;
1024
+ start: string | null;
1025
+ prefix: string | null;
1026
+ referenceId: string;
1027
+ refillInterval: number | null;
1028
+ refillAmount: number | null;
1029
+ lastRefillAt: Date | null;
1030
+ enabled: boolean;
1031
+ rateLimitEnabled: boolean;
1032
+ rateLimitTimeWindow: number | null;
1033
+ rateLimitMax: number | null;
1034
+ requestCount: number;
1035
+ remaining: number | null;
1036
+ lastRequest: Date | null;
1037
+ expiresAt: Date | null;
1038
+ createdAt: Date;
1039
+ updatedAt: Date;
1040
+ }[];
1041
+ total: number;
1042
+ limit: number | undefined;
1043
+ offset: number | undefined;
1044
+ }>;
1045
+ deleteAllExpiredApiKeys: StrictEndpoint<string, {
1046
+ method: "POST";
1047
+ }, {
1048
+ success: boolean;
1049
+ error: unknown;
1050
+ }>;
1051
+ };
1052
+ schema: {
1053
+ apikey: {
1054
+ fields: {
1055
+ configId: {
1056
+ type: "string";
1057
+ required: true;
1058
+ defaultValue: string;
1059
+ input: false;
1060
+ index: true;
1061
+ };
1062
+ name: {
1063
+ type: "string";
1064
+ required: false;
1065
+ input: false;
1066
+ };
1067
+ start: {
1068
+ type: "string";
1069
+ required: false;
1070
+ input: false;
1071
+ };
1072
+ referenceId: {
1073
+ type: "string";
1074
+ required: true;
1075
+ input: false;
1076
+ index: true;
1077
+ };
1078
+ prefix: {
1079
+ type: "string";
1080
+ required: false;
1081
+ input: false;
1082
+ };
1083
+ key: {
1084
+ type: "string";
1085
+ required: true;
1086
+ input: false;
1087
+ index: true;
1088
+ };
1089
+ refillInterval: {
1090
+ type: "number";
1091
+ required: false;
1092
+ input: false;
1093
+ };
1094
+ refillAmount: {
1095
+ type: "number";
1096
+ required: false;
1097
+ input: false;
1098
+ };
1099
+ lastRefillAt: {
1100
+ type: "date";
1101
+ required: false;
1102
+ input: false;
1103
+ };
1104
+ enabled: {
1105
+ type: "boolean";
1106
+ required: false;
1107
+ input: false;
1108
+ defaultValue: true;
1109
+ };
1110
+ rateLimitEnabled: {
1111
+ type: "boolean";
1112
+ required: false;
1113
+ input: false;
1114
+ defaultValue: true;
1115
+ };
1116
+ rateLimitTimeWindow: {
1117
+ type: "number";
1118
+ required: false;
1119
+ input: false;
1120
+ defaultValue: number;
1121
+ };
1122
+ rateLimitMax: {
1123
+ type: "number";
1124
+ required: false;
1125
+ input: false;
1126
+ defaultValue: number;
1127
+ };
1128
+ requestCount: {
1129
+ type: "number";
1130
+ required: false;
1131
+ input: false;
1132
+ defaultValue: number;
1133
+ };
1134
+ remaining: {
1135
+ type: "number";
1136
+ required: false;
1137
+ input: false;
1138
+ };
1139
+ lastRequest: {
1140
+ type: "date";
1141
+ required: false;
1142
+ input: false;
1143
+ };
1144
+ expiresAt: {
1145
+ type: "date";
1146
+ required: false;
1147
+ input: false;
1148
+ };
1149
+ createdAt: {
1150
+ type: "date";
1151
+ required: true;
1152
+ input: false;
1153
+ };
1154
+ updatedAt: {
1155
+ type: "date";
1156
+ required: true;
1157
+ input: false;
1158
+ };
1159
+ permissions: {
1160
+ type: "string";
1161
+ required: false;
1162
+ input: false;
1163
+ };
1164
+ metadata: {
1165
+ type: "string";
1166
+ required: false;
1167
+ input: true;
1168
+ transform: {
1169
+ input(value: import("better-auth").DBPrimitive): string;
1170
+ output(value: import("better-auth").DBPrimitive): any;
1171
+ };
1172
+ };
1173
+ };
1174
+ };
1175
+ };
1176
+ };
1177
+ pathMethods: {
1178
+ "/api-key/create": "POST";
1179
+ "/api-key/delete": "POST";
1180
+ "/api-key/delete-all-expired-api-keys": "POST";
1181
+ };
1182
+ $ERROR_CODES: {
1183
+ INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
1184
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
1185
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
1186
+ USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
1187
+ UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
1188
+ KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
1189
+ KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
1190
+ KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
1191
+ USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
1192
+ KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
1193
+ EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
1194
+ EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
1195
+ INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
1196
+ INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
1197
+ INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
1198
+ METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
1199
+ RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
1200
+ NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
1201
+ KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
1202
+ INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
1203
+ INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
1204
+ INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
1205
+ INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
1206
+ SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
1207
+ FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
1208
+ NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
1209
+ ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
1210
+ USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
1211
+ INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
1212
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
1213
+ ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
1214
+ };
1215
+ } | {
1216
+ id: "passkey";
1217
+ version: string;
1218
+ $InferServerPlugin: ReturnType<(options?: import("@better-auth/passkey/client").PasskeyOptions | undefined) => {
1219
+ id: "passkey";
1220
+ version: string;
1221
+ endpoints: {
1222
+ generatePasskeyRegistrationOptions: StrictEndpoint<"/passkey/generate-register-options", {
1223
+ method: "GET";
1224
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
1225
+ session: {
1226
+ session: Record<string, any> & {
1227
+ id: string;
1228
+ createdAt: Date;
1229
+ updatedAt: Date;
1230
+ userId: string;
1231
+ expiresAt: Date;
1232
+ token: string;
1233
+ ipAddress?: string | null | undefined;
1234
+ userAgent?: string | null | undefined;
1235
+ };
1236
+ user: Record<string, any> & {
1237
+ id: string;
1238
+ createdAt: Date;
1239
+ updatedAt: Date;
1240
+ email: string;
1241
+ emailVerified: boolean;
1242
+ name: string;
1243
+ image?: string | null | undefined;
1244
+ };
1245
+ };
1246
+ }>)[];
1247
+ query: import("zod").ZodOptional<import("zod").ZodObject<{
1248
+ authenticatorAttachment: import("zod").ZodOptional<import("zod").ZodEnum<{
1249
+ platform: "platform";
1250
+ "cross-platform": "cross-platform";
1251
+ }>>;
1252
+ name: import("zod").ZodOptional<import("zod").ZodString>;
1253
+ context: import("zod").ZodOptional<import("zod").ZodString>;
1254
+ }, import("zod/v4/core").$strip>>;
1255
+ metadata: {
1256
+ openapi: {
1257
+ operationId: string;
1258
+ description: string;
1259
+ parameters: {
1260
+ name: string;
1261
+ in: "query";
1262
+ required: false;
1263
+ description: string;
1264
+ schema: {
1265
+ type: "string";
1266
+ };
1267
+ }[];
1268
+ responses: {
1269
+ 200: {
1270
+ description: string;
1271
+ content: {
1272
+ "application/json": {
1273
+ schema: {
1274
+ type: "object";
1275
+ properties: {
1276
+ challenge: {
1277
+ type: string;
1278
+ };
1279
+ rp: {
1280
+ type: string;
1281
+ properties: {
1282
+ name: {
1283
+ type: string;
1284
+ };
1285
+ id: {
1286
+ type: string;
1287
+ };
1288
+ };
1289
+ };
1290
+ user: {
1291
+ type: string;
1292
+ properties: {
1293
+ id: {
1294
+ type: string;
1295
+ };
1296
+ name: {
1297
+ type: string;
1298
+ };
1299
+ displayName: {
1300
+ type: string;
1301
+ };
1302
+ };
1303
+ };
1304
+ pubKeyCredParams: {
1305
+ type: string;
1306
+ items: {
1307
+ type: string;
1308
+ properties: {
1309
+ type: {
1310
+ type: string;
1311
+ };
1312
+ alg: {
1313
+ type: string;
1314
+ };
1315
+ };
1316
+ };
1317
+ };
1318
+ timeout: {
1319
+ type: string;
1320
+ };
1321
+ excludeCredentials: {
1322
+ type: string;
1323
+ items: {
1324
+ type: string;
1325
+ properties: {
1326
+ id: {
1327
+ type: string;
1328
+ };
1329
+ type: {
1330
+ type: string;
1331
+ };
1332
+ transports: {
1333
+ type: string;
1334
+ items: {
1335
+ type: string;
1336
+ };
1337
+ };
1338
+ };
1339
+ };
1340
+ };
1341
+ authenticatorSelection: {
1342
+ type: string;
1343
+ properties: {
1344
+ authenticatorAttachment: {
1345
+ type: string;
1346
+ };
1347
+ requireResidentKey: {
1348
+ type: string;
1349
+ };
1350
+ userVerification: {
1351
+ type: string;
1352
+ };
1353
+ };
1354
+ };
1355
+ attestation: {
1356
+ type: string;
1357
+ };
1358
+ extensions: {
1359
+ type: string;
1360
+ };
1361
+ };
1362
+ };
1363
+ };
1364
+ };
1365
+ };
1366
+ };
1367
+ };
1368
+ };
1369
+ }, PublicKeyCredentialCreationOptionsJSON>;
1370
+ generatePasskeyAuthenticationOptions: StrictEndpoint<"/passkey/generate-authenticate-options", {
1371
+ method: "GET";
1372
+ metadata: {
1373
+ openapi: {
1374
+ operationId: string;
1375
+ description: string;
1376
+ responses: {
1377
+ 200: {
1378
+ description: string;
1379
+ content: {
1380
+ "application/json": {
1381
+ schema: {
1382
+ type: "object";
1383
+ properties: {
1384
+ challenge: {
1385
+ type: string;
1386
+ };
1387
+ rp: {
1388
+ type: string;
1389
+ properties: {
1390
+ name: {
1391
+ type: string;
1392
+ };
1393
+ id: {
1394
+ type: string;
1395
+ };
1396
+ };
1397
+ };
1398
+ user: {
1399
+ type: string;
1400
+ properties: {
1401
+ id: {
1402
+ type: string;
1403
+ };
1404
+ name: {
1405
+ type: string;
1406
+ };
1407
+ displayName: {
1408
+ type: string;
1409
+ };
1410
+ };
1411
+ };
1412
+ timeout: {
1413
+ type: string;
1414
+ };
1415
+ allowCredentials: {
1416
+ type: string;
1417
+ items: {
1418
+ type: string;
1419
+ properties: {
1420
+ id: {
1421
+ type: string;
1422
+ };
1423
+ type: {
1424
+ type: string;
1425
+ };
1426
+ transports: {
1427
+ type: string;
1428
+ items: {
1429
+ type: string;
1430
+ };
1431
+ };
1432
+ };
1433
+ };
1434
+ };
1435
+ userVerification: {
1436
+ type: string;
1437
+ };
1438
+ authenticatorSelection: {
1439
+ type: string;
1440
+ properties: {
1441
+ authenticatorAttachment: {
1442
+ type: string;
1443
+ };
1444
+ requireResidentKey: {
1445
+ type: string;
1446
+ };
1447
+ userVerification: {
1448
+ type: string;
1449
+ };
1450
+ };
1451
+ };
1452
+ extensions: {
1453
+ type: string;
1454
+ };
1455
+ };
1456
+ };
1457
+ };
1458
+ };
1459
+ };
1460
+ };
1461
+ };
1462
+ };
1463
+ }, PublicKeyCredentialRequestOptionsJSON>;
1464
+ verifyPasskeyRegistration: StrictEndpoint<"/passkey/verify-registration", {
1465
+ method: "POST";
1466
+ body: import("zod").ZodObject<{
1467
+ response: import("zod").ZodAny;
1468
+ name: import("zod").ZodOptional<import("zod").ZodString>;
1469
+ }, import("zod/v4/core").$strip>;
1470
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
1471
+ session: {
1472
+ session: Record<string, any> & {
1473
+ id: string;
1474
+ createdAt: Date;
1475
+ updatedAt: Date;
1476
+ userId: string;
1477
+ expiresAt: Date;
1478
+ token: string;
1479
+ ipAddress?: string | null | undefined;
1480
+ userAgent?: string | null | undefined;
1481
+ };
1482
+ user: Record<string, any> & {
1483
+ id: string;
1484
+ createdAt: Date;
1485
+ updatedAt: Date;
1486
+ email: string;
1487
+ emailVerified: boolean;
1488
+ name: string;
1489
+ image?: string | null | undefined;
1490
+ };
1491
+ };
1492
+ }>)[];
1493
+ metadata: {
1494
+ openapi: {
1495
+ operationId: string;
1496
+ description: string;
1497
+ responses: {
1498
+ 200: {
1499
+ description: string;
1500
+ content: {
1501
+ "application/json": {
1502
+ schema: {
1503
+ $ref: string;
1504
+ };
1505
+ };
1506
+ };
1507
+ };
1508
+ 400: {
1509
+ description: string;
1510
+ };
1511
+ };
1512
+ };
1513
+ };
1514
+ }, import("@better-auth/passkey/client").Passkey>;
1515
+ verifyPasskeyAuthentication: StrictEndpoint<"/passkey/verify-authentication", {
1516
+ method: "POST";
1517
+ body: import("zod").ZodObject<{
1518
+ response: import("zod").ZodRecord<import("zod").ZodAny, import("zod").ZodAny>;
1519
+ }, import("zod/v4/core").$strip>;
1520
+ metadata: {
1521
+ openapi: {
1522
+ operationId: string;
1523
+ description: string;
1524
+ responses: {
1525
+ 200: {
1526
+ description: string;
1527
+ content: {
1528
+ "application/json": {
1529
+ schema: {
1530
+ type: "object";
1531
+ properties: {
1532
+ session: {
1533
+ $ref: string;
1534
+ };
1535
+ user: {
1536
+ $ref: string;
1537
+ };
1538
+ };
1539
+ };
1540
+ };
1541
+ };
1542
+ };
1543
+ };
1544
+ };
1545
+ $Infer: {
1546
+ body: {
1547
+ response: AuthenticationResponseJSON;
1548
+ };
1549
+ };
1550
+ };
1551
+ }, {
1552
+ session: {
1553
+ id: string;
1554
+ createdAt: Date;
1555
+ updatedAt: Date;
1556
+ userId: string;
1557
+ expiresAt: Date;
1558
+ token: string;
1559
+ ipAddress?: string | null | undefined;
1560
+ userAgent?: string | null | undefined;
1561
+ };
1562
+ user: {
1563
+ id: string;
1564
+ createdAt: Date;
1565
+ updatedAt: Date;
1566
+ email: string;
1567
+ emailVerified: boolean;
1568
+ name: string;
1569
+ image?: string | null | undefined;
1570
+ };
1571
+ }>;
1572
+ listPasskeys: StrictEndpoint<"/passkey/list-user-passkeys", {
1573
+ method: "GET";
1574
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
1575
+ session: {
1576
+ session: Record<string, any> & {
1577
+ id: string;
1578
+ createdAt: Date;
1579
+ updatedAt: Date;
1580
+ userId: string;
1581
+ expiresAt: Date;
1582
+ token: string;
1583
+ ipAddress?: string | null | undefined;
1584
+ userAgent?: string | null | undefined;
1585
+ };
1586
+ user: Record<string, any> & {
1587
+ id: string;
1588
+ createdAt: Date;
1589
+ updatedAt: Date;
1590
+ email: string;
1591
+ emailVerified: boolean;
1592
+ name: string;
1593
+ image?: string | null | undefined;
1594
+ };
1595
+ };
1596
+ }>)[];
1597
+ metadata: {
1598
+ openapi: {
1599
+ description: string;
1600
+ responses: {
1601
+ "200": {
1602
+ description: string;
1603
+ content: {
1604
+ "application/json": {
1605
+ schema: {
1606
+ type: "array";
1607
+ items: {
1608
+ $ref: string;
1609
+ required: string[];
1610
+ };
1611
+ description: string;
1612
+ };
1613
+ };
1614
+ };
1615
+ };
1616
+ };
1617
+ };
1618
+ };
1619
+ }, import("@better-auth/passkey/client").Passkey[]>;
1620
+ deletePasskey: StrictEndpoint<"/passkey/delete-passkey", {
1621
+ method: "POST";
1622
+ body: import("zod").ZodObject<{
1623
+ id: import("zod").ZodString;
1624
+ }, import("zod/v4/core").$strip>;
1625
+ use: (((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
1626
+ session: {
1627
+ session: Record<string, any> & {
1628
+ id: string;
1629
+ createdAt: Date;
1630
+ updatedAt: Date;
1631
+ userId: string;
1632
+ expiresAt: Date;
1633
+ token: string;
1634
+ ipAddress?: string | null | undefined;
1635
+ userAgent?: string | null | undefined;
1636
+ };
1637
+ user: Record<string, any> & {
1638
+ id: string;
1639
+ createdAt: Date;
1640
+ updatedAt: Date;
1641
+ email: string;
1642
+ emailVerified: boolean;
1643
+ name: string;
1644
+ image?: string | null | undefined;
1645
+ };
1646
+ };
1647
+ }>) | ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
1648
+ verifiedResource: {};
1649
+ }>))[];
1650
+ metadata: {
1651
+ openapi: {
1652
+ description: string;
1653
+ responses: {
1654
+ "200": {
1655
+ description: string;
1656
+ content: {
1657
+ "application/json": {
1658
+ schema: {
1659
+ type: "object";
1660
+ properties: {
1661
+ status: {
1662
+ type: string;
1663
+ description: string;
1664
+ };
1665
+ };
1666
+ required: string[];
1667
+ };
1668
+ };
1669
+ };
1670
+ };
1671
+ };
1672
+ };
1673
+ };
1674
+ }, {
1675
+ status: boolean;
1676
+ }>;
1677
+ updatePasskey: StrictEndpoint<"/passkey/update-passkey", {
1678
+ method: "POST";
1679
+ body: import("zod").ZodObject<{
1680
+ id: import("zod").ZodString;
1681
+ name: import("zod").ZodString;
1682
+ }, import("zod/v4/core").$strip>;
1683
+ use: (((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
1684
+ session: {
1685
+ session: Record<string, any> & {
1686
+ id: string;
1687
+ createdAt: Date;
1688
+ updatedAt: Date;
1689
+ userId: string;
1690
+ expiresAt: Date;
1691
+ token: string;
1692
+ ipAddress?: string | null | undefined;
1693
+ userAgent?: string | null | undefined;
1694
+ };
1695
+ user: Record<string, any> & {
1696
+ id: string;
1697
+ createdAt: Date;
1698
+ updatedAt: Date;
1699
+ email: string;
1700
+ emailVerified: boolean;
1701
+ name: string;
1702
+ image?: string | null | undefined;
1703
+ };
1704
+ };
1705
+ }>) | ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
1706
+ verifiedResource: {};
1707
+ }>))[];
1708
+ metadata: {
1709
+ openapi: {
1710
+ description: string;
1711
+ responses: {
1712
+ "200": {
1713
+ description: string;
1714
+ content: {
1715
+ "application/json": {
1716
+ schema: {
1717
+ type: "object";
1718
+ properties: {
1719
+ passkey: {
1720
+ $ref: string;
1721
+ };
1722
+ };
1723
+ required: string[];
1724
+ };
1725
+ };
1726
+ };
1727
+ };
1728
+ };
1729
+ };
1730
+ };
1731
+ }, {
1732
+ passkey: import("@better-auth/passkey/client").Passkey;
1733
+ }>;
1734
+ };
1735
+ schema: {
1736
+ passkey: {
1737
+ fields: {
1738
+ name: {
1739
+ type: "string";
1740
+ required: false;
1741
+ };
1742
+ publicKey: {
1743
+ type: "string";
1744
+ required: true;
1745
+ };
1746
+ userId: {
1747
+ type: "string";
1748
+ references: {
1749
+ model: string;
1750
+ field: string;
1751
+ };
1752
+ required: true;
1753
+ index: true;
1754
+ };
1755
+ credentialID: {
1756
+ type: "string";
1757
+ required: true;
1758
+ index: true;
1759
+ };
1760
+ counter: {
1761
+ type: "number";
1762
+ required: true;
1763
+ };
1764
+ deviceType: {
1765
+ type: "string";
1766
+ required: true;
1767
+ };
1768
+ backedUp: {
1769
+ type: "boolean";
1770
+ required: true;
1771
+ };
1772
+ transports: {
1773
+ type: "string";
1774
+ required: false;
1775
+ };
1776
+ createdAt: {
1777
+ type: "date";
1778
+ required: false;
1779
+ };
1780
+ aaguid: {
1781
+ type: "string";
1782
+ required: false;
1783
+ };
1784
+ };
1785
+ };
1786
+ };
1787
+ $ERROR_CODES: {
1788
+ CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
1789
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
1790
+ FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
1791
+ PASSKEY_NOT_FOUND: import("better-auth").RawError<"PASSKEY_NOT_FOUND">;
1792
+ AUTHENTICATION_FAILED: import("better-auth").RawError<"AUTHENTICATION_FAILED">;
1793
+ UNABLE_TO_CREATE_SESSION: import("better-auth").RawError<"UNABLE_TO_CREATE_SESSION">;
1794
+ FAILED_TO_UPDATE_PASSKEY: import("better-auth").RawError<"FAILED_TO_UPDATE_PASSKEY">;
1795
+ PREVIOUSLY_REGISTERED: import("better-auth").RawError<"PREVIOUSLY_REGISTERED">;
1796
+ REGISTRATION_CANCELLED: import("better-auth").RawError<"REGISTRATION_CANCELLED">;
1797
+ AUTH_CANCELLED: import("better-auth").RawError<"AUTH_CANCELLED">;
1798
+ UNKNOWN_ERROR: import("better-auth").RawError<"UNKNOWN_ERROR">;
1799
+ SESSION_REQUIRED: import("better-auth").RawError<"SESSION_REQUIRED">;
1800
+ RESOLVE_USER_REQUIRED: import("better-auth").RawError<"RESOLVE_USER_REQUIRED">;
1801
+ RESOLVED_USER_INVALID: import("better-auth").RawError<"RESOLVED_USER_INVALID">;
1802
+ };
1803
+ options: import("@better-auth/passkey/client").PasskeyOptions | undefined;
1804
+ }>;
1805
+ getActions: ($fetch: BetterFetch, $store: import("better-auth").ClientStore) => {
1806
+ signIn: {
1807
+ passkey: (opts?: {
1808
+ autoFill?: boolean;
1809
+ extensions?: AuthenticationExtensionsClientInputs;
1810
+ returnWebAuthnResponse?: boolean;
1811
+ fetchOptions?: import("better-auth").ClientFetchOption;
1812
+ } | undefined, options?: import("better-auth").ClientFetchOption | undefined) => Promise<{
1813
+ data: null;
1814
+ error: {
1815
+ message?: string | undefined;
1816
+ status: number;
1817
+ statusText: string;
1818
+ };
1819
+ } | {
1820
+ data: {
1821
+ session: import("better-auth").Session;
1822
+ user: import("better-auth").User;
1823
+ };
1824
+ error: null;
1825
+ } | {
1826
+ data: null;
1827
+ error: {
1828
+ code: string;
1829
+ message: string;
1830
+ status: number;
1831
+ statusText: string;
1832
+ };
1833
+ } | {
1834
+ webauthn: {
1835
+ response: AuthenticationResponseJSON;
1836
+ clientExtensionResults: AuthenticationExtensionsClientOutputs;
1837
+ };
1838
+ data: null;
1839
+ error: {
1840
+ message?: string | undefined;
1841
+ status: number;
1842
+ statusText: string;
1843
+ };
1844
+ } | {
1845
+ webauthn: {
1846
+ response: AuthenticationResponseJSON;
1847
+ clientExtensionResults: AuthenticationExtensionsClientOutputs;
1848
+ };
1849
+ data: {
1850
+ session: import("better-auth").Session;
1851
+ user: import("better-auth").User;
1852
+ };
1853
+ error: null;
1854
+ }>;
1855
+ };
1856
+ passkey: {
1857
+ addPasskey: (opts?: {
1858
+ fetchOptions?: import("better-auth").ClientFetchOption;
1859
+ name?: string;
1860
+ authenticatorAttachment?: "platform" | "cross-platform";
1861
+ context?: string | null;
1862
+ extensions?: AuthenticationExtensionsClientInputs;
1863
+ useAutoRegister?: boolean;
1864
+ returnWebAuthnResponse?: boolean;
1865
+ } | undefined, fetchOpts?: import("better-auth").ClientFetchOption | undefined) => Promise<{
1866
+ data: null;
1867
+ error: {
1868
+ message?: string | undefined;
1869
+ status: number;
1870
+ statusText: string;
1871
+ };
1872
+ } | {
1873
+ data: import("@better-auth/passkey/client").Passkey;
1874
+ error: null;
1875
+ } | {
1876
+ webauthn: {
1877
+ response: RegistrationResponseJSON;
1878
+ clientExtensionResults: AuthenticationExtensionsClientOutputs;
1879
+ };
1880
+ data: import("@better-auth/passkey/client").Passkey;
1881
+ error: null;
1882
+ } | {
1883
+ data: null;
1884
+ error: {
1885
+ code: string;
1886
+ message: string;
1887
+ status: number;
1888
+ statusText: string;
1889
+ };
1890
+ }>;
1891
+ };
1892
+ $Infer: {
1893
+ Passkey: import("@better-auth/passkey/client").Passkey;
1894
+ };
1895
+ };
1896
+ getAtoms($fetch: BetterFetch): {
1897
+ listPasskeys: import("better-auth/client").AuthQueryAtom<import("@better-auth/passkey/client").Passkey[]>;
1898
+ $listPasskeys: PreinitializedWritableAtom<any> & object;
1899
+ };
1900
+ pathMethods: {
1901
+ "/passkey/register": "POST";
1902
+ "/passkey/authenticate": "POST";
1903
+ };
1904
+ atomListeners: ({
1905
+ matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
1906
+ signal: "$listPasskeys";
1907
+ } | {
1908
+ matcher: (path: string) => path is "/passkey/verify-authentication";
1909
+ signal: "$sessionSignal";
1910
+ })[];
1911
+ $ERROR_CODES: {
1912
+ CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
1913
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
1914
+ FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
1915
+ PASSKEY_NOT_FOUND: import("better-auth").RawError<"PASSKEY_NOT_FOUND">;
1916
+ AUTHENTICATION_FAILED: import("better-auth").RawError<"AUTHENTICATION_FAILED">;
1917
+ UNABLE_TO_CREATE_SESSION: import("better-auth").RawError<"UNABLE_TO_CREATE_SESSION">;
1918
+ FAILED_TO_UPDATE_PASSKEY: import("better-auth").RawError<"FAILED_TO_UPDATE_PASSKEY">;
1919
+ PREVIOUSLY_REGISTERED: import("better-auth").RawError<"PREVIOUSLY_REGISTERED">;
1920
+ REGISTRATION_CANCELLED: import("better-auth").RawError<"REGISTRATION_CANCELLED">;
1921
+ AUTH_CANCELLED: import("better-auth").RawError<"AUTH_CANCELLED">;
1922
+ UNKNOWN_ERROR: import("better-auth").RawError<"UNKNOWN_ERROR">;
1923
+ SESSION_REQUIRED: import("better-auth").RawError<"SESSION_REQUIRED">;
1924
+ RESOLVE_USER_REQUIRED: import("better-auth").RawError<"RESOLVE_USER_REQUIRED">;
1925
+ RESOLVED_USER_INVALID: import("better-auth").RawError<"RESOLVED_USER_INVALID">;
1926
+ };
1927
+ } | {
1928
+ id: "additional-fields-client";
1929
+ version: string;
1930
+ $InferServerPlugin: {
1931
+ id: "additional-fields-client";
1932
+ version: string;
1933
+ schema: {
1934
+ user: {
1935
+ fields: {
1936
+ locale: {
1937
+ type: "string";
1938
+ required: false;
1939
+ input: true;
1940
+ };
1941
+ };
1942
+ };
1943
+ session: {
1944
+ fields: {};
1945
+ };
1946
+ };
1947
+ };
1948
+ } | {
1949
+ id: "admin-client";
1950
+ version: string;
1951
+ $InferServerPlugin: {
1952
+ id: "admin";
1953
+ version: string;
1954
+ init(): {
1955
+ options: {
1956
+ databaseHooks: {
1957
+ user: {
1958
+ create: {
1959
+ before(user: {
1960
+ id: string;
1961
+ createdAt: Date;
1962
+ updatedAt: Date;
1963
+ email: string;
1964
+ emailVerified: boolean;
1965
+ name: string;
1966
+ image?: string | null | undefined;
1967
+ } & Record<string, unknown>): Promise<{
1968
+ data: {
1969
+ id: string;
1970
+ createdAt: Date;
1971
+ updatedAt: Date;
1972
+ email: string;
1973
+ emailVerified: boolean;
1974
+ name: string;
1975
+ image?: string | null | undefined;
1976
+ role: string;
1977
+ };
1978
+ }>;
1979
+ };
1980
+ };
1981
+ session: {
1982
+ create: {
1983
+ before(session: {
1984
+ id: string;
1985
+ createdAt: Date;
1986
+ updatedAt: Date;
1987
+ userId: string;
1988
+ expiresAt: Date;
1989
+ token: string;
1990
+ ipAddress?: string | null | undefined;
1991
+ userAgent?: string | null | undefined;
1992
+ } & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | null): Promise<void>;
1993
+ };
1994
+ };
1995
+ };
1996
+ };
1997
+ };
1998
+ hooks: {
1999
+ after: {
2000
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
2001
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
2002
+ }[];
2003
+ };
2004
+ endpoints: {
2005
+ setRole: import("better-auth").StrictEndpoint<"/admin/set-role", {
2006
+ method: "POST";
2007
+ body: import("zod").ZodObject<{
2008
+ userId: import("zod").ZodCoercedString<unknown>;
2009
+ role: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
2010
+ }, import("zod/v4/core").$strip>;
2011
+ requireHeaders: true;
2012
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2013
+ session: {
2014
+ user: import("better-auth/plugins").UserWithRole;
2015
+ session: {
2016
+ id: string;
2017
+ createdAt: Date;
2018
+ updatedAt: Date;
2019
+ userId: string;
2020
+ expiresAt: Date;
2021
+ token: string;
2022
+ ipAddress?: string | null | undefined;
2023
+ userAgent?: string | null | undefined;
2024
+ };
2025
+ };
2026
+ }>)[];
2027
+ metadata: {
2028
+ openapi: {
2029
+ operationId: string;
2030
+ summary: string;
2031
+ description: string;
2032
+ responses: {
2033
+ 200: {
2034
+ description: string;
2035
+ content: {
2036
+ "application/json": {
2037
+ schema: {
2038
+ type: "object";
2039
+ properties: {
2040
+ user: {
2041
+ $ref: string;
2042
+ };
2043
+ };
2044
+ };
2045
+ };
2046
+ };
2047
+ };
2048
+ };
2049
+ };
2050
+ $Infer: {
2051
+ body: {
2052
+ userId: string;
2053
+ role: "admin" | "user" | ("admin" | "user")[];
2054
+ };
2055
+ };
2056
+ };
2057
+ }, {
2058
+ user: import("better-auth/plugins").UserWithRole;
2059
+ }>;
2060
+ getUser: import("better-auth").StrictEndpoint<"/admin/get-user", {
2061
+ method: "GET";
2062
+ query: import("zod").ZodObject<{
2063
+ id: import("zod").ZodString;
2064
+ }, import("zod/v4/core").$strip>;
2065
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2066
+ session: {
2067
+ user: import("better-auth/plugins").UserWithRole;
2068
+ session: {
2069
+ id: string;
2070
+ createdAt: Date;
2071
+ updatedAt: Date;
2072
+ userId: string;
2073
+ expiresAt: Date;
2074
+ token: string;
2075
+ ipAddress?: string | null | undefined;
2076
+ userAgent?: string | null | undefined;
2077
+ };
2078
+ };
2079
+ }>)[];
2080
+ metadata: {
2081
+ openapi: {
2082
+ operationId: string;
2083
+ summary: string;
2084
+ description: string;
2085
+ responses: {
2086
+ 200: {
2087
+ description: string;
2088
+ content: {
2089
+ "application/json": {
2090
+ schema: {
2091
+ type: "object";
2092
+ properties: {
2093
+ user: {
2094
+ $ref: string;
2095
+ };
2096
+ };
2097
+ };
2098
+ };
2099
+ };
2100
+ };
2101
+ };
2102
+ };
2103
+ };
2104
+ }, import("better-auth/plugins").UserWithRole>;
2105
+ createUser: import("better-auth").StrictEndpoint<"/admin/create-user", {
2106
+ method: "POST";
2107
+ body: import("zod").ZodObject<{
2108
+ email: import("zod").ZodString;
2109
+ password: import("zod").ZodOptional<import("zod").ZodString>;
2110
+ name: import("zod").ZodString;
2111
+ role: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>;
2112
+ data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
2113
+ }, import("zod/v4/core").$strip>;
2114
+ metadata: {
2115
+ openapi: {
2116
+ operationId: string;
2117
+ summary: string;
2118
+ description: string;
2119
+ responses: {
2120
+ 200: {
2121
+ description: string;
2122
+ content: {
2123
+ "application/json": {
2124
+ schema: {
2125
+ type: "object";
2126
+ properties: {
2127
+ user: {
2128
+ $ref: string;
2129
+ };
2130
+ };
2131
+ };
2132
+ };
2133
+ };
2134
+ };
2135
+ };
2136
+ };
2137
+ $Infer: {
2138
+ body: {
2139
+ email: string;
2140
+ password?: string | undefined;
2141
+ name: string;
2142
+ role?: "admin" | "user" | ("admin" | "user")[] | undefined;
2143
+ data?: Record<string, any> | undefined;
2144
+ };
2145
+ };
2146
+ };
2147
+ }, {
2148
+ user: import("better-auth/plugins").UserWithRole;
2149
+ }>;
2150
+ adminUpdateUser: import("better-auth").StrictEndpoint<"/admin/update-user", {
2151
+ method: "POST";
2152
+ body: import("zod").ZodObject<{
2153
+ userId: import("zod").ZodCoercedString<unknown>;
2154
+ data: import("zod").ZodRecord<import("zod").ZodAny, import("zod").ZodAny>;
2155
+ }, import("zod/v4/core").$strip>;
2156
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2157
+ session: {
2158
+ user: import("better-auth/plugins").UserWithRole;
2159
+ session: {
2160
+ id: string;
2161
+ createdAt: Date;
2162
+ updatedAt: Date;
2163
+ userId: string;
2164
+ expiresAt: Date;
2165
+ token: string;
2166
+ ipAddress?: string | null | undefined;
2167
+ userAgent?: string | null | undefined;
2168
+ };
2169
+ };
2170
+ }>)[];
2171
+ metadata: {
2172
+ openapi: {
2173
+ operationId: string;
2174
+ summary: string;
2175
+ description: string;
2176
+ responses: {
2177
+ 200: {
2178
+ description: string;
2179
+ content: {
2180
+ "application/json": {
2181
+ schema: {
2182
+ type: "object";
2183
+ properties: {
2184
+ user: {
2185
+ $ref: string;
2186
+ };
2187
+ };
2188
+ };
2189
+ };
2190
+ };
2191
+ };
2192
+ };
2193
+ };
2194
+ };
2195
+ }, import("better-auth/plugins").UserWithRole>;
2196
+ listUsers: import("better-auth").StrictEndpoint<"/admin/list-users", {
2197
+ method: "GET";
2198
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2199
+ session: {
2200
+ user: import("better-auth/plugins").UserWithRole;
2201
+ session: {
2202
+ id: string;
2203
+ createdAt: Date;
2204
+ updatedAt: Date;
2205
+ userId: string;
2206
+ expiresAt: Date;
2207
+ token: string;
2208
+ ipAddress?: string | null | undefined;
2209
+ userAgent?: string | null | undefined;
2210
+ };
2211
+ };
2212
+ }>)[];
2213
+ query: import("zod").ZodObject<{
2214
+ searchValue: import("zod").ZodOptional<import("zod").ZodString>;
2215
+ searchField: import("zod").ZodOptional<import("zod").ZodEnum<{
2216
+ email: "email";
2217
+ name: "name";
2218
+ }>>;
2219
+ searchOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
2220
+ contains: "contains";
2221
+ starts_with: "starts_with";
2222
+ ends_with: "ends_with";
2223
+ }>>;
2224
+ limit: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
2225
+ offset: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
2226
+ sortBy: import("zod").ZodOptional<import("zod").ZodString>;
2227
+ sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
2228
+ asc: "asc";
2229
+ desc: "desc";
2230
+ }>>;
2231
+ filterField: import("zod").ZodOptional<import("zod").ZodString>;
2232
+ filterValue: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, import("zod").ZodBoolean]>, import("zod").ZodArray<import("zod").ZodString>]>, import("zod").ZodArray<import("zod").ZodNumber>]>>;
2233
+ filterOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
2234
+ eq: "eq";
2235
+ ne: "ne";
2236
+ gt: "gt";
2237
+ gte: "gte";
2238
+ lt: "lt";
2239
+ lte: "lte";
2240
+ in: "in";
2241
+ not_in: "not_in";
2242
+ contains: "contains";
2243
+ starts_with: "starts_with";
2244
+ ends_with: "ends_with";
2245
+ }>>;
2246
+ }, import("zod/v4/core").$strip>;
2247
+ metadata: {
2248
+ openapi: {
2249
+ operationId: string;
2250
+ summary: string;
2251
+ description: string;
2252
+ responses: {
2253
+ 200: {
2254
+ description: string;
2255
+ content: {
2256
+ "application/json": {
2257
+ schema: {
2258
+ type: "object";
2259
+ properties: {
2260
+ users: {
2261
+ type: string;
2262
+ items: {
2263
+ $ref: string;
2264
+ };
2265
+ };
2266
+ total: {
2267
+ type: string;
2268
+ };
2269
+ limit: {
2270
+ type: string;
2271
+ };
2272
+ offset: {
2273
+ type: string;
2274
+ };
2275
+ };
2276
+ required: string[];
2277
+ };
2278
+ };
2279
+ };
2280
+ };
2281
+ };
2282
+ };
2283
+ };
2284
+ }, {
2285
+ users: import("better-auth/plugins").UserWithRole[];
2286
+ total: number;
2287
+ }>;
2288
+ listUserSessions: import("better-auth").StrictEndpoint<"/admin/list-user-sessions", {
2289
+ method: "POST";
2290
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2291
+ session: {
2292
+ user: import("better-auth/plugins").UserWithRole;
2293
+ session: {
2294
+ id: string;
2295
+ createdAt: Date;
2296
+ updatedAt: Date;
2297
+ userId: string;
2298
+ expiresAt: Date;
2299
+ token: string;
2300
+ ipAddress?: string | null | undefined;
2301
+ userAgent?: string | null | undefined;
2302
+ };
2303
+ };
2304
+ }>)[];
2305
+ body: import("zod").ZodObject<{
2306
+ userId: import("zod").ZodCoercedString<unknown>;
2307
+ }, import("zod/v4/core").$strip>;
2308
+ metadata: {
2309
+ openapi: {
2310
+ operationId: string;
2311
+ summary: string;
2312
+ description: string;
2313
+ responses: {
2314
+ 200: {
2315
+ description: string;
2316
+ content: {
2317
+ "application/json": {
2318
+ schema: {
2319
+ type: "object";
2320
+ properties: {
2321
+ sessions: {
2322
+ type: string;
2323
+ items: {
2324
+ $ref: string;
2325
+ };
2326
+ };
2327
+ };
2328
+ };
2329
+ };
2330
+ };
2331
+ };
2332
+ };
2333
+ };
2334
+ };
2335
+ }, {
2336
+ sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
2337
+ }>;
2338
+ unbanUser: import("better-auth").StrictEndpoint<"/admin/unban-user", {
2339
+ method: "POST";
2340
+ body: import("zod").ZodObject<{
2341
+ userId: import("zod").ZodCoercedString<unknown>;
2342
+ }, import("zod/v4/core").$strip>;
2343
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2344
+ session: {
2345
+ user: import("better-auth/plugins").UserWithRole;
2346
+ session: {
2347
+ id: string;
2348
+ createdAt: Date;
2349
+ updatedAt: Date;
2350
+ userId: string;
2351
+ expiresAt: Date;
2352
+ token: string;
2353
+ ipAddress?: string | null | undefined;
2354
+ userAgent?: string | null | undefined;
2355
+ };
2356
+ };
2357
+ }>)[];
2358
+ metadata: {
2359
+ openapi: {
2360
+ operationId: string;
2361
+ summary: string;
2362
+ description: string;
2363
+ responses: {
2364
+ 200: {
2365
+ description: string;
2366
+ content: {
2367
+ "application/json": {
2368
+ schema: {
2369
+ type: "object";
2370
+ properties: {
2371
+ user: {
2372
+ $ref: string;
2373
+ };
2374
+ };
2375
+ };
2376
+ };
2377
+ };
2378
+ };
2379
+ };
2380
+ };
2381
+ };
2382
+ }, {
2383
+ user: import("better-auth/plugins").UserWithRole;
2384
+ }>;
2385
+ banUser: import("better-auth").StrictEndpoint<"/admin/ban-user", {
2386
+ method: "POST";
2387
+ body: import("zod").ZodObject<{
2388
+ userId: import("zod").ZodCoercedString<unknown>;
2389
+ banReason: import("zod").ZodOptional<import("zod").ZodString>;
2390
+ banExpiresIn: import("zod").ZodOptional<import("zod").ZodNumber>;
2391
+ }, import("zod/v4/core").$strip>;
2392
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2393
+ session: {
2394
+ user: import("better-auth/plugins").UserWithRole;
2395
+ session: {
2396
+ id: string;
2397
+ createdAt: Date;
2398
+ updatedAt: Date;
2399
+ userId: string;
2400
+ expiresAt: Date;
2401
+ token: string;
2402
+ ipAddress?: string | null | undefined;
2403
+ userAgent?: string | null | undefined;
2404
+ };
2405
+ };
2406
+ }>)[];
2407
+ metadata: {
2408
+ openapi: {
2409
+ operationId: string;
2410
+ summary: string;
2411
+ description: string;
2412
+ responses: {
2413
+ 200: {
2414
+ description: string;
2415
+ content: {
2416
+ "application/json": {
2417
+ schema: {
2418
+ type: "object";
2419
+ properties: {
2420
+ user: {
2421
+ $ref: string;
2422
+ };
2423
+ };
2424
+ };
2425
+ };
2426
+ };
2427
+ };
2428
+ };
2429
+ };
2430
+ };
2431
+ }, {
2432
+ user: import("better-auth/plugins").UserWithRole;
2433
+ }>;
2434
+ impersonateUser: import("better-auth").StrictEndpoint<"/admin/impersonate-user", {
2435
+ method: "POST";
2436
+ body: import("zod").ZodObject<{
2437
+ userId: import("zod").ZodCoercedString<unknown>;
2438
+ }, import("zod/v4/core").$strip>;
2439
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2440
+ session: {
2441
+ user: import("better-auth/plugins").UserWithRole;
2442
+ session: {
2443
+ id: string;
2444
+ createdAt: Date;
2445
+ updatedAt: Date;
2446
+ userId: string;
2447
+ expiresAt: Date;
2448
+ token: string;
2449
+ ipAddress?: string | null | undefined;
2450
+ userAgent?: string | null | undefined;
2451
+ };
2452
+ };
2453
+ }>)[];
2454
+ metadata: {
2455
+ openapi: {
2456
+ operationId: string;
2457
+ summary: string;
2458
+ description: string;
2459
+ responses: {
2460
+ 200: {
2461
+ description: string;
2462
+ content: {
2463
+ "application/json": {
2464
+ schema: {
2465
+ type: "object";
2466
+ properties: {
2467
+ session: {
2468
+ $ref: string;
2469
+ };
2470
+ user: {
2471
+ $ref: string;
2472
+ };
2473
+ };
2474
+ };
2475
+ };
2476
+ };
2477
+ };
2478
+ };
2479
+ };
2480
+ };
2481
+ }, {
2482
+ session: {
2483
+ id: string;
2484
+ createdAt: Date;
2485
+ updatedAt: Date;
2486
+ userId: string;
2487
+ expiresAt: Date;
2488
+ token: string;
2489
+ ipAddress?: string | null | undefined;
2490
+ userAgent?: string | null | undefined;
2491
+ };
2492
+ user: import("better-auth/plugins").UserWithRole;
2493
+ }>;
2494
+ stopImpersonating: import("better-auth").StrictEndpoint<"/admin/stop-impersonating", {
2495
+ method: "POST";
2496
+ requireHeaders: true;
2497
+ }, {
2498
+ session: {
2499
+ id: string;
2500
+ createdAt: Date;
2501
+ updatedAt: Date;
2502
+ userId: string;
2503
+ expiresAt: Date;
2504
+ token: string;
2505
+ ipAddress?: string | null | undefined;
2506
+ userAgent?: string | null | undefined;
2507
+ } & Record<string, any>;
2508
+ user: {
2509
+ id: string;
2510
+ createdAt: Date;
2511
+ updatedAt: Date;
2512
+ email: string;
2513
+ emailVerified: boolean;
2514
+ name: string;
2515
+ image?: string | null | undefined;
2516
+ } & Record<string, any>;
2517
+ }>;
2518
+ revokeUserSession: import("better-auth").StrictEndpoint<"/admin/revoke-user-session", {
2519
+ method: "POST";
2520
+ body: import("zod").ZodObject<{
2521
+ sessionToken: import("zod").ZodString;
2522
+ }, import("zod/v4/core").$strip>;
2523
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2524
+ session: {
2525
+ user: import("better-auth/plugins").UserWithRole;
2526
+ session: {
2527
+ id: string;
2528
+ createdAt: Date;
2529
+ updatedAt: Date;
2530
+ userId: string;
2531
+ expiresAt: Date;
2532
+ token: string;
2533
+ ipAddress?: string | null | undefined;
2534
+ userAgent?: string | null | undefined;
2535
+ };
2536
+ };
2537
+ }>)[];
2538
+ metadata: {
2539
+ openapi: {
2540
+ operationId: string;
2541
+ summary: string;
2542
+ description: string;
2543
+ responses: {
2544
+ 200: {
2545
+ description: string;
2546
+ content: {
2547
+ "application/json": {
2548
+ schema: {
2549
+ type: "object";
2550
+ properties: {
2551
+ success: {
2552
+ type: string;
2553
+ };
2554
+ };
2555
+ };
2556
+ };
2557
+ };
2558
+ };
2559
+ };
2560
+ };
2561
+ };
2562
+ }, {
2563
+ success: boolean;
2564
+ }>;
2565
+ revokeUserSessions: import("better-auth").StrictEndpoint<"/admin/revoke-user-sessions", {
2566
+ method: "POST";
2567
+ body: import("zod").ZodObject<{
2568
+ userId: import("zod").ZodCoercedString<unknown>;
2569
+ }, import("zod/v4/core").$strip>;
2570
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2571
+ session: {
2572
+ user: import("better-auth/plugins").UserWithRole;
2573
+ session: {
2574
+ id: string;
2575
+ createdAt: Date;
2576
+ updatedAt: Date;
2577
+ userId: string;
2578
+ expiresAt: Date;
2579
+ token: string;
2580
+ ipAddress?: string | null | undefined;
2581
+ userAgent?: string | null | undefined;
2582
+ };
2583
+ };
2584
+ }>)[];
2585
+ metadata: {
2586
+ openapi: {
2587
+ operationId: string;
2588
+ summary: string;
2589
+ description: string;
2590
+ responses: {
2591
+ 200: {
2592
+ description: string;
2593
+ content: {
2594
+ "application/json": {
2595
+ schema: {
2596
+ type: "object";
2597
+ properties: {
2598
+ success: {
2599
+ type: string;
2600
+ };
2601
+ };
2602
+ };
2603
+ };
2604
+ };
2605
+ };
2606
+ };
2607
+ };
2608
+ };
2609
+ }, {
2610
+ success: boolean;
2611
+ }>;
2612
+ removeUser: import("better-auth").StrictEndpoint<"/admin/remove-user", {
2613
+ method: "POST";
2614
+ body: import("zod").ZodObject<{
2615
+ userId: import("zod").ZodCoercedString<unknown>;
2616
+ }, import("zod/v4/core").$strip>;
2617
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2618
+ session: {
2619
+ user: import("better-auth/plugins").UserWithRole;
2620
+ session: {
2621
+ id: string;
2622
+ createdAt: Date;
2623
+ updatedAt: Date;
2624
+ userId: string;
2625
+ expiresAt: Date;
2626
+ token: string;
2627
+ ipAddress?: string | null | undefined;
2628
+ userAgent?: string | null | undefined;
2629
+ };
2630
+ };
2631
+ }>)[];
2632
+ metadata: {
2633
+ openapi: {
2634
+ operationId: string;
2635
+ summary: string;
2636
+ description: string;
2637
+ responses: {
2638
+ 200: {
2639
+ description: string;
2640
+ content: {
2641
+ "application/json": {
2642
+ schema: {
2643
+ type: "object";
2644
+ properties: {
2645
+ success: {
2646
+ type: string;
2647
+ };
2648
+ };
2649
+ };
2650
+ };
2651
+ };
2652
+ };
2653
+ };
2654
+ };
2655
+ };
2656
+ }, {
2657
+ success: boolean;
2658
+ }>;
2659
+ setUserPassword: import("better-auth").StrictEndpoint<"/admin/set-user-password", {
2660
+ method: "POST";
2661
+ body: import("zod").ZodObject<{
2662
+ newPassword: import("zod").ZodString;
2663
+ userId: import("zod").ZodCoercedString<unknown>;
2664
+ }, import("zod/v4/core").$strip>;
2665
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2666
+ session: {
2667
+ user: import("better-auth/plugins").UserWithRole;
2668
+ session: {
2669
+ id: string;
2670
+ createdAt: Date;
2671
+ updatedAt: Date;
2672
+ userId: string;
2673
+ expiresAt: Date;
2674
+ token: string;
2675
+ ipAddress?: string | null | undefined;
2676
+ userAgent?: string | null | undefined;
2677
+ };
2678
+ };
2679
+ }>)[];
2680
+ metadata: {
2681
+ openapi: {
2682
+ operationId: string;
2683
+ summary: string;
2684
+ description: string;
2685
+ responses: {
2686
+ 200: {
2687
+ description: string;
2688
+ content: {
2689
+ "application/json": {
2690
+ schema: {
2691
+ type: "object";
2692
+ properties: {
2693
+ status: {
2694
+ type: string;
2695
+ };
2696
+ };
2697
+ };
2698
+ };
2699
+ };
2700
+ };
2701
+ };
2702
+ };
2703
+ };
2704
+ }, {
2705
+ status: boolean;
2706
+ }>;
2707
+ userHasPermission: import("better-auth").StrictEndpoint<"/admin/has-permission", {
2708
+ method: "POST";
2709
+ body: import("zod").ZodIntersection<import("zod").ZodObject<{
2710
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
2711
+ role: import("zod").ZodOptional<import("zod").ZodString>;
2712
+ }, import("zod/v4/core").$strip>, import("zod").ZodXor<readonly [import("zod").ZodObject<{
2713
+ permission: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
2714
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
2715
+ permissions: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
2716
+ }, import("zod/v4/core").$strip>]>>;
2717
+ metadata: {
2718
+ openapi: {
2719
+ description: string;
2720
+ requestBody: {
2721
+ content: {
2722
+ "application/json": {
2723
+ schema: {
2724
+ type: "object";
2725
+ properties: {
2726
+ permissions: {
2727
+ type: string;
2728
+ description: string;
2729
+ };
2730
+ };
2731
+ required: string[];
2732
+ };
2733
+ };
2734
+ };
2735
+ };
2736
+ responses: {
2737
+ "200": {
2738
+ description: string;
2739
+ content: {
2740
+ "application/json": {
2741
+ schema: {
2742
+ type: "object";
2743
+ properties: {
2744
+ error: {
2745
+ type: string;
2746
+ };
2747
+ success: {
2748
+ type: string;
2749
+ };
2750
+ };
2751
+ required: string[];
2752
+ };
2753
+ };
2754
+ };
2755
+ };
2756
+ };
2757
+ };
2758
+ $Infer: {
2759
+ body: {
2760
+ permissions: {
2761
+ readonly user?: ("ban" | "create" | "delete" | "get" | "impersonate" | "impersonate-admins" | "list" | "set-email" | "set-password" | "set-role" | "update")[] | undefined;
2762
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
2763
+ };
2764
+ } & {
2765
+ userId?: string | undefined;
2766
+ role?: "admin" | "user" | undefined;
2767
+ };
2768
+ };
2769
+ };
2770
+ }, {
2771
+ error: null;
2772
+ success: boolean;
2773
+ }>;
2774
+ };
2775
+ $ERROR_CODES: {
2776
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
2777
+ FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
2778
+ USER_ALREADY_EXISTS: import("better-auth").RawError<"USER_ALREADY_EXISTS">;
2779
+ YOU_CANNOT_BAN_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_BAN_YOURSELF">;
2780
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
2781
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
2782
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
2783
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
2784
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
2785
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
2786
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
2787
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
2788
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
2789
+ BANNED_USER: import("better-auth").RawError<"BANNED_USER">;
2790
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
2791
+ NO_DATA_TO_UPDATE: import("better-auth").RawError<"NO_DATA_TO_UPDATE">;
2792
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
2793
+ YOU_CANNOT_REMOVE_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
2794
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
2795
+ YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
2796
+ INVALID_ROLE_TYPE: import("better-auth").RawError<"INVALID_ROLE_TYPE">;
2797
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
2798
+ PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: import("better-auth").RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
2799
+ };
2800
+ schema: {
2801
+ user: {
2802
+ fields: {
2803
+ role: {
2804
+ type: "string";
2805
+ required: false;
2806
+ input: false;
2807
+ };
2808
+ banned: {
2809
+ type: "boolean";
2810
+ defaultValue: false;
2811
+ required: false;
2812
+ input: false;
2813
+ };
2814
+ banReason: {
2815
+ type: "string";
2816
+ required: false;
2817
+ input: false;
2818
+ };
2819
+ banExpires: {
2820
+ type: "date";
2821
+ required: false;
2822
+ input: false;
2823
+ };
2824
+ };
2825
+ };
2826
+ session: {
2827
+ fields: {
2828
+ impersonatedBy: {
2829
+ type: "string";
2830
+ required: false;
2831
+ input: false;
2832
+ };
2833
+ };
2834
+ };
2835
+ };
2836
+ options: NoInfer<{
2837
+ ac: import("better-auth/plugins").AccessControl<{
2838
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "get", "update"];
2839
+ readonly session: readonly ["list", "revoke", "delete"];
2840
+ }>;
2841
+ roles: {
2842
+ admin: import("better-auth/plugins").Role;
2843
+ user: import("better-auth/plugins").Role;
2844
+ };
2845
+ }>;
2846
+ };
2847
+ getActions: () => {
2848
+ admin: {
2849
+ checkRolePermission: <R extends import("better-auth/client/plugins").AdminClientOptions extends {
2850
+ roles: any;
2851
+ } ? string | number | symbol : "admin" | "user">(data: {
2852
+ permissions: {
2853
+ readonly user?: ("ban" | "create" | "delete" | "get" | "impersonate" | "impersonate-admins" | "list" | "set-email" | "set-password" | "set-role" | "update")[] | undefined;
2854
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
2855
+ };
2856
+ } & {
2857
+ role: R;
2858
+ }) => boolean;
2859
+ };
2860
+ };
2861
+ pathMethods: {
2862
+ "/admin/list-users": "GET";
2863
+ "/admin/impersonate-user": "POST";
2864
+ "/admin/stop-impersonating": "POST";
2865
+ };
2866
+ atomListeners: {
2867
+ matcher: (path: string) => path is "/admin/impersonate-user" | "/admin/stop-impersonating";
2868
+ signal: "$sessionSignal";
2869
+ }[];
2870
+ $ERROR_CODES: {
2871
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
2872
+ FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
2873
+ USER_ALREADY_EXISTS: import("better-auth").RawError<"USER_ALREADY_EXISTS">;
2874
+ YOU_CANNOT_BAN_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_BAN_YOURSELF">;
2875
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
2876
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
2877
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
2878
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
2879
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
2880
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
2881
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
2882
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
2883
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
2884
+ BANNED_USER: import("better-auth").RawError<"BANNED_USER">;
2885
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
2886
+ NO_DATA_TO_UPDATE: import("better-auth").RawError<"NO_DATA_TO_UPDATE">;
2887
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
2888
+ YOU_CANNOT_REMOVE_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
2889
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
2890
+ YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
2891
+ INVALID_ROLE_TYPE: import("better-auth").RawError<"INVALID_ROLE_TYPE">;
2892
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
2893
+ PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: import("better-auth").RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
2894
+ };
2895
+ } | {
2896
+ id: "anonymous";
2897
+ version: string;
2898
+ $InferServerPlugin: ReturnType<(options?: import("better-auth/plugins").AnonymousOptions | undefined) => {
2899
+ id: "anonymous";
2900
+ version: string;
2901
+ endpoints: {
2902
+ signInAnonymous: import("better-auth").StrictEndpoint<"/sign-in/anonymous", {
2903
+ method: "POST";
2904
+ metadata: {
2905
+ openapi: {
2906
+ description: string;
2907
+ responses: {
2908
+ 200: {
2909
+ description: string;
2910
+ content: {
2911
+ "application/json": {
2912
+ schema: {
2913
+ type: "object";
2914
+ properties: {
2915
+ user: {
2916
+ $ref: string;
2917
+ };
2918
+ session: {
2919
+ $ref: string;
2920
+ };
2921
+ };
2922
+ };
2923
+ };
2924
+ };
2925
+ };
2926
+ };
2927
+ };
2928
+ };
2929
+ }, {
2930
+ token: string;
2931
+ user: Record<string, any> & {
2932
+ id: string;
2933
+ createdAt: Date;
2934
+ updatedAt: Date;
2935
+ email: string;
2936
+ emailVerified: boolean;
2937
+ name: string;
2938
+ image?: string | null | undefined;
2939
+ };
2940
+ }>;
2941
+ deleteAnonymousUser: import("better-auth").StrictEndpoint<"/delete-anonymous-user", {
2942
+ method: "POST";
2943
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2944
+ session: {
2945
+ session: Record<string, any> & {
2946
+ id: string;
2947
+ createdAt: Date;
2948
+ updatedAt: Date;
2949
+ userId: string;
2950
+ expiresAt: Date;
2951
+ token: string;
2952
+ ipAddress?: string | null | undefined;
2953
+ userAgent?: string | null | undefined;
2954
+ };
2955
+ user: Record<string, any> & {
2956
+ id: string;
2957
+ createdAt: Date;
2958
+ updatedAt: Date;
2959
+ email: string;
2960
+ emailVerified: boolean;
2961
+ name: string;
2962
+ image?: string | null | undefined;
2963
+ };
2964
+ };
2965
+ }>)[];
2966
+ metadata: {
2967
+ openapi: {
2968
+ description: string;
2969
+ responses: {
2970
+ 200: {
2971
+ description: string;
2972
+ content: {
2973
+ "application/json": {
2974
+ schema: {
2975
+ type: "object";
2976
+ properties: {
2977
+ success: {
2978
+ type: string;
2979
+ };
2980
+ };
2981
+ };
2982
+ };
2983
+ };
2984
+ };
2985
+ "400": {
2986
+ description: string;
2987
+ content: {
2988
+ "application/json": {
2989
+ schema: {
2990
+ type: "object";
2991
+ properties: {
2992
+ message: {
2993
+ type: string;
2994
+ };
2995
+ };
2996
+ };
2997
+ required: string[];
2998
+ };
2999
+ };
3000
+ };
3001
+ "500": {
3002
+ description: string;
3003
+ content: {
3004
+ "application/json": {
3005
+ schema: {
3006
+ type: "object";
3007
+ properties: {
3008
+ message: {
3009
+ type: string;
3010
+ };
3011
+ };
3012
+ required: string[];
3013
+ };
3014
+ };
3015
+ };
3016
+ };
3017
+ };
3018
+ };
3019
+ };
3020
+ }, {
3021
+ success: boolean;
3022
+ }>;
3023
+ };
3024
+ hooks: {
3025
+ after: {
3026
+ matcher(ctx: import("better-auth").HookEndpointContext): boolean;
3027
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
3028
+ }[];
3029
+ };
3030
+ options: import("better-auth/plugins").AnonymousOptions | undefined;
3031
+ schema: {
3032
+ user: {
3033
+ fields: {
3034
+ isAnonymous: {
3035
+ type: "boolean";
3036
+ required: false;
3037
+ input: false;
3038
+ defaultValue: false;
3039
+ };
3040
+ };
3041
+ };
3042
+ };
3043
+ $ERROR_CODES: {
3044
+ FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
3045
+ INVALID_EMAIL_FORMAT: import("better-auth").RawError<"INVALID_EMAIL_FORMAT">;
3046
+ COULD_NOT_CREATE_SESSION: import("better-auth").RawError<"COULD_NOT_CREATE_SESSION">;
3047
+ ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: import("better-auth").RawError<"ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY">;
3048
+ FAILED_TO_DELETE_ANONYMOUS_USER: import("better-auth").RawError<"FAILED_TO_DELETE_ANONYMOUS_USER">;
3049
+ FAILED_TO_DELETE_ANONYMOUS_USER_SESSIONS: import("better-auth").RawError<"FAILED_TO_DELETE_ANONYMOUS_USER_SESSIONS">;
3050
+ USER_IS_NOT_ANONYMOUS: import("better-auth").RawError<"USER_IS_NOT_ANONYMOUS">;
3051
+ DELETE_ANONYMOUS_USER_DISABLED: import("better-auth").RawError<"DELETE_ANONYMOUS_USER_DISABLED">;
3052
+ };
3053
+ }>;
3054
+ pathMethods: {
3055
+ "/sign-in/anonymous": "POST";
3056
+ "/delete-anonymous-user": "POST";
3057
+ };
3058
+ atomListeners: {
3059
+ matcher: (path: string) => path is "/sign-in/anonymous";
3060
+ signal: "$sessionSignal";
3061
+ }[];
3062
+ $ERROR_CODES: {
3063
+ FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
3064
+ INVALID_EMAIL_FORMAT: import("better-auth").RawError<"INVALID_EMAIL_FORMAT">;
3065
+ COULD_NOT_CREATE_SESSION: import("better-auth").RawError<"COULD_NOT_CREATE_SESSION">;
3066
+ ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: import("better-auth").RawError<"ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY">;
3067
+ FAILED_TO_DELETE_ANONYMOUS_USER: import("better-auth").RawError<"FAILED_TO_DELETE_ANONYMOUS_USER">;
3068
+ FAILED_TO_DELETE_ANONYMOUS_USER_SESSIONS: import("better-auth").RawError<"FAILED_TO_DELETE_ANONYMOUS_USER_SESSIONS">;
3069
+ USER_IS_NOT_ANONYMOUS: import("better-auth").RawError<"USER_IS_NOT_ANONYMOUS">;
3070
+ DELETE_ANONYMOUS_USER_DISABLED: import("better-auth").RawError<"DELETE_ANONYMOUS_USER_DISABLED">;
3071
+ };
3072
+ } | {
3073
+ id: "device-authorization";
3074
+ version: string;
3075
+ $InferServerPlugin: ReturnType<(options?: Partial<import("better-auth/plugins").DeviceAuthorizationOptions>) => {
3076
+ id: "device-authorization";
3077
+ version: string;
3078
+ schema: {
3079
+ deviceCode: {
3080
+ fields: {
3081
+ deviceCode: {
3082
+ type: "string";
3083
+ required: true;
3084
+ };
3085
+ userCode: {
3086
+ type: "string";
3087
+ required: true;
3088
+ };
3089
+ userId: {
3090
+ type: "string";
3091
+ required: false;
3092
+ };
3093
+ expiresAt: {
3094
+ type: "date";
3095
+ required: true;
3096
+ };
3097
+ status: {
3098
+ type: "string";
3099
+ required: true;
3100
+ };
3101
+ lastPolledAt: {
3102
+ type: "date";
3103
+ required: false;
3104
+ };
3105
+ pollingInterval: {
3106
+ type: "number";
3107
+ required: false;
3108
+ };
3109
+ clientId: {
3110
+ type: "string";
3111
+ required: false;
3112
+ };
3113
+ scope: {
3114
+ type: "string";
3115
+ required: false;
3116
+ };
3117
+ };
3118
+ };
3119
+ };
3120
+ endpoints: {
3121
+ deviceCode: import("better-auth").StrictEndpoint<"/device/code", {
3122
+ method: "POST";
3123
+ body: import("zod").ZodObject<{
3124
+ client_id: import("zod").ZodString;
3125
+ user_id: import("zod").ZodOptional<import("zod").ZodString>;
3126
+ scope: import("zod").ZodOptional<import("zod").ZodString>;
3127
+ }, import("zod/v4/core").$strip>;
3128
+ error: import("zod").ZodObject<{
3129
+ error: import("zod").ZodEnum<{
3130
+ invalid_request: "invalid_request";
3131
+ invalid_client: "invalid_client";
3132
+ }>;
3133
+ error_description: import("zod").ZodString;
3134
+ }, import("zod/v4/core").$strip>;
3135
+ metadata: {
3136
+ openapi: {
3137
+ description: string;
3138
+ responses: {
3139
+ 200: {
3140
+ description: string;
3141
+ content: {
3142
+ "application/json": {
3143
+ schema: {
3144
+ type: "object";
3145
+ properties: {
3146
+ device_code: {
3147
+ type: string;
3148
+ description: string;
3149
+ };
3150
+ user_code: {
3151
+ type: string;
3152
+ description: string;
3153
+ };
3154
+ verification_uri: {
3155
+ type: string;
3156
+ format: string;
3157
+ description: string;
3158
+ };
3159
+ verification_uri_complete: {
3160
+ type: string;
3161
+ format: string;
3162
+ description: string;
3163
+ };
3164
+ expires_in: {
3165
+ type: string;
3166
+ description: string;
3167
+ };
3168
+ interval: {
3169
+ type: string;
3170
+ description: string;
3171
+ };
3172
+ };
3173
+ };
3174
+ };
3175
+ };
3176
+ };
3177
+ 400: {
3178
+ description: string;
3179
+ content: {
3180
+ "application/json": {
3181
+ schema: {
3182
+ type: "object";
3183
+ properties: {
3184
+ error: {
3185
+ type: string;
3186
+ enum: string[];
3187
+ };
3188
+ error_description: {
3189
+ type: string;
3190
+ };
3191
+ };
3192
+ };
3193
+ };
3194
+ };
3195
+ };
3196
+ };
3197
+ };
3198
+ };
3199
+ }, {
3200
+ device_code: string;
3201
+ user_code: string;
3202
+ verification_uri: string;
3203
+ verification_uri_complete: string;
3204
+ expires_in: number;
3205
+ interval: number;
3206
+ }>;
3207
+ deviceToken: import("better-auth").StrictEndpoint<"/device/token", {
3208
+ method: "POST";
3209
+ body: import("zod").ZodObject<{
3210
+ grant_type: import("zod").ZodLiteral<"urn:ietf:params:oauth:grant-type:device_code">;
3211
+ device_code: import("zod").ZodString;
3212
+ client_id: import("zod").ZodString;
3213
+ }, import("zod/v4/core").$strip>;
3214
+ error: import("zod").ZodObject<{
3215
+ error: import("zod").ZodEnum<{
3216
+ invalid_request: "invalid_request";
3217
+ authorization_pending: "authorization_pending";
3218
+ slow_down: "slow_down";
3219
+ expired_token: "expired_token";
3220
+ access_denied: "access_denied";
3221
+ invalid_grant: "invalid_grant";
3222
+ }>;
3223
+ error_description: import("zod").ZodString;
3224
+ }, import("zod/v4/core").$strip>;
3225
+ metadata: {
3226
+ openapi: {
3227
+ description: string;
3228
+ responses: {
3229
+ 200: {
3230
+ description: string;
3231
+ content: {
3232
+ "application/json": {
3233
+ schema: {
3234
+ type: "object";
3235
+ properties: {
3236
+ session: {
3237
+ $ref: string;
3238
+ };
3239
+ user: {
3240
+ $ref: string;
3241
+ };
3242
+ };
3243
+ };
3244
+ };
3245
+ };
3246
+ };
3247
+ 400: {
3248
+ description: string;
3249
+ content: {
3250
+ "application/json": {
3251
+ schema: {
3252
+ type: "object";
3253
+ properties: {
3254
+ error: {
3255
+ type: string;
3256
+ enum: string[];
3257
+ };
3258
+ error_description: {
3259
+ type: string;
3260
+ };
3261
+ };
3262
+ };
3263
+ };
3264
+ };
3265
+ };
3266
+ };
3267
+ };
3268
+ };
3269
+ }, {
3270
+ access_token: string;
3271
+ token_type: string;
3272
+ expires_in: number;
3273
+ scope: string;
3274
+ }>;
3275
+ deviceVerify: import("better-auth").StrictEndpoint<"/device", {
3276
+ method: "GET";
3277
+ query: import("zod").ZodObject<{
3278
+ user_code: import("zod").ZodString;
3279
+ }, import("zod/v4/core").$strip>;
3280
+ error: import("zod").ZodObject<{
3281
+ error: import("zod").ZodEnum<{
3282
+ invalid_request: "invalid_request";
3283
+ }>;
3284
+ error_description: import("zod").ZodString;
3285
+ }, import("zod/v4/core").$strip>;
3286
+ metadata: {
3287
+ openapi: {
3288
+ description: string;
3289
+ responses: {
3290
+ 200: {
3291
+ description: string;
3292
+ content: {
3293
+ "application/json": {
3294
+ schema: {
3295
+ type: "object";
3296
+ properties: {
3297
+ user_code: {
3298
+ type: string;
3299
+ description: string;
3300
+ };
3301
+ status: {
3302
+ type: string;
3303
+ enum: string[];
3304
+ description: string;
3305
+ };
3306
+ };
3307
+ };
3308
+ };
3309
+ };
3310
+ };
3311
+ };
3312
+ };
3313
+ };
3314
+ }, {
3315
+ user_code: string;
3316
+ status: string;
3317
+ }>;
3318
+ deviceApprove: import("better-auth").StrictEndpoint<"/device/approve", {
3319
+ method: "POST";
3320
+ body: import("zod").ZodObject<{
3321
+ userCode: import("zod").ZodString;
3322
+ }, import("zod/v4/core").$strip>;
3323
+ error: import("zod").ZodObject<{
3324
+ error: import("zod").ZodEnum<{
3325
+ invalid_request: "invalid_request";
3326
+ expired_token: "expired_token";
3327
+ access_denied: "access_denied";
3328
+ device_code_already_processed: "device_code_already_processed";
3329
+ unauthorized: "unauthorized";
3330
+ }>;
3331
+ error_description: import("zod").ZodString;
3332
+ }, import("zod/v4/core").$strip>;
3333
+ requireHeaders: true;
3334
+ metadata: {
3335
+ openapi: {
3336
+ description: string;
3337
+ responses: {
3338
+ 200: {
3339
+ description: string;
3340
+ content: {
3341
+ "application/json": {
3342
+ schema: {
3343
+ type: "object";
3344
+ properties: {
3345
+ success: {
3346
+ type: string;
3347
+ };
3348
+ };
3349
+ };
3350
+ };
3351
+ };
3352
+ };
3353
+ };
3354
+ };
3355
+ };
3356
+ }, {
3357
+ success: boolean;
3358
+ }>;
3359
+ deviceDeny: import("better-auth").StrictEndpoint<"/device/deny", {
3360
+ method: "POST";
3361
+ body: import("zod").ZodObject<{
3362
+ userCode: import("zod").ZodString;
3363
+ }, import("zod/v4/core").$strip>;
3364
+ error: import("zod").ZodObject<{
3365
+ error: import("zod").ZodEnum<{
3366
+ invalid_request: "invalid_request";
3367
+ expired_token: "expired_token";
3368
+ access_denied: "access_denied";
3369
+ unauthorized: "unauthorized";
3370
+ }>;
3371
+ error_description: import("zod").ZodString;
3372
+ }, import("zod/v4/core").$strip>;
3373
+ requireHeaders: true;
3374
+ metadata: {
3375
+ openapi: {
3376
+ description: string;
3377
+ responses: {
3378
+ 200: {
3379
+ description: string;
3380
+ content: {
3381
+ "application/json": {
3382
+ schema: {
3383
+ type: "object";
3384
+ properties: {
3385
+ success: {
3386
+ type: string;
3387
+ };
3388
+ };
3389
+ };
3390
+ };
3391
+ };
3392
+ };
3393
+ };
3394
+ };
3395
+ };
3396
+ }, {
3397
+ success: boolean;
3398
+ }>;
3399
+ };
3400
+ $ERROR_CODES: {
3401
+ USER_NOT_FOUND: import("better-auth").RawError<"USER_NOT_FOUND">;
3402
+ FAILED_TO_CREATE_SESSION: import("better-auth").RawError<"FAILED_TO_CREATE_SESSION">;
3403
+ INVALID_DEVICE_CODE: import("better-auth").RawError<"INVALID_DEVICE_CODE">;
3404
+ EXPIRED_DEVICE_CODE: import("better-auth").RawError<"EXPIRED_DEVICE_CODE">;
3405
+ EXPIRED_USER_CODE: import("better-auth").RawError<"EXPIRED_USER_CODE">;
3406
+ AUTHORIZATION_PENDING: import("better-auth").RawError<"AUTHORIZATION_PENDING">;
3407
+ ACCESS_DENIED: import("better-auth").RawError<"ACCESS_DENIED">;
3408
+ INVALID_USER_CODE: import("better-auth").RawError<"INVALID_USER_CODE">;
3409
+ DEVICE_CODE_ALREADY_PROCESSED: import("better-auth").RawError<"DEVICE_CODE_ALREADY_PROCESSED">;
3410
+ DEVICE_CODE_NOT_CLAIMED: import("better-auth").RawError<"DEVICE_CODE_NOT_CLAIMED">;
3411
+ POLLING_TOO_FREQUENTLY: import("better-auth").RawError<"POLLING_TOO_FREQUENTLY">;
3412
+ INVALID_DEVICE_CODE_STATUS: import("better-auth").RawError<"INVALID_DEVICE_CODE_STATUS">;
3413
+ AUTHENTICATION_REQUIRED: import("better-auth").RawError<"AUTHENTICATION_REQUIRED">;
3414
+ };
3415
+ options: Partial<{
3416
+ expiresIn: import("better-auth/plugins").TimeString;
3417
+ interval: import("better-auth/plugins").TimeString;
3418
+ deviceCodeLength: number;
3419
+ userCodeLength: number;
3420
+ generateDeviceCode?: (() => string | Promise<string>) | undefined;
3421
+ generateUserCode?: (() => string | Promise<string>) | undefined;
3422
+ validateClient?: ((clientId: string) => boolean | Promise<boolean>) | undefined;
3423
+ onDeviceAuthRequest?: ((clientId: string, scope: string | undefined) => void | Promise<void>) | undefined;
3424
+ verificationUri?: string | undefined;
3425
+ schema?: {
3426
+ deviceCode?: {
3427
+ modelName?: string | undefined;
3428
+ fields?: {
3429
+ deviceCode?: string | undefined;
3430
+ userCode?: string | undefined;
3431
+ userId?: string | undefined;
3432
+ expiresAt?: string | undefined;
3433
+ status?: string | undefined;
3434
+ lastPolledAt?: string | undefined;
3435
+ pollingInterval?: string | undefined;
3436
+ clientId?: string | undefined;
3437
+ scope?: string | undefined;
3438
+ } | undefined;
3439
+ } | undefined;
3440
+ } | undefined;
3441
+ }>;
3442
+ }>;
3443
+ pathMethods: {
3444
+ "/device/code": "POST";
3445
+ "/device/token": "POST";
3446
+ "/device": "GET";
3447
+ "/device/approve": "POST";
3448
+ "/device/deny": "POST";
3449
+ };
3450
+ } | {
3451
+ id: "organization";
3452
+ version: string;
3453
+ $InferServerPlugin: import("better-auth/plugins").OrganizationPlugin<{
3454
+ ac: import("better-auth/plugins").AccessControl<{
3455
+ readonly organization: readonly ["update", "delete"];
3456
+ readonly member: readonly ["create", "update", "delete"];
3457
+ readonly invitation: readonly ["create", "cancel"];
3458
+ readonly team: readonly ["create", "update", "delete"];
3459
+ readonly ac: readonly ["create", "read", "update", "delete"];
3460
+ }>;
3461
+ roles: {
3462
+ admin: import("better-auth/plugins").Role;
3463
+ member: import("better-auth/plugins").Role;
3464
+ owner: import("better-auth/plugins").Role;
3465
+ };
3466
+ teams: {
3467
+ enabled: true;
3468
+ };
3469
+ schema: unknown;
3470
+ dynamicAccessControl: {
3471
+ enabled: false;
3472
+ };
3473
+ }>;
3474
+ getActions: ($fetch: BetterFetch, _$store: import("better-auth").ClientStore, co: import("better-auth").BetterAuthClientOptions | undefined) => {
3475
+ $Infer: {
3476
+ ActiveOrganization: {
3477
+ members: {
3478
+ id: string;
3479
+ organizationId: string;
3480
+ role: "admin" | "member" | "owner";
3481
+ createdAt: Date;
3482
+ userId: string;
3483
+ teamId?: string | undefined;
3484
+ user: {
3485
+ id: string;
3486
+ email: string;
3487
+ name: string;
3488
+ image?: string | undefined;
3489
+ };
3490
+ }[];
3491
+ invitations: {
3492
+ id: string;
3493
+ organizationId: string;
3494
+ email: string;
3495
+ role: "admin" | "member" | "owner";
3496
+ status: import("better-auth/plugins").InvitationStatus;
3497
+ inviterId: string;
3498
+ expiresAt: Date;
3499
+ createdAt: Date;
3500
+ teamId?: string | undefined;
3501
+ }[];
3502
+ teams: {
3503
+ id: string;
3504
+ name: string;
3505
+ organizationId: string;
3506
+ createdAt: Date;
3507
+ updatedAt?: Date | undefined;
3508
+ }[];
3509
+ } & {
3510
+ id: string;
3511
+ name: string;
3512
+ slug: string;
3513
+ createdAt: Date;
3514
+ logo?: string | null | undefined;
3515
+ metadata?: any;
3516
+ };
3517
+ Organization: {
3518
+ id: string;
3519
+ name: string;
3520
+ slug: string;
3521
+ logo?: string | null | undefined;
3522
+ metadata?: any;
3523
+ createdAt: Date;
3524
+ };
3525
+ Invitation: {
3526
+ id: string;
3527
+ organizationId: string;
3528
+ email: string;
3529
+ role: "admin" | "member" | "owner";
3530
+ status: import("better-auth/plugins").InvitationStatus;
3531
+ inviterId: string;
3532
+ expiresAt: Date;
3533
+ createdAt: Date;
3534
+ teamId?: string | undefined;
3535
+ };
3536
+ Member: {
3537
+ id: string;
3538
+ organizationId: string;
3539
+ role: "admin" | "member" | "owner";
3540
+ createdAt: Date;
3541
+ userId: string;
3542
+ teamId?: string | undefined;
3543
+ user: {
3544
+ id: string;
3545
+ email: string;
3546
+ name: string;
3547
+ image?: string | undefined;
3548
+ };
3549
+ };
3550
+ Team: {
3551
+ id: string;
3552
+ name: string;
3553
+ organizationId: string;
3554
+ createdAt: Date;
3555
+ updatedAt?: Date | undefined;
3556
+ };
3557
+ };
3558
+ organization: {
3559
+ checkRolePermission: <R extends {
3560
+ teams: {
3561
+ enabled: true;
3562
+ };
3563
+ } extends {
3564
+ roles: any;
3565
+ } ? string | number | symbol : "admin" | "member" | "owner">(data: {
3566
+ permissions: {
3567
+ readonly organization?: ("delete" | "update")[] | undefined;
3568
+ readonly member?: ("create" | "delete" | "update")[] | undefined;
3569
+ readonly invitation?: ("cancel" | "create")[] | undefined;
3570
+ readonly team?: ("create" | "delete" | "update")[] | undefined;
3571
+ readonly ac?: ("create" | "delete" | "read" | "update")[] | undefined;
3572
+ };
3573
+ } & {
3574
+ role: R;
3575
+ }) => boolean;
3576
+ };
3577
+ };
3578
+ getAtoms: ($fetch: BetterFetch) => {
3579
+ $listOrg: PreinitializedWritableAtom<boolean> & object;
3580
+ $activeOrgSignal: PreinitializedWritableAtom<boolean> & object;
3581
+ $activeMemberSignal: PreinitializedWritableAtom<boolean> & object;
3582
+ $activeMemberRoleSignal: PreinitializedWritableAtom<boolean> & object;
3583
+ activeOrganization: import("better-auth/client").AuthQueryAtom<import("better-auth").Prettify<{
3584
+ id: string;
3585
+ name: string;
3586
+ slug: string;
3587
+ createdAt: Date;
3588
+ logo?: string | null | undefined;
3589
+ metadata?: any;
3590
+ } & {
3591
+ members: {
3592
+ id: string;
3593
+ organizationId: string;
3594
+ role: "admin" | "member" | "owner";
3595
+ createdAt: Date;
3596
+ userId: string;
3597
+ teamId?: string | undefined;
3598
+ user: {
3599
+ id: string;
3600
+ email: string;
3601
+ name: string;
3602
+ image?: string | undefined;
3603
+ };
3604
+ }[];
3605
+ invitations: {
3606
+ id: string;
3607
+ organizationId: string;
3608
+ email: string;
3609
+ role: "admin" | "member" | "owner";
3610
+ status: import("better-auth/plugins").InvitationStatus;
3611
+ inviterId: string;
3612
+ expiresAt: Date;
3613
+ createdAt: Date;
3614
+ teamId?: string | undefined;
3615
+ }[];
3616
+ }>>;
3617
+ listOrganizations: import("better-auth/client").AuthQueryAtom<{
3618
+ id: string;
3619
+ name: string;
3620
+ slug: string;
3621
+ createdAt: Date;
3622
+ logo?: string | null | undefined;
3623
+ metadata?: any;
3624
+ }[]>;
3625
+ activeMember: import("better-auth/client").AuthQueryAtom<{
3626
+ id: string;
3627
+ organizationId: string;
3628
+ userId: string;
3629
+ role: string;
3630
+ createdAt: Date;
3631
+ }>;
3632
+ activeMemberRole: import("better-auth/client").AuthQueryAtom<{
3633
+ role: string;
3634
+ }>;
3635
+ };
3636
+ pathMethods: {
3637
+ "/organization/get-full-organization": "GET";
3638
+ "/organization/list-user-teams": "GET";
3639
+ };
3640
+ atomListeners: ({
3641
+ matcher(path: string): path is "/organization/create" | "/organization/update" | "/organization/delete";
3642
+ signal: "$listOrg";
3643
+ } | {
3644
+ matcher(path: string): boolean;
3645
+ signal: "$activeOrgSignal";
3646
+ } | {
3647
+ matcher(path: string): boolean;
3648
+ signal: "$sessionSignal";
3649
+ } | {
3650
+ matcher(path: string): boolean;
3651
+ signal: "$activeMemberSignal";
3652
+ } | {
3653
+ matcher(path: string): boolean;
3654
+ signal: "$activeMemberRoleSignal";
3655
+ })[];
3656
+ $ERROR_CODES: {
3657
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
3658
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: import("better-auth").RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
3659
+ ORGANIZATION_ALREADY_EXISTS: import("better-auth").RawError<"ORGANIZATION_ALREADY_EXISTS">;
3660
+ ORGANIZATION_SLUG_ALREADY_TAKEN: import("better-auth").RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
3661
+ ORGANIZATION_NOT_FOUND: import("better-auth").RawError<"ORGANIZATION_NOT_FOUND">;
3662
+ USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: import("better-auth").RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
3663
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
3664
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
3665
+ NO_ACTIVE_ORGANIZATION: import("better-auth").RawError<"NO_ACTIVE_ORGANIZATION">;
3666
+ USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: import("better-auth").RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
3667
+ MEMBER_NOT_FOUND: import("better-auth").RawError<"MEMBER_NOT_FOUND">;
3668
+ ROLE_NOT_FOUND: import("better-auth").RawError<"ROLE_NOT_FOUND">;
3669
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
3670
+ TEAM_ALREADY_EXISTS: import("better-auth").RawError<"TEAM_ALREADY_EXISTS">;
3671
+ TEAM_NOT_FOUND: import("better-auth").RawError<"TEAM_NOT_FOUND">;
3672
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: import("better-auth").RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
3673
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: import("better-auth").RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
3674
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
3675
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
3676
+ USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: import("better-auth").RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
3677
+ INVITATION_NOT_FOUND: import("better-auth").RawError<"INVITATION_NOT_FOUND">;
3678
+ YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: import("better-auth").RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
3679
+ EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: import("better-auth").RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
3680
+ EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION: import("better-auth").RawError<"EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION">;
3681
+ YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
3682
+ INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: import("better-auth").RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
3683
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
3684
+ FAILED_TO_RETRIEVE_INVITATION: import("better-auth").RawError<"FAILED_TO_RETRIEVE_INVITATION">;
3685
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: import("better-auth").RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
3686
+ UNABLE_TO_REMOVE_LAST_TEAM: import("better-auth").RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
3687
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
3688
+ ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: import("better-auth").RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
3689
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
3690
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
3691
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
3692
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
3693
+ INVITATION_LIMIT_REACHED: import("better-auth").RawError<"INVITATION_LIMIT_REACHED">;
3694
+ TEAM_MEMBER_LIMIT_REACHED: import("better-auth").RawError<"TEAM_MEMBER_LIMIT_REACHED">;
3695
+ USER_IS_NOT_A_MEMBER_OF_THE_TEAM: import("better-auth").RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
3696
+ YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: import("better-auth").RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
3697
+ YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: import("better-auth").RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
3698
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
3699
+ YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
3700
+ YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
3701
+ YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
3702
+ MISSING_AC_INSTANCE: import("better-auth").RawError<"MISSING_AC_INSTANCE">;
3703
+ YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: import("better-auth").RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
3704
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
3705
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
3706
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
3707
+ YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
3708
+ YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
3709
+ YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
3710
+ TOO_MANY_ROLES: import("better-auth").RawError<"TOO_MANY_ROLES">;
3711
+ INVALID_RESOURCE: import("better-auth").RawError<"INVALID_RESOURCE">;
3712
+ ROLE_NAME_IS_ALREADY_TAKEN: import("better-auth").RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
3713
+ CANNOT_DELETE_A_PRE_DEFINED_ROLE: import("better-auth").RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
3714
+ ROLE_IS_ASSIGNED_TO_MEMBERS: import("better-auth").RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
3715
+ INVALID_TEAM_ID: import("better-auth").RawError<"INVALID_TEAM_ID">;
3716
+ };
3717
+ } | {
3718
+ id: "phoneNumber";
3719
+ version: string;
3720
+ $InferServerPlugin: ReturnType<(options?: import("better-auth/plugins").PhoneNumberOptions | undefined) => {
3721
+ id: "phone-number";
3722
+ version: string;
3723
+ init(): {
3724
+ options: {
3725
+ databaseHooks: {
3726
+ user: {
3727
+ update: {
3728
+ before(data: Partial<{
3729
+ id: string;
3730
+ createdAt: Date;
3731
+ updatedAt: Date;
3732
+ email: string;
3733
+ emailVerified: boolean;
3734
+ name: string;
3735
+ image?: string | null | undefined;
3736
+ }> & Record<string, unknown>): Promise<{
3737
+ data: {
3738
+ [x: string]: unknown;
3739
+ id?: string | undefined;
3740
+ createdAt?: Date | undefined;
3741
+ updatedAt?: Date | undefined;
3742
+ email?: string | undefined;
3743
+ emailVerified?: boolean | undefined;
3744
+ name?: string | undefined;
3745
+ image?: string | null | undefined;
3746
+ };
3747
+ } | undefined>;
3748
+ };
3749
+ };
3750
+ };
3751
+ };
3752
+ };
3753
+ hooks: {
3754
+ before: {
3755
+ matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
3756
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<never>;
3757
+ }[];
3758
+ };
3759
+ endpoints: {
3760
+ signInPhoneNumber: import("better-auth").StrictEndpoint<"/sign-in/phone-number", {
3761
+ method: "POST";
3762
+ body: import("zod").ZodObject<{
3763
+ phoneNumber: import("zod").ZodString;
3764
+ password: import("zod").ZodString;
3765
+ rememberMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
3766
+ }, import("zod/v4/core").$strip>;
3767
+ metadata: {
3768
+ openapi: {
3769
+ summary: string;
3770
+ description: string;
3771
+ responses: {
3772
+ 200: {
3773
+ description: string;
3774
+ content: {
3775
+ "application/json": {
3776
+ schema: {
3777
+ type: "object";
3778
+ properties: {
3779
+ user: {
3780
+ $ref: string;
3781
+ };
3782
+ session: {
3783
+ $ref: string;
3784
+ };
3785
+ };
3786
+ };
3787
+ };
3788
+ };
3789
+ };
3790
+ 400: {
3791
+ description: string;
3792
+ };
3793
+ };
3794
+ };
3795
+ };
3796
+ }, {
3797
+ token: string;
3798
+ user: import("better-auth/plugins").UserWithPhoneNumber;
3799
+ }>;
3800
+ sendPhoneNumberOTP: import("better-auth").StrictEndpoint<"/phone-number/send-otp", {
3801
+ method: "POST";
3802
+ body: import("zod").ZodObject<{
3803
+ phoneNumber: import("zod").ZodString;
3804
+ }, import("zod/v4/core").$strip>;
3805
+ metadata: {
3806
+ openapi: {
3807
+ summary: string;
3808
+ description: string;
3809
+ responses: {
3810
+ 200: {
3811
+ description: string;
3812
+ content: {
3813
+ "application/json": {
3814
+ schema: {
3815
+ type: "object";
3816
+ properties: {
3817
+ message: {
3818
+ type: string;
3819
+ };
3820
+ };
3821
+ };
3822
+ };
3823
+ };
3824
+ };
3825
+ };
3826
+ };
3827
+ };
3828
+ }, {
3829
+ message: string;
3830
+ }>;
3831
+ verifyPhoneNumber: import("better-auth").StrictEndpoint<"/phone-number/verify", {
3832
+ method: "POST";
3833
+ body: import("zod").ZodIntersection<import("zod").ZodObject<{
3834
+ phoneNumber: import("zod").ZodString;
3835
+ code: import("zod").ZodString;
3836
+ disableSession: import("zod").ZodOptional<import("zod").ZodBoolean>;
3837
+ updatePhoneNumber: import("zod").ZodOptional<import("zod").ZodBoolean>;
3838
+ }, import("zod/v4/core").$strip>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
3839
+ metadata: {
3840
+ openapi: {
3841
+ summary: string;
3842
+ description: string;
3843
+ responses: {
3844
+ "200": {
3845
+ description: string;
3846
+ content: {
3847
+ "application/json": {
3848
+ schema: {
3849
+ type: "object";
3850
+ properties: {
3851
+ status: {
3852
+ type: string;
3853
+ description: string;
3854
+ enum: boolean[];
3855
+ };
3856
+ token: {
3857
+ type: string;
3858
+ nullable: boolean;
3859
+ description: string;
3860
+ };
3861
+ user: {
3862
+ type: string;
3863
+ nullable: boolean;
3864
+ properties: {
3865
+ id: {
3866
+ type: string;
3867
+ description: string;
3868
+ };
3869
+ email: {
3870
+ type: string;
3871
+ format: string;
3872
+ nullable: boolean;
3873
+ description: string;
3874
+ };
3875
+ emailVerified: {
3876
+ type: string;
3877
+ nullable: boolean;
3878
+ description: string;
3879
+ };
3880
+ name: {
3881
+ type: string;
3882
+ nullable: boolean;
3883
+ description: string;
3884
+ };
3885
+ image: {
3886
+ type: string;
3887
+ format: string;
3888
+ nullable: boolean;
3889
+ description: string;
3890
+ };
3891
+ phoneNumber: {
3892
+ type: string;
3893
+ description: string;
3894
+ };
3895
+ phoneNumberVerified: {
3896
+ type: string;
3897
+ description: string;
3898
+ };
3899
+ createdAt: {
3900
+ type: string;
3901
+ format: string;
3902
+ description: string;
3903
+ };
3904
+ updatedAt: {
3905
+ type: string;
3906
+ format: string;
3907
+ description: string;
3908
+ };
3909
+ };
3910
+ required: string[];
3911
+ description: string;
3912
+ };
3913
+ };
3914
+ required: string[];
3915
+ };
3916
+ };
3917
+ };
3918
+ };
3919
+ 400: {
3920
+ description: string;
3921
+ };
3922
+ };
3923
+ };
3924
+ };
3925
+ }, {
3926
+ status: boolean;
3927
+ token: string;
3928
+ user: {
3929
+ id: string;
3930
+ createdAt: Date;
3931
+ updatedAt: Date;
3932
+ email: string;
3933
+ emailVerified: boolean;
3934
+ name: string;
3935
+ image?: string | null | undefined;
3936
+ } & import("better-auth/plugins").UserWithPhoneNumber;
3937
+ } | {
3938
+ status: boolean;
3939
+ token: null;
3940
+ user: import("better-auth/plugins").UserWithPhoneNumber;
3941
+ }>;
3942
+ requestPasswordResetPhoneNumber: import("better-auth").StrictEndpoint<"/phone-number/request-password-reset", {
3943
+ method: "POST";
3944
+ body: import("zod").ZodObject<{
3945
+ phoneNumber: import("zod").ZodString;
3946
+ }, import("zod/v4/core").$strip>;
3947
+ metadata: {
3948
+ openapi: {
3949
+ description: string;
3950
+ responses: {
3951
+ "200": {
3952
+ description: string;
3953
+ content: {
3954
+ "application/json": {
3955
+ schema: {
3956
+ type: "object";
3957
+ properties: {
3958
+ status: {
3959
+ type: string;
3960
+ description: string;
3961
+ enum: boolean[];
3962
+ };
3963
+ };
3964
+ required: string[];
3965
+ };
3966
+ };
3967
+ };
3968
+ };
3969
+ };
3970
+ };
3971
+ };
3972
+ }, {
3973
+ status: boolean;
3974
+ }>;
3975
+ resetPasswordPhoneNumber: import("better-auth").StrictEndpoint<"/phone-number/reset-password", {
3976
+ method: "POST";
3977
+ body: import("zod").ZodObject<{
3978
+ otp: import("zod").ZodString;
3979
+ phoneNumber: import("zod").ZodString;
3980
+ newPassword: import("zod").ZodString;
3981
+ }, import("zod/v4/core").$strip>;
3982
+ metadata: {
3983
+ openapi: {
3984
+ description: string;
3985
+ responses: {
3986
+ "200": {
3987
+ description: string;
3988
+ content: {
3989
+ "application/json": {
3990
+ schema: {
3991
+ type: "object";
3992
+ properties: {
3993
+ status: {
3994
+ type: string;
3995
+ description: string;
3996
+ enum: boolean[];
3997
+ };
3998
+ };
3999
+ required: string[];
4000
+ };
4001
+ };
4002
+ };
4003
+ };
4004
+ };
4005
+ };
4006
+ };
4007
+ }, {
4008
+ status: boolean;
4009
+ }>;
4010
+ };
4011
+ schema: {
4012
+ user: {
4013
+ fields: {
4014
+ phoneNumber: {
4015
+ type: "string";
4016
+ required: false;
4017
+ unique: true;
4018
+ sortable: true;
4019
+ returned: true;
4020
+ };
4021
+ phoneNumberVerified: {
4022
+ type: "boolean";
4023
+ required: false;
4024
+ returned: true;
4025
+ input: false;
4026
+ };
4027
+ };
4028
+ };
4029
+ };
4030
+ rateLimit: {
4031
+ pathMatcher(path: string): boolean;
4032
+ window: number;
4033
+ max: number;
4034
+ }[];
4035
+ options: import("better-auth/plugins").PhoneNumberOptions | undefined;
4036
+ $ERROR_CODES: {
4037
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
4038
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
4039
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
4040
+ INVALID_PHONE_NUMBER: import("better-auth").RawError<"INVALID_PHONE_NUMBER">;
4041
+ PHONE_NUMBER_EXIST: import("better-auth").RawError<"PHONE_NUMBER_EXIST">;
4042
+ PHONE_NUMBER_NOT_EXIST: import("better-auth").RawError<"PHONE_NUMBER_NOT_EXIST">;
4043
+ INVALID_PHONE_NUMBER_OR_PASSWORD: import("better-auth").RawError<"INVALID_PHONE_NUMBER_OR_PASSWORD">;
4044
+ UNEXPECTED_ERROR: import("better-auth").RawError<"UNEXPECTED_ERROR">;
4045
+ OTP_NOT_FOUND: import("better-auth").RawError<"OTP_NOT_FOUND">;
4046
+ PHONE_NUMBER_NOT_VERIFIED: import("better-auth").RawError<"PHONE_NUMBER_NOT_VERIFIED">;
4047
+ PHONE_NUMBER_CANNOT_BE_UPDATED: import("better-auth").RawError<"PHONE_NUMBER_CANNOT_BE_UPDATED">;
4048
+ SEND_OTP_NOT_IMPLEMENTED: import("better-auth").RawError<"SEND_OTP_NOT_IMPLEMENTED">;
4049
+ };
4050
+ }>;
4051
+ atomListeners: {
4052
+ matcher(path: string): path is "/phone-number/verify" | "/sign-in/phone-number" | "/phone-number/update";
4053
+ signal: "$sessionSignal";
4054
+ }[];
4055
+ $ERROR_CODES: {
4056
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
4057
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
4058
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
4059
+ INVALID_PHONE_NUMBER: import("better-auth").RawError<"INVALID_PHONE_NUMBER">;
4060
+ PHONE_NUMBER_EXIST: import("better-auth").RawError<"PHONE_NUMBER_EXIST">;
4061
+ PHONE_NUMBER_NOT_EXIST: import("better-auth").RawError<"PHONE_NUMBER_NOT_EXIST">;
4062
+ INVALID_PHONE_NUMBER_OR_PASSWORD: import("better-auth").RawError<"INVALID_PHONE_NUMBER_OR_PASSWORD">;
4063
+ UNEXPECTED_ERROR: import("better-auth").RawError<"UNEXPECTED_ERROR">;
4064
+ OTP_NOT_FOUND: import("better-auth").RawError<"OTP_NOT_FOUND">;
4065
+ PHONE_NUMBER_NOT_VERIFIED: import("better-auth").RawError<"PHONE_NUMBER_NOT_VERIFIED">;
4066
+ PHONE_NUMBER_CANNOT_BE_UPDATED: import("better-auth").RawError<"PHONE_NUMBER_CANNOT_BE_UPDATED">;
4067
+ SEND_OTP_NOT_IMPLEMENTED: import("better-auth").RawError<"SEND_OTP_NOT_IMPLEMENTED">;
4068
+ };
4069
+ } | {
4070
+ id: "siwn";
4071
+ $InferServerPlugin: {};
4072
+ getAtoms: (_$fetch: BetterFetch) => import("better-near-auth/client").NearClientAtoms;
4073
+ getActions: ($fetch: BetterFetch, $store: import("better-auth").ClientStore, _options: unknown) => import("better-near-auth/client").SIWNClientActions;
4074
+ })[];
4075
+ }>;
14
4076
  type AuthClient = ReturnType<typeof createAuthClient>;
15
- type OrganizationListResult = Awaited<ReturnType<AuthClient["organization"]["list"]>>;
16
- type PasskeyListResult = Awaited<ReturnType<AuthClient["passkey"]["listUserPasskeys"]>>;
17
4077
  type SessionData = AuthClient["$Infer"]["Session"];
18
- type Organization = NonNullable<OrganizationListResult["data"]>[number];
19
- type Passkey = NonNullable<PasskeyListResult["data"]>[number];
4078
+ /**
4079
+ * Explicit shapes for the organization/passkey records — better-auth's client
4080
+ * inference collapses to `any` for these plugin endpoints, which would leak
4081
+ * `any` into every consumer union.
4082
+ */
4083
+ interface Organization {
4084
+ id: string;
4085
+ name: string;
4086
+ slug?: string | null;
4087
+ logo?: string | null;
4088
+ createdAt?: Date | string | null;
4089
+ metadata?: Record<string, unknown> | null;
4090
+ }
4091
+ interface Passkey {
4092
+ id: string;
4093
+ name?: string | null;
4094
+ createdAt?: Date | string | null;
4095
+ lastUsedAt?: Date | string | null;
4096
+ }
20
4097
  declare function useAuthClient(): AuthClient;
21
4098
  declare const sessionQueryKey: readonly ["session"];
22
4099
  declare function sessionQueryOptions(authClient: AuthClient): {
23
4100
  queryKey: readonly ["session"];
24
- queryFn: () => Promise<any>;
4101
+ queryFn: () => Promise<{
4102
+ user: import("better-auth").StripEmptyObjects<{
4103
+ id: string;
4104
+ createdAt: Date;
4105
+ updatedAt: Date;
4106
+ email: string;
4107
+ emailVerified: boolean;
4108
+ name: string;
4109
+ image?: string | null | undefined;
4110
+ } & {} & {
4111
+ locale?: string | null | undefined;
4112
+ } & {
4113
+ banned: boolean | null | undefined;
4114
+ } & {
4115
+ banExpires?: Date | null | undefined;
4116
+ banReason?: string | null | undefined;
4117
+ role?: string | null | undefined;
4118
+ } & {
4119
+ isAnonymous: boolean | null | undefined;
4120
+ } & {} & {} & {
4121
+ phoneNumber?: string | null | undefined;
4122
+ phoneNumberVerified?: boolean | null | undefined;
4123
+ }>;
4124
+ session: import("better-auth").StripEmptyObjects<{
4125
+ id: string;
4126
+ createdAt: Date;
4127
+ updatedAt: Date;
4128
+ userId: string;
4129
+ expiresAt: Date;
4130
+ token: string;
4131
+ ipAddress?: string | null | undefined;
4132
+ userAgent?: string | null | undefined;
4133
+ } & {} & {} & {} & {
4134
+ impersonatedBy?: string | null | undefined;
4135
+ } & {} & {
4136
+ activeOrganizationId?: string | null | undefined;
4137
+ activeTeamId?: string | null | undefined;
4138
+ }>;
4139
+ } | null>;
25
4140
  staleTime: number;
26
4141
  gcTime: number;
27
4142
  };
@@ -33,7 +4148,18 @@ declare function refreshSessionCache(authClient: AuthClient, queryClient: QueryC
33
4148
  * the dehydrated state carries it to the client.
34
4149
  */
35
4150
  declare function resolveSessionFromCache<T>(queryClient: QueryClient | undefined, contextSession: T | null | undefined): T | null | undefined;
36
- declare function useRelayHistory(session: SessionData | null | undefined, authClient: AuthClient): import("@tanstack/react-query").UseQueryResult<RelayedTransactionT[], Error>;
4151
+ declare function useRelayHistory(session: SessionData | null | undefined, authClient: AuthClient): import("@tanstack/react-query").UseQueryResult<{
4152
+ id: string;
4153
+ userId: string;
4154
+ txHash: string;
4155
+ senderId: string;
4156
+ receiverId: string;
4157
+ network: string;
4158
+ status: string;
4159
+ gasUsed?: string | undefined;
4160
+ createdAt: string;
4161
+ updatedAt?: string | undefined;
4162
+ }[], Error>;
37
4163
  type PasskeyWalletStatus = PasskeyWalletLink;
38
4164
  type PasskeyCeremonyError = Error & {
39
4165
  code?: string;