@neondatabase/auth 0.2.0-beta.1 → 0.4.0-beta

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 (44) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +22 -7
  3. package/codemods/migrate-auth-ui-imports.mjs +439 -0
  4. package/dist/{adapter-core-CnrOXh1T.d.mts → adapter-core-BWM7cWOp.d.mts} +465 -401
  5. package/dist/{adapter-core-CtmnMMJ7.mjs → adapter-core-Bt4M5I2g.mjs} +21 -11
  6. package/dist/auth-interface-Clz-oWq1.d.mts +8 -0
  7. package/dist/better-auth-helpers-Bkezghej.mjs +541 -0
  8. package/dist/{better-auth-react-adapter-DNi5PC5D.d.mts → better-auth-react-adapter-BDxJ65mF.d.mts} +389 -302
  9. package/dist/{better-auth-react-adapter-Dv-o6A6O.mjs → better-auth-react-adapter-aMv8WeDb.mjs} +1 -1
  10. package/dist/{index-CzsGMS7C.d.mts → index-DHryUj7e.d.mts} +0 -1
  11. package/dist/index.d.mts +94 -5
  12. package/dist/index.mjs +4 -3
  13. package/dist/{neon-auth-Cs2cWh1B.mjs → neon-auth-CS4FpK2X.mjs} +1 -1
  14. package/dist/next/index.d.mts +161 -73
  15. package/dist/next/index.mjs +5 -4
  16. package/dist/next/server/index.d.mts +25 -5
  17. package/dist/next/server/index.mjs +369 -251
  18. package/dist/react/adapters/index.d.mts +3 -3
  19. package/dist/react/adapters/index.mjs +2 -2
  20. package/dist/react/index.d.mts +6 -5
  21. package/dist/react/index.mjs +5 -5
  22. package/dist/react/ui/index.d.mts +1 -2
  23. package/dist/react/ui/index.mjs +2 -4
  24. package/dist/react/ui/server.mjs +2 -2
  25. package/dist/{supabase-adapter-DUqw2fw8.d.mts → supabase-adapter-BGwV0Vu2.d.mts} +429 -373
  26. package/dist/{supabase-adapter-BlcGPyOf.mjs → supabase-adapter-DBt4LJJd.mjs} +3 -514
  27. package/dist/types/index.d.mts +2 -2
  28. package/dist/ui/.safelist.html +1 -1
  29. package/dist/ui/css.css +2 -2
  30. package/dist/ui/theme.css +1 -1
  31. package/dist/ui-CnVnqGns.mjs +3 -0
  32. package/dist/vanilla/adapters/index.d.mts +4 -3
  33. package/dist/vanilla/adapters/index.mjs +2 -2
  34. package/dist/vanilla/index.d.mts +4 -3
  35. package/dist/vanilla/index.mjs +2 -2
  36. package/llms.txt +2 -2
  37. package/package.json +27 -21
  38. package/dist/chunk-VCZJYX65-CLnrj1o7-D6ZQkcc_.mjs +0 -543
  39. package/dist/constants-Cupc_bln.mjs +0 -28
  40. package/dist/neon-auth-BEGCfAe6.d.mts +0 -107
  41. package/dist/ui-COLWzDsu.mjs +0 -12469
  42. /package/dist/{adapters-B7YKkjaL.mjs → adapters-CUvhsAvY.mjs} +0 -0
  43. /package/dist/{index-CPnFzULh.d.mts → index-B0Pd4HOH.d.mts} +0 -0
  44. /package/dist/{index-OEBbnNdr.d.mts → index-CzpoWrv9.d.mts} +0 -0
@@ -1,18 +1,19 @@
1
+ import * as better_auth_react1 from "better-auth/react";
1
2
  import { createAuthClient } from "better-auth/react";
2
- import * as better_auth_client11 from "better-auth/client";
3
+ import * as better_auth_client0 from "better-auth/client";
3
4
  import { BetterAuthClientOptions, createAuthClient as createAuthClient$1 } from "better-auth/client";
4
- import * as jose0 from "jose";
5
+ import * as zod0 from "zod";
6
+ import * as jose1 from "jose";
5
7
  import { Session, User } from "better-auth/types";
6
- import * as better_auth151 from "better-auth";
7
- import * as _better_fetch_fetch88 from "@better-fetch/fetch";
8
+ import * as better_auth_plugins43 from "better-auth/plugins";
9
+ import * as better_auth311 from "better-auth";
10
+ import * as _better_fetch_fetch183 from "@better-fetch/fetch";
8
11
  import { BetterFetchError, BetterFetchError as BetterFetchError$1 } from "@better-fetch/fetch";
9
- import * as better_auth_plugins5 from "better-auth/plugins";
10
- import * as nanostores0 from "nanostores";
11
- import * as better_call0 from "better-call";
12
12
  import { Invitation, InvitationInput, InvitationStatus, Member, MemberInput, Organization, OrganizationInput, OrganizationRole, Team, TeamInput, TeamMember, TeamMemberInput } from "better-auth/plugins/organization";
13
13
  import { JWKOptions, JWSAlgorithms, Jwk, JwtOptions } from "better-auth/plugins/jwt";
14
14
  import { AdminOptions, InferAdminRolesFromOption, SessionWithImpersonatedBy, UserWithRole } from "better-auth/plugins/admin";
15
15
  import { EmailOTPOptions } from "better-auth/plugins/email-otp";
16
+ import { MagicLinkOptions } from "better-auth/plugins/magic-link";
16
17
 
17
18
  //#region src/core/better-auth-types.d.ts
18
19
  type BetterAuthSession = Session;
@@ -20,11 +21,19 @@ type BetterAuthUser = User;
20
21
  type BetterAuthErrorResponse = BetterFetchError;
21
22
  //#endregion
22
23
  //#region src/types/index.d.ts
