@vuer-ai/vuer-uikit 0.0.103 → 0.0.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/auth/context/auth-context.d.cts +3 -5
  2. package/dist/auth/context/auth-context.d.ts +3 -5
  3. package/dist/auth/handler/get-session.cjs +11 -0
  4. package/dist/auth/handler/get-session.d.cts +19 -0
  5. package/dist/auth/handler/get-session.d.ts +19 -0
  6. package/dist/auth/handler/get-session.mjs +2 -0
  7. package/dist/auth/handler/sign-in-handler.cjs +3 -3
  8. package/dist/auth/handler/sign-in-handler.d.cts +0 -1
  9. package/dist/auth/handler/sign-in-handler.d.ts +0 -1
  10. package/dist/auth/handler/sign-in-handler.mjs +2 -2
  11. package/dist/auth/handler/sign-out-handler.cjs +11 -0
  12. package/dist/auth/handler/sign-out-handler.d.cts +5 -0
  13. package/dist/auth/handler/sign-out-handler.d.ts +5 -0
  14. package/dist/auth/handler/sign-out-handler.mjs +2 -0
  15. package/dist/auth/hooks/use-vuer-auth.d.cts +0 -1
  16. package/dist/auth/hooks/use-vuer-auth.d.ts +0 -1
  17. package/dist/auth/hooks/use-vuer-method.cjs +5 -4
  18. package/dist/auth/hooks/use-vuer-method.d.cts +2 -3
  19. package/dist/auth/hooks/use-vuer-method.d.ts +2 -3
  20. package/dist/auth/hooks/use-vuer-method.mjs +4 -3
  21. package/dist/auth/index.cjs +9 -13
  22. package/dist/auth/index.d.cts +1 -2
  23. package/dist/auth/index.d.ts +1 -2
  24. package/dist/auth/index.mjs +6 -6
  25. package/dist/auth/localstorage-key.cjs +2 -6
  26. package/dist/auth/localstorage-key.d.cts +1 -2
  27. package/dist/auth/localstorage-key.d.ts +1 -2
  28. package/dist/auth/localstorage-key.mjs +1 -1
  29. package/dist/auth/types.cjs +0 -12
  30. package/dist/auth/types.d.cts +10 -3466
  31. package/dist/auth/types.d.ts +10 -3466
  32. package/dist/auth/types.mjs +1 -1
  33. package/dist/auth/vuer-auth-provider.cjs +4 -5
  34. package/dist/auth/vuer-auth-provider.mjs +3 -4
  35. package/dist/{chunk-WGVKFNG6.mjs → chunk-276VJZCV.mjs} +1 -2
  36. package/dist/chunk-4CPB3XHE.cjs +18 -0
  37. package/dist/chunk-5HS4PMUR.mjs +45 -0
  38. package/dist/{chunk-FBAOEFDU.mjs → chunk-AKVHFPXH.mjs} +7 -5
  39. package/dist/chunk-CGODCUQ5.mjs +16 -0
  40. package/dist/{chunk-JWUIZX35.mjs → chunk-HJAKKWNJ.mjs} +2 -2
  41. package/dist/{chunk-SHHQDSSI.cjs → chunk-L6ZZKK4B.cjs} +2 -2
  42. package/dist/{chunk-I2BVWNRP.cjs → chunk-M3XTCMOA.cjs} +19 -19
  43. package/dist/{chunk-LSKJOUAE.cjs → chunk-PB4UO2NR.cjs} +3 -4
  44. package/dist/{chunk-YLDDI6SZ.mjs → chunk-SLBFCX35.mjs} +19 -19
  45. package/dist/{chunk-6BD5MQ5R.cjs → chunk-SVWS4AL6.cjs} +0 -2
  46. package/dist/chunk-T2D6PSA6.cjs +47 -0
  47. package/dist/chunk-T57VFBIC.mjs +17 -0
  48. package/dist/chunk-WTYBTOLO.cjs +19 -0
  49. package/dist/{chunk-JLWAIMUZ.cjs → chunk-XFTKHT2M.cjs} +8 -6
  50. package/dist/{chunk-7KQXX7QB.mjs → chunk-XGM57WPN.mjs} +2 -3
  51. package/dist/dial/DialPanel.cjs +19 -19
  52. package/dist/dial/DialPanel.d.cts +2 -1
  53. package/dist/dial/DialPanel.d.ts +2 -1
  54. package/dist/dial/DialPanel.mjs +18 -18
  55. package/dist/dial/index.cjs +35 -35
  56. package/dist/dial/index.mjs +18 -18
  57. package/dist/dial/wrapped-inputs/ControlledInputs.cjs +23 -23
  58. package/dist/dial/wrapped-inputs/ControlledInputs.mjs +18 -18
  59. package/dist/dial/wrapped-inputs/DialInputs.cjs +32 -32
  60. package/dist/dial/wrapped-inputs/DialInputs.mjs +18 -18
  61. package/dist/dial/wrapped-inputs/DialPresetsInput.cjs +19 -19
  62. package/dist/dial/wrapped-inputs/DialPresetsInput.mjs +18 -18
  63. package/dist/dial/wrapped-inputs/DialVectorInput.cjs +19 -19
  64. package/dist/dial/wrapped-inputs/DialVectorInput.mjs +18 -18
  65. package/dist/dial/wrapped-inputs/index.cjs +39 -39
  66. package/dist/dial/wrapped-inputs/index.mjs +18 -18
  67. package/dist/index.cjs +100 -100
  68. package/dist/index.mjs +18 -18
  69. package/dist/ui/UIKitBadge.cjs +5 -5
  70. package/dist/ui/UIKitBadge.mjs +1 -1
  71. package/dist/ui/index.cjs +73 -73
  72. package/dist/ui/index.mjs +16 -16
  73. package/dist/ui/inputs/index.cjs +18 -18
  74. package/dist/ui/inputs/index.mjs +4 -4
  75. package/dist/ui/inputs/number-inputs/index.cjs +18 -18
  76. package/dist/ui/inputs/number-inputs/index.mjs +4 -4
  77. package/dist/ui/layouts/index.cjs +5 -5
  78. package/dist/ui/layouts/index.mjs +1 -1
  79. package/dist/ui/tree-view/index.cjs +9 -9
  80. package/dist/ui/tree-view/index.mjs +1 -1
  81. package/dist/ui/waterfall/index.cjs +4 -4
  82. package/dist/ui/waterfall/index.mjs +3 -3
  83. package/package.json +1 -1
  84. package/src/auth/context/auth-context.ts +3 -4
  85. package/src/auth/handler/get-session.ts +17 -0
  86. package/src/auth/handler/sign-in-handler.ts +1 -2
  87. package/src/auth/handler/sign-out-handler.ts +13 -0
  88. package/src/auth/hooks/use-vuer-method.ts +8 -6
  89. package/src/auth/localstorage-key.ts +0 -2
  90. package/src/auth/types.ts +9 -27
  91. package/src/auth/vuer-auth-provider.tsx +25 -8
  92. package/src/dial/DialPanel.tsx +16 -14
  93. package/dist/auth/handler/create-client.cjs +0 -12
  94. package/dist/auth/handler/create-client.d.cts +0 -7
  95. package/dist/auth/handler/create-client.d.ts +0 -7
  96. package/dist/auth/handler/create-client.mjs +0 -3
  97. package/dist/chunk-ACYOVCGH.mjs +0 -30
  98. package/dist/chunk-CHYXRETV.cjs +0 -23
  99. package/dist/chunk-G6U2K2GR.cjs +0 -32
  100. package/dist/chunk-HPK4YEVK.cjs +0 -27
  101. package/dist/chunk-PKSIXQJX.mjs +0 -20
  102. package/dist/chunk-PZMA33PL.mjs +0 -25
  103. package/src/auth/handler/create-client.ts +0 -23
  104. package/dist/{chunk-5SP25SO3.cjs → chunk-7RHQ6DVU.cjs} +2 -2
  105. package/dist/{chunk-YHY6SXVJ.mjs → chunk-K2OC2HWQ.mjs} +2 -2
@@ -1,3468 +1,12 @@
1
- import * as better_auth from 'better-auth';
2
- import { createAuthClient } from 'better-auth/react';
1
+ import { User, Session } from 'better-auth';
3
2
 
