deesse 0.1.24 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/.turbo/turbo-type-check.log +4 -0
  3. package/README.md +48 -0
  4. package/dist/config/define.d.ts +6 -2
  5. package/dist/config/define.d.ts.map +1 -0
  6. package/dist/config/define.js +4 -11
  7. package/dist/config/define.js.map +1 -0
  8. package/dist/config/index.d.ts +3 -2
  9. package/dist/config/index.d.ts.map +1 -0
  10. package/dist/config/index.js +2 -18
  11. package/dist/config/index.js.map +1 -0
  12. package/dist/index.d.ts +3 -3
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +3 -19
  15. package/dist/index.js.map +1 -0
  16. package/package.json +14 -53
  17. package/src/config/define.ts +9 -0
  18. package/src/config/index.ts +2 -0
  19. package/src/index.ts +4 -0
  20. package/tsconfig.json +11 -0
  21. package/tsconfig.tsbuildinfo +1 -0
  22. package/dist/auth/index.d.ts +0 -3
  23. package/dist/auth/index.js +0 -19
  24. package/dist/auth/react/index.d.ts +0 -1
  25. package/dist/auth/react/index.js +0 -17
  26. package/dist/auth/server.d.ts +0 -1168
  27. package/dist/auth/server.js +0 -13
  28. package/dist/config/types.d.ts +0 -14
  29. package/dist/config/types.js +0 -2
  30. package/dist/plugins/admin/define.d.ts +0 -5
  31. package/dist/plugins/admin/define.js +0 -19
  32. package/dist/plugins/admin/index.d.ts +0 -2
  33. package/dist/plugins/admin/index.js +0 -18
  34. package/dist/plugins/admin/types.d.ts +0 -18
  35. package/dist/plugins/admin/types.js +0 -2
  36. package/dist/plugins/define.d.ts +0 -2
  37. package/dist/plugins/define.js +0 -7
  38. package/dist/plugins/index.d.ts +0 -3
  39. package/dist/plugins/index.js +0 -19
  40. package/dist/plugins/types.d.ts +0 -8
  41. package/dist/plugins/types.js +0 -2
