@neondatabase/auth 0.1.0-beta.12 → 0.1.0-beta.13
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.
- package/README.md +20 -1
- package/dist/{adapter-core-Bw9mn_AS.d.mts → adapter-core-D1HVvYeG.d.mts} +162 -130
- package/dist/{adapter-core-DODfSw9P.mjs → adapter-core-Ed-EN_tr.mjs} +160 -35
- package/dist/better-auth-react-adapter-C4kQ31os.d.mts +2194 -0
- package/dist/{better-auth-react-adapter-7JyvHiYG.mjs → better-auth-react-adapter-COSlFmvp.mjs} +1 -6
- package/dist/{chunk-5DLVHPZS-Bxj7snpZ-DoVNlsyk.mjs → chunk-5DLVHPZS-Bxj7snpZ-EhdAQJMu.mjs} +2 -2
- package/dist/index.d.mts +9 -3
- package/dist/index.mjs +1 -1
- package/dist/{neon-auth-Bf2NFptR.mjs → neon-auth-BHWfv-bR.mjs} +4 -3
- package/dist/next/index.d.mts +45 -30
- package/dist/next/index.mjs +2 -2
- package/dist/react/adapters/index.d.mts +2 -2
- package/dist/react/adapters/index.mjs +1 -1
- package/dist/react/index.d.mts +2 -2
- package/dist/react/index.mjs +3 -3
- package/dist/react/ui/index.mjs +2 -2
- package/dist/react/ui/server.mjs +1 -1
- package/dist/supabase-adapter-BFja3Oys.d.mts +2280 -0
- package/dist/{supabase-adapter-DdhH8btX.mjs → supabase-adapter-NVDAeWHu.mjs} +1 -11
- package/dist/{ui-aMoA-9nq.mjs → ui-C1IRQzLY.mjs} +49 -49
- package/dist/vanilla/adapters/index.d.mts +2 -2
- package/dist/vanilla/adapters/index.mjs +1 -1
- package/dist/vanilla/index.d.mts +2 -2
- package/dist/vanilla/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/better-auth-react-adapter-JoscqoDc.d.mts +0 -722
- package/dist/supabase-adapter-Clxlqg1x.d.mts +0 -127
|
@@ -1,22 +1,43 @@
|
|
|
1
1
|
import { createAuthClient } from "better-auth/react";
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import * as jose0 from "jose";
|
|
2
|
+
import * as better_auth_client35 from "better-auth/client";
|
|
3
|
+
import { BetterAuthClientOptions, createAuthClient as createAuthClient$1 } from "better-auth/client";
|
|
4
|
+
import * as better_auth_client_plugins17 from "better-auth/client/plugins";
|
|
6
5
|
import * as zod0 from "zod";
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
6
|
+
import * as jose2 from "jose";
|
|
7
|
+
import * as better_auth460 from "better-auth";
|
|
8
|
+
import * as _better_fetch_fetch269 from "@better-fetch/fetch";
|
|
9
|
+
import * as nanostores7 from "nanostores";
|
|
10
10
|
import * as better_call0 from "better-call";
|
|
11
11
|
import * as better_auth_plugins_email_otp0 from "better-auth/plugins/email-otp";
|
|
12
12
|
|
|
13
13
|
//#region src/core/adapter-core.d.ts
|
|
14
14
|
interface NeonAuthAdapterCoreAuthOptions extends Omit<BetterAuthClientOptions, 'plugins'> {}
|
|
15
15
|
declare const supportedBetterAuthClientPlugins: ({
|
|
16
|
+
id: "anonymous-token";
|
|
17
|
+
pathMethods: {
|
|
18
|
+
"/token/anonymous": "GET";
|
|
19
|
+
};
|
|
20
|
+
getActions: ($fetch: _better_fetch_fetch269.BetterFetch) => {
|
|
21
|
+
getAnonymousToken: (fetchOptions?: any) => Promise<{
|
|
22
|
+
data: {
|
|
23
|
+
token: string;
|
|
24
|
+
expires_at: number;
|
|
25
|
+
};
|
|
26
|
+
error: null;
|
|
27
|
+
} | {
|
|
28
|
+
data: null;
|
|
29
|
+
error: {
|
|
30
|
+
message?: string | undefined;
|
|
31
|
+
status: number;
|
|
32
|
+
statusText: string;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
} | {
|
|
16
37
|
id: "better-auth-client";
|
|
17
|
-
$InferServerPlugin: ReturnType<(options?:
|
|
38
|
+
$InferServerPlugin: ReturnType<(options?: better_auth_client_plugins17.JwtOptions | undefined) => {
|
|
18
39
|
id: "jwt";
|
|
19
|
-
options:
|
|
40
|
+
options: better_auth_client_plugins17.JwtOptions | undefined;
|
|
20
41
|
endpoints: {
|
|
21
42
|
getJwks: better_call0.StrictEndpoint<string, {
|
|
22
43
|
method: "GET";
|
|
@@ -96,7 +117,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
96
117
|
};
|
|
97
118
|
} & {
|
|
98
119
|
use: any[];
|
|
99
|
-
},
|
|
120
|
+
}, jose2.JSONWebKeySet>;
|
|
100
121
|
getToken: better_call0.StrictEndpoint<"/token", {
|
|
101
122
|
method: "GET";
|
|
102
123
|
requireHeaders: true;
|
|
@@ -157,15 +178,15 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
157
178
|
SERVER_ONLY: true;
|
|
158
179
|
$Infer: {
|
|
159
180
|
body: {
|
|
160
|
-
payload:
|
|
161
|
-
overrideOptions?:
|
|
181
|
+
payload: jose2.JWTPayload;
|
|
182
|
+
overrideOptions?: better_auth_client_plugins17.JwtOptions | undefined;
|
|
162
183
|
};
|
|
163
184
|
};
|
|
164
185
|
};
|
|
165
186
|
body: zod0.ZodObject<{
|
|
166
187
|
payload: zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>;
|
|
167
188
|
overrideOptions: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>>;
|
|
168
|
-
},
|
|
189
|
+
}, better_auth460.$strip>;
|
|
169
190
|
} & {
|
|
170
191
|
use: any[];
|
|
171
192
|
}, {
|
|
@@ -192,16 +213,16 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
192
213
|
body: zod0.ZodObject<{
|
|
193
214
|
token: zod0.ZodString;
|
|
194
215
|
issuer: zod0.ZodOptional<zod0.ZodString>;
|
|
195
|
-
},
|
|
216
|
+
}, better_auth460.$strip>;
|
|
196
217
|
} & {
|
|
197
218
|
use: any[];
|
|
198
219
|
}, {
|
|
199
|
-
payload: (
|
|
220
|
+
payload: (jose2.JWTPayload & Required<Pick<jose2.JWTPayload, "sub" | "aud">>) | null;
|
|
200
221
|
}>;
|
|
201
222
|
};
|
|
202
223
|
hooks: {
|
|
203
224
|
after: {
|
|
204
|
-
matcher(context:
|
|
225
|
+
matcher(context: better_auth460.HookEndpointContext): boolean;
|
|
205
226
|
handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
|
|
206
227
|
}[];
|
|
207
228
|
};
|
|
@@ -231,7 +252,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
231
252
|
pathMethods: {
|
|
232
253
|
[x: string]: "GET";
|
|
233
254
|
};
|
|
234
|
-
getActions: ($fetch:
|
|
255
|
+
getActions: ($fetch: _better_fetch_fetch269.BetterFetch) => {
|
|
235
256
|
jwks: (fetchOptions?: any) => Promise<{
|
|
236
257
|
data: null;
|
|
237
258
|
error: {
|
|
@@ -240,7 +261,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
240
261
|
statusText: string;
|
|
241
262
|
};
|
|
242
263
|
} | {
|
|
243
|
-
data:
|
|
264
|
+
data: jose2.JSONWebKeySet;
|
|
244
265
|
error: null;
|
|
245
266
|
}>;
|
|
246
267
|
};
|
|
@@ -286,7 +307,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
286
307
|
token: string;
|
|
287
308
|
ipAddress?: string | null | undefined;
|
|
288
309
|
userAgent?: string | null | undefined;
|
|
289
|
-
} & Record<string, unknown>, ctx:
|
|
310
|
+
} & Record<string, unknown>, ctx: better_auth460.GenericEndpointContext | null): Promise<void>;
|
|
290
311
|
};
|
|
291
312
|
};
|
|
292
313
|
};
|
|
@@ -294,8 +315,8 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
294
315
|
};
|
|
295
316
|
hooks: {
|
|
296
317
|
after: {
|
|
297
|
-
matcher(context:
|
|
298
|
-
handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<
|
|
318
|
+
matcher(context: better_auth460.HookEndpointContext): boolean;
|
|
319
|
+
handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<better_auth_client_plugins17.SessionWithImpersonatedBy[] | undefined>;
|
|
299
320
|
}[];
|
|
300
321
|
};
|
|
301
322
|
endpoints: {
|
|
@@ -304,12 +325,12 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
304
325
|
body: zod0.ZodObject<{
|
|
305
326
|
userId: zod0.ZodCoercedString<unknown>;
|
|
306
327
|
role: zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodArray<zod0.ZodString>]>;
|
|
307
|
-
},
|
|
328
|
+
}, better_auth460.$strip>;
|
|
308
329
|
requireHeaders: true;
|
|
309
330
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
310
331
|
session: {
|
|
311
|
-
user:
|
|
312
|
-
session:
|
|
332
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
333
|
+
session: better_auth460.Session;
|
|
313
334
|
};
|
|
314
335
|
}>)[];
|
|
315
336
|
metadata: {
|
|
@@ -345,17 +366,17 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
345
366
|
} & {
|
|
346
367
|
use: any[];
|
|
347
368
|
}, {
|
|
348
|
-
user:
|
|
369
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
349
370
|
}>;
|
|
350
371
|
getUser: better_call0.StrictEndpoint<"/admin/get-user", {
|
|
351
372
|
method: "GET";
|
|
352
373
|
query: zod0.ZodObject<{
|
|
353
374
|
id: zod0.ZodString;
|
|
354
|
-
},
|
|
375
|
+
}, better_auth460.$strip>;
|
|
355
376
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
356
377
|
session: {
|
|
357
|
-
user:
|
|
358
|
-
session:
|
|
378
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
379
|
+
session: better_auth460.Session;
|
|
359
380
|
};
|
|
360
381
|
}>)[];
|
|
361
382
|
metadata: {
|
|
@@ -401,7 +422,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
401
422
|
name: zod0.ZodString;
|
|
402
423
|
role: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodArray<zod0.ZodString>]>>;
|
|
403
424
|
data: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>>;
|
|
404
|
-
},
|
|
425
|
+
}, better_auth460.$strip>;
|
|
405
426
|
metadata: {
|
|
406
427
|
openapi: {
|
|
407
428
|
operationId: string;
|
|
@@ -438,18 +459,18 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
438
459
|
} & {
|
|
439
460
|
use: any[];
|
|
440
461
|
}, {
|
|
441
|
-
user:
|
|
462
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
442
463
|
}>;
|
|
443
464
|
adminUpdateUser: better_call0.StrictEndpoint<"/admin/update-user", {
|
|
444
465
|
method: "POST";
|
|
445
466
|
body: zod0.ZodObject<{
|
|
446
467
|
userId: zod0.ZodCoercedString<unknown>;
|
|
447
468
|
data: zod0.ZodRecord<zod0.ZodAny, zod0.ZodAny>;
|
|
448
|
-
},
|
|
469
|
+
}, better_auth460.$strip>;
|
|
449
470
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
450
471
|
session: {
|
|
451
|
-
user:
|
|
452
|
-
session:
|
|
472
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
473
|
+
session: better_auth460.Session;
|
|
453
474
|
};
|
|
454
475
|
}>)[];
|
|
455
476
|
metadata: {
|
|
@@ -478,13 +499,13 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
478
499
|
};
|
|
479
500
|
} & {
|
|
480
501
|
use: any[];
|
|
481
|
-
},
|
|
502
|
+
}, better_auth_client_plugins17.UserWithRole>;
|
|
482
503
|
listUsers: better_call0.StrictEndpoint<"/admin/list-users", {
|
|
483
504
|
method: "GET";
|
|
484
505
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
485
506
|
session: {
|
|
486
|
-
user:
|
|
487
|
-
session:
|
|
507
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
508
|
+
session: better_auth460.Session;
|
|
488
509
|
};
|
|
489
510
|
}>)[];
|
|
490
511
|
query: zod0.ZodObject<{
|
|
@@ -516,7 +537,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
516
537
|
gte: "gte";
|
|
517
538
|
contains: "contains";
|
|
518
539
|
}>>;
|
|
519
|
-
},
|
|
540
|
+
}, better_auth460.$strip>;
|
|
520
541
|
metadata: {
|
|
521
542
|
openapi: {
|
|
522
543
|
operationId: string;
|
|
@@ -557,7 +578,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
557
578
|
} & {
|
|
558
579
|
use: any[];
|
|
559
580
|
}, {
|
|
560
|
-
users:
|
|
581
|
+
users: better_auth_client_plugins17.UserWithRole[];
|
|
561
582
|
total: number;
|
|
562
583
|
limit: number | undefined;
|
|
563
584
|
offset: number | undefined;
|
|
@@ -569,13 +590,13 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
569
590
|
method: "POST";
|
|
570
591
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
571
592
|
session: {
|
|
572
|
-
user:
|
|
573
|
-
session:
|
|
593
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
594
|
+
session: better_auth460.Session;
|
|
574
595
|
};
|
|
575
596
|
}>)[];
|
|
576
597
|
body: zod0.ZodObject<{
|
|
577
598
|
userId: zod0.ZodCoercedString<unknown>;
|
|
578
|
-
},
|
|
599
|
+
}, better_auth460.$strip>;
|
|
579
600
|
metadata: {
|
|
580
601
|
openapi: {
|
|
581
602
|
operationId: string;
|
|
@@ -606,17 +627,17 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
606
627
|
} & {
|
|
607
628
|
use: any[];
|
|
608
629
|
}, {
|
|
609
|
-
sessions:
|
|
630
|
+
sessions: better_auth_client_plugins17.SessionWithImpersonatedBy[];
|
|
610
631
|
}>;
|
|
611
632
|
unbanUser: better_call0.StrictEndpoint<"/admin/unban-user", {
|
|
612
633
|
method: "POST";
|
|
613
634
|
body: zod0.ZodObject<{
|
|
614
635
|
userId: zod0.ZodCoercedString<unknown>;
|
|
615
|
-
},
|
|
636
|
+
}, better_auth460.$strip>;
|
|
616
637
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
617
638
|
session: {
|
|
618
|
-
user:
|
|
619
|
-
session:
|
|
639
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
640
|
+
session: better_auth460.Session;
|
|
620
641
|
};
|
|
621
642
|
}>)[];
|
|
622
643
|
metadata: {
|
|
@@ -662,11 +683,11 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
662
683
|
userId: zod0.ZodCoercedString<unknown>;
|
|
663
684
|
banReason: zod0.ZodOptional<zod0.ZodString>;
|
|
664
685
|
banExpiresIn: zod0.ZodOptional<zod0.ZodNumber>;
|
|
665
|
-
},
|
|
686
|
+
}, better_auth460.$strip>;
|
|
666
687
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
667
688
|
session: {
|
|
668
|
-
user:
|
|
669
|
-
session:
|
|
689
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
690
|
+
session: better_auth460.Session;
|
|
670
691
|
};
|
|
671
692
|
}>)[];
|
|
672
693
|
metadata: {
|
|
@@ -710,11 +731,11 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
710
731
|
method: "POST";
|
|
711
732
|
body: zod0.ZodObject<{
|
|
712
733
|
userId: zod0.ZodCoercedString<unknown>;
|
|
713
|
-
},
|
|
734
|
+
}, better_auth460.$strip>;
|
|
714
735
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
715
736
|
session: {
|
|
716
|
-
user:
|
|
717
|
-
session:
|
|
737
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
738
|
+
session: better_auth460.Session;
|
|
718
739
|
};
|
|
719
740
|
}>)[];
|
|
720
741
|
metadata: {
|
|
@@ -757,7 +778,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
757
778
|
ipAddress?: string | null | undefined;
|
|
758
779
|
userAgent?: string | null | undefined;
|
|
759
780
|
};
|
|
760
|
-
user:
|
|
781
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
761
782
|
}>;
|
|
762
783
|
stopImpersonating: better_call0.StrictEndpoint<"/admin/stop-impersonating", {
|
|
763
784
|
method: "POST";
|
|
@@ -765,18 +786,18 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
765
786
|
} & {
|
|
766
787
|
use: any[];
|
|
767
788
|
}, {
|
|
768
|
-
session:
|
|
769
|
-
user:
|
|
789
|
+
session: better_auth460.Session & Record<string, any>;
|
|
790
|
+
user: better_auth460.User & Record<string, any>;
|
|
770
791
|
}>;
|
|
771
792
|
revokeUserSession: better_call0.StrictEndpoint<"/admin/revoke-user-session", {
|
|
772
793
|
method: "POST";
|
|
773
794
|
body: zod0.ZodObject<{
|
|
774
795
|
sessionToken: zod0.ZodString;
|
|
775
|
-
},
|
|
796
|
+
}, better_auth460.$strip>;
|
|
776
797
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
777
798
|
session: {
|
|
778
|
-
user:
|
|
779
|
-
session:
|
|
799
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
800
|
+
session: better_auth460.Session;
|
|
780
801
|
};
|
|
781
802
|
}>)[];
|
|
782
803
|
metadata: {
|
|
@@ -812,11 +833,11 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
812
833
|
method: "POST";
|
|
813
834
|
body: zod0.ZodObject<{
|
|
814
835
|
userId: zod0.ZodCoercedString<unknown>;
|
|
815
|
-
},
|
|
836
|
+
}, better_auth460.$strip>;
|
|
816
837
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
817
838
|
session: {
|
|
818
|
-
user:
|
|
819
|
-
session:
|
|
839
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
840
|
+
session: better_auth460.Session;
|
|
820
841
|
};
|
|
821
842
|
}>)[];
|
|
822
843
|
metadata: {
|
|
@@ -852,11 +873,11 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
852
873
|
method: "POST";
|
|
853
874
|
body: zod0.ZodObject<{
|
|
854
875
|
userId: zod0.ZodCoercedString<unknown>;
|
|
855
|
-
},
|
|
876
|
+
}, better_auth460.$strip>;
|
|
856
877
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
857
878
|
session: {
|
|
858
|
-
user:
|
|
859
|
-
session:
|
|
879
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
880
|
+
session: better_auth460.Session;
|
|
860
881
|
};
|
|
861
882
|
}>)[];
|
|
862
883
|
metadata: {
|
|
@@ -893,11 +914,11 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
893
914
|
body: zod0.ZodObject<{
|
|
894
915
|
newPassword: zod0.ZodString;
|
|
895
916
|
userId: zod0.ZodCoercedString<unknown>;
|
|
896
|
-
},
|
|
917
|
+
}, better_auth460.$strip>;
|
|
897
918
|
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
898
919
|
session: {
|
|
899
|
-
user:
|
|
900
|
-
session:
|
|
920
|
+
user: better_auth_client_plugins17.UserWithRole;
|
|
921
|
+
session: better_auth460.Session;
|
|
901
922
|
};
|
|
902
923
|
}>)[];
|
|
903
924
|
metadata: {
|
|
@@ -934,13 +955,13 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
934
955
|
body: zod0.ZodIntersection<zod0.ZodObject<{
|
|
935
956
|
userId: zod0.ZodOptional<zod0.ZodCoercedString<unknown>>;
|
|
936
957
|
role: zod0.ZodOptional<zod0.ZodString>;
|
|
937
|
-
},
|
|
958
|
+
}, better_auth460.$strip>, zod0.ZodUnion<readonly [zod0.ZodObject<{
|
|
938
959
|
permission: zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>;
|
|
939
960
|
permissions: zod0.ZodUndefined;
|
|
940
|
-
},
|
|
961
|
+
}, better_auth460.$strip>, zod0.ZodObject<{
|
|
941
962
|
permission: zod0.ZodUndefined;
|
|
942
963
|
permissions: zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>;
|
|
943
|
-
},
|
|
964
|
+
}, better_auth460.$strip>]>>;
|
|
944
965
|
metadata: {
|
|
945
966
|
openapi: {
|
|
946
967
|
description: string;
|
|
@@ -990,14 +1011,14 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
990
1011
|
$Infer: {
|
|
991
1012
|
body: ({
|
|
992
1013
|
permission: {
|
|
993
|
-
readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "
|
|
994
|
-
readonly session?: ("
|
|
1014
|
+
readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
|
|
1015
|
+
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
995
1016
|
};
|
|
996
1017
|
permissions?: never | undefined;
|
|
997
1018
|
} | {
|
|
998
1019
|
permissions: {
|
|
999
|
-
readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "
|
|
1000
|
-
readonly session?: ("
|
|
1020
|
+
readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
|
|
1021
|
+
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
1001
1022
|
};
|
|
1002
1023
|
permission?: never | undefined;
|
|
1003
1024
|
}) & {
|
|
@@ -1076,14 +1097,14 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1076
1097
|
admin: {
|
|
1077
1098
|
checkRolePermission: <R extends "user" | "admin">(data: ({
|
|
1078
1099
|
permission: {
|
|
1079
|
-
readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "
|
|
1080
|
-
readonly session?: ("
|
|
1100
|
+
readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
|
|
1101
|
+
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
1081
1102
|
};
|
|
1082
1103
|
permissions?: never | undefined;
|
|
1083
1104
|
} | {
|
|
1084
1105
|
permissions: {
|
|
1085
|
-
readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "
|
|
1086
|
-
readonly session?: ("
|
|
1106
|
+
readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
|
|
1107
|
+
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
1087
1108
|
};
|
|
1088
1109
|
permission?: never | undefined;
|
|
1089
1110
|
}) & {
|
|
@@ -1097,8 +1118,8 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1097
1118
|
};
|
|
1098
1119
|
} | {
|
|
1099
1120
|
id: "organization";
|
|
1100
|
-
$InferServerPlugin:
|
|
1101
|
-
ac:
|
|
1121
|
+
$InferServerPlugin: better_auth_client35.OrganizationPlugin<{
|
|
1122
|
+
ac: better_auth_client35.AccessControl<{
|
|
1102
1123
|
readonly organization: readonly ["update", "delete"];
|
|
1103
1124
|
readonly member: readonly ["create", "update", "delete"];
|
|
1104
1125
|
readonly invitation: readonly ["create", "cancel"];
|
|
@@ -1106,9 +1127,9 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1106
1127
|
readonly ac: readonly ["create", "read", "update", "delete"];
|
|
1107
1128
|
}>;
|
|
1108
1129
|
roles: {
|
|
1109
|
-
admin:
|
|
1110
|
-
member:
|
|
1111
|
-
owner:
|
|
1130
|
+
admin: better_auth_client35.Role;
|
|
1131
|
+
member: better_auth_client35.Role;
|
|
1132
|
+
owner: better_auth_client35.Role;
|
|
1112
1133
|
};
|
|
1113
1134
|
teams: {
|
|
1114
1135
|
enabled: false;
|
|
@@ -1116,27 +1137,27 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1116
1137
|
schema: {
|
|
1117
1138
|
organization?: {
|
|
1118
1139
|
additionalFields?: {
|
|
1119
|
-
[key: string]:
|
|
1140
|
+
[key: string]: better_auth460.DBFieldAttribute;
|
|
1120
1141
|
};
|
|
1121
1142
|
};
|
|
1122
1143
|
member?: {
|
|
1123
1144
|
additionalFields?: {
|
|
1124
|
-
[key: string]:
|
|
1145
|
+
[key: string]: better_auth460.DBFieldAttribute;
|
|
1125
1146
|
};
|
|
1126
1147
|
};
|
|
1127
1148
|
invitation?: {
|
|
1128
1149
|
additionalFields?: {
|
|
1129
|
-
[key: string]:
|
|
1150
|
+
[key: string]: better_auth460.DBFieldAttribute;
|
|
1130
1151
|
};
|
|
1131
1152
|
};
|
|
1132
1153
|
team?: {
|
|
1133
1154
|
additionalFields?: {
|
|
1134
|
-
[key: string]:
|
|
1155
|
+
[key: string]: better_auth460.DBFieldAttribute;
|
|
1135
1156
|
};
|
|
1136
1157
|
};
|
|
1137
1158
|
organizationRole?: {
|
|
1138
1159
|
additionalFields?: {
|
|
1139
|
-
[key: string]:
|
|
1160
|
+
[key: string]: better_auth460.DBFieldAttribute;
|
|
1140
1161
|
};
|
|
1141
1162
|
};
|
|
1142
1163
|
} | undefined;
|
|
@@ -1144,7 +1165,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1144
1165
|
enabled: false;
|
|
1145
1166
|
};
|
|
1146
1167
|
}>;
|
|
1147
|
-
getActions: ($fetch:
|
|
1168
|
+
getActions: ($fetch: _better_fetch_fetch269.BetterFetch, _$store: better_auth460.ClientStore, co: BetterAuthClientOptions | undefined) => {
|
|
1148
1169
|
$Infer: {
|
|
1149
1170
|
ActiveOrganization: {
|
|
1150
1171
|
members: {
|
|
@@ -1165,7 +1186,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1165
1186
|
organizationId: string;
|
|
1166
1187
|
email: string;
|
|
1167
1188
|
role: "admin" | "member" | "owner";
|
|
1168
|
-
status:
|
|
1189
|
+
status: better_auth_client35.InvitationStatus;
|
|
1169
1190
|
inviterId: string;
|
|
1170
1191
|
expiresAt: Date;
|
|
1171
1192
|
createdAt: Date;
|
|
@@ -1191,7 +1212,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1191
1212
|
organizationId: string;
|
|
1192
1213
|
email: string;
|
|
1193
1214
|
role: "admin" | "member" | "owner";
|
|
1194
|
-
status:
|
|
1215
|
+
status: better_auth_client35.InvitationStatus;
|
|
1195
1216
|
inviterId: string;
|
|
1196
1217
|
expiresAt: Date;
|
|
1197
1218
|
createdAt: Date;
|
|
@@ -1221,19 +1242,19 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1221
1242
|
checkRolePermission: <R extends "admin" | "member" | "owner">(data: ({
|
|
1222
1243
|
permission: {
|
|
1223
1244
|
readonly organization?: ("delete" | "update")[] | undefined;
|
|
1224
|
-
readonly member?: ("
|
|
1245
|
+
readonly member?: ("delete" | "create" | "update")[] | undefined;
|
|
1225
1246
|
readonly invitation?: ("create" | "cancel")[] | undefined;
|
|
1226
|
-
readonly team?: ("
|
|
1227
|
-
readonly ac?: ("
|
|
1247
|
+
readonly team?: ("delete" | "create" | "update")[] | undefined;
|
|
1248
|
+
readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
|
|
1228
1249
|
};
|
|
1229
1250
|
permissions?: never | undefined;
|
|
1230
1251
|
} | {
|
|
1231
1252
|
permissions: {
|
|
1232
1253
|
readonly organization?: ("delete" | "update")[] | undefined;
|
|
1233
|
-
readonly member?: ("
|
|
1254
|
+
readonly member?: ("delete" | "create" | "update")[] | undefined;
|
|
1234
1255
|
readonly invitation?: ("create" | "cancel")[] | undefined;
|
|
1235
|
-
readonly team?: ("
|
|
1236
|
-
readonly ac?: ("
|
|
1256
|
+
readonly team?: ("delete" | "create" | "update")[] | undefined;
|
|
1257
|
+
readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
|
|
1237
1258
|
};
|
|
1238
1259
|
permission?: never | undefined;
|
|
1239
1260
|
}) & {
|
|
@@ -1241,13 +1262,13 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1241
1262
|
}) => boolean;
|
|
1242
1263
|
};
|
|
1243
1264
|
};
|
|
1244
|
-
getAtoms: ($fetch:
|
|
1245
|
-
$listOrg:
|
|
1246
|
-
$activeOrgSignal:
|
|
1247
|
-
$activeMemberSignal:
|
|
1248
|
-
$activeMemberRoleSignal:
|
|
1249
|
-
activeOrganization:
|
|
1250
|
-
data:
|
|
1265
|
+
getAtoms: ($fetch: _better_fetch_fetch269.BetterFetch) => {
|
|
1266
|
+
$listOrg: nanostores7.PreinitializedWritableAtom<boolean> & object;
|
|
1267
|
+
$activeOrgSignal: nanostores7.PreinitializedWritableAtom<boolean> & object;
|
|
1268
|
+
$activeMemberSignal: nanostores7.PreinitializedWritableAtom<boolean> & object;
|
|
1269
|
+
$activeMemberRoleSignal: nanostores7.PreinitializedWritableAtom<boolean> & object;
|
|
1270
|
+
activeOrganization: nanostores7.PreinitializedWritableAtom<{
|
|
1271
|
+
data: better_auth460.Prettify<{
|
|
1251
1272
|
id: string;
|
|
1252
1273
|
name: string;
|
|
1253
1274
|
slug: string;
|
|
@@ -1273,20 +1294,20 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1273
1294
|
organizationId: string;
|
|
1274
1295
|
email: string;
|
|
1275
1296
|
role: "admin" | "member" | "owner";
|
|
1276
|
-
status:
|
|
1297
|
+
status: better_auth_client35.InvitationStatus;
|
|
1277
1298
|
inviterId: string;
|
|
1278
1299
|
expiresAt: Date;
|
|
1279
1300
|
createdAt: Date;
|
|
1280
1301
|
}[];
|
|
1281
1302
|
}> | null;
|
|
1282
|
-
error: null |
|
|
1303
|
+
error: null | _better_fetch_fetch269.BetterFetchError;
|
|
1283
1304
|
isPending: boolean;
|
|
1284
1305
|
isRefetching: boolean;
|
|
1285
1306
|
refetch: (queryParams?: {
|
|
1286
|
-
query?:
|
|
1307
|
+
query?: better_auth460.SessionQueryParams;
|
|
1287
1308
|
} | undefined) => Promise<void>;
|
|
1288
1309
|
}> & object;
|
|
1289
|
-
listOrganizations:
|
|
1310
|
+
listOrganizations: nanostores7.PreinitializedWritableAtom<{
|
|
1290
1311
|
data: {
|
|
1291
1312
|
id: string;
|
|
1292
1313
|
name: string;
|
|
@@ -1295,14 +1316,14 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1295
1316
|
logo?: string | null | undefined | undefined;
|
|
1296
1317
|
metadata?: any;
|
|
1297
1318
|
}[] | null;
|
|
1298
|
-
error: null |
|
|
1319
|
+
error: null | _better_fetch_fetch269.BetterFetchError;
|
|
1299
1320
|
isPending: boolean;
|
|
1300
1321
|
isRefetching: boolean;
|
|
1301
1322
|
refetch: (queryParams?: {
|
|
1302
|
-
query?:
|
|
1323
|
+
query?: better_auth460.SessionQueryParams;
|
|
1303
1324
|
} | undefined) => Promise<void>;
|
|
1304
1325
|
}> & object;
|
|
1305
|
-
activeMember:
|
|
1326
|
+
activeMember: nanostores7.PreinitializedWritableAtom<{
|
|
1306
1327
|
data: {
|
|
1307
1328
|
id: string;
|
|
1308
1329
|
organizationId: string;
|
|
@@ -1310,22 +1331,22 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1310
1331
|
role: string;
|
|
1311
1332
|
createdAt: Date;
|
|
1312
1333
|
} | null;
|
|
1313
|
-
error: null |
|
|
1334
|
+
error: null | _better_fetch_fetch269.BetterFetchError;
|
|
1314
1335
|
isPending: boolean;
|
|
1315
1336
|
isRefetching: boolean;
|
|
1316
1337
|
refetch: (queryParams?: {
|
|
1317
|
-
query?:
|
|
1338
|
+
query?: better_auth460.SessionQueryParams;
|
|
1318
1339
|
} | undefined) => Promise<void>;
|
|
1319
1340
|
}> & object;
|
|
1320
|
-
activeMemberRole:
|
|
1341
|
+
activeMemberRole: nanostores7.PreinitializedWritableAtom<{
|
|
1321
1342
|
data: {
|
|
1322
1343
|
role: string;
|
|
1323
1344
|
} | null;
|
|
1324
|
-
error: null |
|
|
1345
|
+
error: null | _better_fetch_fetch269.BetterFetchError;
|
|
1325
1346
|
isPending: boolean;
|
|
1326
1347
|
isRefetching: boolean;
|
|
1327
1348
|
refetch: (queryParams?: {
|
|
1328
|
-
query?:
|
|
1349
|
+
query?: better_auth460.SessionQueryParams;
|
|
1329
1350
|
} | undefined) => Promise<void>;
|
|
1330
1351
|
}> & object;
|
|
1331
1352
|
};
|
|
@@ -1353,11 +1374,11 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1353
1374
|
id: "email-otp";
|
|
1354
1375
|
$InferServerPlugin: ReturnType<(options: better_auth_plugins_email_otp0.EmailOTPOptions) => {
|
|
1355
1376
|
id: "email-otp";
|
|
1356
|
-
init(ctx:
|
|
1377
|
+
init(ctx: better_auth460.AuthContext): {
|
|
1357
1378
|
options: {
|
|
1358
1379
|
emailVerification: {
|
|
1359
1380
|
sendVerificationEmail(data: {
|
|
1360
|
-
user:
|
|
1381
|
+
user: better_auth460.User;
|
|
1361
1382
|
url: string;
|
|
1362
1383
|
token: string;
|
|
1363
1384
|
}, request: Request | undefined): Promise<void>;
|
|
@@ -1374,7 +1395,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1374
1395
|
"email-verification": "email-verification";
|
|
1375
1396
|
"forget-password": "forget-password";
|
|
1376
1397
|
}>;
|
|
1377
|
-
},
|
|
1398
|
+
}, better_auth460.$strip>;
|
|
1378
1399
|
metadata: {
|
|
1379
1400
|
openapi: {
|
|
1380
1401
|
operationId: string;
|
|
@@ -1412,7 +1433,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1412
1433
|
"email-verification": "email-verification";
|
|
1413
1434
|
"forget-password": "forget-password";
|
|
1414
1435
|
}>;
|
|
1415
|
-
},
|
|
1436
|
+
}, better_auth460.$strip>;
|
|
1416
1437
|
metadata: {
|
|
1417
1438
|
SERVER_ONLY: true;
|
|
1418
1439
|
openapi: {
|
|
@@ -1444,7 +1465,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1444
1465
|
"email-verification": "email-verification";
|
|
1445
1466
|
"forget-password": "forget-password";
|
|
1446
1467
|
}>;
|
|
1447
|
-
},
|
|
1468
|
+
}, better_auth460.$strip>;
|
|
1448
1469
|
metadata: {
|
|
1449
1470
|
SERVER_ONLY: true;
|
|
1450
1471
|
openapi: {
|
|
@@ -1489,7 +1510,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1489
1510
|
"forget-password": "forget-password";
|
|
1490
1511
|
}>;
|
|
1491
1512
|
otp: zod0.ZodString;
|
|
1492
|
-
},
|
|
1513
|
+
}, better_auth460.$strip>;
|
|
1493
1514
|
metadata: {
|
|
1494
1515
|
openapi: {
|
|
1495
1516
|
operationId: string;
|
|
@@ -1523,7 +1544,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1523
1544
|
body: zod0.ZodObject<{
|
|
1524
1545
|
email: zod0.ZodString;
|
|
1525
1546
|
otp: zod0.ZodString;
|
|
1526
|
-
},
|
|
1547
|
+
}, better_auth460.$strip>;
|
|
1527
1548
|
metadata: {
|
|
1528
1549
|
openapi: {
|
|
1529
1550
|
description: string;
|
|
@@ -1589,7 +1610,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1589
1610
|
body: zod0.ZodObject<{
|
|
1590
1611
|
email: zod0.ZodString;
|
|
1591
1612
|
otp: zod0.ZodString;
|
|
1592
|
-
},
|
|
1613
|
+
}, better_auth460.$strip>;
|
|
1593
1614
|
metadata: {
|
|
1594
1615
|
openapi: {
|
|
1595
1616
|
operationId: string;
|
|
@@ -1636,7 +1657,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1636
1657
|
method: "POST";
|
|
1637
1658
|
body: zod0.ZodObject<{
|
|
1638
1659
|
email: zod0.ZodString;
|
|
1639
|
-
},
|
|
1660
|
+
}, better_auth460.$strip>;
|
|
1640
1661
|
metadata: {
|
|
1641
1662
|
openapi: {
|
|
1642
1663
|
operationId: string;
|
|
@@ -1672,7 +1693,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1672
1693
|
email: zod0.ZodString;
|
|
1673
1694
|
otp: zod0.ZodString;
|
|
1674
1695
|
password: zod0.ZodString;
|
|
1675
|
-
},
|
|
1696
|
+
}, better_auth460.$strip>;
|
|
1676
1697
|
metadata: {
|
|
1677
1698
|
openapi: {
|
|
1678
1699
|
operationId: string;
|
|
@@ -1704,7 +1725,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1704
1725
|
};
|
|
1705
1726
|
hooks: {
|
|
1706
1727
|
after: {
|
|
1707
|
-
matcher(context:
|
|
1728
|
+
matcher(context: better_auth460.HookEndpointContext): boolean;
|
|
1708
1729
|
handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
|
|
1709
1730
|
}[];
|
|
1710
1731
|
};
|
|
@@ -1737,7 +1758,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1737
1758
|
}[];
|
|
1738
1759
|
} | {
|
|
1739
1760
|
id: "anonymous";
|
|
1740
|
-
$InferServerPlugin: ReturnType<(options?:
|
|
1761
|
+
$InferServerPlugin: ReturnType<(options?: better_auth_client_plugins17.AnonymousOptions | undefined) => {
|
|
1741
1762
|
id: "anonymous";
|
|
1742
1763
|
endpoints: {
|
|
1743
1764
|
signInAnonymous: better_call0.StrictEndpoint<"/sign-in/anonymous", {
|
|
@@ -1783,7 +1804,7 @@ declare const supportedBetterAuthClientPlugins: ({
|
|
|
1783
1804
|
};
|
|
1784
1805
|
hooks: {
|
|
1785
1806
|
after: {
|
|
1786
|
-
matcher(ctx:
|
|
1807
|
+
matcher(ctx: better_auth460.HookEndpointContext): boolean;
|
|
1787
1808
|
handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
|
|
1788
1809
|
}[];
|
|
1789
1810
|
};
|
|
@@ -1827,8 +1848,19 @@ declare abstract class NeonAuthAdapterCore {
|
|
|
1827
1848
|
* See CLAUDE.md for architecture details and API mappings.
|
|
1828
1849
|
*/
|
|
1829
1850
|
constructor(betterAuthClientOptions: NeonAuthAdapterCoreAuthOptions);
|
|
1830
|
-
abstract getBetterAuthInstance
|
|
1831
|
-
|
|
1851
|
+
abstract getBetterAuthInstance(): ReturnType<typeof createAuthClient$1<{
|
|
1852
|
+
plugins: SupportedBetterAuthClientPlugins;
|
|
1853
|
+
}> | typeof createAuthClient<{
|
|
1854
|
+
plugins: SupportedBetterAuthClientPlugins;
|
|
1855
|
+
}>>;
|
|
1856
|
+
/**
|
|
1857
|
+
* Get JWT token for authenticated or anonymous access.
|
|
1858
|
+
* Single source of truth for token retrieval logic.
|
|
1859
|
+
*
|
|
1860
|
+
* @param allowAnonymous - When true, fetches anonymous token if no session exists
|
|
1861
|
+
* @returns JWT token string or null if unavailable
|
|
1862
|
+
*/
|
|
1863
|
+
getJWTToken(allowAnonymous: boolean): Promise<string | null>;
|
|
1832
1864
|
}
|
|
1833
1865
|
//#endregion
|
|
1834
1866
|
export { NeonAuthAdapterCoreAuthOptions as n, SupportedBetterAuthClientPlugins as r, NeonAuthAdapterCore as t };
|