deesse 0.1.19 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,63 @@
1
1
  export declare const authClient: {
2
+ signIn: {
3
+ social: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
4
+ provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
5
+ callbackURL?: string | undefined;
6
+ newUserCallbackURL?: string | undefined;
7
+ errorCallbackURL?: string | undefined;
8
+ disableRedirect?: boolean | undefined;
9
+ idToken?: {
10
+ token: string;
11
+ nonce?: string | undefined;
12
+ accessToken?: string | undefined;
13
+ refreshToken?: string | undefined;
14
+ expiresAt?: number | undefined;
15
+ } | undefined;
16
+ scopes?: string[] | undefined;
17
+ requestSignUp?: boolean | undefined;
18
+ loginHint?: string | undefined;
19
+ additionalData?: Record<string, any> | undefined;
20
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
21
+ provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
22
+ callbackURL?: string | undefined;
23
+ newUserCallbackURL?: string | undefined;
24
+ errorCallbackURL?: string | undefined;
25
+ disableRedirect?: boolean | undefined;
26
+ idToken?: {
27
+ token: string;
28
+ nonce?: string | undefined;
29
+ accessToken?: string | undefined;
30
+ refreshToken?: string | undefined;
31
+ expiresAt?: number | undefined;
32
+ } | undefined;
33
+ scopes?: string[] | undefined;
34
+ requestSignUp?: boolean | undefined;
35
+ loginHint?: string | undefined;
36
+ additionalData?: Record<string, any> | undefined;
37
+ } & {
38
+ fetchOptions?: FetchOptions | undefined;
39
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
40
+ redirect: boolean;
41
+ url: string;
42
+ } | {
43
+ redirect: boolean;
44
+ token: string;
45
+ url: undefined;
46
+ user: {
47
+ id: string;
48
+ createdAt: Date;
49
+ updatedAt: Date;
50
+ email: string;
51
+ emailVerified: boolean;
52
+ name: string;
53
+ image?: string | null | undefined | undefined;
54
+ };
55
+ }>, {
56
+ code?: string | undefined;
57
+ message?: string | undefined;
58
+ }, FetchOptions["throw"] extends true ? true : false>>;
59
+ };
60
+ } & {
2
61
  signOut: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
3
62
  query?: Record<string, any> | undefined;
4
63
  fetchOptions?: FetchOptions | undefined;
@@ -8,6 +67,81 @@ export declare const authClient: {
8
67
  code?: string | undefined;
9
68
  message?: string | undefined;
10
69
  }, FetchOptions["throw"] extends true ? true : false>>;
70
+ } & {
71
+ signUp: {
72
+ email: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
73
+ name: string;
74
+ email: string;
75
+ password: string;
76
+ image?: string | undefined;
77
+ callbackURL?: string | undefined;
78
+ rememberMe?: boolean | undefined;
79
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
80
+ email: string;
81
+ name: string;
82
+ password: string;
83
+ image?: string | undefined;
84
+ callbackURL?: string | undefined;
85
+ fetchOptions?: FetchOptions | undefined;
86
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
87
+ token: null;
88
+ user: {
89
+ id: string;
90
+ createdAt: Date;
91
+ updatedAt: Date;
92
+ email: string;
93
+ emailVerified: boolean;
94
+ name: string;
95
+ image?: string | null | undefined | undefined;
96
+ };
97
+ } | {
98
+ token: string;
99
+ user: {
100
+ id: string;
101
+ createdAt: Date;
102
+ updatedAt: Date;
103
+ email: string;
104
+ emailVerified: boolean;
105
+ name: string;
106
+ image?: string | null | undefined | undefined;
107
+ };
108
+ }>, {
109
+ code?: string | undefined;
110
+ message?: string | undefined;
111
+ }, FetchOptions["throw"] extends true ? true : false>>;
112
+ };
113
+ } & {
114
+ signIn: {
115
+ email: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
116
+ email: string;
117
+ password: string;
118
+ callbackURL?: string | undefined;
119
+ rememberMe?: boolean | undefined;
120
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
121
+ email: string;
122
+ password: string;
123
+ callbackURL?: string | undefined;
124
+ rememberMe?: boolean | undefined;
125
+ } & {
126
+ fetchOptions?: FetchOptions | undefined;
127
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
128
+ redirect: boolean;
129
+ token: string;
130
+ url?: string | undefined;
131
+ user: {
132
+ id: string;
133
+ createdAt: Date;
134
+ updatedAt: Date;
135
+ email: string;
136
+ emailVerified: boolean;
137
+ name: string;
138
+ image?: string | null | undefined | undefined;
139
+ };
140
+ }, {
141
+ code?: string | undefined;
142
+ message?: string | undefined;
143
+ }, FetchOptions["throw"] extends true ? true : false>>;
144
+ };
11
145
  } & {
12
146
  resetPassword: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
13
147
  newPassword: string;
@@ -97,6 +231,20 @@ export declare const authClient: {
97
231
  code?: string | undefined;
98
232
  message?: string | undefined;
99
233
  }, FetchOptions["throw"] extends true ? true : false>>;
234
+ } & {
235
+ updateUser: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<Partial<{}> & {
236
+ name?: string | undefined;
237
+ image?: string | undefined;
238
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
239
+ image?: (string | null) | undefined;
240
+ name?: string | undefined;
241
+ fetchOptions?: FetchOptions | undefined;
242
+ } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
243
+ status: boolean;
244
+ }, {
245
+ code?: string | undefined;
246
+ message?: string | undefined;
247
+ }, FetchOptions["throw"] extends true ? true : false>>;
100
248
  } & {
101
249
  deleteUser: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
102
250
  callbackURL?: string | undefined;
@@ -147,6 +295,23 @@ export declare const authClient: {
147
295
  message?: string | undefined;
148
296
  }, FetchOptions["throw"] extends true ? true : false>>;
149
297
  };
