@neondatabase/auth 0.1.0-beta.2 → 0.1.0-beta.21

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 (45) hide show
  1. package/README.md +112 -18
  2. package/dist/{adapter-core-BDOw-gBC.mjs → adapter-core-PD5NQpLE.mjs} +392 -69
  3. package/dist/{adapter-core-C12KoaiU.d.mts → adapter-core-y53SWo8w.d.mts} +181 -627
  4. package/dist/{better-auth-react-adapter-FnBHa2nr.mjs → better-auth-react-adapter-B0XIXPUH.mjs} +10 -8
  5. package/dist/better-auth-react-adapter-B7zoQmoL.d.mts +2170 -0
  6. package/dist/chunk-VCZJYX65-CLnrj1o7-D6ZQkcc_.mjs +543 -0
  7. package/dist/constants-2bpp2_-f.mjs +30 -0
  8. package/dist/index.d.mts +4 -98
  9. package/dist/index.mjs +2 -1
  10. package/dist/{neon-auth-C9XTFffv.mjs → neon-auth-DUbqaO2v.mjs} +7 -4
  11. package/dist/neon-auth-oDgy6lQm.d.mts +107 -0
  12. package/dist/next/index.d.mts +76 -303
  13. package/dist/next/index.mjs +6 -174
  14. package/dist/next/server/index.d.mts +433 -0
  15. package/dist/next/server/index.mjs +731 -0
  16. package/dist/react/adapters/index.d.mts +4 -4
  17. package/dist/react/adapters/index.mjs +2 -1
  18. package/dist/react/index.d.mts +5 -5
  19. package/dist/react/index.mjs +5 -92
  20. package/dist/react/ui/index.d.mts +1 -1
  21. package/dist/react/ui/index.mjs +3 -91
  22. package/dist/react/ui/server.mjs +1 -1
  23. package/dist/{supabase-adapter-ggmqWgPe.mjs → supabase-adapter-Bdw6aPGx.mjs} +72 -167
  24. package/dist/supabase-adapter-Dm56RKRF.d.mts +2258 -0
  25. package/dist/types/index.d.mts +3 -0
  26. package/dist/types/index.mjs +3 -0
  27. package/dist/ui/.safelist.html +3 -0
  28. package/dist/ui/css.css +2 -2
  29. package/dist/ui/tailwind.css +4 -3
  30. package/dist/ui/theme-inline.css +44 -0
  31. package/dist/ui/theme.css +221 -118
  32. package/dist/ui-CrxGg6vQ.mjs +12113 -0
  33. package/dist/vanilla/adapters/index.d.mts +3 -3
  34. package/dist/vanilla/adapters/index.mjs +2 -1
  35. package/dist/vanilla/index.d.mts +3 -3
  36. package/dist/vanilla/index.mjs +2 -1
  37. package/llms.txt +172 -0
  38. package/package.json +22 -11
  39. package/dist/better-auth-react-adapter-BXL48HIU.d.mts +0 -722
  40. package/dist/supabase-adapter-crabDnl2.d.mts +0 -128
  41. package/dist/ui-CNFBSekF.mjs +0 -401
  42. /package/dist/{adapters-Dkx0zoMR.mjs → adapters-B7YKkjaL.mjs} +0 -0
  43. /package/dist/{index-C-svZlpj.d.mts → index-CPnFzULh.d.mts} +0 -0
  44. /package/dist/{index-DuDD6cIY.d.mts → index-CzsGMS7C.d.mts} +0 -0
  45. /package/dist/{index-UW23fDSn.d.mts → index-OEBbnNdr.d.mts} +0 -0
@@ -1,63 +1,12 @@
1
1
  import * as better_auth_client0 from "better-auth/client";
2
- import * as better_auth_client_plugins0 from "better-auth/client/plugins";
3
2
  import * as jose0 from "jose";
4
- import { NextRequest, NextResponse } from "next/server";
5
3
  import * as better_auth0 from "better-auth";
6
4
  import * as _better_fetch_fetch0 from "@better-fetch/fetch";
5
+ import * as better_auth_plugins0 from "better-auth/plugins";
7
6
  import * as nanostores0 from "nanostores";
8
7
 
