@pelatform/starter 0.1.9 → 0.2.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.
@@ -1,3431 +0,0 @@
1
- import { AnyUseQueryOptions, QueryKey } from '@tanstack/react-query';
2
- import * as better_auth_client_plugins from 'better-auth/client/plugins';
3
- import * as better_auth_react from 'better-auth/react';
4
- import { createAuthClient, BetterFetchResponse, BetterFetchOption } from 'better-auth/react';
5
- import * as better_auth from 'better-auth';
6
- import * as better_auth_plugins_organization from 'better-auth/plugins/organization';
7
- import { Organization } from 'better-auth/plugins/organization';
8
- import { ComponentType, ComponentProps, ReactNode } from 'react';
9
- import { Avatar, buttonVariants, Dialog, Card } from 'pelatform-ui/default';
10
-
11
- type AuthQueryOptions = {
12
- /**
13
- * The default query options for all queries.
14
- */
15
- queryOptions?: Partial<AnyUseQueryOptions>;
16
- /**
17
- * The default query options for session queries.
18
- */
19
- sessionQueryOptions?: Partial<AnyUseQueryOptions>;
20
- /**
21
- * Whether to use optimistic updates for mutations.
22
- */
23
- optimistic: boolean;
24
- /**
25
- * Whether to refetch queries on mutations.
26
- */
27
- refetchOnMutate: boolean;
28
- /**
29
- * The query keys for session queries.
30
- */
31
- queryKey: {
32
- accountInfo: QueryKey;
33
- invitationKey: QueryKey;
34
- listAccounts: QueryKey;
35
- listApiKeys: QueryKey;
36
- listDeviceSessions: QueryKey;
37
- listPasskeys: QueryKey;
38
- listSessions: QueryKey;
39
- session: QueryKey;
40
- workspaceById: (id: string) => QueryKey;
41
- workspaceBySlug: (slug: string) => QueryKey;
42
- workspaceList: QueryKey;
43
- webhooks: (workspaceId: string) => QueryKey;
44
- billings: (workspaceId: string) => QueryKey;
45
- billingUsage: (workspaceId: string) => QueryKey;
46
- };
47
- };
48
- declare const defaultAuthQueryOptions: AuthQueryOptions;
49
-
50
- /**
51
- * Application configuration type definitions
52
- * These types define the structure of the configuration object that can be passed to the starter kit
53
- */
54
- /**
55
- * Application metadata configuration
56
- */
57
- type AppConfig = {
58
- /** Application name */
59
- name: string;
60
- /** Application domain (e.g., localhost:3000, app.example.com) */
61
- domain: string;
62
- /** Full application URL (e.g., http://localhost:3000) */
63
- url: string;
64
- /** API endpoint URL (e.g., http://localhost:3001 or /api) */
65
- api: string;
66
- };
67
- /**
68
- * Locale configuration for internationalization
69
- */
70
- type LocaleConfig = {
71
- /** Locale code (e.g., en, id, ar) */
72
- code: string;
73
- /** Display name of the locale */
74
- name: string;
75
- /** Text direction for the locale */
76
- direction: "ltr" | "rtl";
77
- /** Flag identifier for the locale */
78
- flag: string;
79
- };
80
- /**
81
- * Internationalization configuration
82
- */
83
- type I18nConfig = {
84
- /** Whether i18n is enabled */
85
- enabled: boolean;
86
- /** Available locales mapping */
87
- locales: {
88
- [locale: string]: LocaleConfig;
89
- };
90
- /** Default locale code */
91
- defaultLocale: string;
92
- /** Default currency code */
93
- defaultCurrency: string;
94
- /** Cookie name for storing locale preference */
95
- localeCookieName: string;
96
- };
97
- /**
98
- * Authentication methods configuration
99
- */
100
- type AuthenticationConfig = {
101
- /** Allow anonymous authentication */
102
- anonymous: boolean;
103
- /** Allow email OTP authentication */
104
- emailOtp: boolean;
105
- /** Allow magic link authentication */
106
- magicLink: boolean;
107
- /** Allow Google One Tap authentication */
108
- oneTap: boolean;
109
- /** Allow passkey authentication */
110
- passkey: boolean;
111
- /** Allow password authentication */
112
- password: boolean;
113
- /** Allow phone number authentication */
114
- phoneNumber: boolean;
115
- /** Allow two-factor authentication */
116
- twoFactor: boolean;
117
- /** Allow username authentication */
118
- username: boolean;
119
- };
120
- /**
121
- * Authentication configuration
122
- */
123
- type AuthConfig = {
124
- /** Allow user signup */
125
- enableSignup: boolean;
126
- /** Allow users to change their email */
127
- allowChangeEmail: boolean;
128
- /** Allow users to delete their account */
129
- allowDeleteUser: boolean;
130
- /** Enable or disable email verification for account deletion */
131
- deleteUserVerification: boolean;
132
- /** Redirect path after successful sign in */
133
- redirectAfterSignIn: string;
134
- /** Redirect path after logout */
135
- redirectAfterLogout: string;
136
- /** Freshness age for Session data */
137
- freshAge: number;
138
- /** Session cookie max age in seconds */
139
- sessionCookieMaxAge: number;
140
- /** Enabled social authentication providers */
141
- socialProviders: string[];
142
- /** Authentication methods configuration */
143
- authentication: AuthenticationConfig;
144
- };
145
- /**
146
- * Feature flags configuration
147
- */
148
- type FeaturesConfig = {
149
- /** Enable admin features */
150
- admin: boolean;
151
- /** Enable API key authentication */
152
- apiKey: boolean;
153
- /** Enable CAPTCHA */
154
- captcha: boolean;
155
- /** Enable device authorization */
156
- deviceAuthorization: boolean;
157
- /** Enable HaveIBeenPwned password breach detection */
158
- haveIBeenPwned: boolean;
159
- /** Track last login method */
160
- lastLoginMethod: boolean;
161
- /** Enable multi-session support */
162
- multiSession: boolean;
163
- /** Enable Polar payment integration */
164
- polar: boolean;
165
- /** Enable rate limiting */
166
- rateLimit: boolean;
167
- /** Enable workspace/organization features */
168
- workspace: boolean;
169
- };
170
- /**
171
- * Application path configuration
172
- */
173
- type PathConfig = {
174
- /** Main application paths */
175
- main: {
176
- ERROR: string;
177
- HOME: string;
178
- FEATURES: string;
179
- PRICING: string;
180
- TERMS: string;
181
- PRIVACY: string;
182
- };
183
- /** Authentication related paths */
184
- auth: {
185
- CALLBACK: string;
186
- EMAIL_OTP: string;
187
- FORGOT_PASSWORD: string;
188
- MAGIC_LINK: string;
189
- RECOVER_ACCOUNT: string;
190
- RESET_PASSWORD: string;
191
- SIGN_IN: string;
192
- SIGN_OUT: string;
193
- SIGN_UP: string;
194
- TWO_FACTOR: string;
195
- };
196
- /** Onboarding flow paths */
197
- onboarding: {
198
- WELCOME: string;
199
- WORKSPACE: string;
200
- };
201
- /** User account settings paths */
202
- account: {
203
- SETTINGS: string;
204
- SECURITY: string;
205
- API_KEYS: string;
206
- WORKSPACES: string;
207
- };
208
- /** Workspace settings paths */
209
- workspaces: {
210
- SETTINGS: string;
211
- MEMBERS: string;
212
- API_KEYS: string;
213
- BILLINGS: string;
214
- WEBHOOKS: string;
215
- };
216
- /** Admin paths */
217
- admin: {
218
- OVERVIEW: string;
219
- USERS: string;
220
- };
221
- /** Custom paths */
222
- custom: {
223
- ACCEPT_INVITATION: string;
224
- NEW_WORKSPACE: string;
225
- VERIFY_EMAIL: string;
226
- };
227
- };
228
- /**
229
- * UI configuration
230
- */
231
- type UIConfig = {
232
- /** Enable multiple theme support */
233
- enableMultiThemes: boolean;
234
- /** Default theme name */
235
- defaultTheme: string;
236
- /** Enable workspace slug in URLs */
237
- enableWorkspaceSlug: boolean;
238
- };
239
- /**
240
- * Main configuration object structure
241
- * This is the complete configuration that should be passed to ConfigProvider
242
- */
243
- type Config = {
244
- /** Application metadata */
245
- app: AppConfig;
246
- /** Internationalization settings */
247
- i18n: I18nConfig;
248
- /** Authentication settings */
249
- auth: AuthConfig;
250
- /** Feature flags */
251
- features: FeaturesConfig;
252
- /** Application paths */
253
- path: PathConfig;
254
- /** UI settings */
255
- ui: UIConfig;
256
- };
257
-
258
- type AnyAuthClient = Omit<ReturnType<typeof createAuthClient>, "signUp" | "getSession">;
259
- declare const authClient: {} & {
260
- useActiveOrganization: () => {
261
- data: better_auth.Prettify<{
262
- id: string;
263
- name: string;
264
- slug: string;
265
- createdAt: Date;
266
- logo?: string | null | undefined | undefined;
267
- metadata?: any;
268
- } & {
269
- members: {
270
- id: string;
271
- organizationId: string;
272
- role: "admin" | "member" | "owner";
273
- createdAt: Date;
274
- userId: string;
275
- user: {
276
- id: string;
277
- email: string;
278
- name: string;
279
- image?: string | undefined;
280
- };
281
- }[];
282
- invitations: {
283
- id: string;
284
- organizationId: string;
285
- email: string;
286
- role: "admin" | "member" | "owner";
287
- status: better_auth_plugins_organization.InvitationStatus;
288
- inviterId: string;
289
- expiresAt: Date;
290
- createdAt: Date;
291
- }[];
292
- }> | null;
293
- error: null | better_auth_react.BetterFetchError;
294
- isPending: boolean;
295
- isRefetching: boolean;
296
- refetch: (queryParams?: {
297
- query?: better_auth.SessionQueryParams;
298
- } | undefined) => Promise<void>;
299
- };
300
- useListOrganizations: () => {
301
- data: {
302
- id: string;
303
- name: string;
304
- slug: string;
305
- createdAt: Date;
306
- logo?: string | null | undefined | undefined;
307
- metadata?: any;
308
- }[] | null;
309
- error: null | better_auth_react.BetterFetchError;
310
- isPending: boolean;
311
- isRefetching: boolean;
312
- refetch: (queryParams?: {
313
- query?: better_auth.SessionQueryParams;
314
- } | undefined) => Promise<void>;
315
- };
316
- useActiveMember: () => {
317
- data: {
318
- id: string;
319
- organizationId: string;
320
- userId: string;
321
- role: string;
322
- createdAt: Date;
323
- } | null;
324
- error: null | better_auth_react.BetterFetchError;
325
- isPending: boolean;
326
- isRefetching: boolean;
327
- refetch: (queryParams?: {
328
- query?: better_auth.SessionQueryParams;
329
- } | undefined) => Promise<void>;
330
- };
331
- useActiveMemberRole: () => {
332
- data: {
333
- role: string;
334
- } | null;
335
- error: null | better_auth_react.BetterFetchError;
336
- isPending: boolean;
337
- isRefetching: boolean;
338
- refetch: (queryParams?: {
339
- query?: better_auth.SessionQueryParams;
340
- } | undefined) => Promise<void>;
341
- };
342
- } & {
343
- signIn: {
344
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
345
- provider: "apple" | "discord" | "dropbox" | "facebook" | "github" | "gitlab" | "google" | "huggingface" | "kick" | "linear" | "linkedin" | "microsoft" | "notion" | "reddit" | "roblox" | "slack" | "spotify" | "tiktok" | "twitch" | "vk" | "twitter" | "zoom" | "atlassian" | "cognito" | "figma" | "salesforce" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
346
- callbackURL?: string | undefined;
347
- newUserCallbackURL?: string | undefined;
348
- errorCallbackURL?: string | undefined;
349
- disableRedirect?: boolean | undefined;
350
- idToken?: {
351
- token: string;
352
- nonce?: string | undefined;
353
- accessToken?: string | undefined;
354
- refreshToken?: string | undefined;
355
- expiresAt?: number | undefined;
356
- } | undefined;
357
- scopes?: string[] | undefined;
358
- requestSignUp?: boolean | undefined;
359
- loginHint?: string | undefined;
360
- additionalData?: Record<string, any> | undefined;
361
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
362
- provider: "apple" | "discord" | "dropbox" | "facebook" | "github" | "gitlab" | "google" | "huggingface" | "kick" | "linear" | "linkedin" | "microsoft" | "notion" | "reddit" | "roblox" | "slack" | "spotify" | "tiktok" | "twitch" | "vk" | "twitter" | "zoom" | "atlassian" | "cognito" | "figma" | "salesforce" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
363
- callbackURL?: string | undefined;
364
- newUserCallbackURL?: string | undefined;
365
- errorCallbackURL?: string | undefined;
366
- disableRedirect?: boolean | undefined;
367
- idToken?: {
368
- token: string;
369
- nonce?: string | undefined;
370
- accessToken?: string | undefined;
371
- refreshToken?: string | undefined;
372
- expiresAt?: number | undefined;
373
- } | undefined;
374
- scopes?: string[] | undefined;
375
- requestSignUp?: boolean | undefined;
376
- loginHint?: string | undefined;
377
- additionalData?: Record<string, any> | undefined;
378
- } & {
379
- fetchOptions?: FetchOptions | undefined;
380
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<{
381
- redirect: boolean;
382
- url: string;
383
- } | {
384
- redirect: boolean;
385
- token: string;
386
- url: undefined;
387
- user: {
388
- id: string;
389
- createdAt: Date;
390
- updatedAt: Date;
391
- email: string;
392
- emailVerified: boolean;
393
- name: string;
394
- image?: string | null | undefined | undefined;
395
- };
396
- }>, {
397
- code?: string | undefined;
398
- message?: string | undefined;
399
- }, FetchOptions["throw"] extends true ? true : false>>;
400
- };
401
- } & {
402
- signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
403
- query?: Record<string, any> | undefined;
404
- fetchOptions?: FetchOptions | undefined;
405
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
406
- success: boolean;
407
- }, {
408
- code?: string | undefined;
409
- message?: string | undefined;
410
- }, FetchOptions["throw"] extends true ? true : false>>;
411
- } & {
412
- signUp: {
413
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
414
- name: string;
415
- email: string;
416
- password: string;
417
- image?: string | undefined;
418
- callbackURL?: string | undefined;
419
- rememberMe?: boolean | undefined;
420
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
421
- email: string;
422
- name: string;
423
- password: string;
424
- image?: string | undefined;
425
- callbackURL?: string | undefined;
426
- fetchOptions?: FetchOptions | undefined;
427
- } & {} & {} & {} & {
428
- phoneNumber?: string | null | undefined;
429
- } & {} & {} & {} & {
430
- username?: string | null | undefined;
431
- displayUsername?: string | null | undefined;
432
- } & {} & {}>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<{
433
- token: null;
434
- user: {
435
- id: string;
436
- createdAt: Date;
437
- updatedAt: Date;
438
- email: string;
439
- emailVerified: boolean;
440
- name: string;
441
- image?: string | null | undefined | undefined;
442
- };
443
- } | {
444
- token: string;
445
- user: {
446
- id: string;
447
- createdAt: Date;
448
- updatedAt: Date;
449
- email: string;
450
- emailVerified: boolean;
451
- name: string;
452
- image?: string | null | undefined | undefined;
453
- };
454
- }>, {
455
- code?: string | undefined;
456
- message?: string | undefined;
457
- }, FetchOptions["throw"] extends true ? true : false>>;
458
- };
459
- } & {
460
- signIn: {
461
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
462
- email: string;
463
- password: string;
464
- callbackURL?: string | undefined;
465
- rememberMe?: boolean | undefined;
466
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
467
- email: string;
468
- password: string;
469
- callbackURL?: string | undefined;
470
- rememberMe?: boolean | undefined;
471
- } & {
472
- fetchOptions?: FetchOptions | undefined;
473
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
474
- redirect: boolean;
475
- token: string;
476
- url?: string | undefined;
477
- user: {
478
- id: string;
479
- createdAt: Date;
480
- updatedAt: Date;
481
- email: string;
482
- emailVerified: boolean;
483
- name: string;
484
- image?: string | null | undefined | undefined;
485
- };
486
- }, {
487
- code?: string | undefined;
488
- message?: string | undefined;
489
- }, FetchOptions["throw"] extends true ? true : false>>;
490
- };
491
- } & {
492
- resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
493
- newPassword: string;
494
- token?: string | undefined;
495
- }> & Record<string, any>, Partial<{
496
- token?: string | undefined;
497
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
498
- newPassword: string;
499
- token?: string | undefined;
500
- } & {
501
- fetchOptions?: FetchOptions | undefined;
502
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
503
- status: boolean;
504
- }, {
505
- code?: string | undefined;
506
- message?: string | undefined;
507
- }, FetchOptions["throw"] extends true ? true : false>>;
508
- } & {
509
- verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
510
- token: string;
511
- callbackURL?: string | undefined;
512
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
513
- query: {
514
- token: string;
515
- callbackURL?: string | undefined;
516
- };
517
- fetchOptions?: FetchOptions | undefined;
518
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<void | {
519
- status: boolean;
520
- }>, {
521
- code?: string | undefined;
522
- message?: string | undefined;
523
- }, FetchOptions["throw"] extends true ? true : false>>;
524
- } & {
525
- sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
526
- email: string;
527
- callbackURL?: string | undefined;
528
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
529
- email: string;
530
- callbackURL?: string | undefined;
531
- } & {
532
- fetchOptions?: FetchOptions | undefined;
533
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
534
- status: boolean;
535
- }, {
536
- code?: string | undefined;
537
- message?: string | undefined;
538
- }, FetchOptions["throw"] extends true ? true : false>>;
539
- } & {
540
- changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
541
- newEmail: string;
542
- callbackURL?: string | undefined;
543
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
544
- newEmail: string;
545
- callbackURL?: string | undefined;
546
- } & {
547
- fetchOptions?: FetchOptions | undefined;
548
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
549
- status: boolean;
550
- }, {
551
- code?: string | undefined;
552
- message?: string | undefined;
553
- }, FetchOptions["throw"] extends true ? true : false>>;
554
- } & {
555
- changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
556
- newPassword: string;
557
- currentPassword: string;
558
- revokeOtherSessions?: boolean | undefined;
559
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
560
- newPassword: string;
561
- currentPassword: string;
562
- revokeOtherSessions?: boolean | undefined;
563
- } & {
564
- fetchOptions?: FetchOptions | undefined;
565
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
566
- token: string | null;
567
- user: {
568
- id: string;
569
- email: string;
570
- name: string;
571
- image: string | null | undefined;
572
- emailVerified: boolean;
573
- createdAt: Date;
574
- updatedAt: Date;
575
- };
576
- }, {
577
- code?: string | undefined;
578
- message?: string | undefined;
579
- }, FetchOptions["throw"] extends true ? true : false>>;
580
- } & {
581
- updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
582
- name?: string | undefined;
583
- image?: string | undefined | null;
584
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
585
- image?: (string | null) | undefined;
586
- name?: string | undefined;
587
- fetchOptions?: FetchOptions | undefined;
588
- } & Partial<{} & {} & {} & {
589
- phoneNumber?: string | null | undefined;
590
- } & {} & {} & {} & {
591
- username?: string | null | undefined;
592
- displayUsername?: string | null | undefined;
593
- } & {} & {}>> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
594
- status: boolean;
595
- }, {
596
- code?: string | undefined;
597
- message?: string | undefined;
598
- }, FetchOptions["throw"] extends true ? true : false>>;
599
- } & {
600
- deleteUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
601
- callbackURL?: string | undefined;
602
- password?: string | undefined;
603
- token?: string | undefined;
604
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
605
- callbackURL?: string | undefined;
606
- password?: string | undefined;
607
- token?: string | undefined;
608
- } & {
609
- fetchOptions?: FetchOptions | undefined;
610
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
611
- success: boolean;
612
- message: string;
613
- }, {
614
- code?: string | undefined;
615
- message?: string | undefined;
616
- }, FetchOptions["throw"] extends true ? true : false>>;
617
- } & {
618
- requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
619
- email: string;
620
- redirectTo?: string | undefined;
621
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
622
- email: string;
623
- redirectTo?: string | undefined;
624
- } & {
625
- fetchOptions?: FetchOptions | undefined;
626
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
627
- status: boolean;
628
- message: string;
629
- }, {
630
- code?: string | undefined;
631
- message?: string | undefined;
632
- }, FetchOptions["throw"] extends true ? true : false>>;
633
- } & {
634
- resetPassword: {
635
- ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
636
- callbackURL: string;
637
- }> & Record<string, any>, {
638
- token: string;
639
- }>>(data_0: better_auth.Prettify<{
640
- query: {
641
- callbackURL: string;
642
- };
643
- fetchOptions?: FetchOptions | undefined;
644
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<never, {
645
- code?: string | undefined;
646
- message?: string | undefined;
647
- }, FetchOptions["throw"] extends true ? true : false>>;
648
- };
649
- } & {
650
- listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
651
- query?: Record<string, any> | undefined;
652
- fetchOptions?: FetchOptions | undefined;
653
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<better_auth.Prettify<{
654
- id: string;
655
- createdAt: Date;
656
- updatedAt: Date;
657
- userId: string;
658
- expiresAt: Date;
659
- token: string;
660
- ipAddress?: string | null | undefined | undefined;
661
- userAgent?: string | null | undefined | undefined;
662
- }>[], {
663
- code?: string | undefined;
664
- message?: string | undefined;
665
- }, FetchOptions["throw"] extends true ? true : false>>;
666
- } & {
667
- revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
668
- token: string;
669
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
670
- token: string;
671
- } & {
672
- fetchOptions?: FetchOptions | undefined;
673
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
674
- status: boolean;
675
- }, {
676
- code?: string | undefined;
677
- message?: string | undefined;
678
- }, FetchOptions["throw"] extends true ? true : false>>;
679
- } & {
680
- revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
681
- query?: Record<string, any> | undefined;
682
- fetchOptions?: FetchOptions | undefined;
683
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
684
- status: boolean;
685
- }, {
686
- code?: string | undefined;
687
- message?: string | undefined;
688
- }, FetchOptions["throw"] extends true ? true : false>>;
689
- } & {
690
- revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
691
- query?: Record<string, any> | undefined;
692
- fetchOptions?: FetchOptions | undefined;
693
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
694
- status: boolean;
695
- }, {
696
- code?: string | undefined;
697
- message?: string | undefined;
698
- }, FetchOptions["throw"] extends true ? true : false>>;
699
- } & {
700
- linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
701
- provider: unknown;
702
- callbackURL?: string | undefined;
703
- idToken?: {
704
- token: string;
705
- nonce?: string | undefined;
706
- accessToken?: string | undefined;
707
- refreshToken?: string | undefined;
708
- scopes?: string[] | undefined;
709
- } | undefined;
710
- requestSignUp?: boolean | undefined;
711
- scopes?: string[] | undefined;
712
- errorCallbackURL?: string | undefined;
713
- disableRedirect?: boolean | undefined;
714
- additionalData?: Record<string, any> | undefined;
715
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
716
- provider: unknown;
717
- callbackURL?: string | undefined;
718
- idToken?: {
719
- token: string;
720
- nonce?: string | undefined;
721
- accessToken?: string | undefined;
722
- refreshToken?: string | undefined;
723
- scopes?: string[] | undefined;
724
- } | undefined;
725
- requestSignUp?: boolean | undefined;
726
- scopes?: string[] | undefined;
727
- errorCallbackURL?: string | undefined;
728
- disableRedirect?: boolean | undefined;
729
- additionalData?: Record<string, any> | undefined;
730
- } & {
731
- fetchOptions?: FetchOptions | undefined;
732
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
733
- url: string;
734
- redirect: boolean;
735
- }, {
736
- code?: string | undefined;
737
- message?: string | undefined;
738
- }, FetchOptions["throw"] extends true ? true : false>>;
739
- } & {
740
- listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
741
- query?: Record<string, any> | undefined;
742
- fetchOptions?: FetchOptions | undefined;
743
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
744
- id: string;
745
- providerId: string;
746
- createdAt: Date;
747
- updatedAt: Date;
748
- accountId: string;
749
- userId: string;
750
- scopes: string[];
751
- }[], {
752
- code?: string | undefined;
753
- message?: string | undefined;
754
- }, FetchOptions["throw"] extends true ? true : false>>;
755
- } & {
756
- deleteUser: {
757
- callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
758
- token: string;
759
- callbackURL?: string | undefined;
760
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
761
- query: {
762
- token: string;
763
- callbackURL?: string | undefined;
764
- };
765
- fetchOptions?: FetchOptions | undefined;
766
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
767
- success: boolean;
768
- message: string;
769
- }, {
770
- code?: string | undefined;
771
- message?: string | undefined;
772
- }, FetchOptions["throw"] extends true ? true : false>>;
773
- };
774
- } & {
775
- unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
776
- providerId: string;
777
- accountId?: string | undefined;
778
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
779
- providerId: string;
780
- accountId?: string | undefined;
781
- } & {
782
- fetchOptions?: FetchOptions | undefined;
783
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
784
- status: boolean;
785
- }, {
786
- code?: string | undefined;
787
- message?: string | undefined;
788
- }, FetchOptions["throw"] extends true ? true : false>>;
789
- } & {
790
- refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
791
- providerId: string;
792
- accountId?: string | undefined;
793
- userId?: string | undefined;
794
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
795
- providerId: string;
796
- accountId?: string | undefined;
797
- userId?: string | undefined;
798
- } & {
799
- fetchOptions?: FetchOptions | undefined;
800
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
801
- accessToken: string | undefined;
802
- refreshToken: string | undefined;
803
- accessTokenExpiresAt: Date | undefined;
804
- refreshTokenExpiresAt: Date | undefined;
805
- scope: string | null | undefined;
806
- idToken: string | null | undefined;
807
- providerId: string;
808
- accountId: string;
809
- }, {
810
- code?: string | undefined;
811
- message?: string | undefined;
812
- }, FetchOptions["throw"] extends true ? true : false>>;
813
- } & {
814
- getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
815
- providerId: string;
816
- accountId?: string | undefined;
817
- userId?: string | undefined;
818
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
819
- providerId: string;
820
- accountId?: string | undefined;
821
- userId?: string | undefined;
822
- } & {
823
- fetchOptions?: FetchOptions | undefined;
824
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
825
- accessToken: string;
826
- accessTokenExpiresAt: Date | undefined;
827
- scopes: string[];
828
- idToken: string | undefined;
829
- }, {
830
- code?: string | undefined;
831
- message?: string | undefined;
832
- }, FetchOptions["throw"] extends true ? true : false>>;
833
- } & {
834
- accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
835
- accountId?: string | undefined;
836
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
837
- query?: {
838
- accountId?: string | undefined;
839
- } | undefined;
840
- fetchOptions?: FetchOptions | undefined;
841
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
842
- user: better_auth.OAuth2UserInfo;
843
- data: Record<string, any>;
844
- }, {
845
- code?: string | undefined;
846
- message?: string | undefined;
847
- }, FetchOptions["throw"] extends true ? true : false>>;
848
- } & {
849
- getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
850
- disableCookieCache?: unknown;
851
- disableRefresh?: unknown;
852
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
853
- query?: {
854
- disableCookieCache?: unknown;
855
- disableRefresh?: unknown;
856
- } | undefined;
857
- fetchOptions?: FetchOptions | undefined;
858
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
859
- user: {
860
- id: string;
861
- createdAt: Date;
862
- updatedAt: Date;
863
- email: string;
864
- emailVerified: boolean;
865
- name: string;
866
- image?: string | null | undefined;
867
- isAnonymous: boolean | null | undefined;
868
- phoneNumber?: string | null | undefined;
869
- phoneNumberVerified?: boolean | null | undefined;
870
- twoFactorEnabled: boolean | null | undefined;
871
- username?: string | null | undefined;
872
- displayUsername?: string | null | undefined;
873
- banned: boolean | null | undefined;
874
- role?: string | null | undefined;
875
- banReason?: string | null | undefined;
876
- banExpires?: Date | null | undefined;
877
- };
878
- session: {
879
- id: string;
880
- createdAt: Date;
881
- updatedAt: Date;
882
- userId: string;
883
- expiresAt: Date;
884
- token: string;
885
- ipAddress?: string | null | undefined;
886
- userAgent?: string | null | undefined;
887
- impersonatedBy?: string | null | undefined;
888
- activeOrganizationId?: string | null | undefined;
889
- };
890
- } | null, {
891
- code?: string | undefined;
892
- message?: string | undefined;
893
- }, FetchOptions["throw"] extends true ? true : false>>;
894
- } & {
895
- signIn: {
896
- anonymous: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
897
- query?: Record<string, any> | undefined;
898
- fetchOptions?: FetchOptions | undefined;
899
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
900
- token: string;
901
- user: {
902
- id: string;
903
- email: string;
904
- emailVerified: boolean;
905
- name: string;
906
- createdAt: Date;
907
- updatedAt: Date;
908
- };
909
- }, {
910
- code?: string | undefined;
911
- message?: string | undefined;
912
- }, FetchOptions["throw"] extends true ? true : false>>;
913
- };
914
- } & {
915
- emailOtp: {
916
- checkVerificationOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
917
- email: string;
918
- type: "sign-in" | "email-verification" | "forget-password";
919
- otp: string;
920
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
921
- email: string;
922
- type: "sign-in" | "email-verification" | "forget-password";
923
- otp: string;
924
- } & {
925
- fetchOptions?: FetchOptions | undefined;
926
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
927
- success: boolean;
928
- }, {
929
- code?: string | undefined;
930
- message?: string | undefined;
931
- }, FetchOptions["throw"] extends true ? true : false>>;
932
- };
933
- } & {
934
- emailOtp: {
935
- verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
936
- email: string;
937
- otp: string;
938
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
939
- email: string;
940
- otp: string;
941
- } & {
942
- fetchOptions?: FetchOptions | undefined;
943
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<{
944
- status: boolean;
945
- token: string;
946
- user: {
947
- id: string;
948
- email: string;
949
- emailVerified: boolean;
950
- name: string;
951
- image: string | null | undefined;
952
- createdAt: Date;
953
- updatedAt: Date;
954
- };
955
- } | {
956
- status: boolean;
957
- token: null;
958
- user: {
959
- id: string;
960
- email: string;
961
- emailVerified: boolean;
962
- name: string;
963
- image: string | null | undefined;
964
- createdAt: Date;
965
- updatedAt: Date;
966
- };
967
- }>, {
968
- code?: string | undefined;
969
- message?: string | undefined;
970
- }, FetchOptions["throw"] extends true ? true : false>>;
971
- };
972
- } & {
973
- signIn: {
974
- emailOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
975
- email: string;
976
- otp: string;
977
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
978
- email: string;
979
- otp: string;
980
- } & {
981
- fetchOptions?: FetchOptions | undefined;
982
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
983
- token: string;
984
- user: {
985
- id: string;
986
- email: string;
987
- emailVerified: boolean;
988
- name: string;
989
- image: string | null | undefined;
990
- createdAt: Date;
991
- updatedAt: Date;
992
- };
993
- }, {
994
- code?: string | undefined;
995
- message?: string | undefined;
996
- }, FetchOptions["throw"] extends true ? true : false>>;
997
- };
998
- } & {
999
- forgetPassword: {
1000
- emailOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1001
- email: string;
1002
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1003
- email: string;
1004
- } & {
1005
- fetchOptions?: FetchOptions | undefined;
1006
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1007
- success: boolean;
1008
- }, {
1009
- code?: string | undefined;
1010
- message?: string | undefined;
1011
- }, FetchOptions["throw"] extends true ? true : false>>;
1012
- };
1013
- } & {
1014
- emailOtp: {
1015
- resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1016
- email: string;
1017
- otp: string;
1018
- password: string;
1019
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1020
- email: string;
1021
- otp: string;
1022
- password: string;
1023
- } & {
1024
- fetchOptions?: FetchOptions | undefined;
1025
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1026
- success: boolean;
1027
- }, {
1028
- code?: string | undefined;
1029
- message?: string | undefined;
1030
- }, FetchOptions["throw"] extends true ? true : false>>;
1031
- };
1032
- } & {
1033
- emailOtp: {
1034
- sendVerificationOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1035
- email: string;
1036
- type: "sign-in" | "email-verification" | "forget-password";
1037
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1038
- email: string;
1039
- type: "sign-in" | "email-verification" | "forget-password";
1040
- } & {
1041
- fetchOptions?: FetchOptions | undefined;
1042
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1043
- success: boolean;
1044
- }, {
1045
- code?: string | undefined;
1046
- message?: string | undefined;
1047
- }, FetchOptions["throw"] extends true ? true : false>>;
1048
- };
1049
- } & {
1050
- signIn: {
1051
- magicLink: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1052
- email: string;
1053
- name?: string | undefined;
1054
- callbackURL?: string | undefined;
1055
- newUserCallbackURL?: string | undefined;
1056
- errorCallbackURL?: string | undefined;
1057
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1058
- email: string;
1059
- name?: string | undefined;
1060
- callbackURL?: string | undefined;
1061
- newUserCallbackURL?: string | undefined;
1062
- errorCallbackURL?: string | undefined;
1063
- } & {
1064
- fetchOptions?: FetchOptions | undefined;
1065
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1066
- status: boolean;
1067
- }, {
1068
- code?: string | undefined;
1069
- message?: string | undefined;
1070
- }, FetchOptions["throw"] extends true ? true : false>>;
1071
- };
1072
- } & {
1073
- magicLink: {
1074
- verify: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1075
- token: string;
1076
- callbackURL?: string | undefined;
1077
- errorCallbackURL?: string | undefined;
1078
- newUserCallbackURL?: string | undefined;
1079
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1080
- query: {
1081
- token: string;
1082
- callbackURL?: string | undefined;
1083
- errorCallbackURL?: string | undefined;
1084
- newUserCallbackURL?: string | undefined;
1085
- };
1086
- fetchOptions?: FetchOptions | undefined;
1087
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1088
- token: string;
1089
- user: {
1090
- id: string;
1091
- email: string;
1092
- emailVerified: boolean;
1093
- name: string;
1094
- image: string | null | undefined;
1095
- createdAt: Date;
1096
- updatedAt: Date;
1097
- };
1098
- }, {
1099
- code?: string | undefined;
1100
- message?: string | undefined;
1101
- }, FetchOptions["throw"] extends true ? true : false>>;
1102
- };
1103
- } & {
1104
- signIn: {
1105
- oauth2: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1106
- providerId: string;
1107
- callbackURL?: string | undefined;
1108
- errorCallbackURL?: string | undefined;
1109
- newUserCallbackURL?: string | undefined;
1110
- disableRedirect?: boolean | undefined;
1111
- scopes?: string[] | undefined;
1112
- requestSignUp?: boolean | undefined;
1113
- additionalData?: Record<string, any> | undefined;
1114
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1115
- providerId: string;
1116
- callbackURL?: string | undefined;
1117
- errorCallbackURL?: string | undefined;
1118
- newUserCallbackURL?: string | undefined;
1119
- disableRedirect?: boolean | undefined;
1120
- scopes?: string[] | undefined;
1121
- requestSignUp?: boolean | undefined;
1122
- additionalData?: Record<string, any> | undefined;
1123
- } & {
1124
- fetchOptions?: FetchOptions | undefined;
1125
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1126
- url: string;
1127
- redirect: boolean;
1128
- }, {
1129
- code?: string | undefined;
1130
- message?: string | undefined;
1131
- }, FetchOptions["throw"] extends true ? true : false>>;
1132
- };
1133
- } & {
1134
- oauth2: {
1135
- link: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1136
- providerId: string;
1137
- callbackURL: string;
1138
- scopes?: string[] | undefined;
1139
- errorCallbackURL?: string | undefined;
1140
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1141
- providerId: string;
1142
- callbackURL: string;
1143
- scopes?: string[] | undefined;
1144
- errorCallbackURL?: string | undefined;
1145
- } & {
1146
- fetchOptions?: FetchOptions | undefined;
1147
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1148
- url: string;
1149
- redirect: boolean;
1150
- }, {
1151
- code?: string | undefined;
1152
- message?: string | undefined;
1153
- }, FetchOptions["throw"] extends true ? true : false>>;
1154
- };
1155
- } & {
1156
- signIn: {
1157
- phoneNumber: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1158
- phoneNumber: string;
1159
- password: string;
1160
- rememberMe?: boolean | undefined;
1161
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1162
- phoneNumber: string;
1163
- password: string;
1164
- rememberMe?: boolean | undefined;
1165
- } & {
1166
- fetchOptions?: FetchOptions | undefined;
1167
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1168
- token: string;
1169
- user: better_auth_client_plugins.UserWithPhoneNumber;
1170
- }, {
1171
- code?: string | undefined;
1172
- message?: string | undefined;
1173
- }, FetchOptions["throw"] extends true ? true : false>>;
1174
- };
1175
- } & {
1176
- phoneNumber: {
1177
- sendOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1178
- phoneNumber: string;
1179
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1180
- phoneNumber: string;
1181
- } & {
1182
- fetchOptions?: FetchOptions | undefined;
1183
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1184
- message: string;
1185
- }, {
1186
- code?: string | undefined;
1187
- message?: string | undefined;
1188
- }, FetchOptions["throw"] extends true ? true : false>>;
1189
- };
1190
- } & {
1191
- phoneNumber: {
1192
- verify: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1193
- phoneNumber: string;
1194
- code: string;
1195
- disableSession?: boolean | undefined;
1196
- updatePhoneNumber?: boolean | undefined;
1197
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1198
- phoneNumber: string;
1199
- code: string;
1200
- disableSession?: boolean | undefined;
1201
- updatePhoneNumber?: boolean | undefined;
1202
- } & {
1203
- fetchOptions?: FetchOptions | undefined;
1204
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<{
1205
- status: boolean;
1206
- token: string;
1207
- user: better_auth_client_plugins.UserWithPhoneNumber;
1208
- } | {
1209
- status: boolean;
1210
- token: null;
1211
- user: better_auth_client_plugins.UserWithPhoneNumber;
1212
- }>, {
1213
- code?: string | undefined;
1214
- message?: string | undefined;
1215
- }, FetchOptions["throw"] extends true ? true : false>>;
1216
- };
1217
- } & {
1218
- phoneNumber: {
1219
- requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1220
- phoneNumber: string;
1221
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1222
- phoneNumber: string;
1223
- } & {
1224
- fetchOptions?: FetchOptions | undefined;
1225
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1226
- status: boolean;
1227
- }, {
1228
- code?: string | undefined;
1229
- message?: string | undefined;
1230
- }, FetchOptions["throw"] extends true ? true : false>>;
1231
- };
1232
- } & {
1233
- phoneNumber: {
1234
- resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1235
- otp: string;
1236
- phoneNumber: string;
1237
- newPassword: string;
1238
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1239
- otp: string;
1240
- phoneNumber: string;
1241
- newPassword: string;
1242
- } & {
1243
- fetchOptions?: FetchOptions | undefined;
1244
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1245
- status: boolean;
1246
- }, {
1247
- code?: string | undefined;
1248
- message?: string | undefined;
1249
- }, FetchOptions["throw"] extends true ? true : false>>;
1250
- };
1251
- } & {
1252
- twoFactor: {
1253
- enable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1254
- password: string;
1255
- issuer?: string | undefined;
1256
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1257
- password: string;
1258
- issuer?: string | undefined;
1259
- } & {
1260
- fetchOptions?: FetchOptions | undefined;
1261
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1262
- totpURI: string;
1263
- backupCodes: string[];
1264
- }, {
1265
- code?: string | undefined;
1266
- message?: string | undefined;
1267
- }, FetchOptions["throw"] extends true ? true : false>>;
1268
- };
1269
- } & {
1270
- twoFactor: {
1271
- disable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1272
- password: string;
1273
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1274
- password: string;
1275
- } & {
1276
- fetchOptions?: FetchOptions | undefined;
1277
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1278
- status: boolean;
1279
- }, {
1280
- code?: string | undefined;
1281
- message?: string | undefined;
1282
- }, FetchOptions["throw"] extends true ? true : false>>;
1283
- };
1284
- } & {
1285
- twoFactor: {
1286
- verifyBackupCode: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1287
- code: string;
1288
- disableSession?: boolean | undefined;
1289
- trustDevice?: boolean | undefined;
1290
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1291
- code: string;
1292
- disableSession?: boolean | undefined;
1293
- trustDevice?: boolean | undefined;
1294
- } & {
1295
- fetchOptions?: FetchOptions | undefined;
1296
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1297
- token: string | undefined;
1298
- user: {
1299
- id: string;
1300
- email: string;
1301
- emailVerified: boolean;
1302
- name: string;
1303
- image: string | null | undefined;
1304
- createdAt: Date;
1305
- updatedAt: Date;
1306
- };
1307
- }, {
1308
- code?: string | undefined;
1309
- message?: string | undefined;
1310
- }, FetchOptions["throw"] extends true ? true : false>>;
1311
- };
1312
- } & {
1313
- twoFactor: {
1314
- generateBackupCodes: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1315
- password: string;
1316
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1317
- password: string;
1318
- } & {
1319
- fetchOptions?: FetchOptions | undefined;
1320
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1321
- status: boolean;
1322
- backupCodes: string[];
1323
- }, {
1324
- code?: string | undefined;
1325
- message?: string | undefined;
1326
- }, FetchOptions["throw"] extends true ? true : false>>;
1327
- };
1328
- } & {
1329
- twoFactor: {
1330
- sendOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1331
- trustDevice?: boolean | undefined;
1332
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1333
- query?: Record<string, any> | undefined;
1334
- fetchOptions?: FetchOptions | undefined;
1335
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1336
- status: boolean;
1337
- }, {
1338
- code?: string | undefined;
1339
- message?: string | undefined;
1340
- }, FetchOptions["throw"] extends true ? true : false>>;
1341
- };
1342
- } & {
1343
- twoFactor: {
1344
- verifyOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1345
- code: string;
1346
- trustDevice?: boolean | undefined;
1347
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1348
- code: string;
1349
- trustDevice?: boolean | undefined;
1350
- } & {
1351
- fetchOptions?: FetchOptions | undefined;
1352
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1353
- token: string;
1354
- user: {
1355
- id: string;
1356
- email: string;
1357
- emailVerified: boolean;
1358
- name: string;
1359
- image: string | null | undefined;
1360
- createdAt: Date;
1361
- updatedAt: Date;
1362
- };
1363
- }, {
1364
- code?: string | undefined;
1365
- message?: string | undefined;
1366
- }, FetchOptions["throw"] extends true ? true : false>>;
1367
- };
1368
- } & {
1369
- twoFactor: {
1370
- getTotpUri: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1371
- password: string;
1372
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1373
- password: string;
1374
- } & {
1375
- fetchOptions?: FetchOptions | undefined;
1376
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1377
- totpURI: string;
1378
- }, {
1379
- code?: string | undefined;
1380
- message?: string | undefined;
1381
- }, FetchOptions["throw"] extends true ? true : false>>;
1382
- };
1383
- } & {
1384
- twoFactor: {
1385
- verifyTotp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1386
- code: string;
1387
- trustDevice?: boolean | undefined;
1388
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1389
- code: string;
1390
- trustDevice?: boolean | undefined;
1391
- } & {
1392
- fetchOptions?: FetchOptions | undefined;
1393
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1394
- token: string;
1395
- user: {
1396
- id: string;
1397
- email: string;
1398
- emailVerified: boolean;
1399
- name: string;
1400
- image: string | null | undefined;
1401
- createdAt: Date;
1402
- updatedAt: Date;
1403
- };
1404
- }, {
1405
- code?: string | undefined;
1406
- message?: string | undefined;
1407
- }, FetchOptions["throw"] extends true ? true : false>>;
1408
- };
1409
- } & {
1410
- signIn: {
1411
- username: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1412
- username: string;
1413
- password: string;
1414
- rememberMe?: boolean | undefined;
1415
- callbackURL?: string | undefined;
1416
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1417
- username: string;
1418
- password: string;
1419
- rememberMe?: boolean | undefined;
1420
- callbackURL?: string | undefined;
1421
- } & {
1422
- fetchOptions?: FetchOptions | undefined;
1423
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1424
- token: string;
1425
- user: {
1426
- id: string;
1427
- email: string;
1428
- emailVerified: boolean;
1429
- username: string;
1430
- displayUsername: string;
1431
- name: string;
1432
- image: string | null | undefined;
1433
- createdAt: Date;
1434
- updatedAt: Date;
1435
- };
1436
- }, {
1437
- code?: string | undefined;
1438
- message?: string | undefined;
1439
- }, FetchOptions["throw"] extends true ? true : false>>;
1440
- };
1441
- } & {
1442
- isUsernameAvailable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1443
- username: string;
1444
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1445
- username: string;
1446
- } & {
1447
- fetchOptions?: FetchOptions | undefined;
1448
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1449
- available: boolean;
1450
- }, {
1451
- code?: string | undefined;
1452
- message?: string | undefined;
1453
- }, FetchOptions["throw"] extends true ? true : false>>;
1454
- } & {
1455
- admin: {
1456
- setRole: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1457
- userId: string;
1458
- role: "user" | "admin" | ("user" | "admin")[];
1459
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1460
- userId: string;
1461
- role: "user" | "admin" | ("user" | "admin")[];
1462
- } & {
1463
- fetchOptions?: FetchOptions | undefined;
1464
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1465
- user: better_auth_client_plugins.UserWithRole;
1466
- }, {
1467
- code?: string | undefined;
1468
- message?: string | undefined;
1469
- }, FetchOptions["throw"] extends true ? true : false>>;
1470
- };
1471
- } & {
1472
- admin: {
1473
- getUser: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1474
- id: string;
1475
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1476
- query: {
1477
- id: string;
1478
- };
1479
- fetchOptions?: FetchOptions | undefined;
1480
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1481
- id: string;
1482
- createdAt: Date;
1483
- updatedAt: Date;
1484
- email: string;
1485
- emailVerified: boolean;
1486
- name: string;
1487
- image?: string | null | undefined;
1488
- }, {
1489
- code?: string | undefined;
1490
- message?: string | undefined;
1491
- }, FetchOptions["throw"] extends true ? true : false>>;
1492
- };
1493
- } & {
1494
- admin: {
1495
- createUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1496
- email: string;
1497
- password: string;
1498
- name: string;
1499
- role?: "user" | "admin" | ("user" | "admin")[] | undefined;
1500
- data?: Record<string, any> | undefined;
1501
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1502
- email: string;
1503
- password: string;
1504
- name: string;
1505
- role?: "user" | "admin" | ("user" | "admin")[] | undefined;
1506
- data?: Record<string, any> | undefined;
1507
- } & {
1508
- fetchOptions?: FetchOptions | undefined;
1509
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1510
- user: better_auth_client_plugins.UserWithRole;
1511
- }, {
1512
- code?: string | undefined;
1513
- message?: string | undefined;
1514
- }, FetchOptions["throw"] extends true ? true : false>>;
1515
- };
1516
- } & {
1517
- admin: {
1518
- updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1519
- userId: unknown;
1520
- data: Record<any, any>;
1521
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1522
- userId: unknown;
1523
- data: Record<any, any>;
1524
- } & {
1525
- fetchOptions?: FetchOptions | undefined;
1526
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<better_auth_client_plugins.UserWithRole, {
1527
- code?: string | undefined;
1528
- message?: string | undefined;
1529
- }, FetchOptions["throw"] extends true ? true : false>>;
1530
- };
1531
- } & {
1532
- admin: {
1533
- listUsers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1534
- searchValue?: string | undefined;
1535
- searchField?: "name" | "email" | undefined;
1536
- searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
1537
- limit?: string | number | undefined;
1538
- offset?: string | number | undefined;
1539
- sortBy?: string | undefined;
1540
- sortDirection?: "asc" | "desc" | undefined;
1541
- filterField?: string | undefined;
1542
- filterValue?: string | number | boolean | undefined;
1543
- filterOperator?: "contains" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | undefined;
1544
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1545
- query: {
1546
- searchValue?: string | undefined;
1547
- searchField?: "name" | "email" | undefined;
1548
- searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
1549
- limit?: string | number | undefined;
1550
- offset?: string | number | undefined;
1551
- sortBy?: string | undefined;
1552
- sortDirection?: "asc" | "desc" | undefined;
1553
- filterField?: string | undefined;
1554
- filterValue?: string | number | boolean | undefined;
1555
- filterOperator?: "contains" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | undefined;
1556
- };
1557
- fetchOptions?: FetchOptions | undefined;
1558
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<{
1559
- users: better_auth_client_plugins.UserWithRole[];
1560
- total: number;
1561
- limit: number | undefined;
1562
- offset: number | undefined;
1563
- } | {
1564
- users: never[];
1565
- total: number;
1566
- }>, {
1567
- code?: string | undefined;
1568
- message?: string | undefined;
1569
- }, FetchOptions["throw"] extends true ? true : false>>;
1570
- };
1571
- } & {
1572
- admin: {
1573
- listUserSessions: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1574
- userId: unknown;
1575
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1576
- userId: unknown;
1577
- } & {
1578
- fetchOptions?: FetchOptions | undefined;
1579
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1580
- sessions: better_auth_client_plugins.SessionWithImpersonatedBy[];
1581
- }, {
1582
- code?: string | undefined;
1583
- message?: string | undefined;
1584
- }, FetchOptions["throw"] extends true ? true : false>>;
1585
- };
1586
- } & {
1587
- admin: {
1588
- unbanUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1589
- userId: unknown;
1590
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1591
- userId: unknown;
1592
- } & {
1593
- fetchOptions?: FetchOptions | undefined;
1594
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1595
- user: {
1596
- id: string;
1597
- createdAt: Date;
1598
- updatedAt: Date;
1599
- email: string;
1600
- emailVerified: boolean;
1601
- name: string;
1602
- image?: string | null | undefined;
1603
- } & Record<string, any>;
1604
- }, {
1605
- code?: string | undefined;
1606
- message?: string | undefined;
1607
- }, FetchOptions["throw"] extends true ? true : false>>;
1608
- };
1609
- } & {
1610
- admin: {
1611
- banUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1612
- userId: unknown;
1613
- banReason?: string | undefined;
1614
- banExpiresIn?: number | undefined;
1615
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1616
- userId: unknown;
1617
- banReason?: string | undefined;
1618
- banExpiresIn?: number | undefined;
1619
- } & {
1620
- fetchOptions?: FetchOptions | undefined;
1621
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1622
- user: {
1623
- id: string;
1624
- createdAt: Date;
1625
- updatedAt: Date;
1626
- email: string;
1627
- emailVerified: boolean;
1628
- name: string;
1629
- image?: string | null | undefined;
1630
- } & Record<string, any>;
1631
- }, {
1632
- code?: string | undefined;
1633
- message?: string | undefined;
1634
- }, FetchOptions["throw"] extends true ? true : false>>;
1635
- };
1636
- } & {
1637
- admin: {
1638
- impersonateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1639
- userId: unknown;
1640
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1641
- userId: unknown;
1642
- } & {
1643
- fetchOptions?: FetchOptions | undefined;
1644
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1645
- session: {
1646
- id: string;
1647
- createdAt: Date;
1648
- updatedAt: Date;
1649
- userId: string;
1650
- expiresAt: Date;
1651
- token: string;
1652
- ipAddress?: string | null | undefined;
1653
- userAgent?: string | null | undefined;
1654
- };
1655
- user: {
1656
- id: string;
1657
- createdAt: Date;
1658
- updatedAt: Date;
1659
- email: string;
1660
- emailVerified: boolean;
1661
- name: string;
1662
- image?: string | null | undefined;
1663
- };
1664
- }, {
1665
- code?: string | undefined;
1666
- message?: string | undefined;
1667
- }, FetchOptions["throw"] extends true ? true : false>>;
1668
- };
1669
- } & {
1670
- admin: {
1671
- stopImpersonating: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1672
- query?: Record<string, any> | undefined;
1673
- fetchOptions?: FetchOptions | undefined;
1674
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1675
- session: better_auth.Session & Record<string, any>;
1676
- user: better_auth.User & Record<string, any>;
1677
- }, {
1678
- code?: string | undefined;
1679
- message?: string | undefined;
1680
- }, FetchOptions["throw"] extends true ? true : false>>;
1681
- };
1682
- } & {
1683
- admin: {
1684
- revokeUserSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1685
- sessionToken: string;
1686
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1687
- sessionToken: string;
1688
- } & {
1689
- fetchOptions?: FetchOptions | undefined;
1690
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1691
- success: boolean;
1692
- }, {
1693
- code?: string | undefined;
1694
- message?: string | undefined;
1695
- }, FetchOptions["throw"] extends true ? true : false>>;
1696
- };
1697
- } & {
1698
- admin: {
1699
- revokeUserSessions: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1700
- userId: unknown;
1701
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1702
- userId: unknown;
1703
- } & {
1704
- fetchOptions?: FetchOptions | undefined;
1705
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1706
- success: boolean;
1707
- }, {
1708
- code?: string | undefined;
1709
- message?: string | undefined;
1710
- }, FetchOptions["throw"] extends true ? true : false>>;
1711
- };
1712
- } & {
1713
- admin: {
1714
- removeUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1715
- userId: unknown;
1716
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1717
- userId: unknown;
1718
- } & {
1719
- fetchOptions?: FetchOptions | undefined;
1720
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1721
- success: boolean;
1722
- }, {
1723
- code?: string | undefined;
1724
- message?: string | undefined;
1725
- }, FetchOptions["throw"] extends true ? true : false>>;
1726
- };
1727
- } & {
1728
- admin: {
1729
- setUserPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1730
- newPassword: string;
1731
- userId: unknown;
1732
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1733
- newPassword: string;
1734
- userId: unknown;
1735
- } & {
1736
- fetchOptions?: FetchOptions | undefined;
1737
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1738
- status: boolean;
1739
- }, {
1740
- code?: string | undefined;
1741
- message?: string | undefined;
1742
- }, FetchOptions["throw"] extends true ? true : false>>;
1743
- };
1744
- } & {
1745
- admin: {
1746
- hasPermission: <FetchOptions extends better_auth.ClientFetchOption<Partial<({
1747
- permission: {
1748
- readonly user?: ("delete" | "get" | "set-password" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate")[] | undefined;
1749
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1750
- };
1751
- permissions?: never | undefined;
1752
- } | {
1753
- permissions: {
1754
- readonly user?: ("delete" | "get" | "set-password" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate")[] | undefined;
1755
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1756
- };
1757
- permission?: never | undefined;
1758
- }) & {
1759
- userId?: string | undefined;
1760
- role?: "user" | "admin" | undefined;
1761
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<(({
1762
- permission: {
1763
- readonly user?: ("delete" | "get" | "set-password" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate")[] | undefined;
1764
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1765
- };
1766
- permissions?: never | undefined;
1767
- } | {
1768
- permissions: {
1769
- readonly user?: ("delete" | "get" | "set-password" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate")[] | undefined;
1770
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1771
- };
1772
- permission?: never | undefined;
1773
- }) & {
1774
- userId?: string | undefined;
1775
- role?: "user" | "admin" | undefined;
1776
- }) & {
1777
- fetchOptions?: FetchOptions | undefined;
1778
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1779
- error: null;
1780
- success: boolean;
1781
- }, {
1782
- code?: string | undefined;
1783
- message?: string | undefined;
1784
- }, FetchOptions["throw"] extends true ? true : false>>;
1785
- };
1786
- } & {
1787
- apiKey: {
1788
- create: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1789
- name?: string | undefined;
1790
- expiresIn?: number | null | undefined;
1791
- userId?: unknown;
1792
- prefix?: string | undefined;
1793
- remaining?: number | null | undefined;
1794
- metadata?: any;
1795
- refillAmount?: number | undefined;
1796
- refillInterval?: number | undefined;
1797
- rateLimitTimeWindow?: number | undefined;
1798
- rateLimitMax?: number | undefined;
1799
- rateLimitEnabled?: boolean | undefined;
1800
- permissions?: Record<string, string[]> | undefined;
1801
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1802
- name?: string | undefined;
1803
- expiresIn?: number | null | undefined;
1804
- userId?: unknown;
1805
- prefix?: string | undefined;
1806
- remaining?: number | null | undefined;
1807
- metadata?: any;
1808
- refillAmount?: number | undefined;
1809
- refillInterval?: number | undefined;
1810
- rateLimitTimeWindow?: number | undefined;
1811
- rateLimitMax?: number | undefined;
1812
- rateLimitEnabled?: boolean | undefined;
1813
- permissions?: Record<string, string[]> | undefined;
1814
- } & {
1815
- fetchOptions?: FetchOptions | undefined;
1816
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1817
- key: string;
1818
- metadata: any;
1819
- permissions: any;
1820
- id: string;
1821
- name: string | null;
1822
- start: string | null;
1823
- prefix: string | null;
1824
- userId: string;
1825
- refillInterval: number | null;
1826
- refillAmount: number | null;
1827
- lastRefillAt: Date | null;
1828
- enabled: boolean;
1829
- rateLimitEnabled: boolean;
1830
- rateLimitTimeWindow: number | null;
1831
- rateLimitMax: number | null;
1832
- requestCount: number;
1833
- remaining: number | null;
1834
- lastRequest: Date | null;
1835
- expiresAt: Date | null;
1836
- createdAt: Date;
1837
- updatedAt: Date;
1838
- }, {
1839
- code?: string | undefined;
1840
- message?: string | undefined;
1841
- }, FetchOptions["throw"] extends true ? true : false>>;
1842
- };
1843
- } & {
1844
- apiKey: {
1845
- get: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1846
- id: string;
1847
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1848
- query: {
1849
- id: string;
1850
- };
1851
- fetchOptions?: FetchOptions | undefined;
1852
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1853
- permissions: {
1854
- [key: string]: string[];
1855
- } | null;
1856
- id: string;
1857
- name: string | null;
1858
- start: string | null;
1859
- prefix: string | null;
1860
- userId: string;
1861
- refillInterval: number | null;
1862
- refillAmount: number | null;
1863
- lastRefillAt: Date | null;
1864
- enabled: boolean;
1865
- rateLimitEnabled: boolean;
1866
- rateLimitTimeWindow: number | null;
1867
- rateLimitMax: number | null;
1868
- requestCount: number;
1869
- remaining: number | null;
1870
- lastRequest: Date | null;
1871
- expiresAt: Date | null;
1872
- createdAt: Date;
1873
- updatedAt: Date;
1874
- metadata: Record<string, any> | null;
1875
- }, {
1876
- code?: string | undefined;
1877
- message?: string | undefined;
1878
- }, FetchOptions["throw"] extends true ? true : false>>;
1879
- };
1880
- } & {
1881
- apiKey: {
1882
- update: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1883
- keyId: string;
1884
- userId?: unknown;
1885
- name?: string | undefined;
1886
- enabled?: boolean | undefined;
1887
- remaining?: number | undefined;
1888
- refillAmount?: number | undefined;
1889
- refillInterval?: number | undefined;
1890
- metadata?: any;
1891
- expiresIn?: number | null | undefined;
1892
- rateLimitEnabled?: boolean | undefined;
1893
- rateLimitTimeWindow?: number | undefined;
1894
- rateLimitMax?: number | undefined;
1895
- permissions?: Record<string, string[]> | null | undefined;
1896
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1897
- keyId: string;
1898
- userId?: unknown;
1899
- name?: string | undefined;
1900
- enabled?: boolean | undefined;
1901
- remaining?: number | undefined;
1902
- refillAmount?: number | undefined;
1903
- refillInterval?: number | undefined;
1904
- metadata?: any;
1905
- expiresIn?: number | null | undefined;
1906
- rateLimitEnabled?: boolean | undefined;
1907
- rateLimitTimeWindow?: number | undefined;
1908
- rateLimitMax?: number | undefined;
1909
- permissions?: Record<string, string[]> | null | undefined;
1910
- } & {
1911
- fetchOptions?: FetchOptions | undefined;
1912
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1913
- permissions: {
1914
- [key: string]: string[];
1915
- } | null;
1916
- id: string;
1917
- name: string | null;
1918
- start: string | null;
1919
- prefix: string | null;
1920
- userId: string;
1921
- refillInterval: number | null;
1922
- refillAmount: number | null;
1923
- lastRefillAt: Date | null;
1924
- enabled: boolean;
1925
- rateLimitEnabled: boolean;
1926
- rateLimitTimeWindow: number | null;
1927
- rateLimitMax: number | null;
1928
- requestCount: number;
1929
- remaining: number | null;
1930
- lastRequest: Date | null;
1931
- expiresAt: Date | null;
1932
- createdAt: Date;
1933
- updatedAt: Date;
1934
- metadata: Record<string, any> | null;
1935
- }, {
1936
- code?: string | undefined;
1937
- message?: string | undefined;
1938
- }, FetchOptions["throw"] extends true ? true : false>>;
1939
- };
1940
- } & {
1941
- apiKey: {
1942
- delete: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1943
- keyId: string;
1944
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1945
- keyId: string;
1946
- } & {
1947
- fetchOptions?: FetchOptions | undefined;
1948
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1949
- success: boolean;
1950
- }, {
1951
- code?: string | undefined;
1952
- message?: string | undefined;
1953
- }, FetchOptions["throw"] extends true ? true : false>>;
1954
- };
1955
- } & {
1956
- apiKey: {
1957
- list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1958
- query?: Record<string, any> | undefined;
1959
- fetchOptions?: FetchOptions | undefined;
1960
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
1961
- permissions: {
1962
- [key: string]: string[];
1963
- } | null;
1964
- id: string;
1965
- name: string | null;
1966
- start: string | null;
1967
- prefix: string | null;
1968
- userId: string;
1969
- refillInterval: number | null;
1970
- refillAmount: number | null;
1971
- lastRefillAt: Date | null;
1972
- enabled: boolean;
1973
- rateLimitEnabled: boolean;
1974
- rateLimitTimeWindow: number | null;
1975
- rateLimitMax: number | null;
1976
- requestCount: number;
1977
- remaining: number | null;
1978
- lastRequest: Date | null;
1979
- expiresAt: Date | null;
1980
- createdAt: Date;
1981
- updatedAt: Date;
1982
- metadata: Record<string, any> | null;
1983
- }[], {
1984
- code?: string | undefined;
1985
- message?: string | undefined;
1986
- }, FetchOptions["throw"] extends true ? true : false>>;
1987
- };
1988
- } & {
1989
- organization: {
1990
- create: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1991
- name: string;
1992
- slug: string;
1993
- userId?: string | undefined;
1994
- logo?: string | undefined;
1995
- metadata?: Record<string, any> | undefined;
1996
- keepCurrentActiveOrganization?: boolean | undefined;
1997
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1998
- name: string;
1999
- slug: string;
2000
- userId?: string | undefined;
2001
- logo?: string | undefined;
2002
- metadata?: Record<string, any> | undefined;
2003
- keepCurrentActiveOrganization?: boolean | undefined;
2004
- } & {
2005
- fetchOptions?: FetchOptions | undefined;
2006
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2007
- id: string;
2008
- name: string;
2009
- slug: string;
2010
- createdAt: Date;
2011
- logo?: string | null | undefined | undefined;
2012
- metadata?: any;
2013
- } & {
2014
- metadata: any;
2015
- members: ({
2016
- id: string;
2017
- organizationId: string;
2018
- userId: string;
2019
- role: string;
2020
- createdAt: Date;
2021
- } | undefined)[];
2022
- }, {
2023
- code?: string | undefined;
2024
- message?: string | undefined;
2025
- }, FetchOptions["throw"] extends true ? true : false>>;
2026
- };
2027
- } & {
2028
- organization: {
2029
- update: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2030
- data: {
2031
- name?: string | undefined;
2032
- slug?: string | undefined;
2033
- logo?: string | undefined;
2034
- metadata?: Record<string, any> | undefined;
2035
- } & Partial<{}>;
2036
- organizationId?: string | undefined;
2037
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2038
- data: {
2039
- name?: string | undefined;
2040
- slug?: string | undefined;
2041
- logo?: string | undefined;
2042
- metadata?: Record<string, any> | undefined;
2043
- } & Partial<{}>;
2044
- organizationId?: string | undefined;
2045
- } & {
2046
- fetchOptions?: FetchOptions | undefined;
2047
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2048
- id: string;
2049
- name: string;
2050
- slug: string;
2051
- createdAt: Date;
2052
- logo?: string | null | undefined | undefined;
2053
- metadata?: any;
2054
- } & {
2055
- metadata: Record<string, any> | undefined;
2056
- }, {
2057
- code?: string | undefined;
2058
- message?: string | undefined;
2059
- }, FetchOptions["throw"] extends true ? true : false>>;
2060
- };
2061
- } & {
2062
- organization: {
2063
- delete: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2064
- organizationId: string;
2065
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2066
- organizationId: string;
2067
- } & {
2068
- fetchOptions?: FetchOptions | undefined;
2069
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2070
- id: string;
2071
- name: string;
2072
- slug: string;
2073
- createdAt: Date;
2074
- logo?: string | null | undefined | undefined;
2075
- metadata?: any;
2076
- }, {
2077
- code?: string | undefined;
2078
- message?: string | undefined;
2079
- }, FetchOptions["throw"] extends true ? true : false>>;
2080
- };
2081
- } & {
2082
- organization: {
2083
- setActive: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2084
- organizationId?: string | null | undefined;
2085
- organizationSlug?: string | undefined;
2086
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2087
- organizationId?: string | null | undefined;
2088
- organizationSlug?: string | undefined;
2089
- } & {
2090
- fetchOptions?: FetchOptions | undefined;
2091
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2092
- members: {
2093
- id: string;
2094
- organizationId: string;
2095
- role: "admin" | "member" | "owner";
2096
- createdAt: Date;
2097
- userId: string;
2098
- user: {
2099
- id: string;
2100
- email: string;
2101
- name: string;
2102
- image?: string | undefined;
2103
- };
2104
- }[];
2105
- invitations: {
2106
- id: string;
2107
- organizationId: string;
2108
- email: string;
2109
- role: "admin" | "member" | "owner";
2110
- status: better_auth_plugins_organization.InvitationStatus;
2111
- inviterId: string;
2112
- expiresAt: Date;
2113
- createdAt: Date;
2114
- }[];
2115
- } & {
2116
- id: string;
2117
- name: string;
2118
- slug: string;
2119
- createdAt: Date;
2120
- logo?: string | null | undefined | undefined;
2121
- metadata?: any;
2122
- }, {
2123
- code?: string | undefined;
2124
- message?: string | undefined;
2125
- }, FetchOptions["throw"] extends true ? true : false>>;
2126
- };
2127
- } & {
2128
- organization: {
2129
- getFullOrganization: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2130
- organizationId?: string | undefined;
2131
- organizationSlug?: string | undefined;
2132
- membersLimit?: string | number | undefined;
2133
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2134
- query?: {
2135
- organizationId?: string | undefined;
2136
- organizationSlug?: string | undefined;
2137
- membersLimit?: string | number | undefined;
2138
- } | undefined;
2139
- fetchOptions?: FetchOptions | undefined;
2140
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2141
- members: {
2142
- id: string;
2143
- organizationId: string;
2144
- role: "admin" | "member" | "owner";
2145
- createdAt: Date;
2146
- userId: string;
2147
- user: {
2148
- id: string;
2149
- email: string;
2150
- name: string;
2151
- image?: string | undefined;
2152
- };
2153
- }[];
2154
- invitations: {
2155
- id: string;
2156
- organizationId: string;
2157
- email: string;
2158
- role: "admin" | "member" | "owner";
2159
- status: better_auth_plugins_organization.InvitationStatus;
2160
- inviterId: string;
2161
- expiresAt: Date;
2162
- createdAt: Date;
2163
- }[];
2164
- } & {
2165
- id: string;
2166
- name: string;
2167
- slug: string;
2168
- createdAt: Date;
2169
- logo?: string | null | undefined | undefined;
2170
- metadata?: any;
2171
- }, {
2172
- code?: string | undefined;
2173
- message?: string | undefined;
2174
- }, FetchOptions["throw"] extends true ? true : false>>;
2175
- };
2176
- } & {
2177
- organization: {
2178
- list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2179
- query?: Record<string, any> | undefined;
2180
- fetchOptions?: FetchOptions | undefined;
2181
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2182
- id: string;
2183
- name: string;
2184
- slug: string;
2185
- createdAt: Date;
2186
- logo?: string | null | undefined | undefined;
2187
- metadata?: any;
2188
- }[], {
2189
- code?: string | undefined;
2190
- message?: string | undefined;
2191
- }, FetchOptions["throw"] extends true ? true : false>>;
2192
- };
2193
- } & {
2194
- organization: {
2195
- inviteMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2196
- email: string;
2197
- role: "admin" | "member" | "owner" | ("admin" | "member" | "owner")[];
2198
- organizationId?: string | undefined;
2199
- resend?: boolean | undefined;
2200
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2201
- email: string;
2202
- role: "admin" | "member" | "owner" | ("admin" | "member" | "owner")[];
2203
- organizationId?: string | undefined;
2204
- resend?: boolean | undefined;
2205
- } & {
2206
- fetchOptions?: FetchOptions | undefined;
2207
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2208
- id: string;
2209
- organizationId: string;
2210
- email: string;
2211
- role: "admin" | "member" | "owner";
2212
- status: better_auth_plugins_organization.InvitationStatus;
2213
- inviterId: string;
2214
- expiresAt: Date;
2215
- createdAt: Date;
2216
- }, {
2217
- code?: string | undefined;
2218
- message?: string | undefined;
2219
- }, FetchOptions["throw"] extends true ? true : false>>;
2220
- };
2221
- } & {
2222
- organization: {
2223
- cancelInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2224
- invitationId: string;
2225
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2226
- invitationId: string;
2227
- } & {
2228
- fetchOptions?: FetchOptions | undefined;
2229
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2230
- id: string;
2231
- organizationId: string;
2232
- email: string;
2233
- role: "admin" | "member" | "owner";
2234
- status: better_auth_plugins_organization.InvitationStatus;
2235
- inviterId: string;
2236
- expiresAt: Date;
2237
- createdAt: Date;
2238
- }, {
2239
- code?: string | undefined;
2240
- message?: string | undefined;
2241
- }, FetchOptions["throw"] extends true ? true : false>>;
2242
- };
2243
- } & {
2244
- organization: {
2245
- acceptInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2246
- invitationId: string;
2247
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2248
- invitationId: string;
2249
- } & {
2250
- fetchOptions?: FetchOptions | undefined;
2251
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2252
- invitation: {
2253
- id: string;
2254
- organizationId: string;
2255
- email: string;
2256
- role: "admin" | "member" | "owner";
2257
- status: better_auth_plugins_organization.InvitationStatus;
2258
- inviterId: string;
2259
- expiresAt: Date;
2260
- createdAt: Date;
2261
- };
2262
- member: {
2263
- id: string;
2264
- organizationId: string;
2265
- userId: string;
2266
- role: string;
2267
- createdAt: Date;
2268
- };
2269
- }, {
2270
- code?: string | undefined;
2271
- message?: string | undefined;
2272
- }, FetchOptions["throw"] extends true ? true : false>>;
2273
- };
2274
- } & {
2275
- organization: {
2276
- getInvitation: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2277
- id: string;
2278
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2279
- query: {
2280
- id: string;
2281
- };
2282
- fetchOptions?: FetchOptions | undefined;
2283
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<{
2284
- id: string;
2285
- organizationId: string;
2286
- email: string;
2287
- role: "admin" | "member" | "owner";
2288
- status: better_auth_plugins_organization.InvitationStatus;
2289
- inviterId: string;
2290
- expiresAt: Date;
2291
- createdAt: Date;
2292
- } & {
2293
- organizationName: string;
2294
- organizationSlug: string;
2295
- inviterEmail: string;
2296
- }>, {
2297
- code?: string | undefined;
2298
- message?: string | undefined;
2299
- }, FetchOptions["throw"] extends true ? true : false>>;
2300
- };
2301
- } & {
2302
- organization: {
2303
- rejectInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2304
- invitationId: string;
2305
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2306
- invitationId: string;
2307
- } & {
2308
- fetchOptions?: FetchOptions | undefined;
2309
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2310
- invitation: {
2311
- id: string;
2312
- organizationId: string;
2313
- email: string;
2314
- role: "admin" | "member" | "owner";
2315
- status: better_auth_plugins_organization.InvitationStatus;
2316
- inviterId: string;
2317
- expiresAt: Date;
2318
- createdAt: Date;
2319
- } | null;
2320
- member: null;
2321
- }, {
2322
- code?: string | undefined;
2323
- message?: string | undefined;
2324
- }, FetchOptions["throw"] extends true ? true : false>>;
2325
- };
2326
- } & {
2327
- organization: {
2328
- listInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2329
- organizationId?: string | undefined;
2330
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2331
- query?: {
2332
- organizationId?: string | undefined;
2333
- } | undefined;
2334
- fetchOptions?: FetchOptions | undefined;
2335
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2336
- id: string;
2337
- organizationId: string;
2338
- email: string;
2339
- role: "admin" | "member" | "owner";
2340
- status: better_auth_plugins_organization.InvitationStatus;
2341
- inviterId: string;
2342
- expiresAt: Date;
2343
- createdAt: Date;
2344
- }[], {
2345
- code?: string | undefined;
2346
- message?: string | undefined;
2347
- }, FetchOptions["throw"] extends true ? true : false>>;
2348
- };
2349
- } & {
2350
- organization: {
2351
- getActiveMember: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2352
- query?: Record<string, any> | undefined;
2353
- fetchOptions?: FetchOptions | undefined;
2354
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<Omit<{
2355
- id: string;
2356
- organizationId: string;
2357
- role: "admin" | "member" | "owner";
2358
- createdAt: Date;
2359
- userId: string;
2360
- user: {
2361
- id: string;
2362
- email: string;
2363
- name: string;
2364
- image?: string | undefined;
2365
- };
2366
- } & {
2367
- user: better_auth.User;
2368
- }, "user"> & {
2369
- user: {
2370
- id: string;
2371
- name: string;
2372
- email: string;
2373
- image: string | undefined;
2374
- };
2375
- }, {
2376
- code?: string | undefined;
2377
- message?: string | undefined;
2378
- }, FetchOptions["throw"] extends true ? true : false>>;
2379
- };
2380
- } & {
2381
- organization: {
2382
- checkSlug: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2383
- slug: string;
2384
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2385
- slug: string;
2386
- } & {
2387
- fetchOptions?: FetchOptions | undefined;
2388
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2389
- status: boolean;
2390
- }, {
2391
- code?: string | undefined;
2392
- message?: string | undefined;
2393
- }, FetchOptions["throw"] extends true ? true : false>>;
2394
- };
2395
- } & {
2396
- organization: {
2397
- removeMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2398
- memberIdOrEmail: string;
2399
- organizationId?: string | undefined;
2400
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2401
- memberIdOrEmail: string;
2402
- organizationId?: string | undefined;
2403
- } & {
2404
- fetchOptions?: FetchOptions | undefined;
2405
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2406
- member: {
2407
- id: string;
2408
- organizationId: string;
2409
- role: "admin" | "member" | "owner";
2410
- createdAt: Date;
2411
- userId: string;
2412
- user: {
2413
- id: string;
2414
- email: string;
2415
- name: string;
2416
- image?: string | undefined;
2417
- };
2418
- };
2419
- }, {
2420
- code?: string | undefined;
2421
- message?: string | undefined;
2422
- }, FetchOptions["throw"] extends true ? true : false>>;
2423
- };
2424
- } & {
2425
- organization: {
2426
- updateMemberRole: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2427
- role: better_auth.LiteralString | "admin" | "member" | "owner" | ("admin" | "member" | "owner")[] | better_auth.LiteralString[];
2428
- memberId: string;
2429
- organizationId?: string | undefined;
2430
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2431
- role: better_auth.LiteralString | "admin" | "member" | "owner" | ("admin" | "member" | "owner")[] | better_auth.LiteralString[];
2432
- memberId: string;
2433
- organizationId?: string | undefined;
2434
- } & {
2435
- fetchOptions?: FetchOptions | undefined;
2436
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2437
- id: string;
2438
- organizationId: string;
2439
- role: "admin" | "member" | "owner";
2440
- createdAt: Date;
2441
- userId: string;
2442
- user: {
2443
- id: string;
2444
- email: string;
2445
- name: string;
2446
- image?: string | undefined;
2447
- };
2448
- }, {
2449
- code?: string | undefined;
2450
- message?: string | undefined;
2451
- }, FetchOptions["throw"] extends true ? true : false>>;
2452
- };
2453
- } & {
2454
- organization: {
2455
- leave: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2456
- organizationId: string;
2457
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2458
- organizationId: string;
2459
- } & {
2460
- fetchOptions?: FetchOptions | undefined;
2461
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<Omit<{
2462
- id: string;
2463
- organizationId: string;
2464
- role: "admin" | "member" | "owner";
2465
- createdAt: Date;
2466
- userId: string;
2467
- user: {
2468
- id: string;
2469
- email: string;
2470
- name: string;
2471
- image?: string | undefined;
2472
- };
2473
- } & {
2474
- user: better_auth.User;
2475
- }, "user"> & {
2476
- user: {
2477
- id: string;
2478
- name: string;
2479
- email: string;
2480
- image: string | undefined;
2481
- };
2482
- }>, {
2483
- code?: string | undefined;
2484
- message?: string | undefined;
2485
- }, FetchOptions["throw"] extends true ? true : false>>;
2486
- };
2487
- } & {
2488
- organization: {
2489
- listUserInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2490
- email?: string | undefined;
2491
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2492
- query?: {
2493
- email?: string | undefined;
2494
- } | undefined;
2495
- fetchOptions?: FetchOptions | undefined;
2496
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2497
- id: string;
2498
- organizationId: string;
2499
- email: string;
2500
- role: "admin" | "member" | "owner";
2501
- status: better_auth_plugins_organization.InvitationStatus;
2502
- inviterId: string;
2503
- expiresAt: Date;
2504
- createdAt: Date;
2505
- }[], {
2506
- code?: string | undefined;
2507
- message?: string | undefined;
2508
- }, FetchOptions["throw"] extends true ? true : false>>;
2509
- };
2510
- } & {
2511
- organization: {
2512
- listMembers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2513
- limit?: string | number | undefined;
2514
- offset?: string | number | undefined;
2515
- sortBy?: string | undefined;
2516
- sortDirection?: "asc" | "desc" | undefined;
2517
- filterField?: string | undefined;
2518
- filterValue?: string | number | boolean | undefined;
2519
- filterOperator?: "contains" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | undefined;
2520
- organizationId?: string | undefined;
2521
- organizationSlug?: string | undefined;
2522
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2523
- query?: {
2524
- limit?: string | number | undefined;
2525
- offset?: string | number | undefined;
2526
- sortBy?: string | undefined;
2527
- sortDirection?: "asc" | "desc" | undefined;
2528
- filterField?: string | undefined;
2529
- filterValue?: string | number | boolean | undefined;
2530
- filterOperator?: "contains" | "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | undefined;
2531
- organizationId?: string | undefined;
2532
- organizationSlug?: string | undefined;
2533
- } | undefined;
2534
- fetchOptions?: FetchOptions | undefined;
2535
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2536
- members: ({
2537
- id: string;
2538
- organizationId: string;
2539
- role: "admin" | "member" | "owner";
2540
- createdAt: Date;
2541
- userId: string;
2542
- user: {
2543
- id: string;
2544
- email: string;
2545
- name: string;
2546
- image?: string | undefined;
2547
- };
2548
- } & {
2549
- user: {
2550
- id: string;
2551
- name: string;
2552
- email: string;
2553
- image: string | null | undefined;
2554
- };
2555
- })[];
2556
- total: number;
2557
- }, {
2558
- code?: string | undefined;
2559
- message?: string | undefined;
2560
- }, FetchOptions["throw"] extends true ? true : false>>;
2561
- };
2562
- } & {
2563
- organization: {
2564
- getActiveMemberRole: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2565
- userId?: string | undefined;
2566
- organizationId?: string | undefined;
2567
- organizationSlug?: string | undefined;
2568
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2569
- query?: {
2570
- userId?: string | undefined;
2571
- organizationId?: string | undefined;
2572
- organizationSlug?: string | undefined;
2573
- } | undefined;
2574
- fetchOptions?: FetchOptions | undefined;
2575
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2576
- role: "admin" | "member" | "owner";
2577
- }, {
2578
- code?: string | undefined;
2579
- message?: string | undefined;
2580
- }, FetchOptions["throw"] extends true ? true : false>>;
2581
- };
2582
- } & {
2583
- organization: {
2584
- hasPermission: <FetchOptions extends better_auth.ClientFetchOption<Partial<({
2585
- permission: {
2586
- readonly organization?: ("delete" | "update")[] | undefined;
2587
- readonly member?: ("delete" | "update" | "create")[] | undefined;
2588
- readonly invitation?: ("create" | "cancel")[] | undefined;
2589
- readonly team?: ("delete" | "update" | "create")[] | undefined;
2590
- readonly ac?: ("delete" | "update" | "create" | "read")[] | undefined;
2591
- };
2592
- permissions?: never | undefined;
2593
- } | {
2594
- permissions: {
2595
- readonly organization?: ("delete" | "update")[] | undefined;
2596
- readonly member?: ("delete" | "update" | "create")[] | undefined;
2597
- readonly invitation?: ("create" | "cancel")[] | undefined;
2598
- readonly team?: ("delete" | "update" | "create")[] | undefined;
2599
- readonly ac?: ("delete" | "update" | "create" | "read")[] | undefined;
2600
- };
2601
- permission?: never | undefined;
2602
- }) & {
2603
- organizationId?: string | undefined;
2604
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<(({
2605
- permission: {
2606
- readonly organization?: ("delete" | "update")[] | undefined;
2607
- readonly member?: ("delete" | "update" | "create")[] | undefined;
2608
- readonly invitation?: ("create" | "cancel")[] | undefined;
2609
- readonly team?: ("delete" | "update" | "create")[] | undefined;
2610
- readonly ac?: ("delete" | "update" | "create" | "read")[] | undefined;
2611
- };
2612
- permissions?: never | undefined;
2613
- } | {
2614
- permissions: {
2615
- readonly organization?: ("delete" | "update")[] | undefined;
2616
- readonly member?: ("delete" | "update" | "create")[] | undefined;
2617
- readonly invitation?: ("create" | "cancel")[] | undefined;
2618
- readonly team?: ("delete" | "update" | "create")[] | undefined;
2619
- readonly ac?: ("delete" | "update" | "create" | "read")[] | undefined;
2620
- };
2621
- permission?: never | undefined;
2622
- }) & {
2623
- organizationId?: string | undefined;
2624
- }) & {
2625
- fetchOptions?: FetchOptions | undefined;
2626
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2627
- error: null;
2628
- success: boolean;
2629
- }, {
2630
- code?: string | undefined;
2631
- message?: string | undefined;
2632
- }, FetchOptions["throw"] extends true ? true : false>>;
2633
- };
2634
- } & {
2635
- device: {
2636
- code: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2637
- client_id: string;
2638
- scope?: string | undefined;
2639
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2640
- client_id: string;
2641
- scope?: string | undefined;
2642
- } & {
2643
- fetchOptions?: FetchOptions | undefined;
2644
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2645
- device_code: string;
2646
- user_code: string;
2647
- verification_uri: string;
2648
- verification_uri_complete: string;
2649
- expires_in: number;
2650
- interval: number;
2651
- }, {
2652
- error: "invalid_request" | "invalid_client";
2653
- error_description: string;
2654
- }, FetchOptions["throw"] extends true ? true : false>>;
2655
- };
2656
- } & {
2657
- device: {
2658
- token: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2659
- grant_type: "urn:ietf:params:oauth:grant-type:device_code";
2660
- device_code: string;
2661
- client_id: string;
2662
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2663
- grant_type: "urn:ietf:params:oauth:grant-type:device_code";
2664
- device_code: string;
2665
- client_id: string;
2666
- } & {
2667
- fetchOptions?: FetchOptions | undefined;
2668
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2669
- access_token: string;
2670
- token_type: string;
2671
- expires_in: number;
2672
- scope: string;
2673
- }, {
2674
- error: "invalid_request" | "authorization_pending" | "slow_down" | "expired_token" | "access_denied" | "invalid_grant";
2675
- error_description: string;
2676
- }, FetchOptions["throw"] extends true ? true : false>>;
2677
- };
2678
- } & {
2679
- device: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2680
- user_code: string;
2681
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2682
- query: {
2683
- user_code: string;
2684
- };
2685
- fetchOptions?: FetchOptions | undefined;
2686
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2687
- user_code: string;
2688
- status: string;
2689
- }, {
2690
- error: "invalid_request";
2691
- error_description: string;
2692
- }, FetchOptions["throw"] extends true ? true : false>>;
2693
- } & {
2694
- device: {
2695
- approve: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2696
- userCode: string;
2697
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2698
- userCode: string;
2699
- } & {
2700
- fetchOptions?: FetchOptions | undefined;
2701
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2702
- success: boolean;
2703
- }, {
2704
- error: "invalid_request" | "expired_token" | "device_code_already_processed";
2705
- error_description: string;
2706
- }, FetchOptions["throw"] extends true ? true : false>>;
2707
- };
2708
- } & {
2709
- device: {
2710
- deny: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2711
- userCode: string;
2712
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2713
- userCode: string;
2714
- } & {
2715
- fetchOptions?: FetchOptions | undefined;
2716
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2717
- success: boolean;
2718
- }, {
2719
- error: "invalid_request" | "expired_token";
2720
- error_description: string;
2721
- }, FetchOptions["throw"] extends true ? true : false>>;
2722
- };
2723
- } & {
2724
- multiSession: {
2725
- listDeviceSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2726
- query?: Record<string, any> | undefined;
2727
- fetchOptions?: FetchOptions | undefined;
2728
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2729
- session: better_auth.Session;
2730
- user: better_auth.User;
2731
- }[], {
2732
- code?: string | undefined;
2733
- message?: string | undefined;
2734
- }, FetchOptions["throw"] extends true ? true : false>>;
2735
- };
2736
- } & {
2737
- multiSession: {
2738
- setActive: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2739
- sessionToken: string;
2740
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2741
- sessionToken: string;
2742
- } & {
2743
- fetchOptions?: FetchOptions | undefined;
2744
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2745
- session: better_auth.Session & Record<string, any>;
2746
- user: better_auth.User & Record<string, any>;
2747
- }, {
2748
- code?: string | undefined;
2749
- message?: string | undefined;
2750
- }, FetchOptions["throw"] extends true ? true : false>>;
2751
- };
2752
- } & {
2753
- multiSession: {
2754
- revoke: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2755
- sessionToken: string;
2756
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2757
- sessionToken: string;
2758
- } & {
2759
- fetchOptions?: FetchOptions | undefined;
2760
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<{
2761
- status: boolean;
2762
- }, {
2763
- code?: string | undefined;
2764
- message?: string | undefined;
2765
- }, FetchOptions["throw"] extends true ? true : false>>;
2766
- };
2767
- } & {
2768
- oneTap: (opts?: better_auth_client_plugins.GoogleOneTapActionOptions | undefined, fetchOptions?: better_auth.ClientFetchOption | undefined) => Promise<void>;
2769
- } & {
2770
- admin: {
2771
- checkRolePermission: <R extends "user" | "admin">(data: ({
2772
- permission: {
2773
- readonly user?: ("delete" | "get" | "set-password" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate")[] | undefined;
2774
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
2775
- };
2776
- permissions?: never | undefined;
2777
- } | {
2778
- permissions: {
2779
- readonly user?: ("delete" | "get" | "set-password" | "update" | "list" | "create" | "set-role" | "ban" | "impersonate")[] | undefined;
2780
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
2781
- };
2782
- permission?: never | undefined;
2783
- }) & {
2784
- role: R;
2785
- }) => boolean;
2786
- };
2787
- } & {
2788
- $Infer: {
2789
- ActiveOrganization: {
2790
- members: {
2791
- id: string;
2792
- organizationId: string;
2793
- role: "admin" | "member" | "owner";
2794
- createdAt: Date;
2795
- userId: string;
2796
- user: {
2797
- id: string;
2798
- email: string;
2799
- name: string;
2800
- image?: string | undefined;
2801
- };
2802
- }[];
2803
- invitations: {
2804
- id: string;
2805
- organizationId: string;
2806
- email: string;
2807
- role: "admin" | "member" | "owner";
2808
- status: better_auth_plugins_organization.InvitationStatus;
2809
- inviterId: string;
2810
- expiresAt: Date;
2811
- createdAt: Date;
2812
- }[];
2813
- } & {
2814
- id: string;
2815
- name: string;
2816
- slug: string;
2817
- createdAt: Date;
2818
- logo?: string | null | undefined | undefined;
2819
- metadata?: any;
2820
- };
2821
- Organization: {
2822
- id: string;
2823
- name: string;
2824
- slug: string;
2825
- createdAt: Date;
2826
- logo?: string | null | undefined;
2827
- metadata?: any;
2828
- };
2829
- Invitation: {
2830
- id: string;
2831
- organizationId: string;
2832
- email: string;
2833
- role: "admin" | "member" | "owner";
2834
- status: better_auth_plugins_organization.InvitationStatus;
2835
- inviterId: string;
2836
- expiresAt: Date;
2837
- createdAt: Date;
2838
- };
2839
- Member: {
2840
- id: string;
2841
- organizationId: string;
2842
- role: "admin" | "member" | "owner";
2843
- createdAt: Date;
2844
- userId: string;
2845
- user: {
2846
- id: string;
2847
- email: string;
2848
- name: string;
2849
- image?: string | undefined;
2850
- };
2851
- };
2852
- Team: {
2853
- id: string;
2854
- name: string;
2855
- organizationId: string;
2856
- createdAt: Date;
2857
- updatedAt?: Date | undefined;
2858
- };
2859
- };
2860
- organization: {
2861
- checkRolePermission: <R extends "admin" | "member" | "owner">(data: ({
2862
- permission: {
2863
- readonly organization?: ("delete" | "update")[] | undefined;
2864
- readonly member?: ("delete" | "update" | "create")[] | undefined;
2865
- readonly invitation?: ("create" | "cancel")[] | undefined;
2866
- readonly team?: ("delete" | "update" | "create")[] | undefined;
2867
- readonly ac?: ("delete" | "update" | "create" | "read")[] | undefined;
2868
- };
2869
- permissions?: never | undefined;
2870
- } | {
2871
- permissions: {
2872
- readonly organization?: ("delete" | "update")[] | undefined;
2873
- readonly member?: ("delete" | "update" | "create")[] | undefined;
2874
- readonly invitation?: ("create" | "cancel")[] | undefined;
2875
- readonly team?: ("delete" | "update" | "create")[] | undefined;
2876
- readonly ac?: ("delete" | "update" | "create" | "read")[] | undefined;
2877
- };
2878
- permission?: never | undefined;
2879
- }) & {
2880
- role: R;
2881
- }) => boolean;
2882
- };
2883
- } & {
2884
- getLastUsedLoginMethod: () => string | null;
2885
- clearLastUsedLoginMethod: () => void;
2886
- isLastUsedLoginMethod: (method: string) => boolean;
2887
- } & {
2888
- useSession: () => {
2889
- data: {
2890
- user: {
2891
- id: string;
2892
- createdAt: Date;
2893
- updatedAt: Date;
2894
- email: string;
2895
- emailVerified: boolean;
2896
- name: string;
2897
- image?: string | null | undefined;
2898
- isAnonymous: boolean | null | undefined;
2899
- phoneNumber?: string | null | undefined;
2900
- phoneNumberVerified?: boolean | null | undefined;
2901
- twoFactorEnabled: boolean | null | undefined;
2902
- username?: string | null | undefined;
2903
- displayUsername?: string | null | undefined;
2904
- banned: boolean | null | undefined;
2905
- role?: string | null | undefined;
2906
- banReason?: string | null | undefined;
2907
- banExpires?: Date | null | undefined;
2908
- };
2909
- session: {
2910
- id: string;
2911
- createdAt: Date;
2912
- updatedAt: Date;
2913
- userId: string;
2914
- expiresAt: Date;
2915
- token: string;
2916
- ipAddress?: string | null | undefined;
2917
- userAgent?: string | null | undefined;
2918
- impersonatedBy?: string | null | undefined;
2919
- activeOrganizationId?: string | null | undefined;
2920
- };
2921
- } | null;
2922
- isPending: boolean;
2923
- isRefetching: boolean;
2924
- error: better_auth_react.BetterFetchError | null;
2925
- refetch: (queryParams?: {
2926
- query?: better_auth.SessionQueryParams;
2927
- } | undefined) => Promise<void>;
2928
- };
2929
- $Infer: {
2930
- Session: {
2931
- user: {
2932
- id: string;
2933
- createdAt: Date;
2934
- updatedAt: Date;
2935
- email: string;
2936
- emailVerified: boolean;
2937
- name: string;
2938
- image?: string | null | undefined;
2939
- isAnonymous: boolean | null | undefined;
2940
- phoneNumber?: string | null | undefined;
2941
- phoneNumberVerified?: boolean | null | undefined;
2942
- twoFactorEnabled: boolean | null | undefined;
2943
- username?: string | null | undefined;
2944
- displayUsername?: string | null | undefined;
2945
- banned: boolean | null | undefined;
2946
- role?: string | null | undefined;
2947
- banReason?: string | null | undefined;
2948
- banExpires?: Date | null | undefined;
2949
- };
2950
- session: {
2951
- id: string;
2952
- createdAt: Date;
2953
- updatedAt: Date;
2954
- userId: string;
2955
- expiresAt: Date;
2956
- token: string;
2957
- ipAddress?: string | null | undefined;
2958
- userAgent?: string | null | undefined;
2959
- impersonatedBy?: string | null | undefined;
2960
- activeOrganizationId?: string | null | undefined;
2961
- };
2962
- };
2963
- };
2964
- $fetch: better_auth_react.BetterFetch<{
2965
- plugins: (better_auth_react.BetterFetchPlugin | {
2966
- id: string;
2967
- name: string;
2968
- hooks: {
2969
- onSuccess(context: better_auth_react.SuccessContext<any>): void;
2970
- };
2971
- } | {
2972
- id: string;
2973
- name: string;
2974
- hooks: {
2975
- onSuccess: ((context: better_auth_react.SuccessContext<any>) => Promise<void> | void) | undefined;
2976
- onError: ((context: better_auth_react.ErrorContext) => Promise<void> | void) | undefined;
2977
- onRequest: (<T extends Record<string, any>>(context: better_auth_react.RequestContext<T>) => Promise<better_auth_react.RequestContext | void> | better_auth_react.RequestContext | void) | undefined;
2978
- onResponse: ((context: better_auth_react.ResponseContext) => Promise<Response | void | better_auth_react.ResponseContext> | Response | better_auth_react.ResponseContext | void) | undefined;
2979
- };
2980
- })[];
2981
- cache?: RequestCache | undefined;
2982
- method: string;
2983
- headers?: (HeadersInit & (HeadersInit | {
2984
- accept: "application/json" | "text/plain" | "application/octet-stream";
2985
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
2986
- authorization: "Bearer" | "Basic";
2987
- })) | undefined;
2988
- redirect?: RequestRedirect | undefined;
2989
- credentials?: RequestCredentials;
2990
- integrity?: string | undefined;
2991
- keepalive?: boolean | undefined;
2992
- mode?: RequestMode | undefined;
2993
- priority?: RequestPriority | undefined;
2994
- referrer?: string | undefined;
2995
- referrerPolicy?: ReferrerPolicy | undefined;
2996
- signal?: (AbortSignal | null) | undefined;
2997
- window?: null | undefined;
2998
- onRetry?: ((response: better_auth_react.ResponseContext) => Promise<void> | void) | undefined;
2999
- hookOptions?: {
3000
- cloneResponse?: boolean;
3001
- } | undefined;
3002
- timeout?: number | undefined;
3003
- customFetchImpl: better_auth_react.FetchEsque;
3004
- baseURL: string;
3005
- throw?: boolean | undefined;
3006
- auth?: ({
3007
- type: "Bearer";
3008
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
3009
- } | {
3010
- type: "Basic";
3011
- username: string | (() => string | undefined) | undefined;
3012
- password: string | (() => string | undefined) | undefined;
3013
- } | {
3014
- type: "Custom";
3015
- prefix: string | (() => string | undefined) | undefined;
3016
- value: string | (() => string | undefined) | undefined;
3017
- }) | undefined;
3018
- body?: any;
3019
- query?: any;
3020
- params?: any;
3021
- duplex?: "full" | "half" | undefined;
3022
- jsonParser: (text: string) => Promise<any> | any;
3023
- retry?: better_auth_react.RetryOptions | undefined;
3024
- retryAttempt?: number | undefined;
3025
- output?: (better_auth_react.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
3026
- errorSchema?: better_auth_react.StandardSchemaV1 | undefined;
3027
- disableValidation?: boolean | undefined;
3028
- disableSignal?: boolean | undefined;
3029
- }, unknown, unknown, {}>;
3030
- $store: {
3031
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
3032
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
3033
- atoms: Record<string, better_auth_react.WritableAtom<any>>;
3034
- };
3035
- $ERROR_CODES: {
3036
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
3037
- readonly USER_ALREADY_EXISTS: "User already exists.";
3038
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
3039
- readonly YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself";
3040
- readonly YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role";
3041
- readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users";
3042
- readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users";
3043
- readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions";
3044
- readonly YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users";
3045
- readonly YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users";
3046
- readonly YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions";
3047
- readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users";
3048
- readonly YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password";
3049
- readonly BANNED_USER: "You have been banned from this application";
3050
- readonly YOU_ARE_NOT_ALLOWED_TO_GET_USER: "You are not allowed to get user";
3051
- readonly NO_DATA_TO_UPDATE: "No data to update";
3052
- readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
3053
- readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
3054
- readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
3055
- readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization";
3056
- readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations";
3057
- readonly ORGANIZATION_ALREADY_EXISTS: "Organization already exists";
3058
- readonly ORGANIZATION_SLUG_ALREADY_TAKEN: "Organization slug already taken";
3059
- readonly ORGANIZATION_NOT_FOUND: "Organization not found";
3060
- readonly USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: "User is not a member of the organization";
3061
- readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: "You are not allowed to update this organization";
3062
- readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: "You are not allowed to delete this organization";
3063
- readonly NO_ACTIVE_ORGANIZATION: "No active organization";
3064
- readonly USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: "User is already a member of this organization";
3065
- readonly MEMBER_NOT_FOUND: "Member not found";
3066
- readonly ROLE_NOT_FOUND: "Role not found";
3067
- readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: "You are not allowed to create a new team";
3068
- readonly TEAM_ALREADY_EXISTS: "Team already exists";
3069
- readonly TEAM_NOT_FOUND: "Team not found";
3070
- readonly YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: "You cannot leave the organization as the only owner";
3071
- readonly YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: "You cannot leave the organization without an owner";
3072
- readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: "You are not allowed to delete this member";
3073
- readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: "You are not allowed to invite users to this organization";
3074
- readonly USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: "User is already invited to this organization";
3075
- readonly INVITATION_NOT_FOUND: "Invitation not found";
3076
- readonly YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: "You are not the recipient of the invitation";
3077
- readonly EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: "Email verification required before accepting or rejecting invitation";
3078
- readonly YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: "You are not allowed to cancel this invitation";
3079
- readonly INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: "Inviter is no longer a member of the organization";
3080
- readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: "You are not allowed to invite a user with this role";
3081
- readonly FAILED_TO_RETRIEVE_INVITATION: "Failed to retrieve invitation";
3082
- readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: "You have reached the maximum number of teams";
3083
- readonly UNABLE_TO_REMOVE_LAST_TEAM: "Unable to remove last team";
3084
- readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: "You are not allowed to update this member";
3085
- readonly ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: "Organization membership limit reached";
3086
- readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to create teams in this organization";
3087
- readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to delete teams in this organization";
3088
- readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: "You are not allowed to update this team";
3089
- readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: "You are not allowed to delete this team";
3090
- readonly INVITATION_LIMIT_REACHED: "Invitation limit reached";
3091
- readonly TEAM_MEMBER_LIMIT_REACHED: "Team member limit reached";
3092
- readonly USER_IS_NOT_A_MEMBER_OF_THE_TEAM: "User is not a member of the team";
3093
- readonly YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: "You are not allowed to list the members of this team";
3094
- readonly YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: "You do not have an active team";
3095
- readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: "You are not allowed to create a new member";
3096
- readonly YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: "You are not allowed to remove a team member";
3097
- readonly YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: "You are not allowed to access this organization as an owner";
3098
- readonly YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: "You are not a member of this organization";
3099
- readonly MISSING_AC_INSTANCE: "Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information";
3100
- readonly YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: "You must be in an organization to create a role";
3101
- readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: "You are not allowed to create a role";
3102
- readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: "You are not allowed to update a role";
3103
- readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: "You are not allowed to delete a role";
3104
- readonly YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: "You are not allowed to read a role";
3105
- readonly YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: "You are not allowed to list a role";
3106
- readonly YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: "You are not allowed to get a role";
3107
- readonly TOO_MANY_ROLES: "This organization has too many roles";
3108
- readonly INVALID_RESOURCE: "The provided permission includes an invalid resource";
3109
- readonly ROLE_NAME_IS_ALREADY_TAKEN: "That role name is already taken";
3110
- readonly CANNOT_DELETE_A_PRE_DEFINED_ROLE: "Cannot delete a pre-defined role";
3111
- readonly INVALID_EMAIL_FORMAT: "Email was not generated in a valid format";
3112
- readonly COULD_NOT_CREATE_SESSION: "Could not create session";
3113
- readonly ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously";
3114
- readonly OTP_EXPIRED: "OTP expired";
3115
- readonly INVALID_OTP: "Invalid OTP";
3116
- readonly TOO_MANY_ATTEMPTS: "Too many attempts";
3117
- readonly INVALID_OAUTH_CONFIGURATION: "Invalid OAuth configuration";
3118
- readonly TOKEN_URL_NOT_FOUND: "Invalid OAuth configuration. Token URL not found.";
3119
- readonly PROVIDER_CONFIG_NOT_FOUND: "No config found for provider";
3120
- readonly PROVIDER_ID_REQUIRED: "Provider ID is required";
3121
- readonly INVALID_OAUTH_CONFIG: "Invalid OAuth configuration.";
3122
- readonly SESSION_REQUIRED: "Session is required";
3123
- readonly INVALID_PHONE_NUMBER: "Invalid phone number";
3124
- readonly PHONE_NUMBER_EXIST: "Phone number already exists";
3125
- readonly PHONE_NUMBER_NOT_EXIST: "phone number isn't registered";
3126
- readonly INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password";
3127
- readonly UNEXPECTED_ERROR: "Unexpected error";
3128
- readonly OTP_NOT_FOUND: "OTP not found";
3129
- readonly PHONE_NUMBER_NOT_VERIFIED: "Phone number not verified";
3130
- readonly PHONE_NUMBER_CANNOT_BE_UPDATED: "Phone number cannot be updated";
3131
- readonly SEND_OTP_NOT_IMPLEMENTED: "sendOTP not implemented";
3132
- readonly OTP_NOT_ENABLED: "OTP not enabled";
3133
- readonly OTP_HAS_EXPIRED: "OTP has expired";
3134
- readonly TOTP_NOT_ENABLED: "TOTP not enabled";
3135
- readonly TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled";
3136
- readonly BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled";
3137
- readonly INVALID_BACKUP_CODE: "Invalid backup code";
3138
- readonly INVALID_CODE: "Invalid code";
3139
- readonly TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: "Too many attempts. Please request a new code.";
3140
- readonly INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie";
3141
- readonly INVALID_USERNAME_OR_PASSWORD: "Invalid username or password";
3142
- readonly EMAIL_NOT_VERIFIED: "Email not verified";
3143
- readonly USERNAME_IS_ALREADY_TAKEN: "Username is already taken. Please try another.";
3144
- readonly USERNAME_TOO_SHORT: "Username is too short";
3145
- readonly USERNAME_TOO_LONG: "Username is too long";
3146
- readonly INVALID_USERNAME: "Username is invalid";
3147
- readonly INVALID_DISPLAY_USERNAME: "Display username is invalid";
3148
- readonly INVALID_METADATA_TYPE: "metadata must be an object or undefined";
3149
- readonly REFILL_AMOUNT_AND_INTERVAL_REQUIRED: "refillAmount is required when refillInterval is provided";
3150
- readonly REFILL_INTERVAL_AND_AMOUNT_REQUIRED: "refillInterval is required when refillAmount is provided";
3151
- readonly USER_BANNED: "User is banned";
3152
- readonly UNAUTHORIZED_SESSION: "Unauthorized or invalid session";
3153
- readonly KEY_NOT_FOUND: "API Key not found";
3154
- readonly KEY_DISABLED: "API Key is disabled";
3155
- readonly KEY_EXPIRED: "API Key has expired";
3156
- readonly USAGE_EXCEEDED: "API Key has reached its usage limit";
3157
- readonly KEY_NOT_RECOVERABLE: "API Key is not recoverable";
3158
- readonly EXPIRES_IN_IS_TOO_SMALL: "The expiresIn is smaller than the predefined minimum value.";
3159
- readonly EXPIRES_IN_IS_TOO_LARGE: "The expiresIn is larger than the predefined maximum value.";
3160
- readonly INVALID_REMAINING: "The remaining count is either too large or too small.";
3161
- readonly INVALID_PREFIX_LENGTH: "The prefix length is either too large or too small.";
3162
- readonly INVALID_NAME_LENGTH: "The name length is either too large or too small.";
3163
- readonly METADATA_DISABLED: "Metadata is disabled.";
3164
- readonly RATE_LIMIT_EXCEEDED: "Rate limit exceeded.";
3165
- readonly NO_VALUES_TO_UPDATE: "No values to update.";
3166
- readonly KEY_DISABLED_EXPIRATION: "Custom key expiration values are disabled.";
3167
- readonly INVALID_API_KEY: "Invalid API key.";
3168
- readonly INVALID_USER_ID_FROM_API_KEY: "The user id from the API key is invalid.";
3169
- readonly INVALID_API_KEY_GETTER_RETURN_TYPE: "API Key getter returned an invalid key type. Expected string.";
3170
- readonly SERVER_ONLY_PROPERTY: "The property you're trying to set can only be set from the server auth instance only.";
3171
- readonly FAILED_TO_UPDATE_API_KEY: "Failed to update API key";
3172
- readonly NAME_REQUIRED: "API Key name is required.";
3173
- readonly INVALID_DEVICE_CODE: "Invalid device code";
3174
- readonly EXPIRED_DEVICE_CODE: "Device code has expired";
3175
- readonly EXPIRED_USER_CODE: "User code has expired";
3176
- readonly AUTHORIZATION_PENDING: "Authorization pending";
3177
- readonly ACCESS_DENIED: "Access denied";
3178
- readonly INVALID_USER_CODE: "Invalid user code";
3179
- readonly DEVICE_CODE_ALREADY_PROCESSED: "Device code already processed";
3180
- readonly POLLING_TOO_FREQUENTLY: "Polling too frequently";
3181
- readonly USER_NOT_FOUND: "User not found";
3182
- readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
3183
- readonly INVALID_DEVICE_CODE_STATUS: "Invalid device code status";
3184
- readonly AUTHENTICATION_REQUIRED: "Authentication required";
3185
- readonly INVALID_SESSION_TOKEN: "Invalid session token";
3186
- readonly FAILED_TO_UPDATE_USER: "Failed to update user";
3187
- readonly FAILED_TO_GET_SESSION: "Failed to get session";
3188
- readonly INVALID_PASSWORD: "Invalid password";
3189
- readonly INVALID_EMAIL: "Invalid email";
3190
- readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
3191
- readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
3192
- readonly PROVIDER_NOT_FOUND: "Provider not found";
3193
- readonly INVALID_TOKEN: "Invalid token";
3194
- readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
3195
- readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
3196
- readonly USER_EMAIL_NOT_FOUND: "User email not found";
3197
- readonly PASSWORD_TOO_SHORT: "Password too short";
3198
- readonly PASSWORD_TOO_LONG: "Password too long";
3199
- readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
3200
- readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
3201
- readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
3202
- readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
3203
- readonly ACCOUNT_NOT_FOUND: "Account not found";
3204
- readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
3205
- };
3206
- };
3207
- type AuthClient = typeof authClient;
3208
- type SessionData = AuthClient["$Infer"]["Session"];
3209
- type Session = AuthClient["$Infer"]["Session"]["session"];
3210
- type User = AuthClient["$Infer"]["Session"]["user"];
3211
- type ActiveOrganization = typeof authClient.$Infer.ActiveOrganization;
3212
-
3213
- type BetterFetchRequest<TData> = ({ fetchOptions, }: {
3214
- fetchOptions: BetterFetchOption;
3215
- }) => Promise<BetterFetchResponse<TData>>;
3216
-
3217
- type Locale = keyof Config["i18n"]["locales"] & string;
3218
- type FieldType = "string" | "number" | "boolean";
3219
- type ImageOptions = {
3220
- upload?: (file: File) => Promise<string | undefined | null>;
3221
- delete?: (url: string) => Promise<void>;
3222
- size?: number;
3223
- extension?: string;
3224
- };
3225
- type ProviderIcon = ComponentType<{
3226
- className?: string;
3227
- }>;
3228
- type Provider = {
3229
- provider: string;
3230
- name: string;
3231
- icon?: ProviderIcon;
3232
- };
3233
- type ApiKey = {
3234
- id: string;
3235
- name?: string | null;
3236
- start?: string | null;
3237
- expiresAt?: Date | null;
3238
- createdAt: Date;
3239
- updatedAt: Date;
3240
- metadata?: Record<string, unknown> | null;
3241
- };
3242
- type Invitation = {
3243
- id: string;
3244
- organizationId: string;
3245
- email: string;
3246
- role: string;
3247
- status: string;
3248
- inviterId: string;
3249
- expiresAt: Date;
3250
- teamId?: string | undefined;
3251
- };
3252
- type PasswordValidation = {
3253
- maxLength?: number;
3254
- minLength?: number;
3255
- regex?: RegExp;
3256
- };
3257
- type Profile = {
3258
- id?: string | number;
3259
- email?: string | null;
3260
- name?: string | null;
3261
- displayUsername?: string | null;
3262
- username?: string | null;
3263
- displayName?: string | null;
3264
- firstName?: string | null;
3265
- fullName?: string | null;
3266
- isAnonymous?: boolean | null;
3267
- emailVerified?: boolean | null;
3268
- image?: string | null;
3269
- avatar?: string | null;
3270
- avatarUrl?: string | null;
3271
- };
3272
- type FetchError = {
3273
- code?: string | undefined;
3274
- message?: string | undefined;
3275
- status?: number;
3276
- statusText?: string;
3277
- };
3278
- type Refetch = () => Promise<unknown> | unknown;
3279
- type NonThrowableResult = {
3280
- data: {
3281
- status?: boolean;
3282
- success?: boolean;
3283
- [key: string]: unknown;
3284
- } | null;
3285
- error: {
3286
- code?: string | undefined;
3287
- message?: string | undefined;
3288
- status: number;
3289
- statusText: string;
3290
- } | null;
3291
- };
3292
- type ThrowableResult = {
3293
- status?: boolean;
3294
- [key: string]: unknown;
3295
- };
3296
-
3297
- type AvatarClassNames = {
3298
- base?: string;
3299
- fallback?: string;
3300
- fallbackIcon?: string;
3301
- image?: string;
3302
- skeleton?: string;
3303
- };
3304
- type ViewClassNames = {
3305
- base?: string;
3306
- content?: string;
3307
- title?: string;
3308
- subtitle?: string;
3309
- skeleton?: string;
3310
- icon?: string;
3311
- avatar?: AvatarClassNames;
3312
- };
3313
- type DialogClassNames = {
3314
- content?: string;
3315
- header?: string;
3316
- footer?: string;
3317
- };
3318
- type CardClassNames = {
3319
- base?: string;
3320
- cell?: string;
3321
- content?: string;
3322
- header?: string;
3323
- footer?: string;
3324
- grid?: string;
3325
- skeleton?: string;
3326
- title?: string;
3327
- description?: string;
3328
- instructions?: string;
3329
- error?: string;
3330
- label?: string;
3331
- input?: string;
3332
- checkbox?: string;
3333
- icon?: string;
3334
- button?: string;
3335
- primaryButton?: string;
3336
- secondaryButton?: string;
3337
- outlineButton?: string;
3338
- destructiveButton?: string;
3339
- avatar?: AvatarClassNames;
3340
- dialog?: DialogClassNames;
3341
- };
3342
- interface AvatarProps extends ComponentProps<typeof Avatar> {
3343
- className?: string;
3344
- classNames?: AvatarClassNames;
3345
- isPending?: boolean;
3346
- size?: NonNullable<Parameters<typeof buttonVariants>[0]>["size"] | null | undefined;
3347
- user?: Profile | null;
3348
- workspace?: Partial<Organization> | null;
3349
- }
3350
- interface ViewProps {
3351
- className?: string;
3352
- classNames?: ViewClassNames;
3353
- isPending?: boolean;
3354
- size?: NonNullable<Parameters<typeof buttonVariants>[0]>["size"] | null | undefined;
3355
- user?: Profile | null;
3356
- workspace?: Organization | null;
3357
- }
3358
- interface DialogComponentProps extends ComponentProps<typeof Dialog> {
3359
- className?: string;
3360
- children?: ReactNode;
3361
- classNames?: CardClassNames;
3362
- title?: string;
3363
- description?: string;
3364
- disableFooter?: boolean;
3365
- cancelButton?: boolean;
3366
- cancelButtonDisabled?: boolean;
3367
- button?: ReactNode;
3368
- }
3369
- interface CardComponentProps extends Omit<ComponentProps<typeof Card>, "title" | "variant"> {
3370
- className?: string;
3371
- children?: ReactNode;
3372
- classNames?: CardClassNames;
3373
- title?: ReactNode;
3374
- description?: ReactNode;
3375
- instructions?: ReactNode;
3376
- actionLabel?: ReactNode;
3377
- action?: () => Promise<unknown> | unknown;
3378
- disabled?: boolean;
3379
- isDestructive?: boolean;
3380
- isPending?: boolean;
3381
- isSubmitting?: boolean;
3382
- }
3383
-
3384
- type Workspace = {
3385
- id: string;
3386
- name: string;
3387
- slug: string;
3388
- logo: string | null;
3389
- metadata: Record<string, unknown> | null;
3390
- createdAt: Date | string;
3391
- currentUserRole: string | null;
3392
- members: Array<{
3393
- id: string;
3394
- organizationId: string;
3395
- userId: string;
3396
- role: string;
3397
- createdAt: Date | string;
3398
- user: {
3399
- id: string;
3400
- name: string | null;
3401
- email: string;
3402
- image: string | null;
3403
- };
3404
- }>;
3405
- invitations?: Array<{
3406
- id: string;
3407
- organizationId: string;
3408
- inviterId: string;
3409
- email: string;
3410
- role: string | null;
3411
- status: string;
3412
- expiresAt: Date | string;
3413
- }>;
3414
- subscription: {
3415
- id: string;
3416
- userId: string | null;
3417
- workspaceId: string;
3418
- subscriptionId: string | null;
3419
- externalId: string;
3420
- provider: string;
3421
- status: string;
3422
- plan: string;
3423
- currentPeriodStart?: string | Date;
3424
- currentPeriodEnd?: string | Date;
3425
- cancelAtPeriodEnd?: boolean;
3426
- canceledAt?: string | Date | null;
3427
- isLifetime: boolean;
3428
- } | null;
3429
- };
3430
-
3431
- export { type AuthQueryOptions as A, type BetterFetchRequest as B, type Config as C, type DialogClassNames as D, type FeaturesConfig as F, type I18nConfig as I, type LocaleConfig as L, type NonThrowableResult as N, type PathConfig as P, type Refetch as R, type SessionData as S, type ThrowableResult as T, type UIConfig as U, type ViewClassNames as V, type Workspace as W, type AppConfig as a, type AuthenticationConfig as b, type AuthConfig as c, defaultAuthQueryOptions as d, type AnyAuthClient as e, authClient as f, type AuthClient as g, type Session as h, type User as i, type ActiveOrganization as j, type Locale as k, type FieldType as l, type ImageOptions as m, type ProviderIcon as n, type Provider as o, type ApiKey as p, type Invitation as q, type PasswordValidation as r, type Profile as s, type FetchError as t, type AvatarClassNames as u, type CardClassNames as v, type AvatarProps as w, type ViewProps as x, type DialogComponentProps as y, type CardComponentProps as z };