4
- declare const auth: {
5
- handler: (request: Request) => Promise<Response>;
6
- api: better_auth.InferAPI<{
7
- ok: {
8
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
9
- body?: undefined;
10
- } & {
11
- method?: "GET" | undefined;
12
- } & {
13
- query?: Record<string, any> | undefined;
14
- } & {
15
- params?: Record<string, any>;
16
- } & {
17
- request?: Request;
18
- } & {
19
- headers?: HeadersInit;
20
- } & {
21
- asResponse?: boolean;
22
- returnHeaders?: boolean;
23
- use?: better_auth.Middleware[];
24
- path?: string;
25
- } & {
26
- asResponse?: AsResponse | undefined;
27
- returnHeaders?: ReturnHeaders | undefined;
28
- }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
29
- headers: Headers;
30
- response: {
31
- ok: boolean;
32
- };
33
- } : {
34
- ok: boolean;
35
- }>;
36
- options: {
37
- method: "GET";
38
- metadata: {
39
- openapi: {
40
- description: string;
41
- responses: {
42
- "200": {
43
- description: string;
44
- content: {
45
- "application/json": {
46
- schema: {
47
- type: "object";
48
- properties: {
49
- ok: {
50
- type: string;
51
- description: string;
52
- };
53
- };
54
- required: string[];
55
- };
56
- };
57
- };
58
- };
59
- };
60
- };
61
- isAction: false;
62
- };
63
- } & {
64
- use: any[];
65
- };
66
- path: "/ok";
67
- };
68
- error: {
69
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
70
- body?: undefined;
71
- } & {
72
- method?: "GET" | undefined;
73
- } & {
74
- query?: Record<string, any> | undefined;
75
- } & {
76
- params?: Record<string, any>;
77
- } & {
78
- request?: Request;
79
- } & {
80
- headers?: HeadersInit;
81
- } & {
82
- asResponse?: boolean;
83
- returnHeaders?: boolean;
84
- use?: better_auth.Middleware[];
85
- path?: string;
86
- } & {
87
- asResponse?: AsResponse | undefined;
88
- returnHeaders?: ReturnHeaders | undefined;
89
- }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
90
- headers: Headers;
91
- response: Response;
92
- } : Response>;
93
- options: {
94
- method: "GET";
95
- metadata: {
96
- openapi: {
97
- description: string;
98
- responses: {
99
- "200": {
100
- description: string;
101
- content: {
102
- "text/html": {
103
- schema: {
104
- type: "string";
105
- description: string;
106
- };
107
- };
108
- };
109
- };
110
- };
111
- };
112
- isAction: false;
113
- };
114
- } & {
115
- use: any[];
116
- };
117
- path: "/error";
118
- };
119
- signInSocial: {
120
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
121
- body: {
122
- provider: unknown;
123
- callbackURL?: string | undefined;
124
- newUserCallbackURL?: string | undefined;
125
- errorCallbackURL?: string | undefined;
126
- disableRedirect?: boolean | undefined;
127
- idToken?: {
128
- token: string;
129
- nonce?: string | undefined;
130
- accessToken?: string | undefined;
131
- refreshToken?: string | undefined;
132
- expiresAt?: number | undefined;
133
- } | undefined;
134
- scopes?: string[] | undefined;
135
- requestSignUp?: boolean | undefined;
136
- loginHint?: string | undefined;
137
- };
138
- } & {
139
- method?: "POST" | undefined;
140
- } & {
141
- query?: Record<string, any> | undefined;
142
- } & {
143
- params?: Record<string, any>;
144
- } & {
145
- request?: Request;
146
- } & {
147
- headers?: HeadersInit;
148
- } & {
149
- asResponse?: boolean;
150
- returnHeaders?: boolean;
151
- use?: better_auth.Middleware[];
152
- path?: string;
153
- } & {
154
- asResponse?: AsResponse | undefined;
155
- returnHeaders?: ReturnHeaders | undefined;
156
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
157
- headers: Headers;
158
- response: {
159
- redirect: boolean;
160
- token: string;
161
- url: undefined;
162
- user: {
163
- id: string;
164
- email: string;
165
- name: string;
166
- image: string | null | undefined;
167
- emailVerified: boolean;
168
- createdAt: Date;
169
- updatedAt: Date;
170
- };
171
- } | {
172
- url: string;
173
- redirect: boolean;
174
- };
175
- } : {
176
- redirect: boolean;
177
- token: string;
178
- url: undefined;
179
- user: {
180
- id: string;
181
- email: string;
182
- name: string;
183
- image: string | null | undefined;
184
- emailVerified: boolean;
185
- createdAt: Date;
186
- updatedAt: Date;
187
- };
188
- } | {
189
- url: string;
190
- redirect: boolean;
191
- }>;
192
- options: {
193
- method: "POST";
194
- body: better_auth.ZodObject<{
195
- callbackURL: better_auth.ZodOptional<better_auth.ZodString>;
196
- newUserCallbackURL: better_auth.ZodOptional<better_auth.ZodString>;
197
- errorCallbackURL: better_auth.ZodOptional<better_auth.ZodString>;
198
- provider: better_auth.ZodType<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal" | (string & {}), unknown, better_auth.$ZodTypeInternals<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal" | (string & {}), unknown>>;
199
- disableRedirect: better_auth.ZodOptional<better_auth.ZodBoolean>;
200
- idToken: better_auth.ZodOptional<better_auth.ZodObject<{
201
- token: better_auth.ZodString;
202
- nonce: better_auth.ZodOptional<better_auth.ZodString>;
203
- accessToken: better_auth.ZodOptional<better_auth.ZodString>;
204
- refreshToken: better_auth.ZodOptional<better_auth.ZodString>;
205
- expiresAt: better_auth.ZodOptional<better_auth.ZodNumber>;
206
- }, better_auth.$strip>>;
207
- scopes: better_auth.ZodOptional<better_auth.ZodArray<better_auth.ZodString>>;
208
- requestSignUp: better_auth.ZodOptional<better_auth.ZodBoolean>;
209
- loginHint: better_auth.ZodOptional<better_auth.ZodString>;
210
- }, better_auth.$strip>;
211
- metadata: {
212
- openapi: {
213
- description: string;
214
- operationId: string;
215
- responses: {
216
- "200": {
217
- description: string;
218
- content: {
219
- "application/json": {
220
- schema: {
221
- type: "object";
222
- description: string;
223
- properties: {
224
- redirect: {
225
- type: string;
226
- enum: boolean[];
227
- };
228
- token: {
229
- type: string;
230
- description: string;
231
- url: {
232
- type: string;
233
- nullable: boolean;
234
- };
235
- user: {
236
- type: string;
237
- properties: {
238
- id: {
239
- type: string;
240
- };
241
- email: {
242
- type: string;
243
- };
244
- name: {
245
- type: string;
246
- nullable: boolean;
247
- };
248
- image: {
249
- type: string;
250
- nullable: boolean;
251
- };
252
- emailVerified: {
253
- type: string;
254
- };
255
- createdAt: {
256
- type: string;
257
- format: string;
258
- };
259
- updatedAt: {
260
- type: string;
261
- format: string;
262
- };
263
- };
264
- required: string[];
265
- };
266
- };
267
- };
268
- required: string[];
269
- };
270
- };
271
- };
272
- };
273
- };
274
- };
275
- };
276
- } & {
277
- use: any[];
278
- };
279
- path: "/sign-in/social";
280
- };
281
- callbackOAuth: {
282
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
283
- body?: {
284
- code?: string | undefined;
285
- error?: string | undefined;
286
- device_id?: string | undefined;
287
- error_description?: string | undefined;
288
- state?: string | undefined;
289
- user?: string | undefined;
290
- } | undefined;
291
- } & {
292
- method: "GET" | "POST";
293
- } & {
294
- query?: {
295
- code?: string | undefined;
296
- error?: string | undefined;
297
- device_id?: string | undefined;
298
- error_description?: string | undefined;
299
- state?: string | undefined;
300
- user?: string | undefined;
301
- } | undefined;
302
- } & {
303
- params: {
304
- id: string;
305
- };
306
- } & {
307
- request?: Request;
308
- } & {
309
- headers?: HeadersInit;
310
- } & {
311
- asResponse?: boolean;
312
- returnHeaders?: boolean;
313
- use?: better_auth.Middleware[];
314
- path?: string;
315
- } & {
316
- asResponse?: AsResponse | undefined;
317
- returnHeaders?: ReturnHeaders | undefined;
318
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
319
- headers: Headers;
320
- response: void;
321
- } : void>;
322
- options: {
323
- method: ("GET" | "POST")[];
324
- body: better_auth.ZodOptional<better_auth.ZodObject<{
325
- code: better_auth.ZodOptional<better_auth.ZodString>;
326
- error: better_auth.ZodOptional<better_auth.ZodString>;
327
- device_id: better_auth.ZodOptional<better_auth.ZodString>;
328
- error_description: better_auth.ZodOptional<better_auth.ZodString>;
329
- state: better_auth.ZodOptional<better_auth.ZodString>;
330
- user: better_auth.ZodOptional<better_auth.ZodString>;
331
- }, better_auth.$strip>>;
332
- query: better_auth.ZodOptional<better_auth.ZodObject<{
333
- code: better_auth.ZodOptional<better_auth.ZodString>;
334
- error: better_auth.ZodOptional<better_auth.ZodString>;
335
- device_id: better_auth.ZodOptional<better_auth.ZodString>;
336
- error_description: better_auth.ZodOptional<better_auth.ZodString>;
337
- state: better_auth.ZodOptional<better_auth.ZodString>;
338
- user: better_auth.ZodOptional<better_auth.ZodString>;
339
- }, better_auth.$strip>>;
340
- metadata: {
341
- isAction: false;
342
- };
343
- } & {
344
- use: any[];
345
- };
346
- path: "/callback/:id";
347
- };
348
- getSession: {
349
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
350
- body?: undefined;
351
- } & {
352
- method?: "GET" | undefined;
353
- } & {
354
- query?: {
355
- disableCookieCache?: unknown;
356
- disableRefresh?: unknown;
357
- } | undefined;
358
- } & {
359
- params?: Record<string, any>;
360
- } & {
361
- request?: Request;
362
- } & {
363
- headers: HeadersInit;
364
- } & {
365
- asResponse?: boolean;
366
- returnHeaders?: boolean;
367
- use?: better_auth.Middleware[];
368
- path?: string;
369
- } & {
370
- asResponse?: AsResponse | undefined;
371
- returnHeaders?: ReturnHeaders | undefined;
372
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
373
- headers: Headers;
374
- response: {
375
- session: {
376
- id: string;
377
- createdAt: Date;
378
- updatedAt: Date;
379
- userId: string;
380
- expiresAt: Date;
381
- token: string;
382
- ipAddress?: string | null | undefined | undefined;
383
- userAgent?: string | null | undefined | undefined;
384
- };
385
- user: {
386
- id: string;
387
- createdAt: Date;
388
- updatedAt: Date;
389
- email: string;
390
- emailVerified: boolean;
391
- name: string;
392
- image?: string | null | undefined | undefined;
393
- };
394
- } | null;
395
- } : {
396
- session: {
397
- id: string;
398
- createdAt: Date;
399
- updatedAt: Date;
400
- userId: string;
401
- expiresAt: Date;
402
- token: string;
403
- ipAddress?: string | null | undefined | undefined;
404
- userAgent?: string | null | undefined | undefined;
405
- };
406
- user: {
407
- id: string;
408
- createdAt: Date;
409
- updatedAt: Date;
410
- email: string;
411
- emailVerified: boolean;
412
- name: string;
413
- image?: string | null | undefined | undefined;
414
- };
415
- } | null>;
416
- options: {
417
- method: "GET";
418
- query: better_auth.ZodOptional<better_auth.ZodObject<{
419
- disableCookieCache: better_auth.ZodOptional<better_auth.ZodCoercedBoolean<unknown>>;
420
- disableRefresh: better_auth.ZodOptional<better_auth.ZodCoercedBoolean<unknown>>;
421
- }, better_auth.$strip>>;
422
- requireHeaders: true;
423
- metadata: {
424
- openapi: {
425
- description: string;
426
- responses: {
427
- "200": {
428
- description: string;
429
- content: {
430
- "application/json": {
431
- schema: {
432
- type: "object";
433
- properties: {
434
- session: {
435
- $ref: string;
436
- };
437
- user: {
438
- $ref: string;
439
- };
440
- };
441
- required: string[];
442
- };
443
- };
444
- };
445
- };
446
- };
447
- };
448
- };
449
- } & {
450
- use: any[];
451
- };
452
- path: "/get-session";
453
- };
454
- signOut: {
455
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
456
- body?: undefined;
457
- } & {
458
- method?: "POST" | undefined;
459
- } & {
460
- query?: Record<string, any> | undefined;
461
- } & {
462
- params?: Record<string, any>;
463
- } & {
464
- request?: Request;
465
- } & {
466
- headers: HeadersInit;
467
- } & {
468
- asResponse?: boolean;
469
- returnHeaders?: boolean;
470
- use?: better_auth.Middleware[];
471
- path?: string;
472
- } & {
473
- asResponse?: AsResponse | undefined;
474
- returnHeaders?: ReturnHeaders | undefined;
475
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
476
- headers: Headers;
477
- response: {
478
- success: boolean;
479
- };
480
- } : {
481
- success: boolean;
482
- }>;
483
- options: {
484
- method: "POST";
485
- requireHeaders: true;
486
- metadata: {
487
- openapi: {
488
- description: string;
489
- responses: {
490
- "200": {
491
- description: string;
492
- content: {
493
- "application/json": {
494
- schema: {
495
- type: "object";
496
- properties: {
497
- success: {
498
- type: string;
499
- };
500
- };
501
- };
502
- };
503
- };
504
- };
505
- };
506
- };
507
- };
508
- } & {
509
- use: any[];
510
- };
511
- path: "/sign-out";
512
- };
513
- signUpEmail: {
514
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
515
- body: {
516
- name: string;
517
- email: string;
518
- password: string;
519
- image?: string;
520
- callbackURL?: string;
521
- rememberMe?: boolean;
522
- };
523
- } & {
524
- method?: "POST" | undefined;
525
- } & {
526
- query?: Record<string, any> | undefined;
527
- } & {
528
- params?: Record<string, any>;
529
- } & {
530
- request?: Request;
531
- } & {
532
- headers?: HeadersInit;
533
- } & {
534
- asResponse?: boolean;
535
- returnHeaders?: boolean;
536
- use?: better_auth.Middleware[];
537
- path?: string;
538
- } & {
539
- asResponse?: AsResponse | undefined;
540
- returnHeaders?: ReturnHeaders | undefined;
541
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
542
- headers: Headers;
543
- response: {
544
- token: null;
545
- user: {
546
- id: string;
547
- email: string;
548
- name: string;
549
- image: string | null | undefined;
550
- emailVerified: boolean;
551
- createdAt: Date;
552
- updatedAt: Date;
553
- };
554
- } | {
555
- token: string;
556
- user: {
557
- id: string;
558
- email: string;
559
- name: string;
560
- image: string | null | undefined;
561
- emailVerified: boolean;
562
- createdAt: Date;
563
- updatedAt: Date;
564
- };
565
- };
566
- } : {
567
- token: null;
568
- user: {
569
- id: string;
570
- email: string;
571
- name: string;
572
- image: string | null | undefined;
573
- emailVerified: boolean;
574
- createdAt: Date;
575
- updatedAt: Date;
576
- };
577
- } | {
578
- token: string;
579
- user: {
580
- id: string;
581
- email: string;
582
- name: string;
583
- image: string | null | undefined;
584
- emailVerified: boolean;
585
- createdAt: Date;
586
- updatedAt: Date;
587
- };
588
- }>;
589
- options: {
590
- method: "POST";
591
- body: better_auth.ZodRecord<better_auth.ZodString, better_auth.ZodAny>;
592
- metadata: {
593
- $Infer: {
594
- body: {
595
- name: string;
596
- email: string;
597
- password: string;
598
- image?: string;
599
- callbackURL?: string;
600
- rememberMe?: boolean;
601
- };
602
- };
603
- openapi: {
604
- description: string;
605
- requestBody: {
606
- content: {
607
- "application/json": {
608
- schema: {
609
- type: "object";
610
- properties: {
611
- name: {
612
- type: string;
613
- description: string;
614
- };
615
- email: {
616
- type: string;
617
- description: string;
618
- };
619
- password: {
620
- type: string;
621
- description: string;
622
- };
623
- image: {
624
- type: string;
625
- description: string;
626
- };
627
- callbackURL: {
628
- type: string;
629
- description: string;
630
- };
631
- rememberMe: {
632
- type: string;
633
- description: string;
634
- };
635
- };
636
- required: string[];
637
- };
638
- };
639
- };
640
- };
641
- responses: {
642
- "200": {
643
- description: string;
644
- content: {
645
- "application/json": {
646
- schema: {
647
- type: "object";
648
- properties: {
649
- token: {
650
- type: string;
651
- nullable: boolean;
652
- description: string;
653
- };
654
- user: {
655
- type: string;
656
- properties: {
657
- id: {
658
- type: string;
659
- description: string;
660
- };
661
- email: {
662
- type: string;
663
- format: string;
664
- description: string;
665
- };
666
- name: {
667
- type: string;
668
- description: string;
669
- };
670
- image: {
671
- type: string;
672
- format: string;
673
- nullable: boolean;
674
- description: string;
675
- };
676
- emailVerified: {
677
- type: string;
678
- description: string;
679
- };
680
- createdAt: {
681
- type: string;
682
- format: string;
683
- description: string;
684
- };
685
- updatedAt: {
686
- type: string;
687
- format: string;
688
- description: string;
689
- };
690
- };
691
- required: string[];
692
- };
693
- };
694
- required: string[];
695
- };
696
- };
697
- };
698
- };
699
- "422": {
700
- description: string;
701
- content: {
702
- "application/json": {
703
- schema: {
704
- type: "object";
705
- properties: {
706
- message: {
707
- type: string;
708
- };
709
- };
710
- };
711
- };
712
- };
713
- };
714
- };
715
- };
716
- };
717
- } & {
718
- use: any[];
719
- };
720
- path: "/sign-up/email";
721
- };
722
- signInEmail: {
723
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
724
- body: {
725
- email: string;
726
- password: string;
727
- callbackURL?: string | undefined;
728
- rememberMe?: boolean | undefined;
729
- };
730
- } & {
731
- method?: "POST" | undefined;
732
- } & {
733
- query?: Record<string, any> | undefined;
734
- } & {
735
- params?: Record<string, any>;
736
- } & {
737
- request?: Request;
738
- } & {
739
- headers?: HeadersInit;
740
- } & {
741
- asResponse?: boolean;
742
- returnHeaders?: boolean;
743
- use?: better_auth.Middleware[];
744
- path?: string;
745
- } & {
746
- asResponse?: AsResponse | undefined;
747
- returnHeaders?: ReturnHeaders | undefined;
748
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
749
- headers: Headers;
750
- response: {
751
- redirect: boolean;
752
- token: string;
753
- url: string | undefined;
754
- user: {
755
- id: string;
756
- email: string;
757
- name: string;
758
- image: string | null | undefined;
759
- emailVerified: boolean;
760
- createdAt: Date;
761
- updatedAt: Date;
762
- };
763
- };
764
- } : {
765
- redirect: boolean;
766
- token: string;
767
- url: string | undefined;
768
- user: {
769
- id: string;
770
- email: string;
771
- name: string;
772
- image: string | null | undefined;
773
- emailVerified: boolean;
774
- createdAt: Date;
775
- updatedAt: Date;
776
- };
777
- }>;
778
- options: {
779
- method: "POST";
780
- body: better_auth.ZodObject<{
781
- email: better_auth.ZodString;
782
- password: better_auth.ZodString;
783
- callbackURL: better_auth.ZodOptional<better_auth.ZodString>;
784
- rememberMe: better_auth.ZodOptional<better_auth.ZodDefault<better_auth.ZodBoolean>>;
785
- }, better_auth.$strip>;
786
- metadata: {
787
- openapi: {
788
- description: string;
789
- responses: {
790
- "200": {
791
- description: string;
792
- content: {
793
- "application/json": {
794
- schema: {
795
- type: "object";
796
- description: string;
797
- properties: {
798
- redirect: {
799
- type: string;
800
- enum: boolean[];
801
- };
802
- token: {
803
- type: string;
804
- description: string;
805
- };
806
- url: {
807
- type: string;
808
- nullable: boolean;
809
- };
810
- user: {
811
- type: string;
812
- properties: {
813
- id: {
814
- type: string;
815
- };
816
- email: {
817
- type: string;
818
- };
819
- name: {
820
- type: string;
821
- nullable: boolean;
822
- };
823
- image: {
824
- type: string;
825
- nullable: boolean;
826
- };
827
- emailVerified: {
828
- type: string;
829
- };
830
- createdAt: {
831
- type: string;
832
- format: string;
833
- };
834
- updatedAt: {
835
- type: string;
836
- format: string;
837
- };
838
- };
839
- required: string[];
840
- };
841
- };
842
- required: string[];
843
- };
844
- };
845
- };
846
- };
847
- };
848
- };
849
- };
850
- } & {
851
- use: any[];
852
- };
853
- path: "/sign-in/email";
854
- };
855
- forgetPassword: {
856
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
857
- body: {
858
- email: string;
859
- redirectTo?: string | undefined;
860
- };
861
- } & {
862
- method?: "POST" | undefined;
863
- } & {
864
- query?: Record<string, any> | undefined;
865
- } & {
866
- params?: Record<string, any>;
867
- } & {
868
- request?: Request;
869
- } & {
870
- headers?: HeadersInit;
871
- } & {
872
- asResponse?: boolean;
873
- returnHeaders?: boolean;
874
- use?: better_auth.Middleware[];
875
- path?: string;
876
- } & {
877
- asResponse?: AsResponse | undefined;
878
- returnHeaders?: ReturnHeaders | undefined;
879
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
880
- headers: Headers;
881
- response: {
882
- status: boolean;
883
- };
884
- } : {
885
- status: boolean;
886
- }>;
887
- options: {
888
- method: "POST";
889
- body: better_auth.ZodObject<{
890
- email: better_auth.ZodString;
891
- redirectTo: better_auth.ZodOptional<better_auth.ZodString>;
892
- }, better_auth.$strip>;
893
- metadata: {
894
- openapi: {
895
- description: string;
896
- responses: {
897
- "200": {
898
- description: string;
899
- content: {
900
- "application/json": {
901
- schema: {
902
- type: "object";
903
- properties: {
904
- status: {
905
- type: string;
906
- };
907
- message: {
908
- type: string;
909
- };
910
- };
911
- };
912
- };
913
- };
914
- };
915
- };
916
- };
917
- };
918
- } & {
919
- use: any[];
920
- };
921
- path: "/forget-password";
922
- };
923
- resetPassword: {
924
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
925
- body: {
926
- newPassword: string;
927
- token?: string | undefined;
928
- };
929
- } & {
930
- method?: "POST" | undefined;
931
- } & {
932
- query?: {
933
- token?: string | undefined;
934
- } | undefined;
935
- } & {
936
- params?: Record<string, any>;
937
- } & {
938
- request?: Request;
939
- } & {
940
- headers?: HeadersInit;
941
- } & {
942
- asResponse?: boolean;
943
- returnHeaders?: boolean;
944
- use?: better_auth.Middleware[];
945
- path?: string;
946
- } & {
947
- asResponse?: AsResponse | undefined;
948
- returnHeaders?: ReturnHeaders | undefined;
949
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
950
- headers: Headers;
951
- response: {
952
- status: boolean;
953
- };
954
- } : {
955
- status: boolean;
956
- }>;
957
- options: {
958
- method: "POST";
959
- query: better_auth.ZodOptional<better_auth.ZodObject<{
960
- token: better_auth.ZodOptional<better_auth.ZodString>;
961
- }, better_auth.$strip>>;
962
- body: better_auth.ZodObject<{
963
- newPassword: better_auth.ZodString;
964
- token: better_auth.ZodOptional<better_auth.ZodString>;
965
- }, better_auth.$strip>;
966
- metadata: {
967
- openapi: {
968
- description: string;
969
- responses: {
970
- "200": {
971
- description: string;
972
- content: {
973
- "application/json": {
974
- schema: {
975
- type: "object";
976
- properties: {
977
- status: {
978
- type: string;
979
- };
980
- };
981
- };
982
- };
983
- };
984
- };
985
- };
986
- };
987
- };
988
- } & {
989
- use: any[];
990
- };
991
- path: "/reset-password";
992
- };
993
- verifyEmail: {
994
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
995
- body?: undefined;
996
- } & {
997
- method?: "GET" | undefined;
998
- } & {
999
- query: {
1000
- token: string;
1001
- callbackURL?: string | undefined;
1002
- };
1003
- } & {
1004
- params?: Record<string, any>;
1005
- } & {
1006
- request?: Request;
1007
- } & {
1008
- headers?: HeadersInit;
1009
- } & {
1010
- asResponse?: boolean;
1011
- returnHeaders?: boolean;
1012
- use?: better_auth.Middleware[];
1013
- path?: string;
1014
- } & {
1015
- asResponse?: AsResponse | undefined;
1016
- returnHeaders?: ReturnHeaders | undefined;
1017
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1018
- headers: Headers;
1019
- response: void | {
1020
- status: boolean;
1021
- user: {
1022
- id: any;
1023
- email: any;
1024
- name: any;
1025
- image: any;
1026
- emailVerified: any;
1027
- createdAt: any;
1028
- updatedAt: any;
1029
- };
1030
- } | {
1031
- status: boolean;
1032
- user: null;
1033
- };
1034
- } : void | {
1035
- status: boolean;
1036
- user: {
1037
- id: any;
1038
- email: any;
1039
- name: any;
1040
- image: any;
1041
- emailVerified: any;
1042
- createdAt: any;
1043
- updatedAt: any;
1044
- };
1045
- } | {
1046
- status: boolean;
1047
- user: null;
1048
- }>;
1049
- options: {
1050
- method: "GET";
1051
- query: better_auth.ZodObject<{
1052
- token: better_auth.ZodString;
1053
- callbackURL: better_auth.ZodOptional<better_auth.ZodString>;
1054
- }, better_auth.$strip>;
1055
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<void>)[];
1056
- metadata: {
1057
- openapi: {
1058
- description: string;
1059
- parameters: ({
1060
- name: string;
1061
- in: "query";
1062
- description: string;
1063
- required: true;
1064
- schema: {
1065
- type: "string";
1066
- };
1067
- } | {
1068
- name: string;
1069
- in: "query";
1070
- description: string;
1071
- required: false;
1072
- schema: {
1073
- type: "string";
1074
- };
1075
- })[];
1076
- responses: {
1077
- "200": {
1078
- description: string;
1079
- content: {
1080
- "application/json": {
1081
- schema: {
1082
- type: "object";
1083
- properties: {
1084
- user: {
1085
- type: string;
1086
- properties: {
1087
- id: {
1088
- type: string;
1089
- description: string;
1090
- };
1091
- email: {
1092
- type: string;
1093
- description: string;
1094
- };
1095
- name: {
1096
- type: string;
1097
- description: string;
1098
- };
1099
- image: {
1100
- type: string;
1101
- description: string;
1102
- };
1103
- emailVerified: {
1104
- type: string;
1105
- description: string;
1106
- };
1107
- createdAt: {
1108
- type: string;
1109
- description: string;
1110
- };
1111
- updatedAt: {
1112
- type: string;
1113
- description: string;
1114
- };
1115
- };
1116
- required: string[];
1117
- };
1118
- status: {
1119
- type: string;
1120
- description: string;
1121
- };
1122
- };
1123
- required: string[];
1124
- };
1125
- };
1126
- };
1127
- };
1128
- };
1129
- };
1130
- };
1131
- } & {
1132
- use: any[];
1133
- };
1134
- path: "/verify-email";
1135
- };
1136
- sendVerificationEmail: {
1137
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1138
- body: {
1139
- email: string;
1140
- callbackURL?: string | undefined;
1141
- };
1142
- } & {
1143
- method?: "POST" | undefined;
1144
- } & {
1145
- query?: Record<string, any> | undefined;
1146
- } & {
1147
- params?: Record<string, any>;
1148
- } & {
1149
- request?: Request;
1150
- } & {
1151
- headers?: HeadersInit;
1152
- } & {
1153
- asResponse?: boolean;
1154
- returnHeaders?: boolean;
1155
- use?: better_auth.Middleware[];
1156
- path?: string;
1157
- } & {
1158
- asResponse?: AsResponse | undefined;
1159
- returnHeaders?: ReturnHeaders | undefined;
1160
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1161
- headers: Headers;
1162
- response: {
1163
- status: boolean;
1164
- };
1165
- } : {
1166
- status: boolean;
1167
- }>;
1168
- options: {
1169
- method: "POST";
1170
- body: better_auth.ZodObject<{
1171
- email: better_auth.ZodEmail;
1172
- callbackURL: better_auth.ZodOptional<better_auth.ZodString>;
1173
- }, better_auth.$strip>;
1174
- metadata: {
1175
- openapi: {
1176
- description: string;
1177
- requestBody: {
1178
- content: {
1179
- "application/json": {
1180
- schema: {
1181
- type: "object";
1182
- properties: {
1183
- email: {
1184
- type: string;
1185
- description: string;
1186
- example: string;
1187
- };
1188
- callbackURL: {
1189
- type: string;
1190
- description: string;
1191
- example: string;
1192
- nullable: boolean;
1193
- };
1194
- };
1195
- required: string[];
1196
- };
1197
- };
1198
- };
1199
- };
1200
- responses: {
1201
- "200": {
1202
- description: string;
1203
- content: {
1204
- "application/json": {
1205
- schema: {
1206
- type: "object";
1207
- properties: {
1208
- status: {
1209
- type: string;
1210
- description: string;
1211
- example: boolean;
1212
- };
1213
- };
1214
- };
1215
- };
1216
- };
1217
- };
1218
- "400": {
1219
- description: string;
1220
- content: {
1221
- "application/json": {
1222
- schema: {
1223
- type: "object";
1224
- properties: {
1225
- message: {
1226
- type: string;
1227
- description: string;
1228
- example: string;
1229
- };
1230
- };
1231
- };
1232
- };
1233
- };
1234
- };
1235
- };
1236
- };
1237
- };
1238
- } & {
1239
- use: any[];
1240
- };
1241
- path: "/send-verification-email";
1242
- };
1243
- changeEmail: {
1244
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1245
- body: {
1246
- newEmail: string;
1247
- callbackURL?: string | undefined;
1248
- };
1249
- } & {
1250
- method?: "POST" | undefined;
1251
- } & {
1252
- query?: Record<string, any> | undefined;
1253
- } & {
1254
- params?: Record<string, any>;
1255
- } & {
1256
- request?: Request;
1257
- } & {
1258
- headers?: HeadersInit;
1259
- } & {
1260
- asResponse?: boolean;
1261
- returnHeaders?: boolean;
1262
- use?: better_auth.Middleware[];
1263
- path?: string;
1264
- } & {
1265
- asResponse?: AsResponse | undefined;
1266
- returnHeaders?: ReturnHeaders | undefined;
1267
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1268
- headers: Headers;
1269
- response: {
1270
- status: boolean;
1271
- };
1272
- } : {
1273
- status: boolean;
1274
- }>;
1275
- options: {
1276
- method: "POST";
1277
- body: better_auth.ZodObject<{
1278
- newEmail: better_auth.ZodEmail;
1279
- callbackURL: better_auth.ZodOptional<better_auth.ZodString>;
1280
- }, better_auth.$strip>;
1281
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
1282
- session: {
1283
- session: Record<string, any> & {
1284
- id: string;
1285
- createdAt: Date;
1286
- updatedAt: Date;
1287
- userId: string;
1288
- expiresAt: Date;
1289
- token: string;
1290
- ipAddress?: string | null | undefined;
1291
- userAgent?: string | null | undefined;
1292
- };
1293
- user: Record<string, any> & {
1294
- id: string;
1295
- createdAt: Date;
1296
- updatedAt: Date;
1297
- email: string;
1298
- emailVerified: boolean;
1299
- name: string;
1300
- image?: string | null | undefined;
1301
- };
1302
- };
1303
- }>)[];
1304
- metadata: {
1305
- openapi: {
1306
- responses: {
1307
- "200": {
1308
- description: string;
1309
- content: {
1310
- "application/json": {
1311
- schema: {
1312
- type: "object";
1313
- properties: {
1314
- status: {
1315
- type: string;
1316
- description: string;
1317
- };
1318
- message: {
1319
- type: string;
1320
- enum: string[];
1321
- description: string;
1322
- nullable: boolean;
1323
- };
1324
- };
1325
- required: string[];
1326
- };
1327
- };
1328
- };
1329
- };
1330
- "422": {
1331
- description: string;
1332
- content: {
1333
- "application/json": {
1334
- schema: {
1335
- type: "object";
1336
- properties: {
1337
- message: {
1338
- type: string;
1339
- };
1340
- };
1341
- };
1342
- };
1343
- };
1344
- };
1345
- };
1346
- };
1347
- };
1348
- } & {
1349
- use: any[];
1350
- };
1351
- path: "/change-email";
1352
- };
1353
- changePassword: {
1354
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1355
- body: {
1356
- newPassword: string;
1357
- currentPassword: string;
1358
- revokeOtherSessions?: boolean | undefined;
1359
- };
1360
- } & {
1361
- method?: "POST" | undefined;
1362
- } & {
1363
- query?: Record<string, any> | undefined;
1364
- } & {
1365
- params?: Record<string, any>;
1366
- } & {
1367
- request?: Request;
1368
- } & {
1369
- headers?: HeadersInit;
1370
- } & {
1371
- asResponse?: boolean;
1372
- returnHeaders?: boolean;
1373
- use?: better_auth.Middleware[];
1374
- path?: string;
1375
- } & {
1376
- asResponse?: AsResponse | undefined;
1377
- returnHeaders?: ReturnHeaders | undefined;
1378
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1379
- headers: Headers;
1380
- response: {
1381
- token: string | null;
1382
- user: {
1383
- id: string;
1384
- email: string;
1385
- name: string;
1386
- image: string | null | undefined;
1387
- emailVerified: boolean;
1388
- createdAt: Date;
1389
- updatedAt: Date;
1390
- };
1391
- };
1392
- } : {
1393
- token: string | null;
1394
- user: {
1395
- id: string;
1396
- email: string;
1397
- name: string;
1398
- image: string | null | undefined;
1399
- emailVerified: boolean;
1400
- createdAt: Date;
1401
- updatedAt: Date;
1402
- };
1403
- }>;
1404
- options: {
1405
- method: "POST";
1406
- body: better_auth.ZodObject<{
1407
- newPassword: better_auth.ZodString;
1408
- currentPassword: better_auth.ZodString;
1409
- revokeOtherSessions: better_auth.ZodOptional<better_auth.ZodBoolean>;
1410
- }, better_auth.$strip>;
1411
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
1412
- session: {
1413
- session: Record<string, any> & {
1414
- id: string;
1415
- createdAt: Date;
1416
- updatedAt: Date;
1417
- userId: string;
1418
- expiresAt: Date;
1419
- token: string;
1420
- ipAddress?: string | null | undefined;
1421
- userAgent?: string | null | undefined;
1422
- };
1423
- user: Record<string, any> & {
1424
- id: string;
1425
- createdAt: Date;
1426
- updatedAt: Date;
1427
- email: string;
1428
- emailVerified: boolean;
1429
- name: string;
1430
- image?: string | null | undefined;
1431
- };
1432
- };
1433
- }>)[];
1434
- metadata: {
1435
- openapi: {
1436
- description: string;
1437
- responses: {
1438
- "200": {
1439
- description: string;
1440
- content: {
1441
- "application/json": {
1442
- schema: {
1443
- type: "object";
1444
- properties: {
1445
- token: {
1446
- type: string;
1447
- nullable: boolean;
1448
- description: string;
1449
- };
1450
- user: {
1451
- type: string;
1452
- properties: {
1453
- id: {
1454
- type: string;
1455
- description: string;
1456
- };
1457
- email: {
1458
- type: string;
1459
- format: string;
1460
- description: string;
1461
- };
1462
- name: {
1463
- type: string;
1464
- description: string;
1465
- };
1466
- image: {
1467
- type: string;
1468
- format: string;
1469
- nullable: boolean;
1470
- description: string;
1471
- };
1472
- emailVerified: {
1473
- type: string;
1474
- description: string;
1475
- };
1476
- createdAt: {
1477
- type: string;
1478
- format: string;
1479
- description: string;
1480
- };
1481
- updatedAt: {
1482
- type: string;
1483
- format: string;
1484
- description: string;
1485
- };
1486
- };
1487
- required: string[];
1488
- };
1489
- };
1490
- required: string[];
1491
- };
1492
- };
1493
- };
1494
- };
1495
- };
1496
- };
1497
- };
1498
- } & {
1499
- use: any[];
1500
- };
1501
- path: "/change-password";
1502
- };
1503
- setPassword: {
1504
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1505
- body: {
1506
- newPassword: string;
1507
- };
1508
- } & {
1509
- method?: "POST" | undefined;
1510
- } & {
1511
- query?: Record<string, any> | undefined;
1512
- } & {
1513
- params?: Record<string, any>;
1514
- } & {
1515
- request?: Request;
1516
- } & {
1517
- headers?: HeadersInit;
1518
- } & {
1519
- asResponse?: boolean;
1520
- returnHeaders?: boolean;
1521
- use?: better_auth.Middleware[];
1522
- path?: string;
1523
- } & {
1524
- asResponse?: AsResponse | undefined;
1525
- returnHeaders?: ReturnHeaders | undefined;
1526
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1527
- headers: Headers;
1528
- response: {
1529
- status: boolean;
1530
- };
1531
- } : {
1532
- status: boolean;
1533
- }>;
1534
- options: {
1535
- method: "POST";
1536
- body: better_auth.ZodObject<{
1537
- newPassword: better_auth.ZodString;
1538
- }, better_auth.$strip>;
1539
- metadata: {
1540
- SERVER_ONLY: true;
1541
- };
1542
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
1543
- session: {
1544
- session: Record<string, any> & {
1545
- id: string;
1546
- createdAt: Date;
1547
- updatedAt: Date;
1548
- userId: string;
1549
- expiresAt: Date;
1550
- token: string;
1551
- ipAddress?: string | null | undefined;
1552
- userAgent?: string | null | undefined;
1553
- };
1554
- user: Record<string, any> & {
1555
- id: string;
1556
- createdAt: Date;
1557
- updatedAt: Date;
1558
- email: string;
1559
- emailVerified: boolean;
1560
- name: string;
1561
- image?: string | null | undefined;
1562
- };
1563
- };
1564
- }>)[];
1565
- } & {
1566
- use: any[];
1567
- };
1568
- path: "/set-password";
1569
- };
1570
- updateUser: {
1571
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1572
- body: Partial<{}> & {
1573
- name?: string;
1574
- image?: string;
1575
- };
1576
- } & {
1577
- method?: "POST" | undefined;
1578
- } & {
1579
- query?: Record<string, any> | undefined;
1580
- } & {
1581
- params?: Record<string, any>;
1582
- } & {
1583
- request?: Request;
1584
- } & {
1585
- headers?: HeadersInit;
1586
- } & {
1587
- asResponse?: boolean;
1588
- returnHeaders?: boolean;
1589
- use?: better_auth.Middleware[];
1590
- path?: string;
1591
- } & {
1592
- asResponse?: AsResponse | undefined;
1593
- returnHeaders?: ReturnHeaders | undefined;
1594
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1595
- headers: Headers;
1596
- response: {
1597
- status: boolean;
1598
- };
1599
- } : {
1600
- status: boolean;
1601
- }>;
1602
- options: {
1603
- method: "POST";
1604
- body: better_auth.ZodRecord<better_auth.ZodString, better_auth.ZodAny>;
1605
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
1606
- session: {
1607
- session: Record<string, any> & {
1608
- id: string;
1609
- createdAt: Date;
1610
- updatedAt: Date;
1611
- userId: string;
1612
- expiresAt: Date;
1613
- token: string;
1614
- ipAddress?: string | null | undefined;
1615
- userAgent?: string | null | undefined;
1616
- };
1617
- user: Record<string, any> & {
1618
- id: string;
1619
- createdAt: Date;
1620
- updatedAt: Date;
1621
- email: string;
1622
- emailVerified: boolean;
1623
- name: string;
1624
- image?: string | null | undefined;
1625
- };
1626
- };
1627
- }>)[];
1628
- metadata: {
1629
- $Infer: {
1630
- body: Partial<{}> & {
1631
- name?: string;
1632
- image?: string;
1633
- };
1634
- };
1635
- openapi: {
1636
- description: string;
1637
- requestBody: {
1638
- content: {
1639
- "application/json": {
1640
- schema: {
1641
- type: "object";
1642
- properties: {
1643
- name: {
1644
- type: string;
1645
- description: string;
1646
- };
1647
- image: {
1648
- type: string;
1649
- description: string;
1650
- };
1651
- };
1652
- };
1653
- };
1654
- };
1655
- };
1656
- responses: {
1657
- "200": {
1658
- description: string;
1659
- content: {
1660
- "application/json": {
1661
- schema: {
1662
- type: "object";
1663
- properties: {
1664
- status: {
1665
- type: string;
1666
- description: string;
1667
- };
1668
- };
1669
- };
1670
- };
1671
- };
1672
- };
1673
- };
1674
- };
1675
- };
1676
- } & {
1677
- use: any[];
1678
- };
1679
- path: "/update-user";
1680
- };
1681
- deleteUser: {
1682
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1683
- body: {
1684
- callbackURL?: string | undefined;
1685
- password?: string | undefined;
1686
- token?: string | undefined;
1687
- };
1688
- } & {
1689
- method?: "POST" | undefined;
1690
- } & {
1691
- query?: Record<string, any> | undefined;
1692
- } & {
1693
- params?: Record<string, any>;
1694
- } & {
1695
- request?: Request;
1696
- } & {
1697
- headers?: HeadersInit;
1698
- } & {
1699
- asResponse?: boolean;
1700
- returnHeaders?: boolean;
1701
- use?: better_auth.Middleware[];
1702
- path?: string;
1703
- } & {
1704
- asResponse?: AsResponse | undefined;
1705
- returnHeaders?: ReturnHeaders | undefined;
1706
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1707
- headers: Headers;
1708
- response: {
1709
- success: boolean;
1710
- message: string;
1711
- };
1712
- } : {
1713
- success: boolean;
1714
- message: string;
1715
- }>;
1716
- options: {
1717
- method: "POST";
1718
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
1719
- session: {
1720
- session: Record<string, any> & {
1721
- id: string;
1722
- createdAt: Date;
1723
- updatedAt: Date;
1724
- userId: string;
1725
- expiresAt: Date;
1726
- token: string;
1727
- ipAddress?: string | null | undefined;
1728
- userAgent?: string | null | undefined;
1729
- };
1730
- user: Record<string, any> & {
1731
- id: string;
1732
- createdAt: Date;
1733
- updatedAt: Date;
1734
- email: string;
1735
- emailVerified: boolean;
1736
- name: string;
1737
- image?: string | null | undefined;
1738
- };
1739
- };
1740
- }>)[];
1741
- body: better_auth.ZodObject<{
1742
- callbackURL: better_auth.ZodOptional<better_auth.ZodString>;
1743
- password: better_auth.ZodOptional<better_auth.ZodString>;
1744
- token: better_auth.ZodOptional<better_auth.ZodString>;
1745
- }, better_auth.$strip>;
1746
- metadata: {
1747
- openapi: {
1748
- description: string;
1749
- responses: {
1750
- "200": {
1751
- description: string;
1752
- content: {
1753
- "application/json": {
1754
- schema: {
1755
- type: "object";
1756
- properties: {
1757
- success: {
1758
- type: string;
1759
- description: string;
1760
- };
1761
- message: {
1762
- type: string;
1763
- enum: string[];
1764
- description: string;
1765
- };
1766
- };
1767
- required: string[];
1768
- };
1769
- };
1770
- };
1771
- };
1772
- };
1773
- };
1774
- };
1775
- } & {
1776
- use: any[];
1777
- };
1778
- path: "/delete-user";
1779
- };
1780
- forgetPasswordCallback: {
1781
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1782
- body?: undefined;
1783
- } & {
1784
- method?: "GET" | undefined;
1785
- } & {
1786
- query: {
1787
- callbackURL: string;
1788
- };
1789
- } & {
1790
- params: {
1791
- token: string;
1792
- };
1793
- } & {
1794
- request?: Request;
1795
- } & {
1796
- headers?: HeadersInit;
1797
- } & {
1798
- asResponse?: boolean;
1799
- returnHeaders?: boolean;
1800
- use?: better_auth.Middleware[];
1801
- path?: string;
1802
- } & {
1803
- asResponse?: AsResponse | undefined;
1804
- returnHeaders?: ReturnHeaders | undefined;
1805
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1806
- headers: Headers;
1807
- response: never;
1808
- } : never>;
1809
- options: {
1810
- method: "GET";
1811
- query: better_auth.ZodObject<{
1812
- callbackURL: better_auth.ZodString;
1813
- }, better_auth.$strip>;
1814
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<void>)[];
1815
- metadata: {
1816
- openapi: {
1817
- description: string;
1818
- responses: {
1819
- "200": {
1820
- description: string;
1821
- content: {
1822
- "application/json": {
1823
- schema: {
1824
- type: "object";
1825
- properties: {
1826
- token: {
1827
- type: string;
1828
- };
1829
- };
1830
- };
1831
- };
1832
- };
1833
- };
1834
- };
1835
- };
1836
- };
1837
- } & {
1838
- use: any[];
1839
- };
1840
- path: "/reset-password/:token";
1841
- };
1842
- requestPasswordReset: {
1843
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1844
- body: {
1845
- email: string;
1846
- redirectTo?: string | undefined;
1847
- };
1848
- } & {
1849
- method?: "POST" | undefined;
1850
- } & {
1851
- query?: Record<string, any> | undefined;
1852
- } & {
1853
- params?: Record<string, any>;
1854
- } & {
1855
- request?: Request;
1856
- } & {
1857
- headers?: HeadersInit;
1858
- } & {
1859
- asResponse?: boolean;
1860
- returnHeaders?: boolean;
1861
- use?: better_auth.Middleware[];
1862
- path?: string;
1863
- } & {
1864
- asResponse?: AsResponse | undefined;
1865
- returnHeaders?: ReturnHeaders | undefined;
1866
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1867
- headers: Headers;
1868
- response: {
1869
- status: boolean;
1870
- };
1871
- } : {
1872
- status: boolean;
1873
- }>;
1874
- options: {
1875
- method: "POST";
1876
- body: better_auth.ZodObject<{
1877
- email: better_auth.ZodEmail;
1878
- redirectTo: better_auth.ZodOptional<better_auth.ZodString>;
1879
- }, better_auth.$strip>;
1880
- metadata: {
1881
- openapi: {
1882
- description: string;
1883
- responses: {
1884
- "200": {
1885
- description: string;
1886
- content: {
1887
- "application/json": {
1888
- schema: {
1889
- type: "object";
1890
- properties: {
1891
- status: {
1892
- type: string;
1893
- };
1894
- message: {
1895
- type: string;
1896
- };
1897
- };
1898
- };
1899
- };
1900
- };
1901
- };
1902
- };
1903
- };
1904
- };
1905
- } & {
1906
- use: any[];
1907
- };
1908
- path: "/request-password-reset";
1909
- };
1910
- requestPasswordResetCallback: {
1911
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1912
- body?: undefined;
1913
- } & {
1914
- method?: "GET" | undefined;
1915
- } & {
1916
- query: {
1917
- callbackURL: string;
1918
- };
1919
- } & {
1920
- params: {
1921
- token: string;
1922
- };
1923
- } & {
1924
- request?: Request;
1925
- } & {
1926
- headers?: HeadersInit;
1927
- } & {
1928
- asResponse?: boolean;
1929
- returnHeaders?: boolean;
1930
- use?: better_auth.Middleware[];
1931
- path?: string;
1932
- } & {
1933
- asResponse?: AsResponse | undefined;
1934
- returnHeaders?: ReturnHeaders | undefined;
1935
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1936
- headers: Headers;
1937
- response: never;
1938
- } : never>;
1939
- options: {
1940
- method: "GET";
1941
- query: better_auth.ZodObject<{
1942
- callbackURL: better_auth.ZodString;
1943
- }, better_auth.$strip>;
1944
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<void>)[];
1945
- metadata: {
1946
- openapi: {
1947
- description: string;
1948
- responses: {
1949
- "200": {
1950
- description: string;
1951
- content: {
1952
- "application/json": {
1953
- schema: {
1954
- type: "object";
1955
- properties: {
1956
- token: {
1957
- type: string;
1958
- };
1959
- };
1960
- };
1961
- };
1962
- };
1963
- };
1964
- };
1965
- };
1966
- };
1967
- } & {
1968
- use: any[];
1969
- };
1970
- path: "/reset-password/:token";
1971
- };
1972
- listSessions: {
1973
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1974
- body?: undefined;
1975
- } & {
1976
- method?: "GET" | undefined;
1977
- } & {
1978
- query?: Record<string, any> | undefined;
1979
- } & {
1980
- params?: Record<string, any>;
1981
- } & {
1982
- request?: Request;
1983
- } & {
1984
- headers: HeadersInit;
1985
- } & {
1986
- asResponse?: boolean;
1987
- returnHeaders?: boolean;
1988
- use?: better_auth.Middleware[];
1989
- path?: string;
1990
- } & {
1991
- asResponse?: AsResponse | undefined;
1992
- returnHeaders?: ReturnHeaders | undefined;
1993
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1994
- headers: Headers;
1995
- response: better_auth.Prettify<{
1996
- id: string;
1997
- createdAt: Date;
1998
- updatedAt: Date;
1999
- userId: string;
2000
- expiresAt: Date;
2001
- token: string;
2002
- ipAddress?: string | null | undefined | undefined;
2003
- userAgent?: string | null | undefined | undefined;
2004
- }>[];
2005
- } : better_auth.Prettify<{
2006
- id: string;
2007
- createdAt: Date;
2008
- updatedAt: Date;
2009
- userId: string;
2010
- expiresAt: Date;
2011
- token: string;
2012
- ipAddress?: string | null | undefined | undefined;
2013
- userAgent?: string | null | undefined | undefined;
2014
- }>[]>;
2015
- options: {
2016
- method: "GET";
2017
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2018
- session: {
2019
- session: Record<string, any> & {
2020
- id: string;
2021
- createdAt: Date;
2022
- updatedAt: Date;
2023
- userId: string;
2024
- expiresAt: Date;
2025
- token: string;
2026
- ipAddress?: string | null | undefined;
2027
- userAgent?: string | null | undefined;
2028
- };
2029
- user: Record<string, any> & {
2030
- id: string;
2031
- createdAt: Date;
2032
- updatedAt: Date;
2033
- email: string;
2034
- emailVerified: boolean;
2035
- name: string;
2036
- image?: string | null | undefined;
2037
- };
2038
- };
2039
- }>)[];
2040
- requireHeaders: true;
2041
- metadata: {
2042
- openapi: {
2043
- description: string;
2044
- responses: {
2045
- "200": {
2046
- description: string;
2047
- content: {
2048
- "application/json": {
2049
- schema: {
2050
- type: "array";
2051
- items: {
2052
- $ref: string;
2053
- };
2054
- };
2055
- };
2056
- };
2057
- };
2058
- };
2059
- };
2060
- };
2061
- } & {
2062
- use: any[];
2063
- };
2064
- path: "/list-sessions";
2065
- };
2066
- revokeSession: {
2067
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
2068
- body: {
2069
- token: string;
2070
- };
2071
- } & {
2072
- method?: "POST" | undefined;
2073
- } & {
2074
- query?: Record<string, any> | undefined;
2075
- } & {
2076
- params?: Record<string, any>;
2077
- } & {
2078
- request?: Request;
2079
- } & {
2080
- headers: HeadersInit;
2081
- } & {
2082
- asResponse?: boolean;
2083
- returnHeaders?: boolean;
2084
- use?: better_auth.Middleware[];
2085
- path?: string;
2086
- } & {
2087
- asResponse?: AsResponse | undefined;
2088
- returnHeaders?: ReturnHeaders | undefined;
2089
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2090
- headers: Headers;
2091
- response: {
2092
- status: boolean;
2093
- };
2094
- } : {
2095
- status: boolean;
2096
- }>;
2097
- options: {
2098
- method: "POST";
2099
- body: better_auth.ZodObject<{
2100
- token: better_auth.ZodString;
2101
- }, better_auth.$strip>;
2102
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2103
- session: {
2104
- session: Record<string, any> & {
2105
- id: string;
2106
- createdAt: Date;
2107
- updatedAt: Date;
2108
- userId: string;
2109
- expiresAt: Date;
2110
- token: string;
2111
- ipAddress?: string | null | undefined;
2112
- userAgent?: string | null | undefined;
2113
- };
2114
- user: Record<string, any> & {
2115
- id: string;
2116
- createdAt: Date;
2117
- updatedAt: Date;
2118
- email: string;
2119
- emailVerified: boolean;
2120
- name: string;
2121
- image?: string | null | undefined;
2122
- };
2123
- };
2124
- }>)[];
2125
- requireHeaders: true;
2126
- metadata: {
2127
- openapi: {
2128
- description: string;
2129
- requestBody: {
2130
- content: {
2131
- "application/json": {
2132
- schema: {
2133
- type: "object";
2134
- properties: {
2135
- token: {
2136
- type: string;
2137
- description: string;
2138
- };
2139
- };
2140
- required: string[];
2141
- };
2142
- };
2143
- };
2144
- };
2145
- responses: {
2146
- "200": {
2147
- description: string;
2148
- content: {
2149
- "application/json": {
2150
- schema: {
2151
- type: "object";
2152
- properties: {
2153
- status: {
2154
- type: string;
2155
- description: string;
2156
- };
2157
- };
2158
- required: string[];
2159
- };
2160
- };
2161
- };
2162
- };
2163
- };
2164
- };
2165
- };
2166
- } & {
2167
- use: any[];
2168
- };
2169
- path: "/revoke-session";
2170
- };
2171
- revokeSessions: {
2172
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
2173
- body?: undefined;
2174
- } & {
2175
- method?: "POST" | undefined;
2176
- } & {
2177
- query?: Record<string, any> | undefined;
2178
- } & {
2179
- params?: Record<string, any>;
2180
- } & {
2181
- request?: Request;
2182
- } & {
2183
- headers: HeadersInit;
2184
- } & {
2185
- asResponse?: boolean;
2186
- returnHeaders?: boolean;
2187
- use?: better_auth.Middleware[];
2188
- path?: string;
2189
- } & {
2190
- asResponse?: AsResponse | undefined;
2191
- returnHeaders?: ReturnHeaders | undefined;
2192
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2193
- headers: Headers;
2194
- response: {
2195
- status: boolean;
2196
- };
2197
- } : {
2198
- status: boolean;
2199
- }>;
2200
- options: {
2201
- method: "POST";
2202
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2203
- session: {
2204
- session: Record<string, any> & {
2205
- id: string;
2206
- createdAt: Date;
2207
- updatedAt: Date;
2208
- userId: string;
2209
- expiresAt: Date;
2210
- token: string;
2211
- ipAddress?: string | null | undefined;
2212
- userAgent?: string | null | undefined;
2213
- };
2214
- user: Record<string, any> & {
2215
- id: string;
2216
- createdAt: Date;
2217
- updatedAt: Date;
2218
- email: string;
2219
- emailVerified: boolean;
2220
- name: string;
2221
- image?: string | null | undefined;
2222
- };
2223
- };
2224
- }>)[];
2225
- requireHeaders: true;
2226
- metadata: {
2227
- openapi: {
2228
- description: string;
2229
- responses: {
2230
- "200": {
2231
- description: string;
2232
- content: {
2233
- "application/json": {
2234
- schema: {
2235
- type: "object";
2236
- properties: {
2237
- status: {
2238
- type: string;
2239
- description: string;
2240
- };
2241
- };
2242
- required: string[];
2243
- };
2244
- };
2245
- };
2246
- };
2247
- };
2248
- };
2249
- };
2250
- } & {
2251
- use: any[];
2252
- };
2253
- path: "/revoke-sessions";
2254
- };
2255
- revokeOtherSessions: {
2256
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
2257
- body?: undefined;
2258
- } & {
2259
- method?: "POST" | undefined;
2260
- } & {
2261
- query?: Record<string, any> | undefined;
2262
- } & {
2263
- params?: Record<string, any>;
2264
- } & {
2265
- request?: Request;
2266
- } & {
2267
- headers: HeadersInit;
2268
- } & {
2269
- asResponse?: boolean;
2270
- returnHeaders?: boolean;
2271
- use?: better_auth.Middleware[];
2272
- path?: string;
2273
- } & {
2274
- asResponse?: AsResponse | undefined;
2275
- returnHeaders?: ReturnHeaders | undefined;
2276
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2277
- headers: Headers;
2278
- response: {
2279
- status: boolean;
2280
- };
2281
- } : {
2282
- status: boolean;
2283
- }>;
2284
- options: {
2285
- method: "POST";
2286
- requireHeaders: true;
2287
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2288
- session: {
2289
- session: Record<string, any> & {
2290
- id: string;
2291
- createdAt: Date;
2292
- updatedAt: Date;
2293
- userId: string;
2294
- expiresAt: Date;
2295
- token: string;
2296
- ipAddress?: string | null | undefined;
2297
- userAgent?: string | null | undefined;
2298
- };
2299
- user: Record<string, any> & {
2300
- id: string;
2301
- createdAt: Date;
2302
- updatedAt: Date;
2303
- email: string;
2304
- emailVerified: boolean;
2305
- name: string;
2306
- image?: string | null | undefined;
2307
- };
2308
- };
2309
- }>)[];
2310
- metadata: {
2311
- openapi: {
2312
- description: string;
2313
- responses: {
2314
- "200": {
2315
- description: string;
2316
- content: {
2317
- "application/json": {
2318
- schema: {
2319
- type: "object";
2320
- properties: {
2321
- status: {
2322
- type: string;
2323
- description: string;
2324
- };
2325
- };
2326
- required: string[];
2327
- };
2328
- };
2329
- };
2330
- };
2331
- };
2332
- };
2333
- };
2334
- } & {
2335
- use: any[];
2336
- };
2337
- path: "/revoke-other-sessions";
2338
- };
2339
- linkSocialAccount: {
2340
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
2341
- body: {
2342
- provider: unknown;
2343
- callbackURL?: string | undefined;
2344
- idToken?: {
2345
- token: string;
2346
- nonce?: string | undefined;
2347
- accessToken?: string | undefined;
2348
- refreshToken?: string | undefined;
2349
- scopes?: string[] | undefined;
2350
- } | undefined;
2351
- requestSignUp?: boolean | undefined;
2352
- scopes?: string[] | undefined;
2353
- errorCallbackURL?: string | undefined;
2354
- disableRedirect?: boolean | undefined;
2355
- };
2356
- } & {
2357
- method?: "POST" | undefined;
2358
- } & {
2359
- query?: Record<string, any> | undefined;
2360
- } & {
2361
- params?: Record<string, any>;
2362
- } & {
2363
- request?: Request;
2364
- } & {
2365
- headers: HeadersInit;
2366
- } & {
2367
- asResponse?: boolean;
2368
- returnHeaders?: boolean;
2369
- use?: better_auth.Middleware[];
2370
- path?: string;
2371
- } & {
2372
- asResponse?: AsResponse | undefined;
2373
- returnHeaders?: ReturnHeaders | undefined;
2374
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2375
- headers: Headers;
2376
- response: {
2377
- url: string;
2378
- redirect: boolean;
2379
- };
2380
- } : {
2381
- url: string;
2382
- redirect: boolean;
2383
- }>;
2384
- options: {
2385
- method: "POST";
2386
- requireHeaders: true;
2387
- body: better_auth.ZodObject<{
2388
- callbackURL: better_auth.ZodOptional<better_auth.ZodString>;
2389
- provider: better_auth.ZodType<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal" | (string & {}), unknown, better_auth.$ZodTypeInternals<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal" | (string & {}), unknown>>;
2390
- idToken: better_auth.ZodOptional<better_auth.ZodObject<{
2391
- token: better_auth.ZodString;
2392
- nonce: better_auth.ZodOptional<better_auth.ZodString>;
2393
- accessToken: better_auth.ZodOptional<better_auth.ZodString>;
2394
- refreshToken: better_auth.ZodOptional<better_auth.ZodString>;
2395
- scopes: better_auth.ZodOptional<better_auth.ZodArray<better_auth.ZodString>>;
2396
- }, better_auth.$strip>>;
2397
- requestSignUp: better_auth.ZodOptional<better_auth.ZodBoolean>;
2398
- scopes: better_auth.ZodOptional<better_auth.ZodArray<better_auth.ZodString>>;
2399
- errorCallbackURL: better_auth.ZodOptional<better_auth.ZodString>;
2400
- disableRedirect: better_auth.ZodOptional<better_auth.ZodBoolean>;
2401
- }, better_auth.$strip>;
2402
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2403
- session: {
2404
- session: Record<string, any> & {
2405
- id: string;
2406
- createdAt: Date;
2407
- updatedAt: Date;
2408
- userId: string;
2409
- expiresAt: Date;
2410
- token: string;
2411
- ipAddress?: string | null | undefined;
2412
- userAgent?: string | null | undefined;
2413
- };
2414
- user: Record<string, any> & {
2415
- id: string;
2416
- createdAt: Date;
2417
- updatedAt: Date;
2418
- email: string;
2419
- emailVerified: boolean;
2420
- name: string;
2421
- image?: string | null | undefined;
2422
- };
2423
- };
2424
- }>)[];
2425
- metadata: {
2426
- openapi: {
2427
- description: string;
2428
- responses: {
2429
- "200": {
2430
- description: string;
2431
- content: {
2432
- "application/json": {
2433
- schema: {
2434
- type: "object";
2435
- properties: {
2436
- url: {
2437
- type: string;
2438
- description: string;
2439
- };
2440
- redirect: {
2441
- type: string;
2442
- description: string;
2443
- };
2444
- status: {
2445
- type: string;
2446
- };
2447
- };
2448
- required: string[];
2449
- };
2450
- };
2451
- };
2452
- };
2453
- };
2454
- };
2455
- };
2456
- } & {
2457
- use: any[];
2458
- };
2459
- path: "/link-social";
2460
- };
2461
- listUserAccounts: {
2462
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
2463
- body?: undefined;
2464
- } & {
2465
- method?: "GET" | undefined;
2466
- } & {
2467
- query?: Record<string, any> | undefined;
2468
- } & {
2469
- params?: Record<string, any>;
2470
- } & {
2471
- request?: Request;
2472
- } & {
2473
- headers?: HeadersInit;
2474
- } & {
2475
- asResponse?: boolean;
2476
- returnHeaders?: boolean;
2477
- use?: better_auth.Middleware[];
2478
- path?: string;
2479
- } & {
2480
- asResponse?: AsResponse | undefined;
2481
- returnHeaders?: ReturnHeaders | undefined;
2482
- }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2483
- headers: Headers;
2484
- response: {
2485
- id: string;
2486
- providerId: string;
2487
- createdAt: Date;
2488
- updatedAt: Date;
2489
- accountId: string;
2490
- scopes: string[];
2491
- }[];
2492
- } : {
2493
- id: string;
2494
- providerId: string;
2495
- createdAt: Date;
2496
- updatedAt: Date;
2497
- accountId: string;
2498
- scopes: string[];
2499
- }[]>;
2500
- options: {
2501
- method: "GET";
2502
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2503
- session: {
2504
- session: Record<string, any> & {
2505
- id: string;
2506
- createdAt: Date;
2507
- updatedAt: Date;
2508
- userId: string;
2509
- expiresAt: Date;
2510
- token: string;
2511
- ipAddress?: string | null | undefined;
2512
- userAgent?: string | null | undefined;
2513
- };
2514
- user: Record<string, any> & {
2515
- id: string;
2516
- createdAt: Date;
2517
- updatedAt: Date;
2518
- email: string;
2519
- emailVerified: boolean;
2520
- name: string;
2521
- image?: string | null | undefined;
2522
- };
2523
- };
2524
- }>)[];
2525
- metadata: {
2526
- openapi: {
2527
- description: string;
2528
- responses: {
2529
- "200": {
2530
- description: string;
2531
- content: {
2532
- "application/json": {
2533
- schema: {
2534
- type: "array";
2535
- items: {
2536
- type: string;
2537
- properties: {
2538
- id: {
2539
- type: string;
2540
- };
2541
- providerId: {
2542
- type: string;
2543
- };
2544
- createdAt: {
2545
- type: string;
2546
- format: string;
2547
- };
2548
- updatedAt: {
2549
- type: string;
2550
- format: string;
2551
- };
2552
- accountId: {
2553
- type: string;
2554
- };
2555
- scopes: {
2556
- type: string;
2557
- items: {
2558
- type: string;
2559
- };
2560
- };
2561
- };
2562
- required: string[];
2563
- };
2564
- };
2565
- };
2566
- };
2567
- };
2568
- };
2569
- };
2570
- };
2571
- } & {
2572
- use: any[];
2573
- };
2574
- path: "/list-accounts";
2575
- };
2576
- deleteUserCallback: {
2577
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
2578
- body?: undefined;
2579
- } & {
2580
- method?: "GET" | undefined;
2581
- } & {
2582
- query: {
2583
- token: string;
2584
- callbackURL?: string | undefined;
2585
- };
2586
- } & {
2587
- params?: Record<string, any>;
2588
- } & {
2589
- request?: Request;
2590
- } & {
2591
- headers?: HeadersInit;
2592
- } & {
2593
- asResponse?: boolean;
2594
- returnHeaders?: boolean;
2595
- use?: better_auth.Middleware[];
2596
- path?: string;
2597
- } & {
2598
- asResponse?: AsResponse | undefined;
2599
- returnHeaders?: ReturnHeaders | undefined;
2600
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2601
- headers: Headers;
2602
- response: {
2603
- success: boolean;
2604
- message: string;
2605
- };
2606
- } : {
2607
- success: boolean;
2608
- message: string;
2609
- }>;
2610
- options: {
2611
- method: "GET";
2612
- query: better_auth.ZodObject<{
2613
- token: better_auth.ZodString;
2614
- callbackURL: better_auth.ZodOptional<better_auth.ZodString>;
2615
- }, better_auth.$strip>;
2616
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<void>)[];
2617
- metadata: {
2618
- openapi: {
2619
- description: string;
2620
- responses: {
2621
- "200": {
2622
- description: string;
2623
- content: {
2624
- "application/json": {
2625
- schema: {
2626
- type: "object";
2627
- properties: {
2628
- success: {
2629
- type: string;
2630
- description: string;
2631
- };
2632
- message: {
2633
- type: string;
2634
- enum: string[];
2635
- description: string;
2636
- };
2637
- };
2638
- required: string[];
2639
- };
2640
- };
2641
- };
2642
- };
2643
- };
2644
- };
2645
- };
2646
- } & {
2647
- use: any[];
2648
- };
2649
- path: "/delete-user/callback";
2650
- };
2651
- unlinkAccount: {
2652
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
2653
- body: {
2654
- providerId: string;
2655
- accountId?: string | undefined;
2656
- };
2657
- } & {
2658
- method?: "POST" | undefined;
2659
- } & {
2660
- query?: Record<string, any> | undefined;
2661
- } & {
2662
- params?: Record<string, any>;
2663
- } & {
2664
- request?: Request;
2665
- } & {
2666
- headers?: HeadersInit;
2667
- } & {
2668
- asResponse?: boolean;
2669
- returnHeaders?: boolean;
2670
- use?: better_auth.Middleware[];
2671
- path?: string;
2672
- } & {
2673
- asResponse?: AsResponse | undefined;
2674
- returnHeaders?: ReturnHeaders | undefined;
2675
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2676
- headers: Headers;
2677
- response: {
2678
- status: boolean;
2679
- };
2680
- } : {
2681
- status: boolean;
2682
- }>;
2683
- options: {
2684
- method: "POST";
2685
- body: better_auth.ZodObject<{
2686
- providerId: better_auth.ZodString;
2687
- accountId: better_auth.ZodOptional<better_auth.ZodString>;
2688
- }, better_auth.$strip>;
2689
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2690
- session: {
2691
- session: Record<string, any> & {
2692
- id: string;
2693
- createdAt: Date;
2694
- updatedAt: Date;
2695
- userId: string;
2696
- expiresAt: Date;
2697
- token: string;
2698
- ipAddress?: string | null | undefined;
2699
- userAgent?: string | null | undefined;
2700
- };
2701
- user: Record<string, any> & {
2702
- id: string;
2703
- createdAt: Date;
2704
- updatedAt: Date;
2705
- email: string;
2706
- emailVerified: boolean;
2707
- name: string;
2708
- image?: string | null | undefined;
2709
- };
2710
- };
2711
- }>)[];
2712
- metadata: {
2713
- openapi: {
2714
- description: string;
2715
- responses: {
2716
- "200": {
2717
- description: string;
2718
- content: {
2719
- "application/json": {
2720
- schema: {
2721
- type: "object";
2722
- properties: {
2723
- status: {
2724
- type: string;
2725
- };
2726
- };
2727
- };
2728
- };
2729
- };
2730
- };
2731
- };
2732
- };
2733
- };
2734
- } & {
2735
- use: any[];
2736
- };
2737
- path: "/unlink-account";
2738
- };
2739
- refreshToken: {
2740
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
2741
- body: {
2742
- providerId: string;
2743
- accountId?: string | undefined;
2744
- userId?: string | undefined;
2745
- };
2746
- } & {
2747
- method?: "POST" | undefined;
2748
- } & {
2749
- query?: Record<string, any> | undefined;
2750
- } & {
2751
- params?: Record<string, any>;
2752
- } & {
2753
- request?: Request;
2754
- } & {
2755
- headers?: HeadersInit;
2756
- } & {
2757
- asResponse?: boolean;
2758
- returnHeaders?: boolean;
2759
- use?: better_auth.Middleware[];
2760
- path?: string;
2761
- } & {
2762
- asResponse?: AsResponse | undefined;
2763
- returnHeaders?: ReturnHeaders | undefined;
2764
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2765
- headers: Headers;
2766
- response: better_auth.OAuth2Tokens;
2767
- } : better_auth.OAuth2Tokens>;
2768
- options: {
2769
- method: "POST";
2770
- body: better_auth.ZodObject<{
2771
- providerId: better_auth.ZodString;
2772
- accountId: better_auth.ZodOptional<better_auth.ZodString>;
2773
- userId: better_auth.ZodOptional<better_auth.ZodString>;
2774
- }, better_auth.$strip>;
2775
- metadata: {
2776
- openapi: {
2777
- description: string;
2778
- responses: {
2779
- 200: {
2780
- description: string;
2781
- content: {
2782
- "application/json": {
2783
- schema: {
2784
- type: "object";
2785
- properties: {
2786
- tokenType: {
2787
- type: string;
2788
- };
2789
- idToken: {
2790
- type: string;
2791
- };
2792
- accessToken: {
2793
- type: string;
2794
- };
2795
- refreshToken: {
2796
- type: string;
2797
- };
2798
- accessTokenExpiresAt: {
2799
- type: string;
2800
- format: string;
2801
- };
2802
- refreshTokenExpiresAt: {
2803
- type: string;
2804
- format: string;
2805
- };
2806
- };
2807
- };
2808
- };
2809
- };
2810
- };
2811
- 400: {
2812
- description: string;
2813
- };
2814
- };
2815
- };
2816
- };
2817
- } & {
2818
- use: any[];
2819
- };
2820
- path: "/refresh-token";
2821
- };
2822
- getAccessToken: {
2823
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
2824
- body: {
2825
- providerId: string;
2826
- accountId?: string | undefined;
2827
- userId?: string | undefined;
2828
- };
2829
- } & {
2830
- method?: "POST" | undefined;
2831
- } & {
2832
- query?: Record<string, any> | undefined;
2833
- } & {
2834
- params?: Record<string, any>;
2835
- } & {
2836
- request?: Request;
2837
- } & {
2838
- headers?: HeadersInit;
2839
- } & {
2840
- asResponse?: boolean;
2841
- returnHeaders?: boolean;
2842
- use?: better_auth.Middleware[];
2843
- path?: string;
2844
- } & {
2845
- asResponse?: AsResponse | undefined;
2846
- returnHeaders?: ReturnHeaders | undefined;
2847
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2848
- headers: Headers;
2849
- response: {
2850
- accessToken: string;
2851
- accessTokenExpiresAt: Date | undefined;
2852
- scopes: string[];
2853
- idToken: string | undefined;
2854
- };
2855
- } : {
2856
- accessToken: string;
2857
- accessTokenExpiresAt: Date | undefined;
2858
- scopes: string[];
2859
- idToken: string | undefined;
2860
- }>;
2861
- options: {
2862
- method: "POST";
2863
- body: better_auth.ZodObject<{
2864
- providerId: better_auth.ZodString;
2865
- accountId: better_auth.ZodOptional<better_auth.ZodString>;
2866
- userId: better_auth.ZodOptional<better_auth.ZodString>;
2867
- }, better_auth.$strip>;
2868
- metadata: {
2869
- openapi: {
2870
- description: string;
2871
- responses: {
2872
- 200: {
2873
- description: string;
2874
- content: {
2875
- "application/json": {
2876
- schema: {
2877
- type: "object";
2878
- properties: {
2879
- tokenType: {
2880
- type: string;
2881
- };
2882
- idToken: {
2883
- type: string;
2884
- };
2885
- accessToken: {
2886
- type: string;
2887
- };
2888
- refreshToken: {
2889
- type: string;
2890
- };
2891
- accessTokenExpiresAt: {
2892
- type: string;
2893
- format: string;
2894
- };
2895
- refreshTokenExpiresAt: {
2896
- type: string;
2897
- format: string;
2898
- };
2899
- };
2900
- };
2901
- };
2902
- };
2903
- };
2904
- 400: {
2905
- description: string;
2906
- };
2907
- };
2908
- };
2909
- };
2910
- } & {
2911
- use: any[];
2912
- };
2913
- path: "/get-access-token";
2914
- };
2915
- accountInfo: {
2916
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
2917
- body: {
2918
- accountId: string;
2919
- };
2920
- } & {
2921
- method?: "POST" | undefined;
2922
- } & {
2923
- query?: Record<string, any> | undefined;
2924
- } & {
2925
- params?: Record<string, any>;
2926
- } & {
2927
- request?: Request;
2928
- } & {
2929
- headers?: HeadersInit;
2930
- } & {
2931
- asResponse?: boolean;
2932
- returnHeaders?: boolean;
2933
- use?: better_auth.Middleware[];
2934
- path?: string;
2935
- } & {
2936
- asResponse?: AsResponse | undefined;
2937
- returnHeaders?: ReturnHeaders | undefined;
2938
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
2939
- headers: Headers;
2940
- response: {
2941
- user: better_auth.OAuth2UserInfo;
2942
- data: Record<string, any>;
2943
- } | null;
2944
- } : {
2945
- user: better_auth.OAuth2UserInfo;
2946
- data: Record<string, any>;
2947
- } | null>;
2948
- options: {
2949
- method: "POST";
2950
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2951
- session: {
2952
- session: Record<string, any> & {
2953
- id: string;
2954
- createdAt: Date;
2955
- updatedAt: Date;
2956
- userId: string;
2957
- expiresAt: Date;
2958
- token: string;
2959
- ipAddress?: string | null | undefined;
2960
- userAgent?: string | null | undefined;
2961
- };
2962
- user: Record<string, any> & {
2963
- id: string;
2964
- createdAt: Date;
2965
- updatedAt: Date;
2966
- email: string;
2967
- emailVerified: boolean;
2968
- name: string;
2969
- image?: string | null | undefined;
2970
- };
2971
- };
2972
- }>)[];
2973
- metadata: {
2974
- openapi: {
2975
- description: string;
2976
- responses: {
2977
- "200": {
2978
- description: string;
2979
- content: {
2980
- "application/json": {
2981
- schema: {
2982
- type: "object";
2983
- properties: {
2984
- user: {
2985
- type: string;
2986
- properties: {
2987
- id: {
2988
- type: string;
2989
- };
2990
- name: {
2991
- type: string;
2992
- };
2993
- email: {
2994
- type: string;
2995
- };
2996
- image: {
2997
- type: string;
2998
- };
2999
- emailVerified: {
3000
- type: string;
3001
- };
3002
- };
3003
- required: string[];
3004
- };
3005
- data: {
3006
- type: string;
3007
- properties: {};
3008
- additionalProperties: boolean;
3009
- };
3010
- };
3011
- required: string[];
3012
- additionalProperties: boolean;
3013
- };
3014
- };
3015
- };
3016
- };
3017
- };
3018
- };
3019
- };
3020
- body: better_auth.ZodObject<{
3021
- accountId: better_auth.ZodString;
3022
- }, better_auth.$strip>;
3023
- } & {
3024
- use: any[];
3025
- };
3026
- path: "/account-info";
3027
- };
3028
- } & {
3029
- getSession: {
3030
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
3031
- body?: undefined;
3032
- } & {
3033
- method?: "GET" | undefined;
3034
- } & {
3035
- query?: {
3036
- disableCookieCache?: string | boolean | undefined;
3037
- disableRefresh?: boolean | undefined;
3038
- } | undefined;
3039
- } & {
3040
- params?: Record<string, any>;
3041
- } & {
3042
- request?: Request;
3043
- } & {
3044
- headers: HeadersInit;
3045
- } & {
3046
- asResponse?: boolean;
3047
- returnHeaders?: boolean;
3048
- use?: better_auth.Middleware[];
3049
- path?: string;
3050
- } & {
3051
- asResponse?: AsResponse | undefined;
3052
- returnHeaders?: ReturnHeaders | undefined;
3053
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
3054
- headers: Headers;
3055
- response: {
3056
- session: {
3057
- sessionToken: string;
3058
- id: string;
3059
- createdAt: Date;
3060
- updatedAt: Date;
3061
- userId: string;
3062
- expiresAt: Date;
3063
- token: string;
3064
- ipAddress?: string | null | undefined;
3065
- userAgent?: string | null | undefined;
3066
- };
3067
- user: {
3068
- id: string;
3069
- createdAt: Date;
3070
- updatedAt: Date;
3071
- email: string;
3072
- emailVerified: boolean;
3073
- name: string;
3074
- image?: string | null | undefined;
3075
- };
3076
- } | null;
3077
- } : {
3078
- session: {
3079
- sessionToken: string;
3080
- id: string;
3081
- createdAt: Date;
3082
- updatedAt: Date;
3083
- userId: string;
3084
- expiresAt: Date;
3085
- token: string;
3086
- ipAddress?: string | null | undefined;
3087
- userAgent?: string | null | undefined;
3088
- };
3089
- user: {
3090
- id: string;
3091
- createdAt: Date;
3092
- updatedAt: Date;
3093
- email: string;
3094
- emailVerified: boolean;
3095
- name: string;
3096
- image?: string | null | undefined;
3097
- };
3098
- } | null>;
3099
- options: {
3100
- method: "GET";
3101
- query: better_auth.ZodOptional<better_auth.ZodObject<{
3102
- disableCookieCache: better_auth.ZodOptional<better_auth.ZodUnion<[better_auth.ZodBoolean, better_auth.ZodPipe<better_auth.ZodString, better_auth.ZodTransform<boolean, string>>]>>;
3103
- disableRefresh: better_auth.ZodOptional<better_auth.ZodBoolean>;
3104
- }, better_auth.$strip>>;
3105
- metadata: {
3106
- CUSTOM_SESSION: boolean;
3107
- openapi: {
3108
- description: string;
3109
- responses: {
3110
- "200": {
3111
- description: string;
3112
- content: {
3113
- "application/json": {
3114
- schema: {
3115
- type: "array";
3116
- nullable: boolean;
3117
- items: {
3118
- $ref: string;
3119
- };
3120
- };
3121
- };
3122
- };
3123
- };
3124
- };
3125
- };
3126
- };
3127
- requireHeaders: true;
3128
- } & {
3129
- use: any[];
3130
- };
3131
- path: "/get-session";
3132
- };
3133
- }>;
3134
- options: {
3135
- plugins: [{
3136
- id: "custom-session";
3137
- hooks: {
3138
- after: {
3139
- matcher: (ctx: better_auth.HookEndpointContext) => boolean;
3140
- handler: (inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
3141
- session: {
3142
- sessionToken: string;
3143
- id: string;
3144
- createdAt: Date;
3145
- updatedAt: Date;
3146
- userId: string;
3147
- expiresAt: Date;
3148
- token: string;
3149
- ipAddress?: string | null | undefined;
3150
- userAgent?: string | null | undefined;
3151
- };
3152
- user: {
3153
- id: string;
3154
- createdAt: Date;
3155
- updatedAt: Date;
3156
- email: string;
3157
- emailVerified: boolean;
3158
- name: string;
3159
- image?: string | null | undefined;
3160
- };
3161
- }[] | undefined>;
3162
- }[];
3163
- };
3164
- endpoints: {
3165
- getSession: {
3166
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
3167
- body?: undefined;
3168
- } & {
3169
- method?: "GET" | undefined;
3170
- } & {
3171
- query?: {
3172
- disableCookieCache?: string | boolean | undefined;
3173
- disableRefresh?: boolean | undefined;
3174
- } | undefined;
3175
- } & {
3176
- params?: Record<string, any>;
3177
- } & {
3178
- request?: Request;
3179
- } & {
3180
- headers: HeadersInit;
3181
- } & {
3182
- asResponse?: boolean;
3183
- returnHeaders?: boolean;
3184
- use?: better_auth.Middleware[];
3185
- path?: string;
3186
- } & {
3187
- asResponse?: AsResponse | undefined;
3188
- returnHeaders?: ReturnHeaders | undefined;
3189
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
3190
- headers: Headers;
3191
- response: {
3192
- session: {
3193
- sessionToken: string;
3194
- id: string;
3195
- createdAt: Date;
3196
- updatedAt: Date;
3197
- userId: string;
3198
- expiresAt: Date;
3199
- token: string;
3200
- ipAddress?: string | null | undefined;
3201
- userAgent?: string | null | undefined;
3202
- };
3203
- user: {
3204
- id: string;
3205
- createdAt: Date;
3206
- updatedAt: Date;
3207
- email: string;
3208
- emailVerified: boolean;
3209
- name: string;
3210
- image?: string | null | undefined;
3211
- };
3212
- } | null;
3213
- } : {
3214
- session: {
3215
- sessionToken: string;
3216
- id: string;
3217
- createdAt: Date;
3218
- updatedAt: Date;
3219
- userId: string;
3220
- expiresAt: Date;
3221
- token: string;
3222
- ipAddress?: string | null | undefined;
3223
- userAgent?: string | null | undefined;
3224
- };
3225
- user: {
3226
- id: string;
3227
- createdAt: Date;
3228
- updatedAt: Date;
3229
- email: string;
3230
- emailVerified: boolean;
3231
- name: string;
3232
- image?: string | null | undefined;
3233
- };
3234
- } | null>;
3235
- options: {
3236
- method: "GET";
3237
- query: better_auth.ZodOptional<better_auth.ZodObject<{
3238
- disableCookieCache: better_auth.ZodOptional<better_auth.ZodUnion<[better_auth.ZodBoolean, better_auth.ZodPipe<better_auth.ZodString, better_auth.ZodTransform<boolean, string>>]>>;
3239
- disableRefresh: better_auth.ZodOptional<better_auth.ZodBoolean>;
3240
- }, better_auth.$strip>>;
3241
- metadata: {
3242
- CUSTOM_SESSION: boolean;
3243
- openapi: {
3244
- description: string;
3245
- responses: {
3246
- "200": {
3247
- description: string;
3248
- content: {
3249
- "application/json": {
3250
- schema: {
3251
- type: "array";
3252
- nullable: boolean;
3253
- items: {
3254
- $ref: string;
3255
- };
3256
- };
3257
- };
3258
- };
3259
- };
3260
- };
3261
- };
3262
- };
3263
- requireHeaders: true;
3264
- } & {
3265
- use: any[];
3266
- };
3267
- path: "/get-session";
3268
- };
3269
- };
3270
- }];
3
+ interface UserSession {
4
+ user: User;
5
+ session: Session & {
6
+ sessionToken: string;
7
+ jwt: string;
3271
8
  };
3272
- $context: Promise<better_auth.AuthContext>;
3273
- $Infer: {
3274
- Session: {
3275
- session: {
3276
- id: string;
3277
- createdAt: Date;
3278
- updatedAt: Date;
3279
- userId: string;
3280
- expiresAt: Date;
3281
- token: string;
3282
- ipAddress?: string | null | undefined;
3283
- userAgent?: string | null | undefined;
3284
- };
3285
- user: {
3286
- id: string;
3287
- createdAt: Date;
3288
- updatedAt: Date;
3289
- email: string;
3290
- emailVerified: boolean;
3291
- name: string;
3292
- image?: string | null | undefined;
3293
- };
3294
- };
3295
- };
3296
- $ERROR_CODES: {
3297
- USER_NOT_FOUND: string;
3298
- FAILED_TO_CREATE_USER: string;
3299
- FAILED_TO_CREATE_SESSION: string;
3300
- FAILED_TO_UPDATE_USER: string;
3301
- FAILED_TO_GET_SESSION: string;
3302
- INVALID_PASSWORD: string;
3303
- INVALID_EMAIL: string;
3304
- INVALID_EMAIL_OR_PASSWORD: string;
3305
- SOCIAL_ACCOUNT_ALREADY_LINKED: string;
3306
- PROVIDER_NOT_FOUND: string;
3307
- INVALID_TOKEN: string;
3308
- ID_TOKEN_NOT_SUPPORTED: string;
3309
- FAILED_TO_GET_USER_INFO: string;
3310
- USER_EMAIL_NOT_FOUND: string;
3311
- EMAIL_NOT_VERIFIED: string;
3312
- PASSWORD_TOO_SHORT: string;
3313
- PASSWORD_TOO_LONG: string;
3314
- USER_ALREADY_EXISTS: string;
3315
- EMAIL_CAN_NOT_BE_UPDATED: string;
3316
- CREDENTIAL_ACCOUNT_NOT_FOUND: string;
3317
- SESSION_EXPIRED: string;
3318
- FAILED_TO_UNLINK_LAST_ACCOUNT: string;
3319
- ACCOUNT_NOT_FOUND: string;
3320
- USER_ALREADY_HAS_PASSWORD: string;
3321
- };
3322
- };
3323
- declare const options: {
3324
- plugins: {
3325
- id: "infer-server-plugin";
3326
- $InferServerPlugin: {
3327
- id: "custom-session";
3328
- hooks: {
3329
- after: {
3330
- matcher: (ctx: better_auth.HookEndpointContext) => boolean;
3331
- handler: (inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
3332
- session: {
3333
- sessionToken: string;
3334
- id: string;
3335
- createdAt: Date;
3336
- updatedAt: Date;
3337
- userId: string;
3338
- expiresAt: Date;
3339
- token: string;
3340
- ipAddress?: string | null | undefined;
3341
- userAgent?: string | null | undefined;
3342
- };
3343
- user: {
3344
- id: string;
3345
- createdAt: Date;
3346
- updatedAt: Date;
3347
- email: string;
3348
- emailVerified: boolean;
3349
- name: string;
3350
- image?: string | null | undefined;
3351
- };
3352
- }[] | undefined>;
3353
- }[];
3354
- };
3355
- endpoints: {
3356
- getSession: {
3357
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
3358
- body?: undefined;
3359
- } & {
3360
- method?: "GET" | undefined;
3361
- } & {
3362
- query?: {
3363
- disableCookieCache?: string | boolean | undefined;
3364
- disableRefresh?: boolean | undefined;
3365
- } | undefined;
3366
- } & {
3367
- params?: Record<string, any>;
3368
- } & {
3369
- request?: Request;
3370
- } & {
3371
- headers: HeadersInit;
3372
- } & {
3373
- asResponse?: boolean;
3374
- returnHeaders?: boolean;
3375
- use?: better_auth.Middleware[];
3376
- path?: string;
3377
- } & {
3378
- asResponse?: AsResponse | undefined;
3379
- returnHeaders?: ReturnHeaders | undefined;
3380
- }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
3381
- headers: Headers;
3382
- response: {
3383
- session: {
3384
- sessionToken: string;
3385
- id: string;
3386
- createdAt: Date;
3387
- updatedAt: Date;
3388
- userId: string;
3389
- expiresAt: Date;
3390
- token: string;
3391
- ipAddress?: string | null | undefined;
3392
- userAgent?: string | null | undefined;
3393
- };
3394
- user: {
3395
- id: string;
3396
- createdAt: Date;
3397
- updatedAt: Date;
3398
- email: string;
3399
- emailVerified: boolean;
3400
- name: string;
3401
- image?: string | null | undefined;
3402
- };
3403
- } | null;
3404
- } : {
3405
- session: {
3406
- sessionToken: string;
3407
- id: string;
3408
- createdAt: Date;
3409
- updatedAt: Date;
3410
- userId: string;
3411
- expiresAt: Date;
3412
- token: string;
3413
- ipAddress?: string | null | undefined;
3414
- userAgent?: string | null | undefined;
3415
- };
3416
- user: {
3417
- id: string;
3418
- createdAt: Date;
3419
- updatedAt: Date;
3420
- email: string;
3421
- emailVerified: boolean;
3422
- name: string;
3423
- image?: string | null | undefined;
3424
- };
3425
- } | null>;
3426
- options: {
3427
- method: "GET";
3428
- query: better_auth.ZodOptional<better_auth.ZodObject<{
3429
- disableCookieCache: better_auth.ZodOptional<better_auth.ZodUnion<[better_auth.ZodBoolean, better_auth.ZodPipe<better_auth.ZodString, better_auth.ZodTransform<boolean, string>>]>>;
3430
- disableRefresh: better_auth.ZodOptional<better_auth.ZodBoolean>;
3431
- }, better_auth.$strip>>;
3432
- metadata: {
3433
- CUSTOM_SESSION: boolean;
3434
- openapi: {
3435
- description: string;
3436
- responses: {
3437
- "200": {
3438
- description: string;
3439
- content: {
3440
- "application/json": {
3441
- schema: {
3442
- type: "array";
3443
- nullable: boolean;
3444
- items: {
3445
- $ref: string;
3446
- };
3447
- };
3448
- };
3449
- };
3450
- };
3451
- };
3452
- };
3453
- };
3454
- requireHeaders: true;
3455
- } & {
3456
- use: any[];
3457
- };
3458
- path: "/get-session";
3459
- };
3460
- };
3461
- };
3462
- }[];
3463
- };
3464
- type BetterAuth = ReturnType<typeof createAuthClient<typeof options>>;
3465
- type Session = BetterAuth["$Infer"]["Session"];
9
+ }
3466
10
  interface SignInWithPopup {
3467
11
  baseURL: string;
3468
12
  authMode?: "popup";
@@ -3473,9 +17,9 @@ interface SignInWithRedirect {
3473
17
  authMode: "redirect";
3474
18
  callbackURL: string;
3475
19
  }
3476
- type Refetch = ReturnType<BetterAuth["useSession"]>["refetch"];
3477
- type SignOut = ReturnType<BetterAuth["signOut"]>;
20
+ type Refetch = () => Promise<UserSession | null>;
21
+ type SignOut = () => Promise<void>;
3478
22
  type SignInParams = SignInWithPopup | SignInWithRedirect;
3479
23
  type SignInWithOutBaseURLParams = Omit<SignInWithPopup, "baseURL"> | Omit<SignInWithRedirect, "baseURL">;
3480
24
 
3481
- export { type BetterAuth, type Refetch, type Session, type SignInParams, type SignInWithOutBaseURLParams, type SignInWithPopup, type SignInWithRedirect, type SignOut, auth, options };
25
+ export type { Refetch, SignInParams, SignInWithOutBaseURLParams, SignInWithPopup, SignInWithRedirect, SignOut, UserSession };