9
- //#region src/next/handler/index.d.ts
10
- type Params = {
11
- path: string[];
12
- };
13
- declare const toNextJsHandler: (baseUrl: string) => {
14
- GET: (request: Request, {
15
- params
16
- }: {
17
- params: Promise<Params>;
18
- }) => Promise<Response>;
19
- POST: (request: Request, {
20
- params
21
- }: {
22
- params: Promise<Params>;
23
- }) => Promise<Response>;
24
- PUT: (request: Request, {
25
- params
26
- }: {
27
- params: Promise<Params>;
28
- }) => Promise<Response>;
29
- DELETE: (request: Request, {
30
- params
31
- }: {
32
- params: Promise<Params>;
33
- }) => Promise<Response>;
34
- PATCH: (request: Request, {
35
- params
36
- }: {
37
- params: Promise<Params>;
38
- }) => Promise<Response>;
39
- };
40
- //#endregion
41
- //#region src/next/middleware/index.d.ts
42
- type NeonAuthMiddlewareOptions = {
43
- loginUrl?: string;
44
- /**
45
- * The Neon Auth base URL
46
- * Defaults to `process.env.NEON_AUTH_BASE_URL`
47
- *
48
- * If not provided, and if not in the environment, the middleware will throw an error.
49
- *
50
- * @throws {Error} If the authURL is not provided and not in the environment.
51
- */
52
- authBaseUrl?: string;
53
- };
54
- declare const neonAuthMiddleware: ({
55
- loginUrl,
56
- authBaseUrl
57
- }: NeonAuthMiddlewareOptions) => (request: NextRequest) => Promise<NextResponse<unknown>>;
58
- //#endregion
59
8
  //#region src/next/index.d.ts