23
- type BetterAuthInstance = ReturnType<typeof createAuthClient$1<{
24
+ /**
25
+ * Type representing the Better Auth React client
26
+ */
27
+ type ReactBetterAuthClient = ReturnType<typeof createAuthClient<{
24
28
  plugins: SupportedBetterAuthClientPlugins;
25
- }> | typeof createAuthClient<{
29
+ }>>;
30
+ /**
31
+ * Type representing the Better Auth Vanilla client
32
+ */
33
+ type VanillaBetterAuthClient = ReturnType<typeof createAuthClient$1<{
26
34
  plugins: SupportedBetterAuthClientPlugins;
27
35
  }>>;
36
+ type BetterAuthInstance = VanillaBetterAuthClient | ReactBetterAuthClient;
28
37
  //#endregion
29
38
  //#region src/core/adapter-core.d.ts
30
39
  interface NeonAuthAdapterCoreAuthOptions extends Omit<BetterAuthClientOptions, 'plugins'> {}
@@ -33,7 +42,7 @@ declare const supportedBetterAuthClientPlugins: ({
33
42
  pathMethods: {
34
43
  "/token/anonymous": "GET";
35
44
  };
36
- getActions: ($fetch: _better_fetch_fetch88.BetterFetch) => {
45
+ getActions: ($fetch: _better_fetch_fetch183.BetterFetch) => {
37
46
  getAnonymousToken: (fetchOptions?: any) => Promise<{
38
47
  data: {
39
48
  token: string;
@@ -51,11 +60,11 @@ declare const supportedBetterAuthClientPlugins: ({
51
60
  };
52
61
  } | {
53
62
  id: "better-auth-client";
54
- $InferServerPlugin: ReturnType<(options?: better_auth_plugins5.JwtOptions | undefined) => {
63
+ $InferServerPlugin: ReturnType<(<O extends better_auth_plugins43.JwtOptions>(options?: O) => {
55
64
  id: "jwt";
56
- options: better_auth_plugins5.JwtOptions | undefined;
65
+ options: NoInfer<O>;
57
66
  endpoints: {
58
- getJwks: better_call0.StrictEndpoint<string, {
67
+ getJwks: better_auth311.StrictEndpoint<string, {
59
68
  method: "GET";
60
69
  metadata: {
61
70
  openapi: {
@@ -131,13 +140,11 @@ declare const supportedBetterAuthClientPlugins: ({
131
140
  };
132
141
  };
133
142
  };
134
- } & {
135
- use: any[];
136
- }, jose0.JSONWebKeySet>;
137
- getToken: better_call0.StrictEndpoint<"/token", {
143
+ }, jose1.JSONWebKeySet>;
144
+ getToken: better_auth311.StrictEndpoint<"/token", {
138
145
  method: "GET";
139
146
  requireHeaders: true;
140
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
147
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
141
148
  session: {
142
149
  session: Record<string, any> & {
143
150
  id: string;
@@ -183,35 +190,29 @@ declare const supportedBetterAuthClientPlugins: ({
183
190
  };
184
191
  };
185
192
  };
186
- } & {
187
- use: any[];
188
193
  }, {
189
194
  token: string;
190
195
  }>;
191
- signJWT: better_call0.StrictEndpoint<"/sign-jwt", {
196
+ signJWT: better_auth311.StrictEndpoint<string, {
192
197
  method: "POST";
193
198
  metadata: {
194
- SERVER_ONLY: true;
195
199
  $Infer: {
196
200
  body: {
197
- payload: jose0.JWTPayload;
198
- overrideOptions?: better_auth_plugins5.JwtOptions | undefined;
201
+ payload: jose1.JWTPayload;
202
+ overrideOptions?: better_auth_plugins43.JwtOptions | undefined;
199
203
  };
200
204
  };
201
205
  };
202
- body: better_auth151.ZodObject<{
203
- payload: better_auth151.ZodRecord<better_auth151.ZodString, better_auth151.ZodAny>;
204
- overrideOptions: better_auth151.ZodOptional<better_auth151.ZodRecord<better_auth151.ZodString, better_auth151.ZodAny>>;
205
- }, better_auth151.$strip>;
206
- } & {
207
- use: any[];
206
+ body: zod0.ZodObject<{
207
+ payload: zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>;
208
+ overrideOptions: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>>;
209
+ }, better_auth311.$strip>;
208
210
  }, {
209
211
  token: string;
210
212
  }>;
211
- verifyJWT: better_call0.StrictEndpoint<"/verify-jwt", {
213
+ verifyJWT: better_auth311.StrictEndpoint<string, {
212
214
  method: "POST";
213
215
  metadata: {
214
- SERVER_ONLY: true;
215
216
  $Infer: {
216
217
  body: {
217
218
  token: string;
@@ -226,20 +227,18 @@ declare const supportedBetterAuthClientPlugins: ({
226
227
  };
227
228
  };
228
229
  };
229
- body: better_auth151.ZodObject<{
230
- token: better_auth151.ZodString;
231
- issuer: better_auth151.ZodOptional<better_auth151.ZodString>;
232
- }, better_auth151.$strip>;
233
- } & {
234
- use: any[];
230
+ body: zod0.ZodObject<{
231
+ token: zod0.ZodString;
232
+ issuer: zod0.ZodOptional<zod0.ZodString>;
233
+ }, better_auth311.$strip>;
235
234
  }, {
236
- payload: (jose0.JWTPayload & Required<Pick<jose0.JWTPayload, "sub" | "aud">>) | null;
235
+ payload: (jose1.JWTPayload & Required<Pick<jose1.JWTPayload, "sub" | "aud">>) | null;
237
236
  }>;
238
237
  };
239
238
  hooks: {
240
239
  after: {
241
- matcher(context: better_auth151.HookEndpointContext): boolean;
242
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
240
+ matcher(context: better_auth311.HookEndpointContext): boolean;
241
+ handler: (inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<void>;
243
242
  }[];
244
243
  };
245
244
  schema: {
@@ -264,11 +263,11 @@ declare const supportedBetterAuthClientPlugins: ({
264
263
  };
265
264
  };
266
265
  };
267
- }>;
266
+ })>;
268
267
  pathMethods: {
269
268
  [x: string]: "GET";
270
269
  };
271
- getActions: ($fetch: _better_fetch_fetch88.BetterFetch) => {
270
+ getActions: ($fetch: _better_fetch_fetch183.BetterFetch) => {
272
271
  jwks: (fetchOptions?: any) => Promise<{
273
272
  data: null;
274
273
  error: {
@@ -277,7 +276,7 @@ declare const supportedBetterAuthClientPlugins: ({
277
276
  statusText: string;
278
277
  };
279
278
  } | {
280
- data: jose0.JSONWebKeySet;
279
+ data: jose1.JSONWebKeySet;
281
280
  error: null;
282
281
  }>;
283
282
  };
@@ -323,7 +322,7 @@ declare const supportedBetterAuthClientPlugins: ({
323
322
  token: string;
324
323
  ipAddress?: string | null | undefined;
325
324
  userAgent?: string | null | undefined;
326
- } & Record<string, unknown>, ctx: better_auth151.GenericEndpointContext | null): Promise<void>;
325
+ } & Record<string, unknown>, ctx: better_auth311.GenericEndpointContext | null): Promise<void>;
327
326
  };
328
327
  };
329
328
  };
@@ -331,22 +330,22 @@ declare const supportedBetterAuthClientPlugins: ({
331
330
  };
332
331
  hooks: {
333
332
  after: {
334
- matcher(context: better_auth151.HookEndpointContext): boolean;
335
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<better_auth_plugins5.SessionWithImpersonatedBy[] | undefined>;
333
+ matcher(context: better_auth311.HookEndpointContext): boolean;
334
+ handler: (inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<better_auth_plugins43.SessionWithImpersonatedBy[] | undefined>;
336
335
  }[];
337
336
  };
338
337
  endpoints: {
339
- setRole: better_call0.StrictEndpoint<"/admin/set-role", {
338
+ setRole: better_auth311.StrictEndpoint<"/admin/set-role", {
340
339
  method: "POST";
341
- body: better_auth151.ZodObject<{
342
- userId: better_auth151.ZodCoercedString<unknown>;
343
- role: better_auth151.ZodUnion<readonly [better_auth151.ZodString, better_auth151.ZodArray<better_auth151.ZodString>]>;
344
- }, better_auth151.$strip>;
340
+ body: zod0.ZodObject<{
341
+ userId: zod0.ZodCoercedString<unknown>;
342
+ role: zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodArray<zod0.ZodString>]>;
343
+ }, better_auth311.$strip>;
345
344
  requireHeaders: true;
346
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
345
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
347
346
  session: {
348
- user: better_auth_plugins5.UserWithRole;
349
- session: better_auth151.Session;
347
+ user: better_auth_plugins43.UserWithRole;
348
+ session: better_auth311.Session;
350
349
  };
351
350
  }>)[];
352
351
  metadata: {
@@ -379,20 +378,18 @@ declare const supportedBetterAuthClientPlugins: ({
379
378
  };
380
379
  };
381
380
  };
382
- } & {
383
- use: any[];
384
381
  }, {
385
- user: better_auth_plugins5.UserWithRole;
382
+ user: better_auth_plugins43.UserWithRole;
386
383
  }>;
387
- getUser: better_call0.StrictEndpoint<"/admin/get-user", {
384
+ getUser: better_auth311.StrictEndpoint<"/admin/get-user", {
388
385
  method: "GET";
389
- query: better_auth151.ZodObject<{
390
- id: better_auth151.ZodString;
391
- }, better_auth151.$strip>;
392
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
386
+ query: zod0.ZodObject<{
387
+ id: zod0.ZodString;
388
+ }, better_auth311.$strip>;
389
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
393
390
  session: {
394
- user: better_auth_plugins5.UserWithRole;
395
- session: better_auth151.Session;
391
+ user: better_auth_plugins43.UserWithRole;
392
+ session: better_auth311.Session;
396
393
  };
397
394
  }>)[];
398
395
  metadata: {
@@ -419,26 +416,16 @@ declare const supportedBetterAuthClientPlugins: ({
419
416
  };
420
417
  };
421
418
  };
422
- } & {
423
- use: any[];
424
- }, {
425
- id: string;
426
- createdAt: Date;
427
- updatedAt: Date;
428
- email: string;
429
- emailVerified: boolean;
430
- name: string;
431
- image?: string | null | undefined;
432
- }>;
433
- createUser: better_call0.StrictEndpoint<"/admin/create-user", {
419
+ }, better_auth_plugins43.UserWithRole>;
420
+ createUser: better_auth311.StrictEndpoint<"/admin/create-user", {
434
421
  method: "POST";
435
- body: better_auth151.ZodObject<{
436
- email: better_auth151.ZodString;
437
- password: better_auth151.ZodString;
438
- name: better_auth151.ZodString;
439
- role: better_auth151.ZodOptional<better_auth151.ZodUnion<readonly [better_auth151.ZodString, better_auth151.ZodArray<better_auth151.ZodString>]>>;
440
- data: better_auth151.ZodOptional<better_auth151.ZodRecord<better_auth151.ZodString, better_auth151.ZodAny>>;
441
- }, better_auth151.$strip>;
422
+ body: zod0.ZodObject<{
423
+ email: zod0.ZodString;
424
+ password: zod0.ZodOptional<zod0.ZodString>;
425
+ name: zod0.ZodString;
426
+ role: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodArray<zod0.ZodString>]>>;
427
+ data: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>>;
428
+ }, better_auth311.$strip>;
442
429
  metadata: {
443
430
  openapi: {
444
431
  operationId: string;
@@ -465,28 +452,26 @@ declare const supportedBetterAuthClientPlugins: ({
465
452
  $Infer: {
466
453
  body: {
467
454
  email: string;
468
- password: string;
455
+ password?: string | undefined;
469
456
  name: string;
470
457
  role?: "user" | "admin" | ("user" | "admin")[] | undefined;
471
458
  data?: Record<string, any> | undefined;
472
459
  };
473
460
  };
474
461
  };
475
- } & {
476
- use: any[];
477
462
  }, {
478
- user: better_auth_plugins5.UserWithRole;
463
+ user: better_auth_plugins43.UserWithRole;
479
464
  }>;
480
- adminUpdateUser: better_call0.StrictEndpoint<"/admin/update-user", {
465
+ adminUpdateUser: better_auth311.StrictEndpoint<"/admin/update-user", {
481
466
  method: "POST";
482
- body: better_auth151.ZodObject<{
483
- userId: better_auth151.ZodCoercedString<unknown>;
484
- data: better_auth151.ZodRecord<better_auth151.ZodAny, better_auth151.ZodAny>;
485
- }, better_auth151.$strip>;
486
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
467
+ body: zod0.ZodObject<{
468
+ userId: zod0.ZodCoercedString<unknown>;
469
+ data: zod0.ZodRecord<zod0.ZodAny, zod0.ZodAny>;
470
+ }, better_auth311.$strip>;
471
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
487
472
  session: {
488
- user: better_auth_plugins5.UserWithRole;
489
- session: better_auth151.Session;
473
+ user: better_auth_plugins43.UserWithRole;
474
+ session: better_auth311.Session;
490
475
  };
491
476
  }>)[];
492
477
  metadata: {
@@ -513,38 +498,36 @@ declare const supportedBetterAuthClientPlugins: ({
513
498
  };
514
499
  };
515
500
  };
516
- } & {
517
- use: any[];
518
- }, better_auth_plugins5.UserWithRole>;
519
- listUsers: better_call0.StrictEndpoint<"/admin/list-users", {
501
+ }, better_auth_plugins43.UserWithRole>;
502
+ listUsers: better_auth311.StrictEndpoint<"/admin/list-users", {
520
503
  method: "GET";
521
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
504
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
522
505
  session: {
523
- user: better_auth_plugins5.UserWithRole;
524
- session: better_auth151.Session;
506
+ user: better_auth_plugins43.UserWithRole;
507
+ session: better_auth311.Session;
525
508
  };
526
509
  }>)[];
527
- query: better_auth151.ZodObject<{
528
- searchValue: better_auth151.ZodOptional<better_auth151.ZodString>;
529
- searchField: better_auth151.ZodOptional<better_auth151.ZodEnum<{
510
+ query: zod0.ZodObject<{
511
+ searchValue: zod0.ZodOptional<zod0.ZodString>;
512
+ searchField: zod0.ZodOptional<zod0.ZodEnum<{
530
513
  name: "name";
531
514
  email: "email";
532
515
  }>>;
533
- searchOperator: better_auth151.ZodOptional<better_auth151.ZodEnum<{
516
+ searchOperator: zod0.ZodOptional<zod0.ZodEnum<{
534
517
  contains: "contains";
535
518
  starts_with: "starts_with";
536
519
  ends_with: "ends_with";
537
520
  }>>;
538
- limit: better_auth151.ZodOptional<better_auth151.ZodUnion<[better_auth151.ZodString, better_auth151.ZodNumber]>>;
539
- offset: better_auth151.ZodOptional<better_auth151.ZodUnion<[better_auth151.ZodString, better_auth151.ZodNumber]>>;
540
- sortBy: better_auth151.ZodOptional<better_auth151.ZodString>;
541
- sortDirection: better_auth151.ZodOptional<better_auth151.ZodEnum<{
521
+ limit: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodString, zod0.ZodNumber]>>;
522
+ offset: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodString, zod0.ZodNumber]>>;
523
+ sortBy: zod0.ZodOptional<zod0.ZodString>;
524
+ sortDirection: zod0.ZodOptional<zod0.ZodEnum<{
542
525
  asc: "asc";
543
526
  desc: "desc";
544
527
  }>>;
545
- filterField: better_auth151.ZodOptional<better_auth151.ZodString>;
546
- filterValue: better_auth151.ZodOptional<better_auth151.ZodUnion<[better_auth151.ZodUnion<[better_auth151.ZodString, better_auth151.ZodNumber]>, better_auth151.ZodBoolean]>>;
547
- filterOperator: better_auth151.ZodOptional<better_auth151.ZodEnum<{
528
+ filterField: zod0.ZodOptional<zod0.ZodString>;
529
+ filterValue: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodUnion<[zod0.ZodString, zod0.ZodNumber]>, zod0.ZodBoolean]>>;
530
+ filterOperator: zod0.ZodOptional<zod0.ZodEnum<{
548
531
  eq: "eq";
549
532
  ne: "ne";
550
533
  lt: "lt";
@@ -553,7 +536,7 @@ declare const supportedBetterAuthClientPlugins: ({
553
536
  gte: "gte";
554
537
  contains: "contains";
555
538
  }>>;
556
- }, better_auth151.$strip>;
539
+ }, better_auth311.$strip>;
557
540
  metadata: {
558
541
  openapi: {
559
542
  operationId: string;
@@ -591,10 +574,8 @@ declare const supportedBetterAuthClientPlugins: ({
591
574
  };
592
575
  };
593
576
  };
594
- } & {
595
- use: any[];
596
577
  }, {
597
- users: better_auth_plugins5.UserWithRole[];
578
+ users: better_auth_plugins43.UserWithRole[];
598
579
  total: number;
599
580
  limit: number | undefined;
600
581
  offset: number | undefined;
@@ -602,17 +583,17 @@ declare const supportedBetterAuthClientPlugins: ({
602
583
  users: never[];
603
584
  total: number;
604
585
  }>;
605
- listUserSessions: better_call0.StrictEndpoint<"/admin/list-user-sessions", {
586
+ listUserSessions: better_auth311.StrictEndpoint<"/admin/list-user-sessions", {
606
587
  method: "POST";
607
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
588
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
608
589
  session: {
609
- user: better_auth_plugins5.UserWithRole;
610
- session: better_auth151.Session;
590
+ user: better_auth_plugins43.UserWithRole;
591
+ session: better_auth311.Session;
611
592
  };
612
593
  }>)[];
613
- body: better_auth151.ZodObject<{
614
- userId: better_auth151.ZodCoercedString<unknown>;
615
- }, better_auth151.$strip>;
594
+ body: zod0.ZodObject<{
595
+ userId: zod0.ZodCoercedString<unknown>;
596
+ }, better_auth311.$strip>;
616
597
  metadata: {
617
598
  openapi: {
618
599
  operationId: string;
@@ -640,20 +621,18 @@ declare const supportedBetterAuthClientPlugins: ({
640
621
  };
641
622
  };
642
623
  };
643
- } & {
644
- use: any[];
645
624
  }, {
646
- sessions: better_auth_plugins5.SessionWithImpersonatedBy[];
625
+ sessions: better_auth_plugins43.SessionWithImpersonatedBy[];
647
626
  }>;
648
- unbanUser: better_call0.StrictEndpoint<"/admin/unban-user", {
627
+ unbanUser: better_auth311.StrictEndpoint<"/admin/unban-user", {
649
628
  method: "POST";
650
- body: better_auth151.ZodObject<{
651
- userId: better_auth151.ZodCoercedString<unknown>;
652
- }, better_auth151.$strip>;
653
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
629
+ body: zod0.ZodObject<{
630
+ userId: zod0.ZodCoercedString<unknown>;
631
+ }, better_auth311.$strip>;
632
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
654
633
  session: {
655
- user: better_auth_plugins5.UserWithRole;
656
- session: better_auth151.Session;
634
+ user: better_auth_plugins43.UserWithRole;
635
+ session: better_auth311.Session;
657
636
  };
658
637
  }>)[];
659
638
  metadata: {
@@ -680,30 +659,20 @@ declare const supportedBetterAuthClientPlugins: ({
680
659
  };
681
660
  };
682
661
  };
683
- } & {
684
- use: any[];
685
662
  }, {
686
- user: {
687
- id: string;
688
- createdAt: Date;
689
- updatedAt: Date;
690
- email: string;
691
- emailVerified: boolean;
692
- name: string;
693
- image?: string | null | undefined;
694
- } & Record<string, any>;
663
+ user: better_auth_plugins43.UserWithRole;
695
664
  }>;
696
- banUser: better_call0.StrictEndpoint<"/admin/ban-user", {
665
+ banUser: better_auth311.StrictEndpoint<"/admin/ban-user", {
697
666
  method: "POST";
698
- body: better_auth151.ZodObject<{
699
- userId: better_auth151.ZodCoercedString<unknown>;
700
- banReason: better_auth151.ZodOptional<better_auth151.ZodString>;
701
- banExpiresIn: better_auth151.ZodOptional<better_auth151.ZodNumber>;
702
- }, better_auth151.$strip>;
703
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
667
+ body: zod0.ZodObject<{
668
+ userId: zod0.ZodCoercedString<unknown>;
669
+ banReason: zod0.ZodOptional<zod0.ZodString>;
670
+ banExpiresIn: zod0.ZodOptional<zod0.ZodNumber>;
671
+ }, better_auth311.$strip>;
672
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
704
673
  session: {
705
- user: better_auth_plugins5.UserWithRole;
706
- session: better_auth151.Session;
674
+ user: better_auth_plugins43.UserWithRole;
675
+ session: better_auth311.Session;
707
676
  };
708
677
  }>)[];
709
678
  metadata: {
@@ -730,28 +699,18 @@ declare const supportedBetterAuthClientPlugins: ({
730
699
  };
731
700
  };
732
701
  };
733
- } & {
734
- use: any[];
735
702
  }, {
736
- user: {
737
- id: string;
738
- createdAt: Date;
739
- updatedAt: Date;
740
- email: string;
741
- emailVerified: boolean;
742
- name: string;
743
- image?: string | null | undefined;
744
- } & Record<string, any>;
703
+ user: better_auth_plugins43.UserWithRole;
745
704
  }>;
746
- impersonateUser: better_call0.StrictEndpoint<"/admin/impersonate-user", {
705
+ impersonateUser: better_auth311.StrictEndpoint<"/admin/impersonate-user", {
747
706
  method: "POST";
748
- body: better_auth151.ZodObject<{
749
- userId: better_auth151.ZodCoercedString<unknown>;
750
- }, better_auth151.$strip>;
751
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
707
+ body: zod0.ZodObject<{
708
+ userId: zod0.ZodCoercedString<unknown>;
709
+ }, better_auth311.$strip>;
710
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
752
711
  session: {
753
- user: better_auth_plugins5.UserWithRole;
754
- session: better_auth151.Session;
712
+ user: better_auth_plugins43.UserWithRole;
713
+ session: better_auth311.Session;
755
714
  };
756
715
  }>)[];
757
716
  metadata: {
@@ -781,8 +740,6 @@ declare const supportedBetterAuthClientPlugins: ({
781
740
  };
782
741
  };
783
742
  };
784
- } & {
785
- use: any[];
786
743
  }, {
787
744
  session: {
788
745
  id: string;
@@ -794,26 +751,41 @@ declare const supportedBetterAuthClientPlugins: ({
794
751
  ipAddress?: string | null | undefined;
795
752
  userAgent?: string | null | undefined;
796
753
  };
797
- user: better_auth_plugins5.UserWithRole;
754
+ user: better_auth_plugins43.UserWithRole;
798
755
  }>;
799
- stopImpersonating: better_call0.StrictEndpoint<"/admin/stop-impersonating", {
756
+ stopImpersonating: better_auth311.StrictEndpoint<"/admin/stop-impersonating", {
800
757
  method: "POST";
801
758
  requireHeaders: true;
802
- } & {
803
- use: any[];
804
759
  }, {
805
- session: better_auth151.Session & Record<string, any>;
806
- user: better_auth151.User & Record<string, any>;
760
+ session: {
761
+ id: string;
762
+ createdAt: Date;
763
+ updatedAt: Date;
764
+ userId: string;
765
+ expiresAt: Date;
766
+ token: string;
767
+ ipAddress?: string | null | undefined;
768
+ userAgent?: string | null | undefined;
769
+ } & Record<string, any>;
770
+ user: {
771
+ id: string;
772
+ createdAt: Date;
773
+ updatedAt: Date;
774
+ email: string;
775
+ emailVerified: boolean;
776
+ name: string;
777
+ image?: string | null | undefined;
778
+ } & Record<string, any>;
807
779
  }>;
808
- revokeUserSession: better_call0.StrictEndpoint<"/admin/revoke-user-session", {
780
+ revokeUserSession: better_auth311.StrictEndpoint<"/admin/revoke-user-session", {
809
781
  method: "POST";
810
- body: better_auth151.ZodObject<{
811
- sessionToken: better_auth151.ZodString;
812
- }, better_auth151.$strip>;
813
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
782
+ body: zod0.ZodObject<{
783
+ sessionToken: zod0.ZodString;
784
+ }, better_auth311.$strip>;
785
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
814
786
  session: {
815
- user: better_auth_plugins5.UserWithRole;
816
- session: better_auth151.Session;
787
+ user: better_auth_plugins43.UserWithRole;
788
+ session: better_auth311.Session;
817
789
  };
818
790
  }>)[];
819
791
  metadata: {
@@ -840,20 +812,18 @@ declare const supportedBetterAuthClientPlugins: ({
840
812
  };
841
813
  };
842
814
  };
843
- } & {
844
- use: any[];
845
815
  }, {
846
816
  success: boolean;
847
817
  }>;
848
- revokeUserSessions: better_call0.StrictEndpoint<"/admin/revoke-user-sessions", {
818
+ revokeUserSessions: better_auth311.StrictEndpoint<"/admin/revoke-user-sessions", {
849
819
  method: "POST";
850
- body: better_auth151.ZodObject<{
851
- userId: better_auth151.ZodCoercedString<unknown>;
852
- }, better_auth151.$strip>;
853
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
820
+ body: zod0.ZodObject<{
821
+ userId: zod0.ZodCoercedString<unknown>;
822
+ }, better_auth311.$strip>;
823
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
854
824
  session: {
855
- user: better_auth_plugins5.UserWithRole;
856
- session: better_auth151.Session;
825
+ user: better_auth_plugins43.UserWithRole;
826
+ session: better_auth311.Session;
857
827
  };
858
828
  }>)[];
859
829
  metadata: {
@@ -880,20 +850,18 @@ declare const supportedBetterAuthClientPlugins: ({
880
850
  };
881
851
  };
882
852
  };
883
- } & {
884
- use: any[];
885
853
  }, {
886
854
  success: boolean;
887
855
  }>;
888
- removeUser: better_call0.StrictEndpoint<"/admin/remove-user", {
856
+ removeUser: better_auth311.StrictEndpoint<"/admin/remove-user", {
889
857
  method: "POST";
890
- body: better_auth151.ZodObject<{
891
- userId: better_auth151.ZodCoercedString<unknown>;
892
- }, better_auth151.$strip>;
893
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
858
+ body: zod0.ZodObject<{
859
+ userId: zod0.ZodCoercedString<unknown>;
860
+ }, better_auth311.$strip>;
861
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
894
862
  session: {
895
- user: better_auth_plugins5.UserWithRole;
896
- session: better_auth151.Session;
863
+ user: better_auth_plugins43.UserWithRole;
864
+ session: better_auth311.Session;
897
865
  };
898
866
  }>)[];
899
867
  metadata: {
@@ -920,21 +888,19 @@ declare const supportedBetterAuthClientPlugins: ({
920
888
  };
921
889
  };
922
890
  };
923
- } & {
924
- use: any[];
925
891
  }, {
926
892
  success: boolean;
927
893
  }>;
928
- setUserPassword: better_call0.StrictEndpoint<"/admin/set-user-password", {
894
+ setUserPassword: better_auth311.StrictEndpoint<"/admin/set-user-password", {
929
895
  method: "POST";
930
- body: better_auth151.ZodObject<{
931
- newPassword: better_auth151.ZodString;
932
- userId: better_auth151.ZodCoercedString<unknown>;
933
- }, better_auth151.$strip>;
934
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
896
+ body: zod0.ZodObject<{
897
+ newPassword: zod0.ZodString;
898
+ userId: zod0.ZodCoercedString<unknown>;
899
+ }, better_auth311.$strip>;
900
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<{
935
901
  session: {
936
- user: better_auth_plugins5.UserWithRole;
937
- session: better_auth151.Session;
902
+ user: better_auth_plugins43.UserWithRole;
903
+ session: better_auth311.Session;
938
904
  };
939
905
  }>)[];
940
906
  metadata: {
@@ -961,23 +927,21 @@ declare const supportedBetterAuthClientPlugins: ({
961
927
  };
962
928
  };
963
929
  };
964
- } & {
965
- use: any[];
966
930
  }, {
967
931
  status: boolean;
968
932
  }>;
969
- userHasPermission: better_call0.StrictEndpoint<"/admin/has-permission", {
933
+ userHasPermission: better_auth311.StrictEndpoint<"/admin/has-permission", {
970
934
  method: "POST";
971
- body: better_auth151.ZodIntersection<better_auth151.ZodObject<{
972
- userId: better_auth151.ZodOptional<better_auth151.ZodCoercedString<unknown>>;
973
- role: better_auth151.ZodOptional<better_auth151.ZodString>;
974
- }, better_auth151.$strip>, better_auth151.ZodUnion<readonly [better_auth151.ZodObject<{
975
- permission: better_auth151.ZodRecord<better_auth151.ZodString, better_auth151.ZodArray<better_auth151.ZodString>>;
976
- permissions: better_auth151.ZodUndefined;
977
- }, better_auth151.$strip>, better_auth151.ZodObject<{
978
- permission: better_auth151.ZodUndefined;
979
- permissions: better_auth151.ZodRecord<better_auth151.ZodString, better_auth151.ZodArray<better_auth151.ZodString>>;
980
- }, better_auth151.$strip>]>>;
935
+ body: zod0.ZodIntersection<zod0.ZodObject<{
936
+ userId: zod0.ZodOptional<zod0.ZodCoercedString<unknown>>;
937
+ role: zod0.ZodOptional<zod0.ZodString>;
938
+ }, better_auth311.$strip>, zod0.ZodUnion<readonly [zod0.ZodObject<{
939
+ permission: zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>;
940
+ permissions: zod0.ZodUndefined;
941
+ }, better_auth311.$strip>, zod0.ZodObject<{
942
+ permission: zod0.ZodUndefined;
943
+ permissions: zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>;
944
+ }, better_auth311.$strip>]>>;
981
945
  metadata: {
982
946
  openapi: {
983
947
  description: string;
@@ -1043,8 +1007,6 @@ declare const supportedBetterAuthClientPlugins: ({
1043
1007
  };
1044
1008
  };
1045
1009
  };
1046
- } & {
1047
- use: any[];
1048
1010
  }, {
1049
1011
  error: null;
1050
1012
  success: boolean;
@@ -1071,6 +1033,7 @@ declare const supportedBetterAuthClientPlugins: ({
1071
1033
  readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
1072
1034
  readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
1073
1035
  readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
1036
+ readonly INVALID_ROLE_TYPE: "Invalid role type";
1074
1037
  };
1075
1038
  schema: {
1076
1039
  user: {
@@ -1107,7 +1070,16 @@ declare const supportedBetterAuthClientPlugins: ({
1107
1070
  };
1108
1071
  };
1109
1072
  };
1110
- options: any;
1073
+ options: NoInfer<{
1074
+ ac: better_auth_plugins43.AccessControl<{
1075
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1076
+ readonly session: readonly ["list", "revoke", "delete"];
1077
+ }>;
1078
+ roles: {
1079
+ admin: better_auth_plugins43.Role;
1080
+ user: better_auth_plugins43.Role;
1081
+ };
1082
+ }>;
1111
1083
  };
1112
1084
  getActions: () => {
1113
1085
  admin: {
@@ -1134,8 +1106,8 @@ declare const supportedBetterAuthClientPlugins: ({
1134
1106
  };
1135
1107
  } | {
1136
1108
  id: "organization";
1137
- $InferServerPlugin: better_auth_client11.OrganizationPlugin<{
1138
- ac: better_auth_client11.AccessControl<{
1109
+ $InferServerPlugin: better_auth_plugins43.OrganizationPlugin<{
1110
+ ac: better_auth_plugins43.AccessControl<{
1139
1111
  readonly organization: readonly ["update", "delete"];
1140
1112
  readonly member: readonly ["create", "update", "delete"];
1141
1113
  readonly invitation: readonly ["create", "cancel"];
@@ -1143,9 +1115,9 @@ declare const supportedBetterAuthClientPlugins: ({
1143
1115
  readonly ac: readonly ["create", "read", "update", "delete"];
1144
1116
  }>;
1145
1117
  roles: {
1146
- admin: better_auth_client11.Role;
1147
- member: better_auth_client11.Role;
1148
- owner: better_auth_client11.Role;
1118
+ admin: better_auth_plugins43.Role;
1119
+ member: better_auth_plugins43.Role;
1120
+ owner: better_auth_plugins43.Role;
1149
1121
  };
1150
1122
  teams: {
1151
1123
  enabled: false;
@@ -1153,27 +1125,27 @@ declare const supportedBetterAuthClientPlugins: ({
1153
1125
  schema: {
1154
1126
  organization?: {
1155
1127
  additionalFields?: {
1156
- [key: string]: better_auth151.DBFieldAttribute;
1128
+ [key: string]: better_auth311.DBFieldAttribute;
1157
1129
  };
1158
1130
  };
1159
1131
  member?: {
1160
1132
  additionalFields?: {
1161
- [key: string]: better_auth151.DBFieldAttribute;
1133
+ [key: string]: better_auth311.DBFieldAttribute;
1162
1134
  };
1163
1135
  };
1164
1136
  invitation?: {
1165
1137
  additionalFields?: {
1166
- [key: string]: better_auth151.DBFieldAttribute;
1138
+ [key: string]: better_auth311.DBFieldAttribute;
1167
1139
  };
1168
1140
  };
1169
1141
  team?: {
1170
1142
  additionalFields?: {
1171
- [key: string]: better_auth151.DBFieldAttribute;
1143
+ [key: string]: better_auth311.DBFieldAttribute;
1172
1144
  };
1173
1145
  };
1174
1146
  organizationRole?: {
1175
1147
  additionalFields?: {
1176
- [key: string]: better_auth151.DBFieldAttribute;
1148
+ [key: string]: better_auth311.DBFieldAttribute;
1177
1149
  };
1178
1150
  };
1179
1151
  } | undefined;
@@ -1181,7 +1153,7 @@ declare const supportedBetterAuthClientPlugins: ({
1181
1153
  enabled: false;
1182
1154
  };
1183
1155
  }>;
1184
- getActions: ($fetch: _better_fetch_fetch88.BetterFetch, _$store: better_auth151.ClientStore, co: BetterAuthClientOptions | undefined) => {
1156
+ getActions: ($fetch: _better_fetch_fetch183.BetterFetch, _$store: better_auth311.ClientStore, co: BetterAuthClientOptions | undefined) => {
1185
1157
  $Infer: {
1186
1158
  ActiveOrganization: {
1187
1159
  members: {
@@ -1202,7 +1174,7 @@ declare const supportedBetterAuthClientPlugins: ({
1202
1174
  organizationId: string;
1203
1175
  email: string;
1204
1176
  role: "admin" | "member" | "owner";
1205
- status: better_auth_client11.InvitationStatus;
1177
+ status: better_auth_plugins43.InvitationStatus;
1206
1178
  inviterId: string;
1207
1179
  expiresAt: Date;
1208
1180
  createdAt: Date;
@@ -1228,7 +1200,7 @@ declare const supportedBetterAuthClientPlugins: ({
1228
1200
  organizationId: string;
1229
1201
  email: string;
1230
1202
  role: "admin" | "member" | "owner";
1231
- status: better_auth_client11.InvitationStatus;
1203
+ status: better_auth_plugins43.InvitationStatus;
1232
1204
  inviterId: string;
1233
1205
  expiresAt: Date;
1234
1206
  createdAt: Date;
@@ -1278,93 +1250,61 @@ declare const supportedBetterAuthClientPlugins: ({
1278
1250
  }) => boolean;
1279
1251
  };
1280
1252
  };
1281
- getAtoms: ($fetch: _better_fetch_fetch88.BetterFetch) => {
1282
- $listOrg: nanostores0.PreinitializedWritableAtom<boolean> & object;
1283
- $activeOrgSignal: nanostores0.PreinitializedWritableAtom<boolean> & object;
1284
- $activeMemberSignal: nanostores0.PreinitializedWritableAtom<boolean> & object;
1285
- $activeMemberRoleSignal: nanostores0.PreinitializedWritableAtom<boolean> & object;
1286
- activeOrganization: nanostores0.PreinitializedWritableAtom<{
1287
- data: better_auth151.Prettify<{
1253
+ getAtoms: ($fetch: _better_fetch_fetch183.BetterFetch) => {
1254
+ $listOrg: better_auth_react1.PreinitializedWritableAtom<boolean> & object;
1255
+ $activeOrgSignal: better_auth_react1.PreinitializedWritableAtom<boolean> & object;
1256
+ $activeMemberSignal: better_auth_react1.PreinitializedWritableAtom<boolean> & object;
1257
+ $activeMemberRoleSignal: better_auth_react1.PreinitializedWritableAtom<boolean> & object;
1258
+ activeOrganization: better_auth_client0.AuthQueryAtom<better_auth311.Prettify<{
1259
+ id: string;
1260
+ name: string;
1261
+ slug: string;
1262
+ createdAt: Date;
1263
+ logo?: string | null | undefined | undefined;
1264
+ metadata?: any;
1265
+ } & {
1266
+ members: {
1288
1267
  id: string;
1289
- name: string;
1290
- slug: string;
1268
+ organizationId: string;
1269
+ role: "admin" | "member" | "owner";
1291
1270
  createdAt: Date;
1292
- logo?: string | null | undefined | undefined;
1293
- metadata?: any;
1294
- } & {
1295
- members: {
1296
- id: string;
1297
- organizationId: string;
1298
- role: "admin" | "member" | "owner";
1299
- createdAt: Date;
1300
- userId: string;
1301
- user: {
1302
- id: string;
1303
- email: string;
1304
- name: string;
1305
- image?: string | undefined;
1306
- };
1307
- }[];
1308
- invitations: {
1271
+ userId: string;
1272
+ user: {
1309
1273
  id: string;
1310
- organizationId: string;
1311
1274
  email: string;
1312
- role: "admin" | "member" | "owner";
1313
- status: better_auth_client11.InvitationStatus;
1314
- inviterId: string;
1315
- expiresAt: Date;
1316
- createdAt: Date;
1317
- }[];
1318
- }> | null;
1319
- error: null | _better_fetch_fetch88.BetterFetchError;
1320
- isPending: boolean;
1321
- isRefetching: boolean;
1322
- refetch: (queryParams?: {
1323
- query?: better_auth151.SessionQueryParams;
1324
- } | undefined) => Promise<void>;
1325
- }> & object;
1326
- listOrganizations: nanostores0.PreinitializedWritableAtom<{
1327
- data: {
1328
- id: string;
1329
- name: string;
1330
- slug: string;
1331
- createdAt: Date;
1332
- logo?: string | null | undefined | undefined;
1333
- metadata?: any;
1334
- }[] | null;
1335
- error: null | _better_fetch_fetch88.BetterFetchError;
1336
- isPending: boolean;
1337
- isRefetching: boolean;
1338
- refetch: (queryParams?: {
1339
- query?: better_auth151.SessionQueryParams;
1340
- } | undefined) => Promise<void>;
1341
- }> & object;
1342
- activeMember: nanostores0.PreinitializedWritableAtom<{
1343
- data: {
1275
+ name: string;
1276
+ image?: string | undefined;
1277
+ };
1278
+ }[];
1279
+ invitations: {
1344
1280
  id: string;
1345
1281
  organizationId: string;
1346
- userId: string;
1347
- role: string;
1282
+ email: string;
1283
+ role: "admin" | "member" | "owner";
1284
+ status: better_auth_plugins43.InvitationStatus;
1285
+ inviterId: string;
1286
+ expiresAt: Date;
1348
1287
  createdAt: Date;
1349
- } | null;
1350
- error: null | _better_fetch_fetch88.BetterFetchError;
1351
- isPending: boolean;
1352
- isRefetching: boolean;
1353
- refetch: (queryParams?: {
1354
- query?: better_auth151.SessionQueryParams;
1355
- } | undefined) => Promise<void>;
1356
- }> & object;
1357
- activeMemberRole: nanostores0.PreinitializedWritableAtom<{
1358
- data: {
1359
- role: string;
1360
- } | null;
1361
- error: null | _better_fetch_fetch88.BetterFetchError;
1362
- isPending: boolean;
1363
- isRefetching: boolean;
1364
- refetch: (queryParams?: {
1365
- query?: better_auth151.SessionQueryParams;
1366
- } | undefined) => Promise<void>;
1367
- }> & object;
1288
+ }[];
1289
+ }>>;
1290
+ listOrganizations: better_auth_client0.AuthQueryAtom<{
1291
+ id: string;
1292
+ name: string;
1293
+ slug: string;
1294
+ createdAt: Date;
1295
+ logo?: string | null | undefined | undefined;
1296
+ metadata?: any;
1297
+ }[]>;
1298
+ activeMember: better_auth_client0.AuthQueryAtom<{
1299
+ id: string;
1300
+ organizationId: string;
1301
+ userId: string;
1302
+ role: string;
1303
+ createdAt: Date;
1304
+ }>;
1305
+ activeMemberRole: better_auth_client0.AuthQueryAtom<{
1306
+ role: string;
1307
+ }>;
1368
1308
  };
1369
1309
  pathMethods: {
1370
1310
  "/organization/get-full-organization": "GET";
@@ -1388,13 +1328,13 @@ declare const supportedBetterAuthClientPlugins: ({
1388
1328
  })[];
1389
1329
  } | {
1390
1330
  id: "email-otp";
1391
- $InferServerPlugin: ReturnType<(options: better_auth_plugins5.EmailOTPOptions) => {
1331
+ $InferServerPlugin: ReturnType<(options: better_auth_plugins43.EmailOTPOptions) => {
1392
1332
  id: "email-otp";
1393
- init(ctx: better_auth151.AuthContext): {
1333
+ init(ctx: better_auth311.AuthContext): {
1394
1334
  options: {
1395
1335
  emailVerification: {
1396
1336
  sendVerificationEmail(data: {
1397
- user: better_auth151.User;
1337
+ user: better_auth311.User;
1398
1338
  url: string;
1399
1339
  token: string;
1400
1340
  }, request: Request | undefined): Promise<void>;
@@ -1402,16 +1342,16 @@ declare const supportedBetterAuthClientPlugins: ({
1402
1342
  };
1403
1343
  } | undefined;
1404
1344
  endpoints: {
1405
- sendVerificationOTP: better_call0.StrictEndpoint<"/email-otp/send-verification-otp", {
1345
+ sendVerificationOTP: better_auth311.StrictEndpoint<"/email-otp/send-verification-otp", {
1406
1346
  method: "POST";
1407
- body: better_auth151.ZodObject<{
1408
- email: better_auth151.ZodString;
1409
- type: better_auth151.ZodEnum<{
1347
+ body: zod0.ZodObject<{
1348
+ email: zod0.ZodString;
1349
+ type: zod0.ZodEnum<{
1410
1350
  "sign-in": "sign-in";
1411
1351
  "email-verification": "email-verification";
1412
1352
  "forget-password": "forget-password";
1413
1353
  }>;
1414
- }, better_auth151.$strip>;
1354
+ }, better_auth311.$strip>;
1415
1355
  metadata: {
1416
1356
  openapi: {
1417
1357
  operationId: string;
@@ -1435,23 +1375,20 @@ declare const supportedBetterAuthClientPlugins: ({
1435
1375
  };
1436
1376
  };
1437
1377
  };
1438
- } & {
1439
- use: any[];
1440
1378
  }, {
1441
1379
  success: boolean;
1442
1380
  }>;
1443
- createVerificationOTP: better_call0.StrictEndpoint<"/email-otp/create-verification-otp", {
1381
+ createVerificationOTP: better_auth311.StrictEndpoint<string, {
1444
1382
  method: "POST";
1445
- body: better_auth151.ZodObject<{
1446
- email: better_auth151.ZodString;
1447
- type: better_auth151.ZodEnum<{
1383
+ body: zod0.ZodObject<{
1384
+ email: zod0.ZodString;
1385
+ type: zod0.ZodEnum<{
1448
1386
  "sign-in": "sign-in";
1449
1387
  "email-verification": "email-verification";
1450
1388
  "forget-password": "forget-password";
1451
1389
  }>;
1452
- }, better_auth151.$strip>;
1390
+ }, better_auth311.$strip>;
1453
1391
  metadata: {
1454
- SERVER_ONLY: true;
1455
1392
  openapi: {
1456
1393
  operationId: string;
1457
1394
  description: string;
@@ -1469,21 +1406,18 @@ declare const supportedBetterAuthClientPlugins: ({
1469
1406
  };
1470
1407
  };
1471
1408
  };
1472
- } & {
1473
- use: any[];
1474
1409
  }, string>;
1475
- getVerificationOTP: better_call0.StrictEndpoint<"/email-otp/get-verification-otp", {
1410
+ getVerificationOTP: better_auth311.StrictEndpoint<string, {
1476
1411
  method: "GET";
1477
- query: better_auth151.ZodObject<{
1478
- email: better_auth151.ZodString;
1479
- type: better_auth151.ZodEnum<{
1412
+ query: zod0.ZodObject<{
1413
+ email: zod0.ZodString;
1414
+ type: zod0.ZodEnum<{
1480
1415
  "sign-in": "sign-in";
1481
1416
  "email-verification": "email-verification";
1482
1417
  "forget-password": "forget-password";
1483
1418
  }>;
1484
- }, better_auth151.$strip>;
1419
+ }, better_auth311.$strip>;
1485
1420
  metadata: {
1486
- SERVER_ONLY: true;
1487
1421
  openapi: {
1488
1422
  operationId: string;
1489
1423
  description: string;
@@ -1509,24 +1443,22 @@ declare const supportedBetterAuthClientPlugins: ({
1509
1443
  };
1510
1444
  };
1511
1445
  };
1512
- } & {
1513
- use: any[];
1514
1446
  }, {
1515
1447
  otp: null;
1516
1448
  } | {
1517
1449
  otp: string;
1518
1450
  }>;
1519
- checkVerificationOTP: better_call0.StrictEndpoint<"/email-otp/check-verification-otp", {
1451
+ checkVerificationOTP: better_auth311.StrictEndpoint<"/email-otp/check-verification-otp", {
1520
1452
  method: "POST";
1521
- body: better_auth151.ZodObject<{
1522
- email: better_auth151.ZodString;
1523
- type: better_auth151.ZodEnum<{
1453
+ body: zod0.ZodObject<{
1454
+ email: zod0.ZodString;
1455
+ type: zod0.ZodEnum<{
1524
1456
  "sign-in": "sign-in";
1525
1457
  "email-verification": "email-verification";
1526
1458
  "forget-password": "forget-password";
1527
1459
  }>;
1528
- otp: better_auth151.ZodString;
1529
- }, better_auth151.$strip>;
1460
+ otp: zod0.ZodString;
1461
+ }, better_auth311.$strip>;
1530
1462
  metadata: {
1531
1463
  openapi: {
1532
1464
  operationId: string;
@@ -1550,17 +1482,15 @@ declare const supportedBetterAuthClientPlugins: ({
1550
1482
  };
1551
1483
  };
1552
1484
  };
1553
- } & {
1554
- use: any[];
1555
1485
  }, {
1556
1486
  success: boolean;
1557
1487
  }>;
1558
- verifyEmailOTP: better_call0.StrictEndpoint<"/email-otp/verify-email", {
1488
+ verifyEmailOTP: better_auth311.StrictEndpoint<"/email-otp/verify-email", {
1559
1489
  method: "POST";
1560
- body: better_auth151.ZodObject<{
1561
- email: better_auth151.ZodString;
1562
- otp: better_auth151.ZodString;
1563
- }, better_auth151.$strip>;
1490
+ body: zod0.ZodObject<{
1491
+ email: zod0.ZodString;
1492
+ otp: zod0.ZodString;
1493
+ }, better_auth311.$strip>;
1564
1494
  metadata: {
1565
1495
  openapi: {
1566
1496
  description: string;
@@ -1594,39 +1524,37 @@ declare const supportedBetterAuthClientPlugins: ({
1594
1524
  };
1595
1525
  };
1596
1526
  };
1597
- } & {
1598
- use: any[];
1599
1527
  }, {
1600
1528
  status: boolean;
1601
1529
  token: string;
1602
1530
  user: {
1603
1531
  id: string;
1532
+ createdAt: Date;
1533
+ updatedAt: Date;
1604
1534
  email: string;
1605
1535
  emailVerified: boolean;
1606
1536
  name: string;
1607
- image: string | null | undefined;
1608
- createdAt: Date;
1609
- updatedAt: Date;
1610
- };
1537
+ image?: string | null | undefined;
1538
+ } & Record<string, any>;
1611
1539
  } | {
1612
1540
  status: boolean;
1613
1541
  token: null;
1614
1542
  user: {
1615
1543
  id: string;
1544
+ createdAt: Date;
1545
+ updatedAt: Date;
1616
1546
  email: string;
1617
1547
  emailVerified: boolean;
1618
1548
  name: string;
1619
- image: string | null | undefined;
1620
- createdAt: Date;
1621
- updatedAt: Date;
1622
- };
1549
+ image?: string | null | undefined;
1550
+ } & Record<string, any>;
1623
1551
  }>;
1624
- signInEmailOTP: better_call0.StrictEndpoint<"/sign-in/email-otp", {
1552
+ signInEmailOTP: better_auth311.StrictEndpoint<"/sign-in/email-otp", {
1625
1553
  method: "POST";
1626
- body: better_auth151.ZodObject<{
1627
- email: better_auth151.ZodString;
1628
- otp: better_auth151.ZodString;
1629
- }, better_auth151.$strip>;
1554
+ body: zod0.ZodObject<{
1555
+ email: zod0.ZodString;
1556
+ otp: zod0.ZodString;
1557
+ }, better_auth311.$strip>;
1630
1558
  metadata: {
1631
1559
  openapi: {
1632
1560
  operationId: string;
@@ -1655,25 +1583,55 @@ declare const supportedBetterAuthClientPlugins: ({
1655
1583
  };
1656
1584
  };
1657
1585
  };
1658
- } & {
1659
- use: any[];
1660
1586
  }, {
1661
1587
  token: string;
1662
1588
  user: {
1663
1589
  id: string;
1590
+ createdAt: Date;
1591
+ updatedAt: Date;
1664
1592
  email: string;
1665
1593
  emailVerified: boolean;
1666
1594
  name: string;
1667
- image: string | null | undefined;
1668
- createdAt: Date;
1669
- updatedAt: Date;
1595
+ image?: string | null | undefined;
1670
1596
  };
1671
1597
  }>;
1672
- forgetPasswordEmailOTP: better_call0.StrictEndpoint<"/forget-password/email-otp", {
1598
+ requestPasswordResetEmailOTP: better_auth311.StrictEndpoint<"/email-otp/request-password-reset", {
1673
1599
  method: "POST";
1674
- body: better_auth151.ZodObject<{
1675
- email: better_auth151.ZodString;
1676
- }, better_auth151.$strip>;
1600
+ body: zod0.ZodObject<{
1601
+ email: zod0.ZodString;
1602
+ }, better_auth311.$strip>;
1603
+ metadata: {
1604
+ openapi: {
1605
+ operationId: string;
1606
+ description: string;
1607
+ responses: {
1608
+ 200: {
1609
+ description: string;
1610
+ content: {
1611
+ "application/json": {
1612
+ schema: {
1613
+ type: "object";
1614
+ properties: {
1615
+ success: {
1616
+ type: string;
1617
+ description: string;
1618
+ };
1619
+ };
1620
+ };
1621
+ };
1622
+ };
1623
+ };
1624
+ };
1625
+ };
1626
+ };
1627
+ }, {
1628
+ success: boolean;
1629
+ }>;
1630
+ forgetPasswordEmailOTP: better_auth311.StrictEndpoint<"/forget-password/email-otp", {
1631
+ method: "POST";
1632
+ body: zod0.ZodObject<{
1633
+ email: zod0.ZodString;
1634
+ }, better_auth311.$strip>;
1677
1635
  metadata: {
1678
1636
  openapi: {
1679
1637
  operationId: string;
@@ -1698,18 +1656,16 @@ declare const supportedBetterAuthClientPlugins: ({
1698
1656
  };
1699
1657
  };
1700
1658
  };
1701
- } & {
1702
- use: any[];
1703
1659
  }, {
1704
1660
  success: boolean;
1705
1661
  }>;
1706
- resetPasswordEmailOTP: better_call0.StrictEndpoint<"/email-otp/reset-password", {
1662
+ resetPasswordEmailOTP: better_auth311.StrictEndpoint<"/email-otp/reset-password", {
1707
1663
  method: "POST";
1708
- body: better_auth151.ZodObject<{
1709
- email: better_auth151.ZodString;
1710
- otp: better_auth151.ZodString;
1711
- password: better_auth151.ZodString;
1712
- }, better_auth151.$strip>;
1664
+ body: zod0.ZodObject<{
1665
+ email: zod0.ZodString;
1666
+ otp: zod0.ZodString;
1667
+ password: zod0.ZodString;
1668
+ }, better_auth311.$strip>;
1713
1669
  metadata: {
1714
1670
  openapi: {
1715
1671
  operationId: string;
@@ -1733,16 +1689,14 @@ declare const supportedBetterAuthClientPlugins: ({
1733
1689
  };
1734
1690
  };
1735
1691
  };
1736
- } & {
1737
- use: any[];
1738
1692
  }, {
1739
1693
  success: boolean;
1740
1694
  }>;
1741
1695
  };
1742
1696
  hooks: {
1743
1697
  after: {
1744
- matcher(context: better_auth151.HookEndpointContext): boolean;
1745
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
1698
+ matcher(context: better_auth311.HookEndpointContext): boolean;
1699
+ handler: (inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<void>;
1746
1700
  }[];
1747
1701
  };
1748
1702
  $ERROR_CODES: {
@@ -1766,12 +1720,122 @@ declare const supportedBetterAuthClientPlugins: ({
1766
1720
  pathMatcher(path: string): path is "/sign-in/email-otp";
1767
1721
  window: number;
1768
1722
  max: number;
1723
+ } | {
1724
+ pathMatcher(path: string): path is "/email-otp/request-password-reset";
1725
+ window: number;
1726
+ max: number;
1727
+ } | {
1728
+ pathMatcher(path: string): path is "/email-otp/reset-password";
1729
+ window: number;
1730
+ max: number;
1731
+ } | {
1732
+ pathMatcher(path: string): path is "/forget-password/email-otp";
1733
+ window: number;
1734
+ max: number;
1769
1735
  })[];
1736
+ options: better_auth_plugins43.EmailOTPOptions;
1770
1737
  }>;
1771
1738
  atomListeners: {
1772
1739
  matcher: (path: string) => path is "/email-otp/verify-email" | "/sign-in/email-otp";
1773
1740
  signal: "$sessionSignal";
1774
1741
  }[];
1742
+ } | {
1743
+ id: "magic-link";
1744
+ $InferServerPlugin: ReturnType<(options: better_auth_plugins43.MagicLinkOptions) => {
1745
+ id: "magic-link";
1746
+ endpoints: {
1747
+ signInMagicLink: better_auth311.StrictEndpoint<"/sign-in/magic-link", {
1748
+ method: "POST";
1749
+ requireHeaders: true;
1750
+ body: zod0.ZodObject<{
1751
+ email: zod0.ZodEmail;
1752
+ name: zod0.ZodOptional<zod0.ZodString>;
1753
+ callbackURL: zod0.ZodOptional<zod0.ZodString>;
1754
+ newUserCallbackURL: zod0.ZodOptional<zod0.ZodString>;
1755
+ errorCallbackURL: zod0.ZodOptional<zod0.ZodString>;
1756
+ }, better_auth311.$strip>;
1757
+ metadata: {
1758
+ openapi: {
1759
+ operationId: string;
1760
+ description: string;
1761
+ responses: {
1762
+ 200: {
1763
+ description: string;
1764
+ content: {
1765
+ "application/json": {
1766
+ schema: {
1767
+ type: "object";
1768
+ properties: {
1769
+ status: {
1770
+ type: string;
1771
+ };
1772
+ };
1773
+ };
1774
+ };
1775
+ };
1776
+ };
1777
+ };
1778
+ };
1779
+ };
1780
+ }, {
1781
+ status: boolean;
1782
+ }>;
1783
+ magicLinkVerify: better_auth311.StrictEndpoint<"/magic-link/verify", {
1784
+ method: "GET";
1785
+ query: zod0.ZodObject<{
1786
+ token: zod0.ZodString;
1787
+ callbackURL: zod0.ZodOptional<zod0.ZodString>;
1788
+ errorCallbackURL: zod0.ZodOptional<zod0.ZodString>;
1789
+ newUserCallbackURL: zod0.ZodOptional<zod0.ZodString>;
1790
+ }, better_auth311.$strip>;
1791
+ use: ((inputContext: better_auth311.MiddlewareInputContext<better_auth311.MiddlewareOptions>) => Promise<void>)[];
1792
+ requireHeaders: true;
1793
+ metadata: {
1794
+ openapi: {
1795
+ operationId: string;
1796
+ description: string;
1797
+ responses: {
1798
+ 200: {
1799
+ description: string;
1800
+ content: {
1801
+ "application/json": {
1802
+ schema: {
1803
+ type: "object";
1804
+ properties: {
1805
+ session: {
1806
+ $ref: string;
1807
+ };
1808
+ user: {
1809
+ $ref: string;
1810
+ };
1811
+ };
1812
+ };
1813
+ };
1814
+ };
1815
+ };
1816
+ };
1817
+ };
1818
+ };
1819
+ }, {
1820
+ token: string;
1821
+ user: {
1822
+ id: string;
1823
+ createdAt: Date;
1824
+ updatedAt: Date;
1825
+ email: string;
1826
+ emailVerified: boolean;
1827
+ name: string;
1828
+ image?: string | null | undefined;
1829
+ };
1830
+ }>;
1831
+ };
1832
+ rateLimit: {
1833
+ pathMatcher(path: string): boolean;
1834
+ window: number;
1835
+ max: number;
1836
+ }[];
1837
+ options: better_auth_plugins43.MagicLinkOptions;
1838
+ }>;
1775
1839
  })[];
1776
1840
  type SupportedBetterAuthClientPlugins = typeof supportedBetterAuthClientPlugins;
1777
1841
  declare abstract class NeonAuthAdapterCore {
@@ -1797,4 +1861,4 @@ declare abstract class NeonAuthAdapterCore {
1797
1861
  getJWTToken(allowAnonymous: boolean): Promise<string | null>;
1798
1862
  }
1799
1863
  //#endregion
1800
- export { TeamInput as C, BetterAuthErrorResponse as D, UserWithRole as E, BetterAuthSession as O, Team as S, TeamMemberInput as T, MemberInput as _, BetterAuthInstance as a, OrganizationRole as b, InferAdminRolesFromOption as c, InvitationStatus as d, JWKOptions as f, Member as g, JwtOptions as h, AdminOptions as i, BetterAuthUser as k, Invitation as l, Jwk as m, NeonAuthAdapterCoreAuthOptions as n, BetterFetchError$1 as o, JWSAlgorithms as p, SupportedBetterAuthClientPlugins as r, EmailOTPOptions as s, NeonAuthAdapterCore as t, InvitationInput as u, Organization as v, TeamMember as w, SessionWithImpersonatedBy as x, OrganizationInput as y };
1864
+ export { BetterAuthErrorResponse as A, SessionWithImpersonatedBy as C, TeamMemberInput as D, TeamMember as E, BetterAuthUser as M, UserWithRole as O, ReactBetterAuthClient as S, TeamInput as T, Member as _, BetterAuthInstance as a, OrganizationInput as b, InferAdminRolesFromOption as c, InvitationStatus as d, JWKOptions as f, MagicLinkOptions as g, JwtOptions as h, AdminOptions as i, BetterAuthSession as j, VanillaBetterAuthClient as k, Invitation as l, Jwk as m, NeonAuthAdapterCoreAuthOptions as n, BetterFetchError$1 as o, JWSAlgorithms as p, SupportedBetterAuthClientPlugins as r, EmailOTPOptions as s, NeonAuthAdapterCore as t, InvitationInput as u, MemberInput as v, Team as w, OrganizationRole as x, Organization as y };