@@ -1,1168 +0,0 @@
1
- import { Config } from "../config/types";
2
- export declare const createAuth: (config: Config) => import("better-auth").Auth<{
3
- plugins: [{
4
- id: "admin";
5
- init(): {
6
- options: {
7
- databaseHooks: {
8
- user: {
9
- create: {
10
- before(user: {
11
- id: string;
12
- createdAt: Date;
13
- updatedAt: Date;
14
- email: string;
15
- emailVerified: boolean;
16
- name: string;
17
- image?: string | null | undefined;
18
- } & Record<string, unknown>): Promise<{
19
- data: {
20
- id: string;
21
- createdAt: Date;
22
- updatedAt: Date;
23
- email: string;
24
- emailVerified: boolean;
25
- name: string;
26
- image?: string | null | undefined;
27
- role: string;
28
- };
29
- }>;
30
- };
31
- };
32
- session: {
33
- create: {
34
- before(session: {
35
- id: string;
36
- createdAt: Date;
37
- updatedAt: Date;
38
- userId: string;
39
- expiresAt: Date;
40
- token: string;
41
- ipAddress?: string | null | undefined;
42
- userAgent?: string | null | undefined;
43
- } & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | undefined): Promise<void>;
44
- };
45
- };
46
- };
47
- };
48
- };
49
- hooks: {
50
- after: {
51
- matcher(context: import("better-auth").HookEndpointContext): boolean;
52
- handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
53
- }[];
54
- };
55
- endpoints: {
56
- setRole: import("better-auth").StrictEndpoint<"/admin/set-role", {
57
- method: "POST";
58
- body: import("better-auth").ZodObject<{
59
- userId: import("better-auth").ZodCoercedString<unknown>;
60
- role: import("better-auth").ZodUnion<readonly [import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>]>;
61
- }, import("better-auth").$strip>;
62
- requireHeaders: true;
63
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
64
- session: {
65
- user: import("better-auth/plugins").UserWithRole;
66
- session: import("better-auth").Session;
67
- };
68
- }>)[];
69
- metadata: {
70
- openapi: {
71
- operationId: string;
72
- summary: string;
73
- description: string;
74
- responses: {
75
- 200: {
76
- description: string;
77
- content: {
78
- "application/json": {
79
- schema: {
80
- type: "object";
81
- properties: {
82
- user: {
83
- $ref: string;
84
- };
85
- };
86
- };
87
- };
88
- };
89
- };
90
- };
91
- };
92
- $Infer: {
93
- body: {
94
- userId: string;
95
- role: "user" | "admin" | ("user" | "admin")[];
96
- };
97
- };
98
- };
99
- } & {
100
- use: any[];
101
- }, {
102
- user: import("better-auth/plugins").UserWithRole;
103
- }>;
104
- getUser: import("better-auth").StrictEndpoint<"/admin/get-user", {
105
- method: "GET";
106
- query: import("better-auth").ZodObject<{
107
- id: import("better-auth").ZodString;
108
- }, import("better-auth").$strip>;
109
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
110
- session: {
111
- user: import("better-auth/plugins").UserWithRole;
112
- session: import("better-auth").Session;
113
- };
114
- }>)[];
115
- metadata: {
116
- openapi: {
117
- operationId: string;
118
- summary: string;
119
- description: string;
120
- responses: {
121
- 200: {
122
- description: string;
123
- content: {
124
- "application/json": {
125
- schema: {
126
- type: "object";
127
- properties: {
128
- user: {
129
- $ref: string;
130
- };
131
- };
132
- };
133
- };
134
- };
135
- };
136
- };
137
- };
138
- };
139
- } & {
140
- use: any[];
141
- }, {
142
- id: string;
143
- createdAt: Date;
144
- updatedAt: Date;
145
- email: string;
146
- emailVerified: boolean;
147
- name: string;
148
- image?: string | null | undefined;
149
- }>;
150
- createUser: import("better-auth").StrictEndpoint<"/admin/create-user", {
151
- method: "POST";
152
- body: import("better-auth").ZodObject<{
153
- email: import("better-auth").ZodString;
154
- password: import("better-auth").ZodString;
155
- name: import("better-auth").ZodString;
156
- role: import("better-auth").ZodOptional<import("better-auth").ZodUnion<readonly [import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>]>>;
157
- data: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
158
- }, import("better-auth").$strip>;
159
- metadata: {
160
- openapi: {
161
- operationId: string;
162
- summary: string;
163
- description: string;
164
- responses: {
165
- 200: {
166
- description: string;
167
- content: {
168
- "application/json": {
169
- schema: {
170
- type: "object";
171
- properties: {
172
- user: {
173
- $ref: string;
174
- };
175
- };
176
- };
177
- };
178
- };
179
- };
180
- };
181
- };
182
- $Infer: {
183
- body: {
184
- email: string;
185
- password: string;
186
- name: string;
187
- role?: "user" | "admin" | ("user" | "admin")[] | undefined;
188
- data?: Record<string, any> | undefined;
189
- };
190
- };
191
- };
192
- } & {
193
- use: any[];
194
- }, {
195
- user: import("better-auth/plugins").UserWithRole;
196
- }>;
197
- adminUpdateUser: import("better-auth").StrictEndpoint<"/admin/update-user", {
198
- method: "POST";
199
- body: import("better-auth").ZodObject<{
200
- userId: import("better-auth").ZodCoercedString<unknown>;
201
- data: import("better-auth").ZodRecord<import("better-auth").ZodAny, import("better-auth").ZodAny>;
202
- }, import("better-auth").$strip>;
203
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
204
- session: {
205
- user: import("better-auth/plugins").UserWithRole;
206
- session: import("better-auth").Session;
207
- };
208
- }>)[];
209
- metadata: {
210
- openapi: {
211
- operationId: string;
212
- summary: string;
213
- description: string;
214
- responses: {
215
- 200: {
216
- description: string;
217
- content: {
218
- "application/json": {
219
- schema: {
220
- type: "object";
221
- properties: {
222
- user: {
223
- $ref: string;
224
- };
225
- };
226
- };
227
- };
228
- };
229
- };
230
- };
231
- };
232
- };
233
- } & {
234
- use: any[];
235
- }, import("better-auth/plugins").UserWithRole>;
236
- listUsers: import("better-auth").StrictEndpoint<"/admin/list-users", {
237
- method: "GET";
238
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
239
- session: {
240
- user: import("better-auth/plugins").UserWithRole;
241
- session: import("better-auth").Session;
242
- };
243
- }>)[];
244
- query: import("better-auth").ZodObject<{
245
- searchValue: import("better-auth").ZodOptional<import("better-auth").ZodString>;
246
- searchField: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
247
- name: "name";
248
- email: "email";
249
- }>>;
250
- searchOperator: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
251
- contains: "contains";
252
- starts_with: "starts_with";
253
- ends_with: "ends_with";
254
- }>>;
255
- limit: import("better-auth").ZodOptional<import("better-auth").ZodUnion<[import("better-auth").ZodString, import("better-auth").ZodNumber]>>;
256
- offset: import("better-auth").ZodOptional<import("better-auth").ZodUnion<[import("better-auth").ZodString, import("better-auth").ZodNumber]>>;
257
- sortBy: import("better-auth").ZodOptional<import("better-auth").ZodString>;
258
- sortDirection: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
259
- asc: "asc";
260
- desc: "desc";
261
- }>>;
262
- filterField: import("better-auth").ZodOptional<import("better-auth").ZodString>;
263
- filterValue: import("better-auth").ZodOptional<import("better-auth").ZodUnion<[import("better-auth").ZodUnion<[import("better-auth").ZodString, import("better-auth").ZodNumber]>, import("better-auth").ZodBoolean]>>;
264
- filterOperator: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
265
- eq: "eq";
266
- ne: "ne";
267
- lt: "lt";
268
- lte: "lte";
269
- gt: "gt";
270
- gte: "gte";
271
- contains: "contains";
272
- }>>;
273
- }, import("better-auth").$strip>;
274
- metadata: {
275
- openapi: {
276
- operationId: string;
277
- summary: string;
278
- description: string;
279
- responses: {
280
- 200: {
281
- description: string;
282
- content: {
283
- "application/json": {
284
- schema: {
285
- type: "object";
286
- properties: {
287
- users: {
288
- type: string;
289
- items: {
290
- $ref: string;
291
- };
292
- };
293
- total: {
294
- type: string;
295
- };
296
- limit: {
297
- type: string;
298
- };
299
- offset: {
300
- type: string;
301
- };
302
- };
303
- required: string[];
304
- };
305
- };
306
- };
307
- };
308
- };
309
- };
310
- };
311
- } & {
312
- use: any[];
313
- }, {
314
- users: import("better-auth/plugins").UserWithRole[];
315
- total: number;
316
- limit: number | undefined;
317
- offset: number | undefined;
318
- } | {
319
- users: never[];
320
- total: number;
321
- }>;
322
- listUserSessions: import("better-auth").StrictEndpoint<"/admin/list-user-sessions", {
323
- method: "POST";
324
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
325
- session: {
326
- user: import("better-auth/plugins").UserWithRole;
327
- session: import("better-auth").Session;
328
- };
329
- }>)[];
330
- body: import("better-auth").ZodObject<{
331
- userId: import("better-auth").ZodCoercedString<unknown>;
332
- }, import("better-auth").$strip>;
333
- metadata: {
334
- openapi: {
335
- operationId: string;
336
- summary: string;
337
- description: string;
338
- responses: {
339
- 200: {
340
- description: string;
341
- content: {
342
- "application/json": {
343
- schema: {
344
- type: "object";
345
- properties: {
346
- sessions: {
347
- type: string;
348
- items: {
349
- $ref: string;
350
- };
351
- };
352
- };
353
- };
354
- };
355
- };
356
- };
357
- };
358
- };
359
- };
360
- } & {
361
- use: any[];
362
- }, {
363
- sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
364
- }>;
365
- unbanUser: import("better-auth").StrictEndpoint<"/admin/unban-user", {
366
- method: "POST";
367
- body: import("better-auth").ZodObject<{
368
- userId: import("better-auth").ZodCoercedString<unknown>;
369
- }, import("better-auth").$strip>;
370
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
371
- session: {
372
- user: import("better-auth/plugins").UserWithRole;
373
- session: import("better-auth").Session;
374
- };
375
- }>)[];
376
- metadata: {
377
- openapi: {
378
- operationId: string;
379
- summary: string;
380
- description: string;
381
- responses: {
382
- 200: {
383
- description: string;
384
- content: {
385
- "application/json": {
386
- schema: {
387
- type: "object";
388
- properties: {
389
- user: {
390
- $ref: string;
391
- };
392
- };
393
- };
394
- };
395
- };
396
- };
397
- };
398
- };
399
- };
400
- } & {
401
- use: any[];
402
- }, {
403
- user: {
404
- id: string;
405
- createdAt: Date;
406
- updatedAt: Date;
407
- email: string;
408
- emailVerified: boolean;
409
- name: string;
410
- image?: string | null | undefined;
411
- } & Record<string, any>;
412
- }>;
413
- banUser: import("better-auth").StrictEndpoint<"/admin/ban-user", {
414
- method: "POST";
415
- body: import("better-auth").ZodObject<{
416
- userId: import("better-auth").ZodCoercedString<unknown>;
417
- banReason: import("better-auth").ZodOptional<import("better-auth").ZodString>;
418
- banExpiresIn: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
419
- }, import("better-auth").$strip>;
420
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
421
- session: {
422
- user: import("better-auth/plugins").UserWithRole;
423
- session: import("better-auth").Session;
424
- };
425
- }>)[];
426
- metadata: {
427
- openapi: {
428
- operationId: string;
429
- summary: string;
430
- description: string;
431
- responses: {
432
- 200: {
433
- description: string;
434
- content: {
435
- "application/json": {
436
- schema: {
437
- type: "object";
438
- properties: {
439
- user: {
440
- $ref: string;
441
- };
442
- };
443
- };
444
- };
445
- };
446
- };
447
- };
448
- };
449
- };
450
- } & {
451
- use: any[];
452
- }, {
453
- user: {
454
- id: string;
455
- createdAt: Date;
456
- updatedAt: Date;
457
- email: string;
458
- emailVerified: boolean;
459
- name: string;
460
- image?: string | null | undefined;
461
- } & Record<string, any>;
462
- }>;
463
- impersonateUser: import("better-auth").StrictEndpoint<"/admin/impersonate-user", {
464
- method: "POST";
465
- body: import("better-auth").ZodObject<{
466
- userId: import("better-auth").ZodCoercedString<unknown>;
467
- }, import("better-auth").$strip>;
468
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
469
- session: {
470
- user: import("better-auth/plugins").UserWithRole;
471
- session: import("better-auth").Session;
472
- };
473
- }>)[];
474
- metadata: {
475
- openapi: {
476
- operationId: string;
477
- summary: string;
478
- description: string;
479
- responses: {
480
- 200: {
481
- description: string;
482
- content: {
483
- "application/json": {
484
- schema: {
485
- type: "object";
486
- properties: {
487
- session: {
488
- $ref: string;
489
- };
490
- user: {
491
- $ref: string;
492
- };
493
- };
494
- };
495
- };
496
- };
497
- };
498
- };
499
- };
500
- };
501
- } & {
502
- use: any[];
503
- }, {
504
- session: {
505
- id: string;
506
- createdAt: Date;
507
- updatedAt: Date;
508
- userId: string;
509
- expiresAt: Date;
510
- token: string;
511
- ipAddress?: string | null | undefined;
512
- userAgent?: string | null | undefined;
513
- };
514
- user: {
515
- id: string;
516
- createdAt: Date;
517
- updatedAt: Date;
518
- email: string;
519
- emailVerified: boolean;
520
- name: string;
521
- image?: string | null | undefined;
522
- };
523
- }>;
524
- stopImpersonating: import("better-auth").StrictEndpoint<"/admin/stop-impersonating", {
525
- method: "POST";
526
- requireHeaders: true;
527
- } & {
528
- use: any[];
529
- }, {
530
- session: import("better-auth").Session & Record<string, any>;
531
- user: import("better-auth").User & Record<string, any>;
532
- }>;
533
- revokeUserSession: import("better-auth").StrictEndpoint<"/admin/revoke-user-session", {
534
- method: "POST";
535
- body: import("better-auth").ZodObject<{
536
- sessionToken: import("better-auth").ZodString;
537
- }, import("better-auth").$strip>;
538
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
539
- session: {
540
- user: import("better-auth/plugins").UserWithRole;
541
- session: import("better-auth").Session;
542
- };
543
- }>)[];
544
- metadata: {
545
- openapi: {
546
- operationId: string;
547
- summary: string;
548
- description: string;
549
- responses: {
550
- 200: {
551
- description: string;
552
- content: {
553
- "application/json": {
554
- schema: {
555
- type: "object";
556
- properties: {
557
- success: {
558
- type: string;
559
- };
560
- };
561
- };
562
- };
563
- };
564
- };
565
- };
566
- };
567
- };
568
- } & {
569
- use: any[];
570
- }, {
571
- success: boolean;
572
- }>;
573
- revokeUserSessions: import("better-auth").StrictEndpoint<"/admin/revoke-user-sessions", {
574
- method: "POST";
575
- body: import("better-auth").ZodObject<{
576
- userId: import("better-auth").ZodCoercedString<unknown>;
577
- }, import("better-auth").$strip>;
578
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
579
- session: {
580
- user: import("better-auth/plugins").UserWithRole;
581
- session: import("better-auth").Session;
582
- };
583
- }>)[];
584
- metadata: {
585
- openapi: {
586
- operationId: string;
587
- summary: string;
588
- description: string;
589
- responses: {
590
- 200: {
591
- description: string;
592
- content: {
593
- "application/json": {
594
- schema: {
595
- type: "object";
596
- properties: {
597
- success: {
598
- type: string;
599
- };
600
- };
601
- };
602
- };
603
- };
604
- };
605
- };
606
- };
607
- };
608
- } & {
609
- use: any[];
610
- }, {
611
- success: boolean;
612
- }>;
613
- removeUser: import("better-auth").StrictEndpoint<"/admin/remove-user", {
614
- method: "POST";
615
- body: import("better-auth").ZodObject<{
616
- userId: import("better-auth").ZodCoercedString<unknown>;
617
- }, import("better-auth").$strip>;
618
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
619
- session: {
620
- user: import("better-auth/plugins").UserWithRole;
621
- session: import("better-auth").Session;
622
- };
623
- }>)[];
624
- metadata: {
625
- openapi: {
626
- operationId: string;
627
- summary: string;
628
- description: string;
629
- responses: {
630
- 200: {
631
- description: string;
632
- content: {
633
- "application/json": {
634
- schema: {
635
- type: "object";
636
- properties: {
637
- success: {
638
- type: string;
639
- };
640
- };
641
- };
642
- };
643
- };
644
- };
645
- };
646
- };
647
- };
648
- } & {
649
- use: any[];
650
- }, {
651
- success: boolean;
652
- }>;
653
- setUserPassword: import("better-auth").StrictEndpoint<"/admin/set-user-password", {
654
- method: "POST";
655
- body: import("better-auth").ZodObject<{
656
- newPassword: import("better-auth").ZodString;
657
- userId: import("better-auth").ZodCoercedString<unknown>;
658
- }, import("better-auth").$strip>;
659
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
660
- session: {
661
- user: import("better-auth/plugins").UserWithRole;
662
- session: import("better-auth").Session;
663
- };
664
- }>)[];
665
- metadata: {
666
- openapi: {
667
- operationId: string;
668
- summary: string;
669
- description: string;
670
- responses: {
671
- 200: {
672
- description: string;
673
- content: {
674
- "application/json": {
675
- schema: {
676
- type: "object";
677
- properties: {
678
- status: {
679
- type: string;
680
- };
681
- };
682
- };
683
- };
684
- };
685
- };
686
- };
687
- };
688
- };
689
- } & {
690
- use: any[];
691
- }, {
692
- status: boolean;
693
- }>;
694
- userHasPermission: import("better-auth").StrictEndpoint<"/admin/has-permission", {
695
- method: "POST";
696
- body: import("better-auth").ZodIntersection<import("better-auth").ZodObject<{
697
- userId: import("better-auth").ZodOptional<import("better-auth").ZodCoercedString<unknown>>;
698
- role: import("better-auth").ZodOptional<import("better-auth").ZodString>;
699
- }, import("better-auth").$strip>, import("better-auth").ZodUnion<readonly [import("better-auth").ZodObject<{
700
- permission: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>;
701
- permissions: import("better-auth").ZodUndefined;
702
- }, import("better-auth").$strip>, import("better-auth").ZodObject<{
703
- permission: import("better-auth").ZodUndefined;
704
- permissions: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>;
705
- }, import("better-auth").$strip>]>>;
706
- metadata: {
707
- openapi: {
708
- description: string;
709
- requestBody: {
710
- content: {
711
- "application/json": {
712
- schema: {
713
- type: "object";
714
- properties: {
715
- permission: {
716
- type: string;
717
- description: string;
718
- deprecated: boolean;
719
- };
720
- permissions: {
721
- type: string;
722
- description: string;
723
- };
724
- };
725
- required: string[];
726
- };
727
- };
728
- };
729
- };
730
- responses: {
731
- "200": {
732
- description: string;
733
- content: {
734
- "application/json": {
735
- schema: {
736
- type: "object";
737
- properties: {
738
- error: {
739
- type: string;
740
- };
741
- success: {
742
- type: string;
743
- };
744
- };
745
- required: string[];
746
- };
747
- };
748
- };
749
- };
750
- };
751
- };
752
- $Infer: {
753
- body: ({
754
- permission: {
755
- readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
756
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
757
- };
758
- permissions?: never | undefined;
759
- } | {
760
- permissions: {
761
- readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
762
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
763
- };
764
- permission?: never | undefined;
765
- }) & {
766
- userId?: string | undefined;
767
- role?: "user" | "admin" | undefined;
768
- };
769
- };
770
- };
771
- } & {
772
- use: any[];
773
- }, {
774
- error: null;
775
- success: boolean;
776
- }>;
777
- };
778
- $ERROR_CODES: {
779
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
780
- readonly USER_ALREADY_EXISTS: "User already exists.";
781
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
782
- readonly YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself";
783
- readonly YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role";
784
- readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users";
785
- readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users";
786
- readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions";
787
- readonly YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users";
788
- readonly YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users";
789
- readonly YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions";
790
- readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users";
791
- readonly YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password";
792
- readonly BANNED_USER: "You have been banned from this application";
793
- readonly YOU_ARE_NOT_ALLOWED_TO_GET_USER: "You are not allowed to get user";
794
- readonly NO_DATA_TO_UPDATE: "No data to update";
795
- readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
796
- readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
797
- readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
798
- };
799
- schema: {
800
- user: {
801
- fields: {
802
- role: {
803
- type: "string";
804
- required: false;
805
- input: false;
806
- };
807
- banned: {
808
- type: "boolean";
809
- defaultValue: false;
810
- required: false;
811
- input: false;
812
- };
813
- banReason: {
814
- type: "string";
815
- required: false;
816
- input: false;
817
- };
818
- banExpires: {
819
- type: "date";
820
- required: false;
821
- input: false;
822
- };
823
- };
824
- };
825
- session: {
826
- fields: {
827
- impersonatedBy: {
828
- type: "string";
829
- required: false;
830
- };
831
- };
832
- };
833
- };
834
- options: any;
835
- }];
836
- secret: string | undefined;
837
- appName?: string | undefined;
838
- baseURL?: string | undefined;
839
- basePath?: string | undefined;
840
- secondaryStorage?: import("better-auth").SecondaryStorage | undefined;
841
- emailVerification?: {
842
- sendVerificationEmail?: (data: {
843
- user: import("better-auth").User;
844
- url: string;
845
- token: string;
846
- }, request?: Request) => Promise<void>;
847
- sendOnSignUp?: boolean;
848
- sendOnSignIn?: boolean;
849
- autoSignInAfterVerification?: boolean;
850
- expiresIn?: number;
851
- onEmailVerification?: (user: import("better-auth").User, request?: Request) => Promise<void>;
852
- afterEmailVerification?: (user: import("better-auth").User, request?: Request) => Promise<void>;
853
- } | undefined;
854
- emailAndPassword?: {
855
- enabled: boolean;
856
- disableSignUp?: boolean;
857
- requireEmailVerification?: boolean;
858
- maxPasswordLength?: number;
859
- minPasswordLength?: number;
860
- sendResetPassword?: (data: {
861
- user: import("better-auth").User;
862
- url: string;
863
- token: string;
864
- }, request?: Request) => Promise<void>;
865
- resetPasswordTokenExpiresIn?: number;
866
- onPasswordReset?: (data: {
867
- user: import("better-auth").User;
868
- }, request?: Request) => Promise<void>;
869
- password?: {
870
- hash?: (password: string) => Promise<string>;
871
- verify?: (data: {
872
- hash: string;
873
- password: string;
874
- }) => Promise<boolean>;
875
- };
876
- autoSignIn?: boolean;
877
- revokeSessionsOnPasswordReset?: boolean;
878
- } | undefined;
879
- socialProviders?: import("@better-auth/core/dist/index-CVLGS-cz.mjs").w | undefined;
880
- user?: {
881
- modelName?: string;
882
- fields?: Partial<Record<"name" | "createdAt" | "updatedAt" | "email" | "emailVerified" | "image", string>>;
883
- additionalFields?: {
884
- [key: string]: import("better-auth").DBFieldAttribute;
885
- };
886
- changeEmail?: {
887
- enabled: boolean;
888
- sendChangeEmailVerification?: (data: {
889
- user: import("better-auth").User;
890
- newEmail: string;
891
- url: string;
892
- token: string;
893
- }, request?: Request) => Promise<void>;
894
- sendChangeEmailConfirmation?: (data: {
895
- user: import("better-auth").User;
896
- newEmail: string;
897
- url: string;
898
- token: string;
899
- }, request?: Request) => Promise<void>;
900
- updateEmailWithoutVerification?: boolean;
901
- };
902
- deleteUser?: {
903
- enabled?: boolean;
904
- sendDeleteAccountVerification?: (data: {
905
- user: import("better-auth").User;
906
- url: string;
907
- token: string;
908
- }, request?: Request) => Promise<void>;
909
- beforeDelete?: (user: import("better-auth").User, request?: Request) => Promise<void>;
910
- afterDelete?: (user: import("better-auth").User, request?: Request) => Promise<void>;
911
- deleteTokenExpiresIn?: number;
912
- };
913
- } | undefined;
914
- session?: {
915
- modelName?: string;
916
- fields?: Partial<Record<"createdAt" | "updatedAt" | "userId" | "expiresAt" | "token" | "ipAddress" | "userAgent", string>>;
917
- expiresIn?: number;
918
- updateAge?: number;
919
- disableSessionRefresh?: boolean;
920
- additionalFields?: {
921
- [key: string]: import("better-auth").DBFieldAttribute;
922
- };
923
- storeSessionInDatabase?: boolean;
924
- preserveSessionInDatabase?: boolean;
925
- cookieCache?: {
926
- maxAge?: number;
927
- enabled?: boolean;
928
- strategy?: "compact" | "jwt" | "jwe";
929
- refreshCache?: boolean | {
930
- updateAge?: number;
931
- };
932
- version?: string | ((session: import("better-auth").Session & Record<string, any>, user: import("better-auth").User & Record<string, any>) => string) | ((session: import("better-auth").Session & Record<string, any>, user: import("better-auth").User & Record<string, any>) => Promise<string>);
933
- };
934
- freshAge?: number;
935
- } | undefined;
936
- account?: {
937
- modelName?: string;
938
- fields?: Partial<Record<"createdAt" | "updatedAt" | "userId" | "password" | "providerId" | "accountId" | "accessToken" | "refreshToken" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope", string>>;
939
- additionalFields?: {
940
- [key: string]: import("better-auth").DBFieldAttribute;
941
- };
942
- updateAccountOnSignIn?: boolean;
943
- accountLinking?: {
944
- enabled?: boolean;
945
- trustedProviders?: Array<import("better-auth").LiteralUnion<import("@better-auth/core/dist/index-CVLGS-cz.mjs").S[number] | "email-password", string>>;
946
- allowDifferentEmails?: boolean;
947
- allowUnlinkingAll?: boolean;
948
- updateUserInfoOnLink?: boolean;
949
- };
950
- encryptOAuthTokens?: boolean;
951
- skipStateCookieCheck?: boolean;
952
- storeStateStrategy?: "database" | "cookie";
953
- storeAccountCookie?: boolean;
954
- } | undefined;
955
- verification?: {
956
- modelName?: string;
957
- fields?: Partial<Record<"createdAt" | "updatedAt" | "expiresAt" | "value" | "identifier", string>>;
958
- disableCleanup?: boolean;
959
- } | undefined;
960
- trustedOrigins?: (string[] | ((request: Request) => string[] | Promise<string[]>)) | undefined;
961
- rateLimit?: import("better-auth").BetterAuthRateLimitOptions | undefined;
962
- advanced?: import("better-auth").BetterAuthAdvancedOptions | undefined;
963
- logger?: import("better-auth").Logger | undefined;
964
- databaseHooks?: {
965
- user?: {
966
- create?: {
967
- before?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
968
- data: {
969
- id?: string | undefined;
970
- createdAt?: Date | undefined;
971
- updatedAt?: Date | undefined;
972
- email?: string | undefined;
973
- emailVerified?: boolean | undefined;
974
- name?: string | undefined;
975
- image?: string | null | undefined;
976
- } & Record<string, any>;
977
- }>;
978
- after?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
979
- };
980
- update?: {
981
- before?: (user: Partial<import("better-auth").User> & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
982
- data: {
983
- [x: string]: any;
984
- id?: string | undefined;
985
- createdAt?: Date | undefined;
986
- updatedAt?: Date | undefined;
987
- email?: string | undefined;
988
- emailVerified?: boolean | undefined;
989
- name?: string | undefined;
990
- image?: string | null | undefined;
991
- };
992
- }>;
993
- after?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
994
- };
995
- delete?: {
996
- before?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void>;
997
- after?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
998
- };
999
- };
1000
- session?: {
1001
- create?: {
1002
- before?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
1003
- data: {
1004
- id?: string | undefined;
1005
- createdAt?: Date | undefined;
1006
- updatedAt?: Date | undefined;
1007
- userId?: string | undefined;
1008
- expiresAt?: Date | undefined;
1009
- token?: string | undefined;
1010
- ipAddress?: string | null | undefined;
1011
- userAgent?: string | null | undefined;
1012
- } & Record<string, any>;
1013
- }>;
1014
- after?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
1015
- };
1016
- update?: {
1017
- before?: (session: Partial<import("better-auth").Session> & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
1018
- data: {
1019
- [x: string]: any;
1020
- id?: string | undefined;
1021
- createdAt?: Date | undefined;
1022
- updatedAt?: Date | undefined;
1023
- userId?: string | undefined;
1024
- expiresAt?: Date | undefined;
1025
- token?: string | undefined;
1026
- ipAddress?: string | null | undefined;
1027
- userAgent?: string | null | undefined;
1028
- };
1029
- }>;
1030
- after?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
1031
- };
1032
- delete?: {
1033
- before?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void>;
1034
- after?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
1035
- };
1036
- };
1037
- account?: {
1038
- create?: {
1039
- before?: (account: import("better-auth").Account, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
1040
- data: {
1041
- id?: string | undefined;
1042
- createdAt?: Date | undefined;
1043
- updatedAt?: Date | undefined;
1044
- providerId?: string | undefined;
1045
- accountId?: string | undefined;
1046
- userId?: string | undefined;
1047
- accessToken?: string | null | undefined;
1048
- refreshToken?: string | null | undefined;
1049
- idToken?: string | null | undefined;
1050
- accessTokenExpiresAt?: Date | null | undefined;
1051
- refreshTokenExpiresAt?: Date | null | undefined;
1052
- scope?: string | null | undefined;
1053
- password?: string | null | undefined;
1054
- } & Record<string, any>;
1055
- }>;
1056
- after?: (account: import("better-auth").Account, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
1057
- };
1058
- update?: {
1059
- before?: (account: Partial<import("better-auth").Account> & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
1060
- data: {
1061
- [x: string]: any;
1062
- id?: string | undefined;
1063
- createdAt?: Date | undefined;
1064
- updatedAt?: Date | undefined;
1065
- providerId?: string | undefined;
1066
- accountId?: string | undefined;
1067
- userId?: string | undefined;
1068
- accessToken?: string | null | undefined;
1069
- refreshToken?: string | null | undefined;
1070
- idToken?: string | null | undefined;
1071
- accessTokenExpiresAt?: Date | null | undefined;
1072
- refreshTokenExpiresAt?: Date | null | undefined;
1073
- scope?: string | null | undefined;
1074
- password?: string | null | undefined;
1075
- };
1076
- }>;
1077
- after?: (account: import("better-auth").Account & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
1078
- };
1079
- delete?: {
1080
- before?: (account: import("better-auth").Account & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void>;
1081
- after?: (account: import("better-auth").Account & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
1082
- };
1083
- };
1084
- verification?: {
1085
- create?: {
1086
- before?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
1087
- data: {
1088
- id?: string | undefined;
1089
- createdAt?: Date | undefined;
1090
- updatedAt?: Date | undefined;
1091
- value?: string | undefined;
1092
- expiresAt?: Date | undefined;
1093
- identifier?: string | undefined;
1094
- } & Record<string, any>;
1095
- }>;
1096
- after?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
1097
- };
1098
- update?: {
1099
- before?: (verification: Partial<import("better-auth").Verification> & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
1100
- data: {
1101
- [x: string]: any;
1102
- id?: string | undefined;
1103
- createdAt?: Date | undefined;
1104
- updatedAt?: Date | undefined;
1105
- value?: string | undefined;
1106
- expiresAt?: Date | undefined;
1107
- identifier?: string | undefined;
1108
- };
1109
- }>;
1110
- after?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
1111
- };
1112
- delete?: {
1113
- before?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void>;
1114
- after?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
1115
- };
1116
- };
1117
- } | undefined;
1118
- onAPIError?: {
1119
- throw?: boolean;
1120
- onError?: (error: unknown, ctx: import("better-auth").AuthContext) => void | Promise<void>;
1121
- errorURL?: string;
1122
- customizeDefaultErrorPage?: {
1123
- colors?: {
1124
- background?: string;
1125
- foreground?: string;
1126
- primary?: string;
1127
- primaryForeground?: string;
1128
- mutedForeground?: string;
1129
- border?: string;
1130
- destructive?: string;
1131
- titleBorder?: string;
1132
- titleColor?: string;
1133
- gridColor?: string;
1134
- cardBackground?: string;
1135
- cornerBorder?: string;
1136
- };
1137
- size?: {
1138
- radiusSm?: string;
1139
- radiusMd?: string;
1140
- radiusLg?: string;
1141
- textSm?: string;
1142
- text2xl?: string;
1143
- text4xl?: string;
1144
- text6xl?: string;
1145
- };
1146
- font?: {
1147
- defaultFamily?: string;
1148
- monoFamily?: string;
1149
- };
1150
- disableTitleBorder?: boolean;
1151
- disableCornerDecorations?: boolean;
1152
- disableBackgroundGrid?: boolean;
1153
- };
1154
- } | undefined;
1155
- hooks?: {
1156
- before?: import("better-auth/plugins").AuthMiddleware;
1157
- after?: import("better-auth/plugins").AuthMiddleware;
1158
- } | undefined;
1159
- disabledPaths?: string[] | undefined;
1160
- telemetry?: {
1161
- enabled?: boolean;
1162
- debug?: boolean;
1163
- } | undefined;
1164
- experimental?: {
1165
- joins?: boolean;
1166
- };
1167
- database: (options: import("better-auth").BetterAuthOptions) => import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
1168
- }>;