298
+ } & {
299
+ listSessions: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
300
+ query?: Record<string, any> | undefined;
301
+ fetchOptions?: FetchOptions | undefined;
302
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth/react").Prettify<{
303
+ id: string;
304
+ createdAt: Date;
305
+ updatedAt: Date;
306
+ userId: string;
307
+ expiresAt: Date;
308
+ token: string;
309
+ ipAddress?: string | null | undefined | undefined;
310
+ userAgent?: string | null | undefined | undefined;
311
+ }>[], {
312
+ code?: string | undefined;
313
+ message?: string | undefined;
314
+ }, FetchOptions["throw"] extends true ? true : false>>;
150
315
  } & {
151
316
  revokeSession: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
152
317
  token: string;
@@ -329,171 +494,6 @@ export declare const authClient: {
329
494
  code?: string | undefined;
330
495
  message?: string | undefined;
331
496
  }, FetchOptions["throw"] extends true ? true : false>>;
332
- } & {
333
- signIn: {
334
- social: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
335
- provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
336
- callbackURL?: string | undefined;
337
- newUserCallbackURL?: string | undefined;
338
- errorCallbackURL?: string | undefined;
339
- disableRedirect?: boolean | undefined;
340
- idToken?: {
341
- token: string;
342
- nonce?: string | undefined;
343
- accessToken?: string | undefined;
344
- refreshToken?: string | undefined;
345
- expiresAt?: number | undefined;
346
- } | undefined;
347
- scopes?: string[] | undefined;
348
- requestSignUp?: boolean | undefined;
349
- loginHint?: string | undefined;
350
- additionalData?: Record<string, any> | undefined;
351
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
352
- provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
353
- callbackURL?: string | undefined;
354
- newUserCallbackURL?: string | undefined;
355
- errorCallbackURL?: string | undefined;
356
- disableRedirect?: boolean | undefined;
357
- idToken?: {
358
- token: string;
359
- nonce?: string | undefined;
360
- accessToken?: string | undefined;
361
- refreshToken?: string | undefined;
362
- expiresAt?: number | undefined;
363
- } | undefined;
364
- scopes?: string[] | undefined;
365
- requestSignUp?: boolean | undefined;
366
- loginHint?: string | undefined;
367
- additionalData?: Record<string, any> | undefined;
368
- } & {
369
- fetchOptions?: FetchOptions | undefined;
370
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
371
- redirect: boolean;
372
- url: string;
373
- } | {
374
- redirect: boolean;
375
- token: string;
376
- url: undefined;
377
- user: {
378
- id: string;
379
- createdAt: Date;
380
- updatedAt: Date;
381
- email: string;
382
- emailVerified: boolean;
383
- name: string;
384
- image?: string | null | undefined | undefined;
385
- };
386
- }>, {
387
- code?: string | undefined;
388
- message?: string | undefined;
389
- }, FetchOptions["throw"] extends true ? true : false>>;
390
- };
391
- } & {
392
- signUp: {
393
- email: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
394
- name: string;
395
- email: string;
396
- password: string;
397
- image?: string | undefined;
398
- callbackURL?: string | undefined;
399
- rememberMe?: boolean | undefined;
400
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
401
- email: string;
402
- name: string;
403
- password: string;
404
- image?: string | undefined;
405
- callbackURL?: string | undefined;
406
- fetchOptions?: FetchOptions | undefined;
407
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
408
- token: null;
409
- user: {
410
- id: string;
411
- createdAt: Date;
412
- updatedAt: Date;
413
- email: string;
414
- emailVerified: boolean;
415
- name: string;
416
- image?: string | null | undefined | undefined;
417
- };
418
- } | {
419
- token: string;
420
- user: {
421
- id: string;
422
- createdAt: Date;
423
- updatedAt: Date;
424
- email: string;
425
- emailVerified: boolean;
426
- name: string;
427
- image?: string | null | undefined | undefined;
428
- };
429
- }>, {
430
- code?: string | undefined;
431
- message?: string | undefined;
432
- }, FetchOptions["throw"] extends true ? true : false>>;
433
- };
434
- } & {
435
- signIn: {
436
- email: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<{
437
- email: string;
438
- password: string;
439
- callbackURL?: string | undefined;
440
- rememberMe?: boolean | undefined;
441
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
442
- email: string;
443
- password: string;
444
- callbackURL?: string | undefined;
445
- rememberMe?: boolean | undefined;
446
- } & {
447
- fetchOptions?: FetchOptions | undefined;
448
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
449
- redirect: boolean;
450
- token: string;
451
- url?: string | undefined;
452
- user: {
453
- id: string;
454
- createdAt: Date;
455
- updatedAt: Date;
456
- email: string;
457
- emailVerified: boolean;
458
- name: string;
459
- image?: string | null | undefined | undefined;
460
- };
461
- }, {
462
- code?: string | undefined;
463
- message?: string | undefined;
464
- }, FetchOptions["throw"] extends true ? true : false>>;
465
- };
466
- } & {
467
- updateUser: <FetchOptions extends import("better-auth/*").ClientFetchOption<Partial<Partial<{}> & {
468
- name?: string | undefined;
469
- image?: string | undefined;
470
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
471
- image?: (string | null) | undefined;
472
- name?: string | undefined;
473
- fetchOptions?: FetchOptions | undefined;
474
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
475
- status: boolean;
476
- }, {
477
- code?: string | undefined;
478
- message?: string | undefined;
479
- }, FetchOptions["throw"] extends true ? true : false>>;
480
- } & {
481
- listSessions: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
482
- query?: Record<string, any> | undefined;
483
- fetchOptions?: FetchOptions | undefined;
484
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth/react").Prettify<{
485
- id: string;
486
- createdAt: Date;
487
- updatedAt: Date;
488
- userId: string;
489
- expiresAt: Date;
490
- token: string;
491
- ipAddress?: string | null | undefined | undefined;
492
- userAgent?: string | null | undefined | undefined;
493
- }>[], {
494
- code?: string | undefined;
495
- message?: string | undefined;
496
- }, FetchOptions["throw"] extends true ? true : false>>;
497
497
  } & {
498
498
  getSession: <FetchOptions extends import("better-auth/*").ClientFetchOption<never, Partial<{
499
499
  disableCookieCache?: unknown;
@@ -1,5 +1,838 @@
1
1
  import { Config } from "../config/types";
2
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" | "set-password" | "update" | "delete" | "list" | "get" | "create" | "ban" | "impersonate")[] | undefined;
756
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
757
+ };
758
+ permissions?: never | undefined;
759
+ } | {
760
+ permissions: {
761
+ readonly user?: ("set-role" | "set-password" | "update" | "delete" | "list" | "get" | "create" | "ban" | "impersonate")[] | undefined;
762
+ readonly session?: ("delete" | "list" | "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
+ }];
3
836
  secret: string | undefined;
4
837
  appName?: string | undefined;
5
838
  baseURL?: string | undefined;
@@ -44,10 +877,9 @@ export declare const createAuth: (config: Config) => import("better-auth").Auth<
44
877
  revokeSessionsOnPasswordReset?: boolean;
45
878
  } | undefined;