60
- declare const createAuthClient: () => {
9
+ declare function createAuthClient(): {
61
10
  useActiveOrganization: () => {
62
11
  data: better_auth0.Prettify<{
63
12
  id: string;
@@ -161,7 +110,7 @@ declare const createAuthClient: () => {
161
110
  } & {
162
111
  fetchOptions?: FetchOptions | undefined;
163
112
  }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
164
- user: better_auth_client_plugins0.UserWithRole;
113
+ user: better_auth_plugins0.UserWithRole;
165
114
  }, {
166
115
  code?: string | undefined;
167
116
  message?: string | undefined;
@@ -206,7 +155,7 @@ declare const createAuthClient: () => {
206
155
  } & {
207
156
  fetchOptions?: FetchOptions | undefined;
208
157
  }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
209
- user: better_auth_client_plugins0.UserWithRole;
158
+ user: better_auth_plugins0.UserWithRole;
210
159
  }, {
211
160
  code?: string | undefined;
212
161
  message?: string | undefined;
@@ -222,7 +171,7 @@ declare const createAuthClient: () => {
222
171
  data: Record<any, any>;
223
172
  } & {
224
173
  fetchOptions?: FetchOptions | undefined;
225
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<better_auth_client_plugins0.UserWithRole, {
174
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<better_auth_plugins0.UserWithRole, {
226
175
  code?: string | undefined;
227
176
  message?: string | undefined;
228
177
  }, FetchOptions["throw"] extends true ? true : false>>;
@@ -255,7 +204,7 @@ declare const createAuthClient: () => {
255
204
  };
256
205
  fetchOptions?: FetchOptions | undefined;
257
206
  }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
258
- users: better_auth_client_plugins0.UserWithRole[];
207
+ users: better_auth_plugins0.UserWithRole[];
259
208
  total: number;
260
209
  limit: number | undefined;
261
210
  offset: number | undefined;
@@ -276,7 +225,7 @@ declare const createAuthClient: () => {
276
225
  } & {
277
226
  fetchOptions?: FetchOptions | undefined;
278
227
  }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
279
- sessions: better_auth_client_plugins0.SessionWithImpersonatedBy[];
228
+ sessions: better_auth_plugins0.SessionWithImpersonatedBy[];
280
229
  }, {
281
230
  code?: string | undefined;
282
231
  message?: string | undefined;
@@ -351,15 +300,7 @@ declare const createAuthClient: () => {
351
300
  ipAddress?: string | null | undefined;
352
301
  userAgent?: string | null | undefined;
353
302
  };
354
- user: {
355
- id: string;
356
- createdAt: Date;
357
- updatedAt: Date;
358
- email: string;
359
- emailVerified: boolean;
360
- name: string;
361
- image?: string | null | undefined;
362
- };
303
+ user: better_auth_plugins0.UserWithRole;
363
304
  }, {
364
305
  code?: string | undefined;
365
306
  message?: string | undefined;
@@ -444,14 +385,14 @@ declare const createAuthClient: () => {
444
385
  admin: {
445
386
  hasPermission: <FetchOptions extends better_auth0.ClientFetchOption<Partial<({
446
387
  permission: {
447
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
448
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
388
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
389
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
449
390
  };
450
391
  permissions?: never | undefined;
451
392
  } | {
452
393
  permissions: {
453
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
454
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
394
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
395
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
455
396
  };
456
397
  permission?: never | undefined;
457
398
  }) & {
@@ -459,14 +400,14 @@ declare const createAuthClient: () => {
459
400
  role?: "user" | "admin" | undefined;
460
401
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<(({
461
402
  permission: {
462
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
463
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
403
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
404
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
464
405
  };
465
406
  permissions?: never | undefined;
466
407
  } | {
467
408
  permissions: {
468
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
469
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
409
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
410
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
470
411
  };
471
412
  permission?: never | undefined;
472
413
  }) & {
@@ -990,7 +931,7 @@ declare const createAuthClient: () => {
990
931
  email?: string | undefined;
991
932
  } | undefined;
992
933
  fetchOptions?: FetchOptions | undefined;
993
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
934
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<(Omit<{
994
935
  id: string;
995
936
  organizationId: string;
996
937
  email: string;
@@ -999,7 +940,18 @@ declare const createAuthClient: () => {
999
940
  inviterId: string;
1000
941
  expiresAt: Date;
1001
942
  createdAt: Date;
1002
- }[], {
943
+ } & {
944
+ organization: {
945
+ id: string;
946
+ name: string;
947
+ slug: string;
948
+ createdAt: Date;
949
+ logo?: string | null | undefined | undefined;
950
+ metadata?: any;
951
+ };
952
+ }, "organization"> & {
953
+ organizationName: string;
954
+ })[], {
1003
955
  code?: string | undefined;
1004
956
  message?: string | undefined;
1005
957
  }, FetchOptions["throw"] extends true ? true : false>>;
@@ -1081,19 +1033,19 @@ declare const createAuthClient: () => {
1081
1033
  hasPermission: <FetchOptions extends better_auth0.ClientFetchOption<Partial<({
1082
1034
  permission: {
1083
1035
  readonly organization?: ("delete" | "update")[] | undefined;
1084
- readonly member?: ("create" | "delete" | "update")[] | undefined;
1085
- readonly invitation?: ("create" | "cancel")[] | undefined;
1086
- readonly team?: ("create" | "delete" | "update")[] | undefined;
1087
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1036
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1037
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1038
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1039
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
1088
1040
  };
1089
1041
  permissions?: never | undefined;
1090
1042
  } | {
1091
1043
  permissions: {
1092
1044
  readonly organization?: ("delete" | "update")[] | undefined;
1093
- readonly member?: ("create" | "delete" | "update")[] | undefined;
1094
- readonly invitation?: ("create" | "cancel")[] | undefined;
1095
- readonly team?: ("create" | "delete" | "update")[] | undefined;
1096
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1045
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1046
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1047
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1048
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
1097
1049
  };
1098
1050
  permission?: never | undefined;
1099
1051
  }) & {
@@ -1101,19 +1053,19 @@ declare const createAuthClient: () => {
1101
1053
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<(({
1102
1054
  permission: {
1103
1055
  readonly organization?: ("delete" | "update")[] | undefined;
1104
- readonly member?: ("create" | "delete" | "update")[] | undefined;
1105
- readonly invitation?: ("create" | "cancel")[] | undefined;
1106
- readonly team?: ("create" | "delete" | "update")[] | undefined;
1107
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1056
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1057
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1058
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1059
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
1108
1060
  };
1109
1061
  permissions?: never | undefined;
1110
1062
  } | {
1111
1063
  permissions: {
1112
1064
  readonly organization?: ("delete" | "update")[] | undefined;
1113
- readonly member?: ("create" | "delete" | "update")[] | undefined;
1114
- readonly invitation?: ("create" | "cancel")[] | undefined;
1115
- readonly team?: ("create" | "delete" | "update")[] | undefined;
1116
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1065
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1066
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1067
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1068
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
1117
1069
  };
1118
1070
  permission?: never | undefined;
1119
1071
  }) & {
@@ -1263,176 +1215,6 @@ declare const createAuthClient: () => {
1263
1215
  message?: string | undefined;
1264
1216
  }, FetchOptions["throw"] extends true ? true : false>>;
1265
1217
  };
1266
- } & {
1267
- signIn: {
1268
- anonymous: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1269
- query?: Record<string, any> | undefined;
1270
- fetchOptions?: FetchOptions | undefined;
1271
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1272
- token: string;
1273
- user: {
1274
- id: string;
1275
- email: string;
1276
- emailVerified: boolean;
1277
- name: string;
1278
- createdAt: Date;
1279
- updatedAt: Date;
1280
- };
1281
- }, {
1282
- code?: string | undefined;
1283
- message?: string | undefined;
1284
- }, FetchOptions["throw"] extends true ? true : false>>;
1285
- };
1286
- } & {
1287
- signIn: {
1288
- phoneNumber: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1289
- phoneNumber: string;
1290
- password: string;
1291
- rememberMe?: boolean | undefined;
1292
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1293
- phoneNumber: string;
1294
- password: string;
1295
- rememberMe?: boolean | undefined;
1296
- } & {
1297
- fetchOptions?: FetchOptions | undefined;
1298
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1299
- token: string;
1300
- user: better_auth_client_plugins0.UserWithPhoneNumber;
1301
- }, {
1302
- code?: string | undefined;
1303
- message?: string | undefined;
1304
- }, FetchOptions["throw"] extends true ? true : false>>;
1305
- };
1306
- } & {
1307
- phoneNumber: {
1308
- sendOtp: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1309
- phoneNumber: string;
1310
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1311
- phoneNumber: string;
1312
- } & {
1313
- fetchOptions?: FetchOptions | undefined;
1314
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1315
- message: string;
1316
- }, {
1317
- code?: string | undefined;
1318
- message?: string | undefined;
1319
- }, FetchOptions["throw"] extends true ? true : false>>;
1320
- };
1321
- } & {
1322
- phoneNumber: {
1323
- verify: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1324
- phoneNumber: string;
1325
- code: string;
1326
- disableSession?: boolean | undefined;
1327
- updatePhoneNumber?: boolean | undefined;
1328
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1329
- phoneNumber: string;
1330
- code: string;
1331
- disableSession?: boolean | undefined;
1332
- updatePhoneNumber?: boolean | undefined;
1333
- } & {
1334
- fetchOptions?: FetchOptions | undefined;
1335
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
1336
- status: boolean;
1337
- token: string;
1338
- user: better_auth_client_plugins0.UserWithPhoneNumber;
1339
- } | {
1340
- status: boolean;
1341
- token: null;
1342
- user: better_auth_client_plugins0.UserWithPhoneNumber;
1343
- }>, {
1344
- code?: string | undefined;
1345
- message?: string | undefined;
1346
- }, FetchOptions["throw"] extends true ? true : false>>;
1347
- };
1348
- } & {
1349
- phoneNumber: {
1350
- requestPasswordReset: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1351
- phoneNumber: string;
1352
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1353
- phoneNumber: string;
1354
- } & {
1355
- fetchOptions?: FetchOptions | undefined;
1356
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1357
- status: boolean;
1358
- }, {
1359
- code?: string | undefined;
1360
- message?: string | undefined;
1361
- }, FetchOptions["throw"] extends true ? true : false>>;
1362
- };
1363
- } & {
1364
- phoneNumber: {
1365
- resetPassword: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1366
- otp: string;
1367
- phoneNumber: string;
1368
- newPassword: string;
1369
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1370
- otp: string;
1371
- phoneNumber: string;
1372
- newPassword: string;
1373
- } & {
1374
- fetchOptions?: FetchOptions | undefined;
1375
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1376
- status: boolean;
1377
- }, {
1378
- code?: string | undefined;
1379
- message?: string | undefined;
1380
- }, FetchOptions["throw"] extends true ? true : false>>;
1381
- };
1382
- } & {
1383
- signIn: {
1384
- magicLink: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1385
- email: string;
1386
- name?: string | undefined;
1387
- callbackURL?: string | undefined;
1388
- newUserCallbackURL?: string | undefined;
1389
- errorCallbackURL?: string | undefined;
1390
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1391
- email: string;
1392
- name?: string | undefined;
1393
- callbackURL?: string | undefined;
1394
- newUserCallbackURL?: string | undefined;
1395
- errorCallbackURL?: string | undefined;
1396
- } & {
1397
- fetchOptions?: FetchOptions | undefined;
1398
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1399
- status: boolean;
1400
- }, {
1401
- code?: string | undefined;
1402
- message?: string | undefined;
1403
- }, FetchOptions["throw"] extends true ? true : false>>;
1404
- };
1405
- } & {
1406
- magicLink: {
1407
- verify: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
1408
- token: string;
1409
- callbackURL?: string | undefined;
1410
- errorCallbackURL?: string | undefined;
1411
- newUserCallbackURL?: string | undefined;
1412
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1413
- query: {
1414
- token: string;
1415
- callbackURL?: string | undefined;
1416
- errorCallbackURL?: string | undefined;
1417
- newUserCallbackURL?: string | undefined;
1418
- };
1419
- fetchOptions?: FetchOptions | undefined;
1420
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1421
- token: string;
1422
- user: {
1423
- id: string;
1424
- email: string;
1425
- emailVerified: boolean;
1426
- name: string;
1427
- image: string | null | undefined;
1428
- createdAt: Date;
1429
- updatedAt: Date;
1430
- };
1431
- }, {
1432
- code?: string | undefined;
1433
- message?: string | undefined;
1434
- }, FetchOptions["throw"] extends true ? true : false>>;
1435
- };
1436
1218
  } & {
1437
1219
  signIn: {
1438
1220
  social: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
@@ -1518,9 +1300,7 @@ declare const createAuthClient: () => {
1518
1300
  image?: string | undefined;
1519
1301
  callbackURL?: string | undefined;
1520
1302
  fetchOptions?: FetchOptions | undefined;
1521
- } & {} & {} & {} & {} & {} & {
1522
- phoneNumber?: string | null | undefined;
1523
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
1303
+ } & {} & {}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
1524
1304
  token: null;
1525
1305
  user: {
1526
1306
  id: string;
@@ -1676,9 +1456,7 @@ declare const createAuthClient: () => {
1676
1456
  image?: (string | null) | undefined;
1677
1457
  name?: string | undefined;
1678
1458
  fetchOptions?: FetchOptions | undefined;
1679
- } & Partial<{} & {} & {} & {} & {} & {
1680
- phoneNumber?: string | null | undefined;
1681
- }>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1459
+ } & Partial<{} & {}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1682
1460
  status: boolean;
1683
1461
  }, {
1684
1462
  code?: string | undefined;
@@ -1956,9 +1734,6 @@ declare const createAuthClient: () => {
1956
1734
  role?: string | null | undefined;
1957
1735
  banReason?: string | null | undefined;
1958
1736
  banExpires?: Date | null | undefined;
1959
- isAnonymous: boolean | null | undefined;
1960
- phoneNumber?: string | null | undefined;
1961
- phoneNumberVerified?: boolean | null | undefined;
1962
1737
  };
1963
1738
  session: {
1964
1739
  id: string;
@@ -1976,6 +1751,21 @@ declare const createAuthClient: () => {
1976
1751
  code?: string | undefined;
1977
1752
  message?: string | undefined;
1978
1753
  }, FetchOptions["throw"] extends true ? true : false>>;
1754
+ } & {
1755
+ getAnonymousToken: (fetchOptions?: any) => Promise<{
1756
+ data: {
1757
+ token: string;
1758
+ expires_at: number;
1759
+ };
1760
+ error: null;
1761
+ } | {
1762
+ data: null;
1763
+ error: {
1764
+ message?: string | undefined;
1765
+ status: number;
1766
+ statusText: string;
1767
+ };
1768
+ }>;
1979
1769
  } & {
1980
1770
  jwks: (fetchOptions?: any) => Promise<{
1981
1771
  data: null;
@@ -1992,14 +1782,14 @@ declare const createAuthClient: () => {
1992
1782
  admin: {
1993
1783
  checkRolePermission: <R extends "user" | "admin">(data: ({
1994
1784
  permission: {
1995
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
1996
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1785
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1786
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1997
1787
  };
1998
1788
  permissions?: never | undefined;
1999
1789
  } | {
2000
1790
  permissions: {
2001
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
2002
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1791
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1792
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
2003
1793
  };
2004
1794
  permission?: never | undefined;
2005
1795
  }) & {
@@ -2083,19 +1873,19 @@ declare const createAuthClient: () => {
2083
1873
  checkRolePermission: <R extends "admin" | "member" | "owner">(data: ({
2084
1874
  permission: {
2085
1875
  readonly organization?: ("delete" | "update")[] | undefined;
2086
- readonly member?: ("create" | "delete" | "update")[] | undefined;
2087
- readonly invitation?: ("create" | "cancel")[] | undefined;
2088
- readonly team?: ("create" | "delete" | "update")[] | undefined;
2089
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1876
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1877
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1878
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1879
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
2090
1880
  };
2091
1881
  permissions?: never | undefined;
2092
1882
  } | {
2093
1883
  permissions: {
2094
1884
  readonly organization?: ("delete" | "update")[] | undefined;
2095
- readonly member?: ("create" | "delete" | "update")[] | undefined;
2096
- readonly invitation?: ("create" | "cancel")[] | undefined;
2097
- readonly team?: ("create" | "delete" | "update")[] | undefined;
2098
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1885
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1886
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1887
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1888
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
2099
1889
  };
2100
1890
  permission?: never | undefined;
2101
1891
  }) & {
@@ -2117,9 +1907,6 @@ declare const createAuthClient: () => {
2117
1907
  role?: string | null | undefined;
2118
1908
  banReason?: string | null | undefined;
2119
1909
  banExpires?: Date | null | undefined;
2120
- isAnonymous: boolean | null | undefined;
2121
- phoneNumber?: string | null | undefined;
2122
- phoneNumberVerified?: boolean | null | undefined;
2123
1910
  };
2124
1911
  session: {
2125
1912
  id: string;
@@ -2155,9 +1942,6 @@ declare const createAuthClient: () => {
2155
1942
  role?: string | null | undefined;
2156
1943
  banReason?: string | null | undefined;
2157
1944
  banExpires?: Date | null | undefined;
2158
- isAnonymous: boolean | null | undefined;
2159
- phoneNumber?: string | null | undefined;
2160
- phoneNumberVerified?: boolean | null | undefined;
2161
1945
  };
2162
1946
  session: {
2163
1947
  id: string;
@@ -2264,6 +2048,7 @@ declare const createAuthClient: () => {
2264
2048
  readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
2265
2049
  readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
2266
2050
  readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
2051
+ readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
2267
2052
  readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization";
2268
2053
  readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations";
2269
2054
  readonly ORGANIZATION_ALREADY_EXISTS: "Organization already exists";
@@ -2323,18 +2108,6 @@ declare const createAuthClient: () => {
2323
2108
  readonly OTP_EXPIRED: "OTP expired";
2324
2109
  readonly INVALID_OTP: "Invalid OTP";
2325
2110
  readonly TOO_MANY_ATTEMPTS: "Too many attempts";
2326
- readonly INVALID_EMAIL_FORMAT: "Email was not generated in a valid format";
2327
- readonly COULD_NOT_CREATE_SESSION: "Could not create session";
2328
- readonly ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously";
2329
- readonly INVALID_PHONE_NUMBER: "Invalid phone number";
2330
- readonly PHONE_NUMBER_EXIST: "Phone number already exists";
2331
- readonly PHONE_NUMBER_NOT_EXIST: "phone number isn't registered";
2332
- readonly INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password";
2333
- readonly UNEXPECTED_ERROR: "Unexpected error";
2334
- readonly OTP_NOT_FOUND: "OTP not found";
2335
- readonly PHONE_NUMBER_NOT_VERIFIED: "Phone number not verified";
2336
- readonly PHONE_NUMBER_CANNOT_BE_UPDATED: "Phone number cannot be updated";
2337
- readonly SEND_OTP_NOT_IMPLEMENTED: "sendOTP not implemented";
2338
2111
  readonly USER_NOT_FOUND: "User not found";
2339
2112
  readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
2340
2113
  readonly FAILED_TO_UPDATE_USER: "Failed to update user";
@@ -2360,4 +2133,4 @@ declare const createAuthClient: () => {
2360
2133
  };
2361
2134
  };
2362
2135
  //#endregion
2363
- export { createAuthClient, neonAuthMiddleware, toNextJsHandler };
2136
+ export { createAuthClient };