@neondatabase/auth 0.1.0-beta.1

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.
@@ -0,0 +1,2363 @@
1
+ import * as better_auth_client0 from "better-auth/client";
2
+ import * as better_auth_client_plugins0 from "better-auth/client/plugins";
3
+ import * as jose0 from "jose";
4
+ import { NextRequest, NextResponse } from "next/server";
5
+ import * as better_auth0 from "better-auth";
6
+ import * as _better_fetch_fetch0 from "@better-fetch/fetch";
7
+ import * as nanostores0 from "nanostores";
8
+
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
+ //#region src/next/index.d.ts
60
+ declare const createAuthClient: () => {
61
+ useActiveOrganization: () => {
62
+ data: better_auth0.Prettify<{
63
+ id: string;
64
+ name: string;
65
+ slug: string;
66
+ createdAt: Date;
67
+ logo?: string | null | undefined | undefined;
68
+ metadata?: any;
69
+ } & {
70
+ members: {
71
+ id: string;
72
+ organizationId: string;
73
+ role: "admin" | "member" | "owner";
74
+ createdAt: Date;
75
+ userId: string;
76
+ user: {
77
+ id: string;
78
+ email: string;
79
+ name: string;
80
+ image?: string | undefined;
81
+ };
82
+ }[];
83
+ invitations: {
84
+ id: string;
85
+ organizationId: string;
86
+ email: string;
87
+ role: "admin" | "member" | "owner";
88
+ status: better_auth_client0.InvitationStatus;
89
+ inviterId: string;
90
+ expiresAt: Date;
91
+ createdAt: Date;
92
+ }[];
93
+ }> | null;
94
+ error: null | _better_fetch_fetch0.BetterFetchError;
95
+ isPending: boolean;
96
+ isRefetching: boolean;
97
+ refetch: (queryParams?: {
98
+ query?: better_auth0.SessionQueryParams;
99
+ } | undefined) => Promise<void>;
100
+ };
101
+ useListOrganizations: () => {
102
+ data: {
103
+ id: string;
104
+ name: string;
105
+ slug: string;
106
+ createdAt: Date;
107
+ logo?: string | null | undefined | undefined;
108
+ metadata?: any;
109
+ }[] | null;
110
+ error: null | _better_fetch_fetch0.BetterFetchError;
111
+ isPending: boolean;
112
+ isRefetching: boolean;
113
+ refetch: (queryParams?: {
114
+ query?: better_auth0.SessionQueryParams;
115
+ } | undefined) => Promise<void>;
116
+ };
117
+ useActiveMember: () => {
118
+ data: {
119
+ id: string;
120
+ organizationId: string;
121
+ userId: string;
122
+ role: string;
123
+ createdAt: Date;
124
+ } | null;
125
+ error: null | _better_fetch_fetch0.BetterFetchError;
126
+ isPending: boolean;
127
+ isRefetching: boolean;
128
+ refetch: (queryParams?: {
129
+ query?: better_auth0.SessionQueryParams;
130
+ } | undefined) => Promise<void>;
131
+ };
132
+ useActiveMemberRole: () => {
133
+ data: {
134
+ role: string;
135
+ } | null;
136
+ error: null | _better_fetch_fetch0.BetterFetchError;
137
+ isPending: boolean;
138
+ isRefetching: boolean;
139
+ refetch: (queryParams?: {
140
+ query?: better_auth0.SessionQueryParams;
141
+ } | undefined) => Promise<void>;
142
+ };
143
+ } & {
144
+ token: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
145
+ query?: Record<string, any> | undefined;
146
+ fetchOptions?: FetchOptions | undefined;
147
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
148
+ token: string;
149
+ }, {
150
+ code?: string | undefined;
151
+ message?: string | undefined;
152
+ }, FetchOptions["throw"] extends true ? true : false>>;
153
+ } & {
154
+ admin: {
155
+ setRole: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
156
+ userId: string;
157
+ role: "user" | "admin" | ("user" | "admin")[];
158
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
159
+ userId: string;
160
+ role: "user" | "admin" | ("user" | "admin")[];
161
+ } & {
162
+ fetchOptions?: FetchOptions | undefined;
163
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
164
+ user: better_auth_client_plugins0.UserWithRole;
165
+ }, {
166
+ code?: string | undefined;
167
+ message?: string | undefined;
168
+ }, FetchOptions["throw"] extends true ? true : false>>;
169
+ };
170
+ } & {
171
+ admin: {
172
+ getUser: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
173
+ id: string;
174
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
175
+ query: {
176
+ id: string;
177
+ };
178
+ fetchOptions?: FetchOptions | undefined;
179
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
180
+ id: string;
181
+ createdAt: Date;
182
+ updatedAt: Date;
183
+ email: string;
184
+ emailVerified: boolean;
185
+ name: string;
186
+ image?: string | null | undefined;
187
+ }, {
188
+ code?: string | undefined;
189
+ message?: string | undefined;
190
+ }, FetchOptions["throw"] extends true ? true : false>>;
191
+ };
192
+ } & {
193
+ admin: {
194
+ createUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
195
+ email: string;
196
+ password: string;
197
+ name: string;
198
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
199
+ data?: Record<string, any> | undefined;
200
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
201
+ email: string;
202
+ password: string;
203
+ name: string;
204
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
205
+ data?: Record<string, any> | undefined;
206
+ } & {
207
+ fetchOptions?: FetchOptions | undefined;
208
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
209
+ user: better_auth_client_plugins0.UserWithRole;
210
+ }, {
211
+ code?: string | undefined;
212
+ message?: string | undefined;
213
+ }, FetchOptions["throw"] extends true ? true : false>>;
214
+ };
215
+ } & {
216
+ admin: {
217
+ updateUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
218
+ userId: unknown;
219
+ data: Record<any, any>;
220
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
221
+ userId: unknown;
222
+ data: Record<any, any>;
223
+ } & {
224
+ fetchOptions?: FetchOptions | undefined;
225
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<better_auth_client_plugins0.UserWithRole, {
226
+ code?: string | undefined;
227
+ message?: string | undefined;
228
+ }, FetchOptions["throw"] extends true ? true : false>>;
229
+ };
230
+ } & {
231
+ admin: {
232
+ listUsers: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
233
+ searchValue?: string | undefined;
234
+ searchField?: "email" | "name" | undefined;
235
+ searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
236
+ limit?: string | number | undefined;
237
+ offset?: string | number | undefined;
238
+ sortBy?: string | undefined;
239
+ sortDirection?: "asc" | "desc" | undefined;
240
+ filterField?: string | undefined;
241
+ filterValue?: string | number | boolean | undefined;
242
+ filterOperator?: "contains" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | undefined;
243
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
244
+ query: {
245
+ searchValue?: string | undefined;
246
+ searchField?: "email" | "name" | undefined;
247
+ searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
248
+ limit?: string | number | undefined;
249
+ offset?: string | number | undefined;
250
+ sortBy?: string | undefined;
251
+ sortDirection?: "asc" | "desc" | undefined;
252
+ filterField?: string | undefined;
253
+ filterValue?: string | number | boolean | undefined;
254
+ filterOperator?: "contains" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | undefined;
255
+ };
256
+ fetchOptions?: FetchOptions | undefined;
257
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
258
+ users: better_auth_client_plugins0.UserWithRole[];
259
+ total: number;
260
+ limit: number | undefined;
261
+ offset: number | undefined;
262
+ } | {
263
+ users: never[];
264
+ total: number;
265
+ }>, {
266
+ code?: string | undefined;
267
+ message?: string | undefined;
268
+ }, FetchOptions["throw"] extends true ? true : false>>;
269
+ };
270
+ } & {
271
+ admin: {
272
+ listUserSessions: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
273
+ userId: unknown;
274
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
275
+ userId: unknown;
276
+ } & {
277
+ fetchOptions?: FetchOptions | undefined;
278
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
279
+ sessions: better_auth_client_plugins0.SessionWithImpersonatedBy[];
280
+ }, {
281
+ code?: string | undefined;
282
+ message?: string | undefined;
283
+ }, FetchOptions["throw"] extends true ? true : false>>;
284
+ };
285
+ } & {
286
+ admin: {
287
+ unbanUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
288
+ userId: unknown;
289
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
290
+ userId: unknown;
291
+ } & {
292
+ fetchOptions?: FetchOptions | undefined;
293
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
294
+ user: {
295
+ id: string;
296
+ createdAt: Date;
297
+ updatedAt: Date;
298
+ email: string;
299
+ emailVerified: boolean;
300
+ name: string;
301
+ image?: string | null | undefined;
302
+ } & Record<string, any>;
303
+ }, {
304
+ code?: string | undefined;
305
+ message?: string | undefined;
306
+ }, FetchOptions["throw"] extends true ? true : false>>;
307
+ };
308
+ } & {
309
+ admin: {
310
+ banUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
311
+ userId: unknown;
312
+ banReason?: string | undefined;
313
+ banExpiresIn?: number | undefined;
314
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
315
+ userId: unknown;
316
+ banReason?: string | undefined;
317
+ banExpiresIn?: number | undefined;
318
+ } & {
319
+ fetchOptions?: FetchOptions | undefined;
320
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
321
+ user: {
322
+ id: string;
323
+ createdAt: Date;
324
+ updatedAt: Date;
325
+ email: string;
326
+ emailVerified: boolean;
327
+ name: string;
328
+ image?: string | null | undefined;
329
+ } & Record<string, any>;
330
+ }, {
331
+ code?: string | undefined;
332
+ message?: string | undefined;
333
+ }, FetchOptions["throw"] extends true ? true : false>>;
334
+ };
335
+ } & {
336
+ admin: {
337
+ impersonateUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
338
+ userId: unknown;
339
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
340
+ userId: unknown;
341
+ } & {
342
+ fetchOptions?: FetchOptions | undefined;
343
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
344
+ session: {
345
+ id: string;
346
+ createdAt: Date;
347
+ updatedAt: Date;
348
+ userId: string;
349
+ expiresAt: Date;
350
+ token: string;
351
+ ipAddress?: string | null | undefined;
352
+ userAgent?: string | null | undefined;
353
+ };
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
+ };
363
+ }, {
364
+ code?: string | undefined;
365
+ message?: string | undefined;
366
+ }, FetchOptions["throw"] extends true ? true : false>>;
367
+ };
368
+ } & {
369
+ admin: {
370
+ stopImpersonating: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
371
+ query?: Record<string, any> | undefined;
372
+ fetchOptions?: FetchOptions | undefined;
373
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
374
+ session: better_auth0.Session & Record<string, any>;
375
+ user: better_auth0.User & Record<string, any>;
376
+ }, {
377
+ code?: string | undefined;
378
+ message?: string | undefined;
379
+ }, FetchOptions["throw"] extends true ? true : false>>;
380
+ };
381
+ } & {
382
+ admin: {
383
+ revokeUserSession: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
384
+ sessionToken: string;
385
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
386
+ sessionToken: string;
387
+ } & {
388
+ fetchOptions?: FetchOptions | undefined;
389
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
390
+ success: boolean;
391
+ }, {
392
+ code?: string | undefined;
393
+ message?: string | undefined;
394
+ }, FetchOptions["throw"] extends true ? true : false>>;
395
+ };
396
+ } & {
397
+ admin: {
398
+ revokeUserSessions: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
399
+ userId: unknown;
400
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
401
+ userId: unknown;
402
+ } & {
403
+ fetchOptions?: FetchOptions | undefined;
404
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
405
+ success: boolean;
406
+ }, {
407
+ code?: string | undefined;
408
+ message?: string | undefined;
409
+ }, FetchOptions["throw"] extends true ? true : false>>;
410
+ };
411
+ } & {
412
+ admin: {
413
+ removeUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
414
+ userId: unknown;
415
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
416
+ userId: unknown;
417
+ } & {
418
+ fetchOptions?: FetchOptions | undefined;
419
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
420
+ success: boolean;
421
+ }, {
422
+ code?: string | undefined;
423
+ message?: string | undefined;
424
+ }, FetchOptions["throw"] extends true ? true : false>>;
425
+ };
426
+ } & {
427
+ admin: {
428
+ setUserPassword: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
429
+ newPassword: string;
430
+ userId: unknown;
431
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
432
+ newPassword: string;
433
+ userId: unknown;
434
+ } & {
435
+ fetchOptions?: FetchOptions | undefined;
436
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
437
+ status: boolean;
438
+ }, {
439
+ code?: string | undefined;
440
+ message?: string | undefined;
441
+ }, FetchOptions["throw"] extends true ? true : false>>;
442
+ };
443
+ } & {
444
+ admin: {
445
+ hasPermission: <FetchOptions extends better_auth0.ClientFetchOption<Partial<({
446
+ permission: {
447
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
448
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
449
+ };
450
+ permissions?: never | undefined;
451
+ } | {
452
+ permissions: {
453
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
454
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
455
+ };
456
+ permission?: never | undefined;
457
+ }) & {
458
+ userId?: string | undefined;
459
+ role?: "user" | "admin" | undefined;
460
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<(({
461
+ permission: {
462
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
463
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
464
+ };
465
+ permissions?: never | undefined;
466
+ } | {
467
+ permissions: {
468
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
469
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
470
+ };
471
+ permission?: never | undefined;
472
+ }) & {
473
+ userId?: string | undefined;
474
+ role?: "user" | "admin" | undefined;
475
+ }) & {
476
+ fetchOptions?: FetchOptions | undefined;
477
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
478
+ error: null;
479
+ success: boolean;
480
+ }, {
481
+ code?: string | undefined;
482
+ message?: string | undefined;
483
+ }, FetchOptions["throw"] extends true ? true : false>>;
484
+ };
485
+ } & {
486
+ organization: {
487
+ create: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
488
+ name: string;
489
+ slug: string;
490
+ userId?: string | undefined;
491
+ logo?: string | undefined;
492
+ metadata?: Record<string, any> | undefined;
493
+ keepCurrentActiveOrganization?: boolean | undefined;
494
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
495
+ name: string;
496
+ slug: string;
497
+ userId?: string | undefined;
498
+ logo?: string | undefined;
499
+ metadata?: Record<string, any> | undefined;
500
+ keepCurrentActiveOrganization?: boolean | undefined;
501
+ } & {
502
+ fetchOptions?: FetchOptions | undefined;
503
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
504
+ id: string;
505
+ name: string;
506
+ slug: string;
507
+ createdAt: Date;
508
+ logo?: string | null | undefined | undefined;
509
+ metadata?: any;
510
+ } & {
511
+ metadata: any;
512
+ members: ({
513
+ id: string;
514
+ organizationId: string;
515
+ userId: string;
516
+ role: string;
517
+ createdAt: Date;
518
+ } | undefined)[];
519
+ }, {
520
+ code?: string | undefined;
521
+ message?: string | undefined;
522
+ }, FetchOptions["throw"] extends true ? true : false>>;
523
+ };
524
+ } & {
525
+ organization: {
526
+ update: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
527
+ data: {
528
+ name?: string | undefined;
529
+ slug?: string | undefined;
530
+ logo?: string | undefined;
531
+ metadata?: Record<string, any> | undefined;
532
+ } & Partial<{}>;
533
+ organizationId?: string | undefined;
534
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
535
+ data: {
536
+ name?: string | undefined;
537
+ slug?: string | undefined;
538
+ logo?: string | undefined;
539
+ metadata?: Record<string, any> | undefined;
540
+ } & Partial<{}>;
541
+ organizationId?: string | undefined;
542
+ } & {
543
+ fetchOptions?: FetchOptions | undefined;
544
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
545
+ id: string;
546
+ name: string;
547
+ slug: string;
548
+ createdAt: Date;
549
+ logo?: string | null | undefined | undefined;
550
+ metadata?: any;
551
+ } & {
552
+ metadata: Record<string, any> | undefined;
553
+ }, {
554
+ code?: string | undefined;
555
+ message?: string | undefined;
556
+ }, FetchOptions["throw"] extends true ? true : false>>;
557
+ };
558
+ } & {
559
+ organization: {
560
+ delete: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
561
+ organizationId: string;
562
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
563
+ organizationId: string;
564
+ } & {
565
+ fetchOptions?: FetchOptions | undefined;
566
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
567
+ id: string;
568
+ name: string;
569
+ slug: string;
570
+ createdAt: Date;
571
+ logo?: string | null | undefined | undefined;
572
+ metadata?: any;
573
+ }, {
574
+ code?: string | undefined;
575
+ message?: string | undefined;
576
+ }, FetchOptions["throw"] extends true ? true : false>>;
577
+ };
578
+ } & {
579
+ organization: {
580
+ setActive: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
581
+ organizationId?: string | null | undefined;
582
+ organizationSlug?: string | undefined;
583
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
584
+ organizationId?: string | null | undefined;
585
+ organizationSlug?: string | undefined;
586
+ } & {
587
+ fetchOptions?: FetchOptions | undefined;
588
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
589
+ members: {
590
+ id: string;
591
+ organizationId: string;
592
+ role: "admin" | "member" | "owner";
593
+ createdAt: Date;
594
+ userId: string;
595
+ user: {
596
+ id: string;
597
+ email: string;
598
+ name: string;
599
+ image?: string | undefined;
600
+ };
601
+ }[];
602
+ invitations: {
603
+ id: string;
604
+ organizationId: string;
605
+ email: string;
606
+ role: "admin" | "member" | "owner";
607
+ status: better_auth_client0.InvitationStatus;
608
+ inviterId: string;
609
+ expiresAt: Date;
610
+ createdAt: Date;
611
+ }[];
612
+ } & {
613
+ id: string;
614
+ name: string;
615
+ slug: string;
616
+ createdAt: Date;
617
+ logo?: string | null | undefined | undefined;
618
+ metadata?: any;
619
+ }, {
620
+ code?: string | undefined;
621
+ message?: string | undefined;
622
+ }, FetchOptions["throw"] extends true ? true : false>>;
623
+ };
624
+ } & {
625
+ organization: {
626
+ getFullOrganization: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
627
+ organizationId?: string | undefined;
628
+ organizationSlug?: string | undefined;
629
+ membersLimit?: string | number | undefined;
630
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
631
+ query?: {
632
+ organizationId?: string | undefined;
633
+ organizationSlug?: string | undefined;
634
+ membersLimit?: string | number | undefined;
635
+ } | undefined;
636
+ fetchOptions?: FetchOptions | undefined;
637
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
638
+ members: {
639
+ id: string;
640
+ organizationId: string;
641
+ role: "admin" | "member" | "owner";
642
+ createdAt: Date;
643
+ userId: string;
644
+ user: {
645
+ id: string;
646
+ email: string;
647
+ name: string;
648
+ image?: string | undefined;
649
+ };
650
+ }[];
651
+ invitations: {
652
+ id: string;
653
+ organizationId: string;
654
+ email: string;
655
+ role: "admin" | "member" | "owner";
656
+ status: better_auth_client0.InvitationStatus;
657
+ inviterId: string;
658
+ expiresAt: Date;
659
+ createdAt: Date;
660
+ }[];
661
+ } & {
662
+ id: string;
663
+ name: string;
664
+ slug: string;
665
+ createdAt: Date;
666
+ logo?: string | null | undefined | undefined;
667
+ metadata?: any;
668
+ }, {
669
+ code?: string | undefined;
670
+ message?: string | undefined;
671
+ }, FetchOptions["throw"] extends true ? true : false>>;
672
+ };
673
+ } & {
674
+ organization: {
675
+ list: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
676
+ query?: Record<string, any> | undefined;
677
+ fetchOptions?: FetchOptions | undefined;
678
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
679
+ id: string;
680
+ name: string;
681
+ slug: string;
682
+ createdAt: Date;
683
+ logo?: string | null | undefined | undefined;
684
+ metadata?: any;
685
+ }[], {
686
+ code?: string | undefined;
687
+ message?: string | undefined;
688
+ }, FetchOptions["throw"] extends true ? true : false>>;
689
+ };
690
+ } & {
691
+ organization: {
692
+ inviteMember: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
693
+ email: string;
694
+ role: "admin" | "member" | "owner" | ("admin" | "member" | "owner")[];
695
+ organizationId?: string | undefined;
696
+ resend?: boolean | undefined;
697
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
698
+ email: string;
699
+ role: "admin" | "member" | "owner" | ("admin" | "member" | "owner")[];
700
+ organizationId?: string | undefined;
701
+ resend?: boolean | undefined;
702
+ } & {
703
+ fetchOptions?: FetchOptions | undefined;
704
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
705
+ id: string;
706
+ organizationId: string;
707
+ email: string;
708
+ role: "admin" | "member" | "owner";
709
+ status: better_auth_client0.InvitationStatus;
710
+ inviterId: string;
711
+ expiresAt: Date;
712
+ createdAt: Date;
713
+ }, {
714
+ code?: string | undefined;
715
+ message?: string | undefined;
716
+ }, FetchOptions["throw"] extends true ? true : false>>;
717
+ };
718
+ } & {
719
+ organization: {
720
+ cancelInvitation: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
721
+ invitationId: string;
722
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
723
+ invitationId: string;
724
+ } & {
725
+ fetchOptions?: FetchOptions | undefined;
726
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
727
+ id: string;
728
+ organizationId: string;
729
+ email: string;
730
+ role: "admin" | "member" | "owner";
731
+ status: better_auth_client0.InvitationStatus;
732
+ inviterId: string;
733
+ expiresAt: Date;
734
+ createdAt: Date;
735
+ }, {
736
+ code?: string | undefined;
737
+ message?: string | undefined;
738
+ }, FetchOptions["throw"] extends true ? true : false>>;
739
+ };
740
+ } & {
741
+ organization: {
742
+ acceptInvitation: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
743
+ invitationId: string;
744
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
745
+ invitationId: string;
746
+ } & {
747
+ fetchOptions?: FetchOptions | undefined;
748
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
749
+ invitation: {
750
+ id: string;
751
+ organizationId: string;
752
+ email: string;
753
+ role: "admin" | "member" | "owner";
754
+ status: better_auth_client0.InvitationStatus;
755
+ inviterId: string;
756
+ expiresAt: Date;
757
+ createdAt: Date;
758
+ };
759
+ member: {
760
+ id: string;
761
+ organizationId: string;
762
+ userId: string;
763
+ role: string;
764
+ createdAt: Date;
765
+ };
766
+ }, {
767
+ code?: string | undefined;
768
+ message?: string | undefined;
769
+ }, FetchOptions["throw"] extends true ? true : false>>;
770
+ };
771
+ } & {
772
+ organization: {
773
+ getInvitation: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
774
+ id: string;
775
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
776
+ query: {
777
+ id: string;
778
+ };
779
+ fetchOptions?: FetchOptions | undefined;
780
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
781
+ id: string;
782
+ organizationId: string;
783
+ email: string;
784
+ role: "admin" | "member" | "owner";
785
+ status: better_auth_client0.InvitationStatus;
786
+ inviterId: string;
787
+ expiresAt: Date;
788
+ createdAt: Date;
789
+ } & {
790
+ organizationName: string;
791
+ organizationSlug: string;
792
+ inviterEmail: string;
793
+ }>, {
794
+ code?: string | undefined;
795
+ message?: string | undefined;
796
+ }, FetchOptions["throw"] extends true ? true : false>>;
797
+ };
798
+ } & {
799
+ organization: {
800
+ rejectInvitation: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
801
+ invitationId: string;
802
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
803
+ invitationId: string;
804
+ } & {
805
+ fetchOptions?: FetchOptions | undefined;
806
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
807
+ invitation: {
808
+ id: string;
809
+ organizationId: string;
810
+ email: string;
811
+ role: "member" | "admin" | "owner";
812
+ status: better_auth_client0.InvitationStatus;
813
+ inviterId: string;
814
+ expiresAt: Date;
815
+ createdAt: Date;
816
+ } | null;
817
+ member: null;
818
+ }, {
819
+ code?: string | undefined;
820
+ message?: string | undefined;
821
+ }, FetchOptions["throw"] extends true ? true : false>>;
822
+ };
823
+ } & {
824
+ organization: {
825
+ listInvitations: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
826
+ organizationId?: string | undefined;
827
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
828
+ query?: {
829
+ organizationId?: string | undefined;
830
+ } | undefined;
831
+ fetchOptions?: FetchOptions | undefined;
832
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
833
+ id: string;
834
+ organizationId: string;
835
+ email: string;
836
+ role: "admin" | "member" | "owner";
837
+ status: better_auth_client0.InvitationStatus;
838
+ inviterId: string;
839
+ expiresAt: Date;
840
+ createdAt: Date;
841
+ }[], {
842
+ code?: string | undefined;
843
+ message?: string | undefined;
844
+ }, FetchOptions["throw"] extends true ? true : false>>;
845
+ };
846
+ } & {
847
+ organization: {
848
+ getActiveMember: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
849
+ query?: Record<string, any> | undefined;
850
+ fetchOptions?: FetchOptions | undefined;
851
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<Omit<{
852
+ id: string;
853
+ organizationId: string;
854
+ role: "admin" | "member" | "owner";
855
+ createdAt: Date;
856
+ userId: string;
857
+ user: {
858
+ id: string;
859
+ email: string;
860
+ name: string;
861
+ image?: string | undefined;
862
+ };
863
+ } & {
864
+ user: better_auth0.User;
865
+ }, "user"> & {
866
+ user: {
867
+ id: string;
868
+ name: string;
869
+ email: string;
870
+ image: string | undefined;
871
+ };
872
+ }, {
873
+ code?: string | undefined;
874
+ message?: string | undefined;
875
+ }, FetchOptions["throw"] extends true ? true : false>>;
876
+ };
877
+ } & {
878
+ organization: {
879
+ checkSlug: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
880
+ slug: string;
881
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
882
+ slug: string;
883
+ } & {
884
+ fetchOptions?: FetchOptions | undefined;
885
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
886
+ status: boolean;
887
+ }, {
888
+ code?: string | undefined;
889
+ message?: string | undefined;
890
+ }, FetchOptions["throw"] extends true ? true : false>>;
891
+ };
892
+ } & {
893
+ organization: {
894
+ removeMember: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
895
+ memberIdOrEmail: string;
896
+ organizationId?: string | undefined;
897
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
898
+ memberIdOrEmail: string;
899
+ organizationId?: string | undefined;
900
+ } & {
901
+ fetchOptions?: FetchOptions | undefined;
902
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
903
+ member: {
904
+ id: string;
905
+ organizationId: string;
906
+ role: "admin" | "member" | "owner";
907
+ createdAt: Date;
908
+ userId: string;
909
+ user: {
910
+ id: string;
911
+ email: string;
912
+ name: string;
913
+ image?: string | undefined;
914
+ };
915
+ };
916
+ }, {
917
+ code?: string | undefined;
918
+ message?: string | undefined;
919
+ }, FetchOptions["throw"] extends true ? true : false>>;
920
+ };
921
+ } & {
922
+ organization: {
923
+ updateMemberRole: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
924
+ role: better_auth0.LiteralString | "admin" | "member" | "owner" | ("admin" | "member" | "owner")[] | better_auth0.LiteralString[];
925
+ memberId: string;
926
+ organizationId?: string | undefined;
927
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
928
+ role: better_auth0.LiteralString | "admin" | "member" | "owner" | ("admin" | "member" | "owner")[] | better_auth0.LiteralString[];
929
+ memberId: string;
930
+ organizationId?: string | undefined;
931
+ } & {
932
+ fetchOptions?: FetchOptions | undefined;
933
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
934
+ id: string;
935
+ organizationId: string;
936
+ role: "member" | "admin" | "owner";
937
+ createdAt: Date;
938
+ userId: string;
939
+ user: {
940
+ id: string;
941
+ email: string;
942
+ name: string;
943
+ image?: string | undefined;
944
+ };
945
+ }, {
946
+ code?: string | undefined;
947
+ message?: string | undefined;
948
+ }, FetchOptions["throw"] extends true ? true : false>>;
949
+ };
950
+ } & {
951
+ organization: {
952
+ leave: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
953
+ organizationId: string;
954
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
955
+ organizationId: string;
956
+ } & {
957
+ fetchOptions?: FetchOptions | undefined;
958
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<Omit<{
959
+ id: string;
960
+ organizationId: string;
961
+ role: "admin" | "member" | "owner";
962
+ createdAt: Date;
963
+ userId: string;
964
+ user: {
965
+ id: string;
966
+ email: string;
967
+ name: string;
968
+ image?: string | undefined;
969
+ };
970
+ } & {
971
+ user: better_auth0.User;
972
+ }, "user"> & {
973
+ user: {
974
+ id: string;
975
+ name: string;
976
+ email: string;
977
+ image: string | undefined;
978
+ };
979
+ }>, {
980
+ code?: string | undefined;
981
+ message?: string | undefined;
982
+ }, FetchOptions["throw"] extends true ? true : false>>;
983
+ };
984
+ } & {
985
+ organization: {
986
+ listUserInvitations: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
987
+ email?: string | undefined;
988
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
989
+ query?: {
990
+ email?: string | undefined;
991
+ } | undefined;
992
+ fetchOptions?: FetchOptions | undefined;
993
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
994
+ id: string;
995
+ organizationId: string;
996
+ email: string;
997
+ role: "admin" | "member" | "owner";
998
+ status: better_auth_client0.InvitationStatus;
999
+ inviterId: string;
1000
+ expiresAt: Date;
1001
+ createdAt: Date;
1002
+ }[], {
1003
+ code?: string | undefined;
1004
+ message?: string | undefined;
1005
+ }, FetchOptions["throw"] extends true ? true : false>>;
1006
+ };
1007
+ } & {
1008
+ organization: {
1009
+ listMembers: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
1010
+ limit?: string | number | undefined;
1011
+ offset?: string | number | undefined;
1012
+ sortBy?: string | undefined;
1013
+ sortDirection?: "asc" | "desc" | undefined;
1014
+ filterField?: string | undefined;
1015
+ filterValue?: string | number | boolean | undefined;
1016
+ filterOperator?: "contains" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | undefined;
1017
+ organizationId?: string | undefined;
1018
+ organizationSlug?: string | undefined;
1019
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1020
+ query?: {
1021
+ limit?: string | number | undefined;
1022
+ offset?: string | number | undefined;
1023
+ sortBy?: string | undefined;
1024
+ sortDirection?: "asc" | "desc" | undefined;
1025
+ filterField?: string | undefined;
1026
+ filterValue?: string | number | boolean | undefined;
1027
+ filterOperator?: "contains" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | undefined;
1028
+ organizationId?: string | undefined;
1029
+ organizationSlug?: string | undefined;
1030
+ } | undefined;
1031
+ fetchOptions?: FetchOptions | undefined;
1032
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1033
+ members: ({
1034
+ id: string;
1035
+ organizationId: string;
1036
+ role: "admin" | "member" | "owner";
1037
+ createdAt: Date;
1038
+ userId: string;
1039
+ user: {
1040
+ id: string;
1041
+ email: string;
1042
+ name: string;
1043
+ image?: string | undefined;
1044
+ };
1045
+ } & {
1046
+ user: {
1047
+ id: string;
1048
+ name: string;
1049
+ email: string;
1050
+ image: string | null | undefined;
1051
+ };
1052
+ })[];
1053
+ total: number;
1054
+ }, {
1055
+ code?: string | undefined;
1056
+ message?: string | undefined;
1057
+ }, FetchOptions["throw"] extends true ? true : false>>;
1058
+ };
1059
+ } & {
1060
+ organization: {
1061
+ getActiveMemberRole: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
1062
+ userId?: string | undefined;
1063
+ organizationId?: string | undefined;
1064
+ organizationSlug?: string | undefined;
1065
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1066
+ query?: {
1067
+ userId?: string | undefined;
1068
+ organizationId?: string | undefined;
1069
+ organizationSlug?: string | undefined;
1070
+ } | undefined;
1071
+ fetchOptions?: FetchOptions | undefined;
1072
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1073
+ role: "admin" | "member" | "owner";
1074
+ }, {
1075
+ code?: string | undefined;
1076
+ message?: string | undefined;
1077
+ }, FetchOptions["throw"] extends true ? true : false>>;
1078
+ };
1079
+ } & {
1080
+ organization: {
1081
+ hasPermission: <FetchOptions extends better_auth0.ClientFetchOption<Partial<({
1082
+ permission: {
1083
+ 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;
1088
+ };
1089
+ permissions?: never | undefined;
1090
+ } | {
1091
+ permissions: {
1092
+ 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;
1097
+ };
1098
+ permission?: never | undefined;
1099
+ }) & {
1100
+ organizationId?: string | undefined;
1101
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<(({
1102
+ permission: {
1103
+ 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;
1108
+ };
1109
+ permissions?: never | undefined;
1110
+ } | {
1111
+ permissions: {
1112
+ 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;
1117
+ };
1118
+ permission?: never | undefined;
1119
+ }) & {
1120
+ organizationId?: string | undefined;
1121
+ }) & {
1122
+ fetchOptions?: FetchOptions | undefined;
1123
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1124
+ error: null;
1125
+ success: boolean;
1126
+ }, {
1127
+ code?: string | undefined;
1128
+ message?: string | undefined;
1129
+ }, FetchOptions["throw"] extends true ? true : false>>;
1130
+ };
1131
+ } & {
1132
+ emailOtp: {
1133
+ sendVerificationOtp: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1134
+ email: string;
1135
+ type: "sign-in" | "email-verification" | "forget-password";
1136
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1137
+ email: string;
1138
+ type: "sign-in" | "email-verification" | "forget-password";
1139
+ } & {
1140
+ fetchOptions?: FetchOptions | undefined;
1141
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1142
+ success: boolean;
1143
+ }, {
1144
+ code?: string | undefined;
1145
+ message?: string | undefined;
1146
+ }, FetchOptions["throw"] extends true ? true : false>>;
1147
+ };
1148
+ } & {
1149
+ emailOtp: {
1150
+ checkVerificationOtp: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1151
+ email: string;
1152
+ type: "sign-in" | "email-verification" | "forget-password";
1153
+ otp: string;
1154
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1155
+ email: string;
1156
+ type: "sign-in" | "email-verification" | "forget-password";
1157
+ otp: string;
1158
+ } & {
1159
+ fetchOptions?: FetchOptions | undefined;
1160
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1161
+ success: boolean;
1162
+ }, {
1163
+ code?: string | undefined;
1164
+ message?: string | undefined;
1165
+ }, FetchOptions["throw"] extends true ? true : false>>;
1166
+ };
1167
+ } & {
1168
+ emailOtp: {
1169
+ verifyEmail: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1170
+ email: string;
1171
+ otp: string;
1172
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1173
+ email: string;
1174
+ otp: string;
1175
+ } & {
1176
+ fetchOptions?: FetchOptions | undefined;
1177
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
1178
+ status: boolean;
1179
+ token: string;
1180
+ user: {
1181
+ id: string;
1182
+ email: string;
1183
+ emailVerified: boolean;
1184
+ name: string;
1185
+ image: string | null | undefined;
1186
+ createdAt: Date;
1187
+ updatedAt: Date;
1188
+ };
1189
+ } | {
1190
+ status: boolean;
1191
+ token: null;
1192
+ user: {
1193
+ id: string;
1194
+ email: string;
1195
+ emailVerified: boolean;
1196
+ name: string;
1197
+ image: string | null | undefined;
1198
+ createdAt: Date;
1199
+ updatedAt: Date;
1200
+ };
1201
+ }>, {
1202
+ code?: string | undefined;
1203
+ message?: string | undefined;
1204
+ }, FetchOptions["throw"] extends true ? true : false>>;
1205
+ };
1206
+ } & {
1207
+ signIn: {
1208
+ emailOtp: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1209
+ email: string;
1210
+ otp: string;
1211
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1212
+ email: string;
1213
+ otp: string;
1214
+ } & {
1215
+ fetchOptions?: FetchOptions | undefined;
1216
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1217
+ token: string;
1218
+ user: {
1219
+ id: string;
1220
+ email: string;
1221
+ emailVerified: boolean;
1222
+ name: string;
1223
+ image: string | null | undefined;
1224
+ createdAt: Date;
1225
+ updatedAt: Date;
1226
+ };
1227
+ }, {
1228
+ code?: string | undefined;
1229
+ message?: string | undefined;
1230
+ }, FetchOptions["throw"] extends true ? true : false>>;
1231
+ };
1232
+ } & {
1233
+ forgetPassword: {
1234
+ emailOtp: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1235
+ email: string;
1236
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1237
+ email: string;
1238
+ } & {
1239
+ fetchOptions?: FetchOptions | undefined;
1240
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1241
+ success: boolean;
1242
+ }, {
1243
+ code?: string | undefined;
1244
+ message?: string | undefined;
1245
+ }, FetchOptions["throw"] extends true ? true : false>>;
1246
+ };
1247
+ } & {
1248
+ emailOtp: {
1249
+ resetPassword: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1250
+ email: string;
1251
+ otp: string;
1252
+ password: string;
1253
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1254
+ email: string;
1255
+ otp: string;
1256
+ password: string;
1257
+ } & {
1258
+ fetchOptions?: FetchOptions | undefined;
1259
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1260
+ success: boolean;
1261
+ }, {
1262
+ code?: string | undefined;
1263
+ message?: string | undefined;
1264
+ }, FetchOptions["throw"] extends true ? true : false>>;
1265
+ };
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
+ } & {
1437
+ signIn: {
1438
+ social: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1439
+ provider: (string & {}) | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel";
1440
+ callbackURL?: string | undefined;
1441
+ newUserCallbackURL?: string | undefined;
1442
+ errorCallbackURL?: string | undefined;
1443
+ disableRedirect?: boolean | undefined;
1444
+ idToken?: {
1445
+ token: string;
1446
+ nonce?: string | undefined;
1447
+ accessToken?: string | undefined;
1448
+ refreshToken?: string | undefined;
1449
+ expiresAt?: number | undefined;
1450
+ } | undefined;
1451
+ scopes?: string[] | undefined;
1452
+ requestSignUp?: boolean | undefined;
1453
+ loginHint?: string | undefined;
1454
+ additionalData?: Record<string, any> | undefined;
1455
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1456
+ provider: (string & {}) | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel";
1457
+ callbackURL?: string | undefined;
1458
+ newUserCallbackURL?: string | undefined;
1459
+ errorCallbackURL?: string | undefined;
1460
+ disableRedirect?: boolean | undefined;
1461
+ idToken?: {
1462
+ token: string;
1463
+ nonce?: string | undefined;
1464
+ accessToken?: string | undefined;
1465
+ refreshToken?: string | undefined;
1466
+ expiresAt?: number | undefined;
1467
+ } | undefined;
1468
+ scopes?: string[] | undefined;
1469
+ requestSignUp?: boolean | undefined;
1470
+ loginHint?: string | undefined;
1471
+ additionalData?: Record<string, any> | undefined;
1472
+ } & {
1473
+ fetchOptions?: FetchOptions | undefined;
1474
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
1475
+ redirect: boolean;
1476
+ url: string;
1477
+ } | {
1478
+ redirect: boolean;
1479
+ token: string;
1480
+ url: undefined;
1481
+ user: {
1482
+ id: string;
1483
+ createdAt: Date;
1484
+ updatedAt: Date;
1485
+ email: string;
1486
+ emailVerified: boolean;
1487
+ name: string;
1488
+ image?: string | null | undefined | undefined;
1489
+ };
1490
+ }>, {
1491
+ code?: string | undefined;
1492
+ message?: string | undefined;
1493
+ }, FetchOptions["throw"] extends true ? true : false>>;
1494
+ };
1495
+ } & {
1496
+ signOut: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1497
+ query?: Record<string, any> | undefined;
1498
+ fetchOptions?: FetchOptions | undefined;
1499
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1500
+ success: boolean;
1501
+ }, {
1502
+ code?: string | undefined;
1503
+ message?: string | undefined;
1504
+ }, FetchOptions["throw"] extends true ? true : false>>;
1505
+ } & {
1506
+ signUp: {
1507
+ email: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1508
+ name: string;
1509
+ email: string;
1510
+ password: string;
1511
+ image?: string | undefined;
1512
+ callbackURL?: string | undefined;
1513
+ rememberMe?: boolean | undefined;
1514
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1515
+ email: string;
1516
+ name: string;
1517
+ password: string;
1518
+ image?: string | undefined;
1519
+ callbackURL?: string | undefined;
1520
+ fetchOptions?: FetchOptions | undefined;
1521
+ } & {} & {} & {} & {} & {} & {
1522
+ phoneNumber?: string | null | undefined;
1523
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
1524
+ token: null;
1525
+ user: {
1526
+ id: string;
1527
+ createdAt: Date;
1528
+ updatedAt: Date;
1529
+ email: string;
1530
+ emailVerified: boolean;
1531
+ name: string;
1532
+ image?: string | null | undefined | undefined;
1533
+ };
1534
+ } | {
1535
+ token: string;
1536
+ user: {
1537
+ id: string;
1538
+ createdAt: Date;
1539
+ updatedAt: Date;
1540
+ email: string;
1541
+ emailVerified: boolean;
1542
+ name: string;
1543
+ image?: string | null | undefined | undefined;
1544
+ };
1545
+ }>, {
1546
+ code?: string | undefined;
1547
+ message?: string | undefined;
1548
+ }, FetchOptions["throw"] extends true ? true : false>>;
1549
+ };
1550
+ } & {
1551
+ signIn: {
1552
+ email: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1553
+ email: string;
1554
+ password: string;
1555
+ callbackURL?: string | undefined;
1556
+ rememberMe?: boolean | undefined;
1557
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1558
+ email: string;
1559
+ password: string;
1560
+ callbackURL?: string | undefined;
1561
+ rememberMe?: boolean | undefined;
1562
+ } & {
1563
+ fetchOptions?: FetchOptions | undefined;
1564
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1565
+ redirect: boolean;
1566
+ token: string;
1567
+ url?: string | undefined;
1568
+ user: {
1569
+ id: string;
1570
+ createdAt: Date;
1571
+ updatedAt: Date;
1572
+ email: string;
1573
+ emailVerified: boolean;
1574
+ name: string;
1575
+ image?: string | null | undefined | undefined;
1576
+ };
1577
+ }, {
1578
+ code?: string | undefined;
1579
+ message?: string | undefined;
1580
+ }, FetchOptions["throw"] extends true ? true : false>>;
1581
+ };
1582
+ } & {
1583
+ resetPassword: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1584
+ newPassword: string;
1585
+ token?: string | undefined;
1586
+ }> & Record<string, any>, Partial<{
1587
+ token?: string | undefined;
1588
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1589
+ newPassword: string;
1590
+ token?: string | undefined;
1591
+ } & {
1592
+ fetchOptions?: FetchOptions | undefined;
1593
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1594
+ status: boolean;
1595
+ }, {
1596
+ code?: string | undefined;
1597
+ message?: string | undefined;
1598
+ }, FetchOptions["throw"] extends true ? true : false>>;
1599
+ } & {
1600
+ verifyEmail: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
1601
+ token: string;
1602
+ callbackURL?: string | undefined;
1603
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1604
+ query: {
1605
+ token: string;
1606
+ callbackURL?: string | undefined;
1607
+ };
1608
+ fetchOptions?: FetchOptions | undefined;
1609
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<void | {
1610
+ status: boolean;
1611
+ }>, {
1612
+ code?: string | undefined;
1613
+ message?: string | undefined;
1614
+ }, FetchOptions["throw"] extends true ? true : false>>;
1615
+ } & {
1616
+ sendVerificationEmail: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1617
+ email: string;
1618
+ callbackURL?: string | undefined;
1619
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1620
+ email: string;
1621
+ callbackURL?: string | undefined;
1622
+ } & {
1623
+ fetchOptions?: FetchOptions | undefined;
1624
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1625
+ status: boolean;
1626
+ }, {
1627
+ code?: string | undefined;
1628
+ message?: string | undefined;
1629
+ }, FetchOptions["throw"] extends true ? true : false>>;
1630
+ } & {
1631
+ changeEmail: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1632
+ newEmail: string;
1633
+ callbackURL?: string | undefined;
1634
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1635
+ newEmail: string;
1636
+ callbackURL?: string | undefined;
1637
+ } & {
1638
+ fetchOptions?: FetchOptions | undefined;
1639
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1640
+ status: boolean;
1641
+ }, {
1642
+ code?: string | undefined;
1643
+ message?: string | undefined;
1644
+ }, FetchOptions["throw"] extends true ? true : false>>;
1645
+ } & {
1646
+ changePassword: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1647
+ newPassword: string;
1648
+ currentPassword: string;
1649
+ revokeOtherSessions?: boolean | undefined;
1650
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1651
+ newPassword: string;
1652
+ currentPassword: string;
1653
+ revokeOtherSessions?: boolean | undefined;
1654
+ } & {
1655
+ fetchOptions?: FetchOptions | undefined;
1656
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1657
+ token: string | null;
1658
+ user: {
1659
+ id: string;
1660
+ email: string;
1661
+ name: string;
1662
+ image: string | null | undefined;
1663
+ emailVerified: boolean;
1664
+ createdAt: Date;
1665
+ updatedAt: Date;
1666
+ };
1667
+ }, {
1668
+ code?: string | undefined;
1669
+ message?: string | undefined;
1670
+ }, FetchOptions["throw"] extends true ? true : false>>;
1671
+ } & {
1672
+ updateUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<Partial<{}> & {
1673
+ name?: string | undefined;
1674
+ image?: string | undefined | null;
1675
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1676
+ image?: (string | null) | undefined;
1677
+ name?: string | undefined;
1678
+ fetchOptions?: FetchOptions | undefined;
1679
+ } & Partial<{} & {} & {} & {} & {} & {
1680
+ phoneNumber?: string | null | undefined;
1681
+ }>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1682
+ status: boolean;
1683
+ }, {
1684
+ code?: string | undefined;
1685
+ message?: string | undefined;
1686
+ }, FetchOptions["throw"] extends true ? true : false>>;
1687
+ } & {
1688
+ deleteUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1689
+ callbackURL?: string | undefined;
1690
+ password?: string | undefined;
1691
+ token?: string | undefined;
1692
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1693
+ callbackURL?: string | undefined;
1694
+ password?: string | undefined;
1695
+ token?: string | undefined;
1696
+ } & {
1697
+ fetchOptions?: FetchOptions | undefined;
1698
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1699
+ success: boolean;
1700
+ message: string;
1701
+ }, {
1702
+ code?: string | undefined;
1703
+ message?: string | undefined;
1704
+ }, FetchOptions["throw"] extends true ? true : false>>;
1705
+ } & {
1706
+ requestPasswordReset: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1707
+ email: string;
1708
+ redirectTo?: string | undefined;
1709
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1710
+ email: string;
1711
+ redirectTo?: string | undefined;
1712
+ } & {
1713
+ fetchOptions?: FetchOptions | undefined;
1714
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1715
+ status: boolean;
1716
+ message: string;
1717
+ }, {
1718
+ code?: string | undefined;
1719
+ message?: string | undefined;
1720
+ }, FetchOptions["throw"] extends true ? true : false>>;
1721
+ } & {
1722
+ resetPassword: {
1723
+ ":token": <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
1724
+ callbackURL: string;
1725
+ }> & Record<string, any>, {
1726
+ token: string;
1727
+ }>>(data_0: better_auth0.Prettify<{
1728
+ query: {
1729
+ callbackURL: string;
1730
+ };
1731
+ fetchOptions?: FetchOptions | undefined;
1732
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<never, {
1733
+ code?: string | undefined;
1734
+ message?: string | undefined;
1735
+ }, FetchOptions["throw"] extends true ? true : false>>;
1736
+ };
1737
+ } & {
1738
+ listSessions: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1739
+ query?: Record<string, any> | undefined;
1740
+ fetchOptions?: FetchOptions | undefined;
1741
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<better_auth0.Prettify<{
1742
+ id: string;
1743
+ createdAt: Date;
1744
+ updatedAt: Date;
1745
+ userId: string;
1746
+ expiresAt: Date;
1747
+ token: string;
1748
+ ipAddress?: string | null | undefined | undefined;
1749
+ userAgent?: string | null | undefined | undefined;
1750
+ }>[], {
1751
+ code?: string | undefined;
1752
+ message?: string | undefined;
1753
+ }, FetchOptions["throw"] extends true ? true : false>>;
1754
+ } & {
1755
+ revokeSession: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1756
+ token: string;
1757
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1758
+ token: string;
1759
+ } & {
1760
+ fetchOptions?: FetchOptions | undefined;
1761
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1762
+ status: boolean;
1763
+ }, {
1764
+ code?: string | undefined;
1765
+ message?: string | undefined;
1766
+ }, FetchOptions["throw"] extends true ? true : false>>;
1767
+ } & {
1768
+ revokeSessions: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1769
+ query?: Record<string, any> | undefined;
1770
+ fetchOptions?: FetchOptions | undefined;
1771
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1772
+ status: boolean;
1773
+ }, {
1774
+ code?: string | undefined;
1775
+ message?: string | undefined;
1776
+ }, FetchOptions["throw"] extends true ? true : false>>;
1777
+ } & {
1778
+ revokeOtherSessions: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1779
+ query?: Record<string, any> | undefined;
1780
+ fetchOptions?: FetchOptions | undefined;
1781
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1782
+ status: boolean;
1783
+ }, {
1784
+ code?: string | undefined;
1785
+ message?: string | undefined;
1786
+ }, FetchOptions["throw"] extends true ? true : false>>;
1787
+ } & {
1788
+ linkSocial: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1789
+ provider: unknown;
1790
+ callbackURL?: string | undefined;
1791
+ idToken?: {
1792
+ token: string;
1793
+ nonce?: string | undefined;
1794
+ accessToken?: string | undefined;
1795
+ refreshToken?: string | undefined;
1796
+ scopes?: string[] | undefined;
1797
+ } | undefined;
1798
+ requestSignUp?: boolean | undefined;
1799
+ scopes?: string[] | undefined;
1800
+ errorCallbackURL?: string | undefined;
1801
+ disableRedirect?: boolean | undefined;
1802
+ additionalData?: Record<string, any> | undefined;
1803
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1804
+ provider: unknown;
1805
+ callbackURL?: string | undefined;
1806
+ idToken?: {
1807
+ token: string;
1808
+ nonce?: string | undefined;
1809
+ accessToken?: string | undefined;
1810
+ refreshToken?: string | undefined;
1811
+ scopes?: string[] | undefined;
1812
+ } | undefined;
1813
+ requestSignUp?: boolean | undefined;
1814
+ scopes?: string[] | undefined;
1815
+ errorCallbackURL?: string | undefined;
1816
+ disableRedirect?: boolean | undefined;
1817
+ additionalData?: Record<string, any> | undefined;
1818
+ } & {
1819
+ fetchOptions?: FetchOptions | undefined;
1820
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1821
+ url: string;
1822
+ redirect: boolean;
1823
+ }, {
1824
+ code?: string | undefined;
1825
+ message?: string | undefined;
1826
+ }, FetchOptions["throw"] extends true ? true : false>>;
1827
+ } & {
1828
+ listAccounts: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1829
+ query?: Record<string, any> | undefined;
1830
+ fetchOptions?: FetchOptions | undefined;
1831
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1832
+ id: string;
1833
+ providerId: string;
1834
+ createdAt: Date;
1835
+ updatedAt: Date;
1836
+ accountId: string;
1837
+ userId: string;
1838
+ scopes: string[];
1839
+ }[], {
1840
+ code?: string | undefined;
1841
+ message?: string | undefined;
1842
+ }, FetchOptions["throw"] extends true ? true : false>>;
1843
+ } & {
1844
+ deleteUser: {
1845
+ callback: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
1846
+ token: string;
1847
+ callbackURL?: string | undefined;
1848
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1849
+ query: {
1850
+ token: string;
1851
+ callbackURL?: string | undefined;
1852
+ };
1853
+ fetchOptions?: FetchOptions | undefined;
1854
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1855
+ success: boolean;
1856
+ message: string;
1857
+ }, {
1858
+ code?: string | undefined;
1859
+ message?: string | undefined;
1860
+ }, FetchOptions["throw"] extends true ? true : false>>;
1861
+ };
1862
+ } & {
1863
+ unlinkAccount: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1864
+ providerId: string;
1865
+ accountId?: string | undefined;
1866
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1867
+ providerId: string;
1868
+ accountId?: string | undefined;
1869
+ } & {
1870
+ fetchOptions?: FetchOptions | undefined;
1871
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1872
+ status: boolean;
1873
+ }, {
1874
+ code?: string | undefined;
1875
+ message?: string | undefined;
1876
+ }, FetchOptions["throw"] extends true ? true : false>>;
1877
+ } & {
1878
+ refreshToken: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1879
+ providerId: string;
1880
+ accountId?: string | undefined;
1881
+ userId?: string | undefined;
1882
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1883
+ providerId: string;
1884
+ accountId?: string | undefined;
1885
+ userId?: string | undefined;
1886
+ } & {
1887
+ fetchOptions?: FetchOptions | undefined;
1888
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1889
+ accessToken: string | undefined;
1890
+ refreshToken: string | undefined;
1891
+ accessTokenExpiresAt: Date | undefined;
1892
+ refreshTokenExpiresAt: Date | undefined;
1893
+ scope: string | null | undefined;
1894
+ idToken: string | null | undefined;
1895
+ providerId: string;
1896
+ accountId: string;
1897
+ }, {
1898
+ code?: string | undefined;
1899
+ message?: string | undefined;
1900
+ }, FetchOptions["throw"] extends true ? true : false>>;
1901
+ } & {
1902
+ getAccessToken: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1903
+ providerId: string;
1904
+ accountId?: string | undefined;
1905
+ userId?: string | undefined;
1906
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1907
+ providerId: string;
1908
+ accountId?: string | undefined;
1909
+ userId?: string | undefined;
1910
+ } & {
1911
+ fetchOptions?: FetchOptions | undefined;
1912
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1913
+ accessToken: string;
1914
+ accessTokenExpiresAt: Date | undefined;
1915
+ scopes: string[];
1916
+ idToken: string | undefined;
1917
+ }, {
1918
+ code?: string | undefined;
1919
+ message?: string | undefined;
1920
+ }, FetchOptions["throw"] extends true ? true : false>>;
1921
+ } & {
1922
+ accountInfo: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
1923
+ accountId?: string | undefined;
1924
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1925
+ query?: {
1926
+ accountId?: string | undefined;
1927
+ } | undefined;
1928
+ fetchOptions?: FetchOptions | undefined;
1929
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1930
+ user: better_auth0.OAuth2UserInfo;
1931
+ data: Record<string, any>;
1932
+ }, {
1933
+ code?: string | undefined;
1934
+ message?: string | undefined;
1935
+ }, FetchOptions["throw"] extends true ? true : false>>;
1936
+ } & {
1937
+ getSession: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
1938
+ disableCookieCache?: unknown;
1939
+ disableRefresh?: unknown;
1940
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth0.Prettify<{
1941
+ query?: {
1942
+ disableCookieCache?: unknown;
1943
+ disableRefresh?: unknown;
1944
+ } | undefined;
1945
+ fetchOptions?: FetchOptions | undefined;
1946
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1947
+ user: {
1948
+ id: string;
1949
+ createdAt: Date;
1950
+ updatedAt: Date;
1951
+ email: string;
1952
+ emailVerified: boolean;
1953
+ name: string;
1954
+ image?: string | null | undefined;
1955
+ banned: boolean | null | undefined;
1956
+ role?: string | null | undefined;
1957
+ banReason?: string | null | undefined;
1958
+ banExpires?: Date | null | undefined;
1959
+ isAnonymous: boolean | null | undefined;
1960
+ phoneNumber?: string | null | undefined;
1961
+ phoneNumberVerified?: boolean | null | undefined;
1962
+ };
1963
+ session: {
1964
+ id: string;
1965
+ createdAt: Date;
1966
+ updatedAt: Date;
1967
+ userId: string;
1968
+ expiresAt: Date;
1969
+ token: string;
1970
+ ipAddress?: string | null | undefined;
1971
+ userAgent?: string | null | undefined;
1972
+ impersonatedBy?: string | null | undefined;
1973
+ activeOrganizationId?: string | null | undefined;
1974
+ };
1975
+ } | null, {
1976
+ code?: string | undefined;
1977
+ message?: string | undefined;
1978
+ }, FetchOptions["throw"] extends true ? true : false>>;
1979
+ } & {
1980
+ jwks: (fetchOptions?: any) => Promise<{
1981
+ data: null;
1982
+ error: {
1983
+ message?: string | undefined;
1984
+ status: number;
1985
+ statusText: string;
1986
+ };
1987
+ } | {
1988
+ data: jose0.JSONWebKeySet;
1989
+ error: null;
1990
+ }>;
1991
+ } & {
1992
+ admin: {
1993
+ checkRolePermission: <R extends "user" | "admin">(data: ({
1994
+ permission: {
1995
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
1996
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1997
+ };
1998
+ permissions?: never | undefined;
1999
+ } | {
2000
+ permissions: {
2001
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
2002
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
2003
+ };
2004
+ permission?: never | undefined;
2005
+ }) & {
2006
+ role: R;
2007
+ }) => boolean;
2008
+ };
2009
+ } & {
2010
+ $Infer: {
2011
+ ActiveOrganization: {
2012
+ members: {
2013
+ id: string;
2014
+ organizationId: string;
2015
+ role: "admin" | "member" | "owner";
2016
+ createdAt: Date;
2017
+ userId: string;
2018
+ user: {
2019
+ id: string;
2020
+ email: string;
2021
+ name: string;
2022
+ image?: string | undefined;
2023
+ };
2024
+ }[];
2025
+ invitations: {
2026
+ id: string;
2027
+ organizationId: string;
2028
+ email: string;
2029
+ role: "admin" | "member" | "owner";
2030
+ status: better_auth_client0.InvitationStatus;
2031
+ inviterId: string;
2032
+ expiresAt: Date;
2033
+ createdAt: Date;
2034
+ }[];
2035
+ } & {
2036
+ id: string;
2037
+ name: string;
2038
+ slug: string;
2039
+ createdAt: Date;
2040
+ logo?: string | null | undefined | undefined;
2041
+ metadata?: any;
2042
+ };
2043
+ Organization: {
2044
+ id: string;
2045
+ name: string;
2046
+ slug: string;
2047
+ createdAt: Date;
2048
+ logo?: string | null | undefined;
2049
+ metadata?: any;
2050
+ };
2051
+ Invitation: {
2052
+ id: string;
2053
+ organizationId: string;
2054
+ email: string;
2055
+ role: "admin" | "member" | "owner";
2056
+ status: better_auth_client0.InvitationStatus;
2057
+ inviterId: string;
2058
+ expiresAt: Date;
2059
+ createdAt: Date;
2060
+ };
2061
+ Member: {
2062
+ id: string;
2063
+ organizationId: string;
2064
+ role: "admin" | "member" | "owner";
2065
+ createdAt: Date;
2066
+ userId: string;
2067
+ user: {
2068
+ id: string;
2069
+ email: string;
2070
+ name: string;
2071
+ image?: string | undefined;
2072
+ };
2073
+ };
2074
+ Team: {
2075
+ id: string;
2076
+ name: string;
2077
+ organizationId: string;
2078
+ createdAt: Date;
2079
+ updatedAt?: Date | undefined;
2080
+ };
2081
+ };
2082
+ organization: {
2083
+ checkRolePermission: <R extends "admin" | "member" | "owner">(data: ({
2084
+ permission: {
2085
+ 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;
2090
+ };
2091
+ permissions?: never | undefined;
2092
+ } | {
2093
+ permissions: {
2094
+ 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;
2099
+ };
2100
+ permission?: never | undefined;
2101
+ }) & {
2102
+ role: R;
2103
+ }) => boolean;
2104
+ };
2105
+ } & {
2106
+ useSession: () => {
2107
+ data: {
2108
+ user: {
2109
+ id: string;
2110
+ createdAt: Date;
2111
+ updatedAt: Date;
2112
+ email: string;
2113
+ emailVerified: boolean;
2114
+ name: string;
2115
+ image?: string | null | undefined;
2116
+ banned: boolean | null | undefined;
2117
+ role?: string | null | undefined;
2118
+ banReason?: string | null | undefined;
2119
+ banExpires?: Date | null | undefined;
2120
+ isAnonymous: boolean | null | undefined;
2121
+ phoneNumber?: string | null | undefined;
2122
+ phoneNumberVerified?: boolean | null | undefined;
2123
+ };
2124
+ session: {
2125
+ id: string;
2126
+ createdAt: Date;
2127
+ updatedAt: Date;
2128
+ userId: string;
2129
+ expiresAt: Date;
2130
+ token: string;
2131
+ ipAddress?: string | null | undefined;
2132
+ userAgent?: string | null | undefined;
2133
+ impersonatedBy?: string | null | undefined;
2134
+ activeOrganizationId?: string | null | undefined;
2135
+ };
2136
+ } | null;
2137
+ isPending: boolean;
2138
+ isRefetching: boolean;
2139
+ error: _better_fetch_fetch0.BetterFetchError | null;
2140
+ refetch: (queryParams?: {
2141
+ query?: better_auth0.SessionQueryParams;
2142
+ } | undefined) => Promise<void>;
2143
+ };
2144
+ $Infer: {
2145
+ Session: {
2146
+ user: {
2147
+ id: string;
2148
+ createdAt: Date;
2149
+ updatedAt: Date;
2150
+ email: string;
2151
+ emailVerified: boolean;
2152
+ name: string;
2153
+ image?: string | null | undefined;
2154
+ banned: boolean | null | undefined;
2155
+ role?: string | null | undefined;
2156
+ banReason?: string | null | undefined;
2157
+ banExpires?: Date | null | undefined;
2158
+ isAnonymous: boolean | null | undefined;
2159
+ phoneNumber?: string | null | undefined;
2160
+ phoneNumberVerified?: boolean | null | undefined;
2161
+ };
2162
+ session: {
2163
+ id: string;
2164
+ createdAt: Date;
2165
+ updatedAt: Date;
2166
+ userId: string;
2167
+ expiresAt: Date;
2168
+ token: string;
2169
+ ipAddress?: string | null | undefined;
2170
+ userAgent?: string | null | undefined;
2171
+ impersonatedBy?: string | null | undefined;
2172
+ activeOrganizationId?: string | null | undefined;
2173
+ };
2174
+ };
2175
+ };
2176
+ $fetch: _better_fetch_fetch0.BetterFetch<{
2177
+ plugins: (_better_fetch_fetch0.BetterFetchPlugin | {
2178
+ id: string;
2179
+ name: string;
2180
+ hooks: {
2181
+ onSuccess(context: _better_fetch_fetch0.SuccessContext<any>): void;
2182
+ };
2183
+ } | {
2184
+ id: string;
2185
+ name: string;
2186
+ hooks: {
2187
+ onSuccess: ((context: _better_fetch_fetch0.SuccessContext<any>) => Promise<void> | void) | undefined;
2188
+ onError: ((context: _better_fetch_fetch0.ErrorContext) => Promise<void> | void) | undefined;
2189
+ onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch0.RequestContext<T>) => Promise<_better_fetch_fetch0.RequestContext | void> | _better_fetch_fetch0.RequestContext | void) | undefined;
2190
+ onResponse: ((context: _better_fetch_fetch0.ResponseContext) => Promise<Response | void | _better_fetch_fetch0.ResponseContext> | Response | _better_fetch_fetch0.ResponseContext | void) | undefined;
2191
+ };
2192
+ })[];
2193
+ cache?: RequestCache | undefined;
2194
+ method: string;
2195
+ headers?: (HeadersInit & (HeadersInit | {
2196
+ accept: "application/json" | "text/plain" | "application/octet-stream";
2197
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
2198
+ authorization: "Bearer" | "Basic";
2199
+ })) | undefined;
2200
+ redirect?: RequestRedirect | undefined;
2201
+ credentials?: RequestCredentials;
2202
+ integrity?: string | undefined;
2203
+ keepalive?: boolean | undefined;
2204
+ mode?: RequestMode | undefined;
2205
+ priority?: RequestPriority | undefined;
2206
+ referrer?: string | undefined;
2207
+ referrerPolicy?: ReferrerPolicy | undefined;
2208
+ signal?: (AbortSignal | null) | undefined;
2209
+ window?: null | undefined;
2210
+ onRetry?: ((response: _better_fetch_fetch0.ResponseContext) => Promise<void> | void) | undefined;
2211
+ hookOptions?: {
2212
+ cloneResponse?: boolean;
2213
+ } | undefined;
2214
+ timeout?: number | undefined;
2215
+ customFetchImpl: _better_fetch_fetch0.FetchEsque;
2216
+ baseURL: string;
2217
+ throw?: boolean | undefined;
2218
+ auth?: ({
2219
+ type: "Bearer";
2220
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
2221
+ } | {
2222
+ type: "Basic";
2223
+ username: string | (() => string | undefined) | undefined;
2224
+ password: string | (() => string | undefined) | undefined;
2225
+ } | {
2226
+ type: "Custom";
2227
+ prefix: string | (() => string | undefined) | undefined;
2228
+ value: string | (() => string | undefined) | undefined;
2229
+ }) | undefined;
2230
+ body?: any;
2231
+ query?: any;
2232
+ params?: any;
2233
+ duplex?: "full" | "half" | undefined;
2234
+ jsonParser: (text: string) => Promise<any> | any;
2235
+ retry?: _better_fetch_fetch0.RetryOptions | undefined;
2236
+ retryAttempt?: number | undefined;
2237
+ output?: (_better_fetch_fetch0.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2238
+ errorSchema?: _better_fetch_fetch0.StandardSchemaV1 | undefined;
2239
+ disableValidation?: boolean | undefined;
2240
+ disableSignal?: boolean | undefined;
2241
+ }, unknown, unknown, {}>;
2242
+ $store: {
2243
+ notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
2244
+ listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
2245
+ atoms: Record<string, nanostores0.WritableAtom<any>>;
2246
+ };
2247
+ $ERROR_CODES: {
2248
+ readonly FAILED_TO_CREATE_USER: "Failed to create user";
2249
+ readonly USER_ALREADY_EXISTS: "User already exists.";
2250
+ readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
2251
+ readonly YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself";
2252
+ readonly YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role";
2253
+ readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users";
2254
+ readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users";
2255
+ readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions";
2256
+ readonly YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users";
2257
+ readonly YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users";
2258
+ readonly YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions";
2259
+ readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users";
2260
+ readonly YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password";
2261
+ readonly BANNED_USER: "You have been banned from this application";
2262
+ readonly YOU_ARE_NOT_ALLOWED_TO_GET_USER: "You are not allowed to get user";
2263
+ readonly NO_DATA_TO_UPDATE: "No data to update";
2264
+ readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
2265
+ readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
2266
+ readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
2267
+ readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization";
2268
+ readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations";
2269
+ readonly ORGANIZATION_ALREADY_EXISTS: "Organization already exists";
2270
+ readonly ORGANIZATION_SLUG_ALREADY_TAKEN: "Organization slug already taken";
2271
+ readonly ORGANIZATION_NOT_FOUND: "Organization not found";
2272
+ readonly USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: "User is not a member of the organization";
2273
+ readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: "You are not allowed to update this organization";
2274
+ readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: "You are not allowed to delete this organization";
2275
+ readonly NO_ACTIVE_ORGANIZATION: "No active organization";
2276
+ readonly USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: "User is already a member of this organization";
2277
+ readonly MEMBER_NOT_FOUND: "Member not found";
2278
+ readonly ROLE_NOT_FOUND: "Role not found";
2279
+ readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: "You are not allowed to create a new team";
2280
+ readonly TEAM_ALREADY_EXISTS: "Team already exists";
2281
+ readonly TEAM_NOT_FOUND: "Team not found";
2282
+ readonly YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: "You cannot leave the organization as the only owner";
2283
+ readonly YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: "You cannot leave the organization without an owner";
2284
+ readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: "You are not allowed to delete this member";
2285
+ readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: "You are not allowed to invite users to this organization";
2286
+ readonly USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: "User is already invited to this organization";
2287
+ readonly INVITATION_NOT_FOUND: "Invitation not found";
2288
+ readonly YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: "You are not the recipient of the invitation";
2289
+ readonly EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: "Email verification required before accepting or rejecting invitation";
2290
+ readonly YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: "You are not allowed to cancel this invitation";
2291
+ readonly INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: "Inviter is no longer a member of the organization";
2292
+ readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: "You are not allowed to invite a user with this role";
2293
+ readonly FAILED_TO_RETRIEVE_INVITATION: "Failed to retrieve invitation";
2294
+ readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: "You have reached the maximum number of teams";
2295
+ readonly UNABLE_TO_REMOVE_LAST_TEAM: "Unable to remove last team";
2296
+ readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: "You are not allowed to update this member";
2297
+ readonly ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: "Organization membership limit reached";
2298
+ readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to create teams in this organization";
2299
+ readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to delete teams in this organization";
2300
+ readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: "You are not allowed to update this team";
2301
+ readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: "You are not allowed to delete this team";
2302
+ readonly INVITATION_LIMIT_REACHED: "Invitation limit reached";
2303
+ readonly TEAM_MEMBER_LIMIT_REACHED: "Team member limit reached";
2304
+ readonly USER_IS_NOT_A_MEMBER_OF_THE_TEAM: "User is not a member of the team";
2305
+ readonly YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: "You are not allowed to list the members of this team";
2306
+ readonly YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: "You do not have an active team";
2307
+ readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: "You are not allowed to create a new member";
2308
+ readonly YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: "You are not allowed to remove a team member";
2309
+ readonly YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: "You are not allowed to access this organization as an owner";
2310
+ readonly YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: "You are not a member of this organization";
2311
+ readonly MISSING_AC_INSTANCE: "Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information";
2312
+ readonly YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: "You must be in an organization to create a role";
2313
+ readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: "You are not allowed to create a role";
2314
+ readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: "You are not allowed to update a role";
2315
+ readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: "You are not allowed to delete a role";
2316
+ readonly YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: "You are not allowed to read a role";
2317
+ readonly YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: "You are not allowed to list a role";
2318
+ readonly YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: "You are not allowed to get a role";
2319
+ readonly TOO_MANY_ROLES: "This organization has too many roles";
2320
+ readonly INVALID_RESOURCE: "The provided permission includes an invalid resource";
2321
+ readonly ROLE_NAME_IS_ALREADY_TAKEN: "That role name is already taken";
2322
+ readonly CANNOT_DELETE_A_PRE_DEFINED_ROLE: "Cannot delete a pre-defined role";
2323
+ readonly OTP_EXPIRED: "OTP expired";
2324
+ readonly INVALID_OTP: "Invalid OTP";
2325
+ 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
+ readonly USER_NOT_FOUND: "User not found";
2339
+ readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
2340
+ readonly FAILED_TO_UPDATE_USER: "Failed to update user";
2341
+ readonly FAILED_TO_GET_SESSION: "Failed to get session";
2342
+ readonly INVALID_PASSWORD: "Invalid password";
2343
+ readonly INVALID_EMAIL: "Invalid email";
2344
+ readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
2345
+ readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
2346
+ readonly PROVIDER_NOT_FOUND: "Provider not found";
2347
+ readonly INVALID_TOKEN: "Invalid token";
2348
+ readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
2349
+ readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
2350
+ readonly USER_EMAIL_NOT_FOUND: "User email not found";
2351
+ readonly EMAIL_NOT_VERIFIED: "Email not verified";
2352
+ readonly PASSWORD_TOO_SHORT: "Password too short";
2353
+ readonly PASSWORD_TOO_LONG: "Password too long";
2354
+ readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
2355
+ readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
2356
+ readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
2357
+ readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
2358
+ readonly ACCOUNT_NOT_FOUND: "Account not found";
2359
+ readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
2360
+ };
2361
+ };
2362
+ //#endregion
2363
+ export { createAuthClient, neonAuthMiddleware, toNextJsHandler };