46
879
  socialProviders?: import("@better-auth/core/dist/index-CVLGS-cz.mjs").w | undefined;
47
- plugins?: ([] | import("better-auth").BetterAuthPlugin[]) | undefined;
48
880
  user?: {
49
881
  modelName?: string;
50
- fields?: Partial<Record<"name" | "email" | "createdAt" | "updatedAt" | "emailVerified" | "image", string>>;
882
+ fields?: Partial<Record<"name" | "createdAt" | "updatedAt" | "email" | "emailVerified" | "image", string>>;
51
883
  additionalFields?: {
52
884
  [key: string]: import("better-auth").DBFieldAttribute;
53
885
  };
@@ -81,7 +913,7 @@ export declare const createAuth: (config: Config) => import("better-auth").Auth<
81
913
  } | undefined;
82
914
  session?: {
83
915
  modelName?: string;
84
- fields?: Partial<Record<"token" | "expiresAt" | "userId" | "createdAt" | "updatedAt" | "ipAddress" | "userAgent", string>>;
916
+ fields?: Partial<Record<"createdAt" | "updatedAt" | "userId" | "expiresAt" | "token" | "ipAddress" | "userAgent", string>>;
85
917
  expiresIn?: number;
86
918
  updateAge?: number;
87
919
  disableSessionRefresh?: boolean;
@@ -103,7 +935,7 @@ export declare const createAuth: (config: Config) => import("better-auth").Auth<
103
935
  } | undefined;
104
936
  account?: {
105
937
  modelName?: string;
106
- fields?: Partial<Record<"refreshToken" | "idToken" | "accessToken" | "password" | "providerId" | "accountId" | "userId" | "createdAt" | "updatedAt" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope", string>>;
938
+ fields?: Partial<Record<"createdAt" | "updatedAt" | "userId" | "password" | "refreshToken" | "idToken" | "accessToken" | "providerId" | "accountId" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope", string>>;
107
939
  additionalFields?: {
108
940
  [key: string]: import("better-auth").DBFieldAttribute;
109
941
  };
@@ -122,7 +954,7 @@ export declare const createAuth: (config: Config) => import("better-auth").Auth<
122
954
  } | undefined;
123
955
  verification?: {
124
956
  modelName?: string;
125
- fields?: Partial<Record<"expiresAt" | "createdAt" | "updatedAt" | "value" | "identifier", string>>;
957
+ fields?: Partial<Record<"createdAt" | "updatedAt" | "expiresAt" | "value" | "identifier", string>>;
126
958
  disableCleanup?: boolean;
127
959
  } | undefined;
128
960
  trustedOrigins?: (string[] | ((request: Request) => string[] | Promise<string[]>)) | undefined;
@@ -321,8 +1153,8 @@ export declare const createAuth: (config: Config) => import("better-auth").Auth<
321
1153
  };
322
1154
  } | undefined;
323
1155
  hooks?: {
324
- before?: import("@better-auth/core/api").AuthMiddleware;
325
- after?: import("@better-auth/core/api").AuthMiddleware;
1156
+ before?: import("better-auth/plugins").AuthMiddleware;
1157
+ after?: import("better-auth/plugins").AuthMiddleware;
326
1158
  } | undefined;
327
1159
  disabledPaths?: string[] | undefined;
328
1160
  telemetry?: {
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createAuth = void 0;
4
4
  const better_auth_1 = require("better-auth");
5
5
  const drizzle_1 = require("better-auth/adapters/drizzle");
6
+ const plugins_1 = require("better-auth/plugins");
6
7
  const createAuth = (config) => (0, better_auth_1.betterAuth)({
7
8
  database: (0, drizzle_1.drizzleAdapter)(config.database, { provider: "pg" }),
8
9
  ...config.auth,
10
+ plugins: [(0, plugins_1.admin)()],
9
11
  secret: process.env.DEESSE_SECRET,
10
12
  });
11
13
  exports.createAuth = createAuth;
@@ -1,11 +1,14 @@
1
- import { betterAuth, BetterAuthOptions } from "better-auth";
1
+ import { BetterAuthOptions } from "better-auth";
2
2
  import { drizzle as createDrizzle } from "drizzle-orm/node-postgres";
3
3
  import { Plugin } from "../plugins/types";
4
+ import { Collection } from "@deessejs/collections";
5
+ import { createAuth } from "../auth";
4
6
  export type Config = {
5
7
  database: ReturnType<typeof createDrizzle>;
6
8
  auth?: Omit<BetterAuthOptions, "secret" | "database">;
7
9
  plugins?: Plugin[];
10
+ collections?: Collection[];
8
11
  };
9
12
  export type FinalConfig = Config & {
10
- auth: ReturnType<typeof betterAuth>;
13
+ auth: ReturnType<typeof createAuth>;
11
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deesse",
3
- "version": "0.1.19",
3
+ "version": "0.1.22",
4
4
  "description": "The fullstack web framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,6 +37,7 @@
37
37
  "author": "",
38
38
  "license": "ISC",
39
39
  "dependencies": {
40
+ "@deessejs/collections": "^0.0.34",
40
41
  "better-auth": "^1.4.3",
41
42
  "pg": "^8.16.3"
42
43
  },