@monkeyplus/flow 6.0.36 → 6.0.38

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 (78) hide show
  1. package/cms/dist/assets/AuthForm-D9zqy79A.js +1 -0
  2. package/cms/dist/assets/Button-BxK__vWW.js +3 -0
  3. package/cms/dist/assets/Checkbox-ZAz-DF2K.js +1 -0
  4. package/cms/dist/assets/Cms-C6Sdowsy.js +1 -0
  5. package/cms/dist/assets/Cms-Dy96x5P5.js +1 -0
  6. package/cms/dist/assets/Cms.vue_vue_type_script_setup_true_lang-DibRYDhk.js +1 -0
  7. package/cms/dist/assets/Collection-CeT7sqBS.js +1 -0
  8. package/cms/dist/assets/Collection-CkmskhNr.js +1 -0
  9. package/cms/dist/assets/Collection.vue_vue_type_script_setup_true_lang-CLuwC8Uj.js +4 -0
  10. package/cms/dist/assets/DropdownMenu-D5x3rHhs.js +1 -0
  11. package/cms/dist/assets/Entry-C0oNgptm.js +1 -0
  12. package/cms/dist/assets/Entry-DK9arl_r.js +1 -0
  13. package/cms/dist/assets/Entry-DiaxpV9P.js +1 -0
  14. package/cms/dist/assets/Entry-DnIfmeOq.js +1 -0
  15. package/cms/dist/assets/Entry.vue_vue_type_script_setup_true_lang-DQpUwjD1.js +1 -0
  16. package/cms/dist/assets/Entry.vue_vue_type_script_setup_true_lang-Lpiwz51b.js +1 -0
  17. package/cms/dist/assets/Fields-25hjY31I.js +210 -0
  18. package/cms/dist/assets/Fields-CnUfMg91.css +1 -0
  19. package/cms/dist/assets/FormField-j7eHJ9wN.js +1 -0
  20. package/cms/dist/assets/Input-1aJl-rMT.js +1 -0
  21. package/cms/dist/assets/Main-I4OsPHC_.js +1 -0
  22. package/cms/dist/assets/Media-BiUrdhiy.js +64 -0
  23. package/cms/dist/assets/Modal-CL4NZ42V.js +1 -0
  24. package/cms/dist/assets/Page-C2SS3gyg.js +1 -0
  25. package/cms/dist/assets/PageSideForm-BZD26RtU.js +1 -0
  26. package/cms/dist/assets/PageSideForm-CEDt6M5O.js +1 -0
  27. package/cms/dist/assets/Pages-BQ95j-9A.js +1 -0
  28. package/cms/dist/assets/Pages-Ci78caHB.js +1 -0
  29. package/cms/dist/assets/Preview-DV3zHCWR.js +1 -0
  30. package/cms/dist/assets/RovingFocusGroup-CnDWyi3J.js +1 -0
  31. package/cms/dist/assets/RovingFocusItem-VyijGu8z.js +1 -0
  32. package/cms/dist/assets/Settings-BygzRFRi.js +1 -0
  33. package/cms/dist/assets/Sidebar-RRp6XCg_.js +1 -0
  34. package/cms/dist/assets/TooltipProvider-B0Lr7v95.js +1 -0
  35. package/cms/dist/assets/app-DFMmXmuL.js +1 -0
  36. package/cms/dist/assets/app-DyuvC6pP.js +1 -0
  37. package/cms/dist/assets/app.vue_vue_type_script_setup_true_lang-a-0WngBC.js +13 -0
  38. package/cms/dist/assets/auth-DCLgP-Ce.js +3 -0
  39. package/cms/dist/assets/cms-BfAB9urh.js +1 -0
  40. package/cms/dist/assets/dist-gC8hGhMx.js +1 -0
  41. package/cms/dist/assets/index-B-MXuuNZ.css +2 -0
  42. package/cms/dist/assets/index.spa-_gVd6eNI.js +18 -0
  43. package/cms/dist/assets/index.vue_vue_type_script_setup_true_lang-mq8D_l8z.js +1 -0
  44. package/cms/dist/assets/not-found-DKsTsHpk.js +1 -0
  45. package/cms/dist/assets/not-found-DclK62tc.js +1 -0
  46. package/cms/dist/assets/pages-DLGXw_J5.js +1 -0
  47. package/cms/dist/assets/pages-DhCx_5RP.js +1 -0
  48. package/cms/dist/assets/preview-EralP1Qk.js +1 -0
  49. package/cms/dist/assets/useCmsBreadcrumb-Cvg0a25f.js +1 -0
  50. package/cms/dist/assets/useOverlay-42WuI5Jo.js +1 -0
  51. package/cms/dist/assets/usePortal-BkuxWRnT.js +1 -0
  52. package/cms/dist/assets/useToast-CDyjwefJ.js +1 -0
  53. package/cms/dist/assets/utils-DsgHgvSL.js +1 -0
  54. package/cms/dist/assets/virtualizer-IKP0IcQd.js +1 -0
  55. package/cms/dist/index.spa.html +13 -0
  56. package/cms/server/database/schema.d.ts +257 -261
  57. package/cms/server/database/schema.mjs +58 -38
  58. package/cms/server/middleware/auth.d.ts +2 -0
  59. package/cms/server/middleware/auth.mjs +18 -0
  60. package/cms/server/plugins/migrate.d.ts +2 -0
  61. package/cms/server/plugins/migrate.mjs +16 -0
  62. package/cms/server/routes/api/auth/init/index.get.d.ts +2 -0
  63. package/cms/server/routes/api/auth/init/index.get.mjs +8 -0
  64. package/cms/server/routes/api/auth/init/index.post.d.ts +2 -0
  65. package/cms/server/routes/api/auth/init/index.post.mjs +18 -0
  66. package/cms/server/routes/api/repos/remote/[repo]/files/[branch]/index.mjs +5 -1
  67. package/cms/server/utils/auth.d.ts +1139 -0
  68. package/cms/server/utils/auth.mjs +79 -8
  69. package/cms/server/utils/db.d.ts +4 -2
  70. package/cms/server/utils/db.mjs +7 -4
  71. package/cms/server/utils/github.d.ts +0 -1
  72. package/cms/server/utils/github.mjs +15 -25
  73. package/modules/cms/server/api/admin.mjs +2 -1
  74. package/modules/images/cli-pregenerate.mjs +1 -0
  75. package/modules/images/runtime/build.mjs +6 -4
  76. package/modules/images/runtime/image.mjs +2 -2
  77. package/modules/images/runtime/types.d.ts +1 -0
  78. package/package.json +2 -2
@@ -1,3 +1,1142 @@
1
+ import type { z } from 'zod';
1
2
  export declare const auth: import("better-auth/*").Auth<{
3
+ baseURL: any;
2
4
  database: (options: import("better-auth/*").BetterAuthOptions) => import("better-auth/*").DBAdapter<import("better-auth/*").BetterAuthOptions>;
5
+ emailVerification: {
6
+ sendOnSignUp: true;
7
+ sendOnSignIn: true;
8
+ sendVerificationEmail({ url, user }: {
9
+ user: import("better-auth/*").User;
10
+ url: string;
11
+ token: string;
12
+ }): Promise<void>;
13
+ };
14
+ emailAndPassword: {
15
+ enabled: true;
16
+ requireEmailVerification: true;
17
+ sendResetPassword({ url, user }: {
18
+ user: import("better-auth/*").User;
19
+ url: string;
20
+ token: string;
21
+ }): Promise<void>;
22
+ customSyntheticUser: ({ coreFields, additionalFields, id }: {
23
+ coreFields: {
24
+ name: string;
25
+ email: string;
26
+ emailVerified: boolean;
27
+ image: string | null;
28
+ createdAt: Date;
29
+ updatedAt: Date;
30
+ };
31
+ additionalFields: Record<string, unknown>;
32
+ id: string;
33
+ }) => {
34
+ id: string;
35
+ role: string;
36
+ banned: boolean;
37
+ banReason: null;
38
+ banExpires: null;
39
+ name: string;
40
+ email: string;
41
+ emailVerified: boolean;
42
+ image: string | null;
43
+ createdAt: Date;
44
+ updatedAt: Date;
45
+ };
46
+ };
47
+ session: {
48
+ cookieCache: {
49
+ enabled: true;
50
+ };
51
+ };
52
+ plugins: [{
53
+ id: "admin";
54
+ version: string;
55
+ init(): {
56
+ options: {
57
+ databaseHooks: {
58
+ user: {
59
+ create: {
60
+ before(user: {
61
+ id: string;
62
+ createdAt: Date;
63
+ updatedAt: Date;
64
+ email: string;
65
+ emailVerified: boolean;
66
+ name: string;
67
+ image?: string | null | undefined;
68
+ } & Record<string, unknown>): Promise<{
69
+ data: {
70
+ id: string;
71
+ createdAt: Date;
72
+ updatedAt: Date;
73
+ email: string;
74
+ emailVerified: boolean;
75
+ name: string;
76
+ image?: string | null | undefined;
77
+ role: string;
78
+ };
79
+ }>;
80
+ };
81
+ };
82
+ session: {
83
+ create: {
84
+ before(session: {
85
+ id: string;
86
+ createdAt: Date;
87
+ updatedAt: Date;
88
+ userId: string;
89
+ expiresAt: Date;
90
+ token: string;
91
+ ipAddress?: string | null | undefined;
92
+ userAgent?: string | null | undefined;
93
+ } & Record<string, unknown>, ctx: import("better-auth/*").GenericEndpointContext | null): Promise<void>;
94
+ };
95
+ };
96
+ };
97
+ };
98
+ };
99
+ hooks: {
100
+ after: {
101
+ matcher(context: import("better-auth/*").HookEndpointContext): boolean;
102
+ handler: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
103
+ }[];
104
+ };
105
+ endpoints: {
106
+ setRole: import("better-auth/*").StrictEndpoint<"/admin/set-role", {
107
+ method: "POST";
108
+ body: z.ZodObject<{
109
+ userId: z.ZodCoercedString<unknown>;
110
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
111
+ }, z.core.$strip>;
112
+ requireHeaders: true;
113
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
114
+ session: {
115
+ user: import("better-auth/plugins").UserWithRole;
116
+ session: {
117
+ id: string;
118
+ createdAt: Date;
119
+ updatedAt: Date;
120
+ userId: string;
121
+ expiresAt: Date;
122
+ token: string;
123
+ ipAddress?: string | null | undefined;
124
+ userAgent?: string | null | undefined;
125
+ };
126
+ };
127
+ }>)[];
128
+ metadata: {
129
+ openapi: {
130
+ operationId: string;
131
+ summary: string;
132
+ description: string;
133
+ responses: {
134
+ 200: {
135
+ description: string;
136
+ content: {
137
+ "application/json": {
138
+ schema: {
139
+ type: "object";
140
+ properties: {
141
+ user: {
142
+ $ref: string;
143
+ };
144
+ };
145
+ };
146
+ };
147
+ };
148
+ };
149
+ };
150
+ };
151
+ $Infer: {
152
+ body: {
153
+ userId: string;
154
+ role: "user" | "admin" | ("user" | "admin")[];
155
+ };
156
+ };
157
+ };
158
+ }, {
159
+ user: import("better-auth/plugins").UserWithRole;
160
+ }>;
161
+ getUser: import("better-auth/*").StrictEndpoint<"/admin/get-user", {
162
+ method: "GET";
163
+ query: z.ZodObject<{
164
+ id: z.ZodString;
165
+ }, z.core.$strip>;
166
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
167
+ session: {
168
+ user: import("better-auth/plugins").UserWithRole;
169
+ session: {
170
+ id: string;
171
+ createdAt: Date;
172
+ updatedAt: Date;
173
+ userId: string;
174
+ expiresAt: Date;
175
+ token: string;
176
+ ipAddress?: string | null | undefined;
177
+ userAgent?: string | null | undefined;
178
+ };
179
+ };
180
+ }>)[];
181
+ metadata: {
182
+ openapi: {
183
+ operationId: string;
184
+ summary: string;
185
+ description: string;
186
+ responses: {
187
+ 200: {
188
+ description: string;
189
+ content: {
190
+ "application/json": {
191
+ schema: {
192
+ type: "object";
193
+ properties: {
194
+ user: {
195
+ $ref: string;
196
+ };
197
+ };
198
+ };
199
+ };
200
+ };
201
+ };
202
+ };
203
+ };
204
+ };
205
+ }, import("better-auth/plugins").UserWithRole>;
206
+ createUser: import("better-auth/*").StrictEndpoint<"/admin/create-user", {
207
+ method: "POST";
208
+ body: z.ZodObject<{
209
+ email: z.ZodString;
210
+ password: z.ZodOptional<z.ZodString>;
211
+ name: z.ZodString;
212
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
213
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
214
+ }, z.core.$strip>;
215
+ metadata: {
216
+ openapi: {
217
+ operationId: string;
218
+ summary: string;
219
+ description: string;
220
+ responses: {
221
+ 200: {
222
+ description: string;
223
+ content: {
224
+ "application/json": {
225
+ schema: {
226
+ type: "object";
227
+ properties: {
228
+ user: {
229
+ $ref: string;
230
+ };
231
+ };
232
+ };
233
+ };
234
+ };
235
+ };
236
+ };
237
+ };
238
+ $Infer: {
239
+ body: {
240
+ email: string;
241
+ password?: string | undefined;
242
+ name: string;
243
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
244
+ data?: Record<string, any> | undefined;
245
+ };
246
+ };
247
+ };
248
+ }, {
249
+ user: import("better-auth/plugins").UserWithRole;
250
+ }>;
251
+ adminUpdateUser: import("better-auth/*").StrictEndpoint<"/admin/update-user", {
252
+ method: "POST";
253
+ body: z.ZodObject<{
254
+ userId: z.ZodCoercedString<unknown>;
255
+ data: z.ZodRecord<z.ZodAny, z.ZodAny>;
256
+ }, z.core.$strip>;
257
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
258
+ session: {
259
+ user: import("better-auth/plugins").UserWithRole;
260
+ session: {
261
+ id: string;
262
+ createdAt: Date;
263
+ updatedAt: Date;
264
+ userId: string;
265
+ expiresAt: Date;
266
+ token: string;
267
+ ipAddress?: string | null | undefined;
268
+ userAgent?: string | null | undefined;
269
+ };
270
+ };
271
+ }>)[];
272
+ metadata: {
273
+ openapi: {
274
+ operationId: string;
275
+ summary: string;
276
+ description: string;
277
+ responses: {
278
+ 200: {
279
+ description: string;
280
+ content: {
281
+ "application/json": {
282
+ schema: {
283
+ type: "object";
284
+ properties: {
285
+ user: {
286
+ $ref: string;
287
+ };
288
+ };
289
+ };
290
+ };
291
+ };
292
+ };
293
+ };
294
+ };
295
+ };
296
+ }, import("better-auth/plugins").UserWithRole>;
297
+ listUsers: import("better-auth/*").StrictEndpoint<"/admin/list-users", {
298
+ method: "GET";
299
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
300
+ session: {
301
+ user: import("better-auth/plugins").UserWithRole;
302
+ session: {
303
+ id: string;
304
+ createdAt: Date;
305
+ updatedAt: Date;
306
+ userId: string;
307
+ expiresAt: Date;
308
+ token: string;
309
+ ipAddress?: string | null | undefined;
310
+ userAgent?: string | null | undefined;
311
+ };
312
+ };
313
+ }>)[];
314
+ query: z.ZodObject<{
315
+ searchValue: z.ZodOptional<z.ZodString>;
316
+ searchField: z.ZodOptional<z.ZodEnum<{
317
+ email: "email";
318
+ name: "name";
319
+ }>>;
320
+ searchOperator: z.ZodOptional<z.ZodEnum<{
321
+ contains: "contains";
322
+ starts_with: "starts_with";
323
+ ends_with: "ends_with";
324
+ }>>;
325
+ limit: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
326
+ offset: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
327
+ sortBy: z.ZodOptional<z.ZodString>;
328
+ sortDirection: z.ZodOptional<z.ZodEnum<{
329
+ asc: "asc";
330
+ desc: "desc";
331
+ }>>;
332
+ filterField: z.ZodOptional<z.ZodString>;
333
+ filterValue: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodBoolean]>, z.ZodArray<z.ZodString>]>, z.ZodArray<z.ZodNumber>]>>;
334
+ filterOperator: z.ZodOptional<z.ZodEnum<{
335
+ eq: "eq";
336
+ ne: "ne";
337
+ gt: "gt";
338
+ gte: "gte";
339
+ lt: "lt";
340
+ lte: "lte";
341
+ in: "in";
342
+ not_in: "not_in";
343
+ contains: "contains";
344
+ starts_with: "starts_with";
345
+ ends_with: "ends_with";
346
+ }>>;
347
+ }, z.core.$strip>;
348
+ metadata: {
349
+ openapi: {
350
+ operationId: string;
351
+ summary: string;
352
+ description: string;
353
+ responses: {
354
+ 200: {
355
+ description: string;
356
+ content: {
357
+ "application/json": {
358
+ schema: {
359
+ type: "object";
360
+ properties: {
361
+ users: {
362
+ type: string;
363
+ items: {
364
+ $ref: string;
365
+ };
366
+ };
367
+ total: {
368
+ type: string;
369
+ };
370
+ limit: {
371
+ type: string;
372
+ };
373
+ offset: {
374
+ type: string;
375
+ };
376
+ };
377
+ required: string[];
378
+ };
379
+ };
380
+ };
381
+ };
382
+ };
383
+ };
384
+ };
385
+ }, {
386
+ users: import("better-auth/plugins").UserWithRole[];
387
+ total: number;
388
+ }>;
389
+ listUserSessions: import("better-auth/*").StrictEndpoint<"/admin/list-user-sessions", {
390
+ method: "POST";
391
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
392
+ session: {
393
+ user: import("better-auth/plugins").UserWithRole;
394
+ session: {
395
+ id: string;
396
+ createdAt: Date;
397
+ updatedAt: Date;
398
+ userId: string;
399
+ expiresAt: Date;
400
+ token: string;
401
+ ipAddress?: string | null | undefined;
402
+ userAgent?: string | null | undefined;
403
+ };
404
+ };
405
+ }>)[];
406
+ body: z.ZodObject<{
407
+ userId: z.ZodCoercedString<unknown>;
408
+ }, z.core.$strip>;
409
+ metadata: {
410
+ openapi: {
411
+ operationId: string;
412
+ summary: string;
413
+ description: string;
414
+ responses: {
415
+ 200: {
416
+ description: string;
417
+ content: {
418
+ "application/json": {
419
+ schema: {
420
+ type: "object";
421
+ properties: {
422
+ sessions: {
423
+ type: string;
424
+ items: {
425
+ $ref: string;
426
+ };
427
+ };
428
+ };
429
+ };
430
+ };
431
+ };
432
+ };
433
+ };
434
+ };
435
+ };
436
+ }, {
437
+ sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
438
+ }>;
439
+ unbanUser: import("better-auth/*").StrictEndpoint<"/admin/unban-user", {
440
+ method: "POST";
441
+ body: z.ZodObject<{
442
+ userId: z.ZodCoercedString<unknown>;
443
+ }, z.core.$strip>;
444
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
445
+ session: {
446
+ user: import("better-auth/plugins").UserWithRole;
447
+ session: {
448
+ id: string;
449
+ createdAt: Date;
450
+ updatedAt: Date;
451
+ userId: string;
452
+ expiresAt: Date;
453
+ token: string;
454
+ ipAddress?: string | null | undefined;
455
+ userAgent?: string | null | undefined;
456
+ };
457
+ };
458
+ }>)[];
459
+ metadata: {
460
+ openapi: {
461
+ operationId: string;
462
+ summary: string;
463
+ description: string;
464
+ responses: {
465
+ 200: {
466
+ description: string;
467
+ content: {
468
+ "application/json": {
469
+ schema: {
470
+ type: "object";
471
+ properties: {
472
+ user: {
473
+ $ref: string;
474
+ };
475
+ };
476
+ };
477
+ };
478
+ };
479
+ };
480
+ };
481
+ };
482
+ };
483
+ }, {
484
+ user: import("better-auth/plugins").UserWithRole;
485
+ }>;
486
+ banUser: import("better-auth/*").StrictEndpoint<"/admin/ban-user", {
487
+ method: "POST";
488
+ body: z.ZodObject<{
489
+ userId: z.ZodCoercedString<unknown>;
490
+ banReason: z.ZodOptional<z.ZodString>;
491
+ banExpiresIn: z.ZodOptional<z.ZodNumber>;
492
+ }, z.core.$strip>;
493
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
494
+ session: {
495
+ user: import("better-auth/plugins").UserWithRole;
496
+ session: {
497
+ id: string;
498
+ createdAt: Date;
499
+ updatedAt: Date;
500
+ userId: string;
501
+ expiresAt: Date;
502
+ token: string;
503
+ ipAddress?: string | null | undefined;
504
+ userAgent?: string | null | undefined;
505
+ };
506
+ };
507
+ }>)[];
508
+ metadata: {
509
+ openapi: {
510
+ operationId: string;
511
+ summary: string;
512
+ description: string;
513
+ responses: {
514
+ 200: {
515
+ description: string;
516
+ content: {
517
+ "application/json": {
518
+ schema: {
519
+ type: "object";
520
+ properties: {
521
+ user: {
522
+ $ref: string;
523
+ };
524
+ };
525
+ };
526
+ };
527
+ };
528
+ };
529
+ };
530
+ };
531
+ };
532
+ }, {
533
+ user: import("better-auth/plugins").UserWithRole;
534
+ }>;
535
+ impersonateUser: import("better-auth/*").StrictEndpoint<"/admin/impersonate-user", {
536
+ method: "POST";
537
+ body: z.ZodObject<{
538
+ userId: z.ZodCoercedString<unknown>;
539
+ }, z.core.$strip>;
540
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
541
+ session: {
542
+ user: import("better-auth/plugins").UserWithRole;
543
+ session: {
544
+ id: string;
545
+ createdAt: Date;
546
+ updatedAt: Date;
547
+ userId: string;
548
+ expiresAt: Date;
549
+ token: string;
550
+ ipAddress?: string | null | undefined;
551
+ userAgent?: string | null | undefined;
552
+ };
553
+ };
554
+ }>)[];
555
+ metadata: {
556
+ openapi: {
557
+ operationId: string;
558
+ summary: string;
559
+ description: string;
560
+ responses: {
561
+ 200: {
562
+ description: string;
563
+ content: {
564
+ "application/json": {
565
+ schema: {
566
+ type: "object";
567
+ properties: {
568
+ session: {
569
+ $ref: string;
570
+ };
571
+ user: {
572
+ $ref: string;
573
+ };
574
+ };
575
+ };
576
+ };
577
+ };
578
+ };
579
+ };
580
+ };
581
+ };
582
+ }, {
583
+ session: {
584
+ id: string;
585
+ createdAt: Date;
586
+ updatedAt: Date;
587
+ userId: string;
588
+ expiresAt: Date;
589
+ token: string;
590
+ ipAddress?: string | null | undefined;
591
+ userAgent?: string | null | undefined;
592
+ };
593
+ user: import("better-auth/plugins").UserWithRole;
594
+ }>;
595
+ stopImpersonating: import("better-auth/*").StrictEndpoint<"/admin/stop-impersonating", {
596
+ method: "POST";
597
+ requireHeaders: true;
598
+ }, {
599
+ session: {
600
+ id: string;
601
+ createdAt: Date;
602
+ updatedAt: Date;
603
+ userId: string;
604
+ expiresAt: Date;
605
+ token: string;
606
+ ipAddress?: string | null | undefined;
607
+ userAgent?: string | null | undefined;
608
+ } & Record<string, any>;
609
+ user: {
610
+ id: string;
611
+ createdAt: Date;
612
+ updatedAt: Date;
613
+ email: string;
614
+ emailVerified: boolean;
615
+ name: string;
616
+ image?: string | null | undefined;
617
+ } & Record<string, any>;
618
+ }>;
619
+ revokeUserSession: import("better-auth/*").StrictEndpoint<"/admin/revoke-user-session", {
620
+ method: "POST";
621
+ body: z.ZodObject<{
622
+ sessionToken: z.ZodString;
623
+ }, z.core.$strip>;
624
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
625
+ session: {
626
+ user: import("better-auth/plugins").UserWithRole;
627
+ session: {
628
+ id: string;
629
+ createdAt: Date;
630
+ updatedAt: Date;
631
+ userId: string;
632
+ expiresAt: Date;
633
+ token: string;
634
+ ipAddress?: string | null | undefined;
635
+ userAgent?: string | null | undefined;
636
+ };
637
+ };
638
+ }>)[];
639
+ metadata: {
640
+ openapi: {
641
+ operationId: string;
642
+ summary: string;
643
+ description: string;
644
+ responses: {
645
+ 200: {
646
+ description: string;
647
+ content: {
648
+ "application/json": {
649
+ schema: {
650
+ type: "object";
651
+ properties: {
652
+ success: {
653
+ type: string;
654
+ };
655
+ };
656
+ };
657
+ };
658
+ };
659
+ };
660
+ };
661
+ };
662
+ };
663
+ }, {
664
+ success: boolean;
665
+ }>;
666
+ revokeUserSessions: import("better-auth/*").StrictEndpoint<"/admin/revoke-user-sessions", {
667
+ method: "POST";
668
+ body: z.ZodObject<{
669
+ userId: z.ZodCoercedString<unknown>;
670
+ }, z.core.$strip>;
671
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
672
+ session: {
673
+ user: import("better-auth/plugins").UserWithRole;
674
+ session: {
675
+ id: string;
676
+ createdAt: Date;
677
+ updatedAt: Date;
678
+ userId: string;
679
+ expiresAt: Date;
680
+ token: string;
681
+ ipAddress?: string | null | undefined;
682
+ userAgent?: string | null | undefined;
683
+ };
684
+ };
685
+ }>)[];
686
+ metadata: {
687
+ openapi: {
688
+ operationId: string;
689
+ summary: string;
690
+ description: string;
691
+ responses: {
692
+ 200: {
693
+ description: string;
694
+ content: {
695
+ "application/json": {
696
+ schema: {
697
+ type: "object";
698
+ properties: {
699
+ success: {
700
+ type: string;
701
+ };
702
+ };
703
+ };
704
+ };
705
+ };
706
+ };
707
+ };
708
+ };
709
+ };
710
+ }, {
711
+ success: boolean;
712
+ }>;
713
+ removeUser: import("better-auth/*").StrictEndpoint<"/admin/remove-user", {
714
+ method: "POST";
715
+ body: z.ZodObject<{
716
+ userId: z.ZodCoercedString<unknown>;
717
+ }, z.core.$strip>;
718
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
719
+ session: {
720
+ user: import("better-auth/plugins").UserWithRole;
721
+ session: {
722
+ id: string;
723
+ createdAt: Date;
724
+ updatedAt: Date;
725
+ userId: string;
726
+ expiresAt: Date;
727
+ token: string;
728
+ ipAddress?: string | null | undefined;
729
+ userAgent?: string | null | undefined;
730
+ };
731
+ };
732
+ }>)[];
733
+ metadata: {
734
+ openapi: {
735
+ operationId: string;
736
+ summary: string;
737
+ description: string;
738
+ responses: {
739
+ 200: {
740
+ description: string;
741
+ content: {
742
+ "application/json": {
743
+ schema: {
744
+ type: "object";
745
+ properties: {
746
+ success: {
747
+ type: string;
748
+ };
749
+ };
750
+ };
751
+ };
752
+ };
753
+ };
754
+ };
755
+ };
756
+ };
757
+ }, {
758
+ success: boolean;
759
+ }>;
760
+ setUserPassword: import("better-auth/*").StrictEndpoint<"/admin/set-user-password", {
761
+ method: "POST";
762
+ body: z.ZodObject<{
763
+ newPassword: z.ZodString;
764
+ userId: z.ZodCoercedString<unknown>;
765
+ }, z.core.$strip>;
766
+ use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<{
767
+ session: {
768
+ user: import("better-auth/plugins").UserWithRole;
769
+ session: {
770
+ id: string;
771
+ createdAt: Date;
772
+ updatedAt: Date;
773
+ userId: string;
774
+ expiresAt: Date;
775
+ token: string;
776
+ ipAddress?: string | null | undefined;
777
+ userAgent?: string | null | undefined;
778
+ };
779
+ };
780
+ }>)[];
781
+ metadata: {
782
+ openapi: {
783
+ operationId: string;
784
+ summary: string;
785
+ description: string;
786
+ responses: {
787
+ 200: {
788
+ description: string;
789
+ content: {
790
+ "application/json": {
791
+ schema: {
792
+ type: "object";
793
+ properties: {
794
+ status: {
795
+ type: string;
796
+ };
797
+ };
798
+ };
799
+ };
800
+ };
801
+ };
802
+ };
803
+ };
804
+ };
805
+ }, {
806
+ status: boolean;
807
+ }>;
808
+ userHasPermission: import("better-auth/*").StrictEndpoint<"/admin/has-permission", {
809
+ method: "POST";
810
+ body: z.ZodIntersection<z.ZodObject<{
811
+ userId: z.ZodOptional<z.ZodCoercedString<unknown>>;
812
+ role: z.ZodOptional<z.ZodString>;
813
+ }, z.core.$strip>, z.ZodXor<readonly [z.ZodObject<{
814
+ permission: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
815
+ }, z.core.$strip>, z.ZodObject<{
816
+ permissions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
817
+ }, z.core.$strip>]>>;
818
+ metadata: {
819
+ openapi: {
820
+ description: string;
821
+ requestBody: {
822
+ content: {
823
+ "application/json": {
824
+ schema: {
825
+ type: "object";
826
+ properties: {
827
+ permissions: {
828
+ type: string;
829
+ description: string;
830
+ };
831
+ };
832
+ required: string[];
833
+ };
834
+ };
835
+ };
836
+ };
837
+ responses: {
838
+ "200": {
839
+ description: string;
840
+ content: {
841
+ "application/json": {
842
+ schema: {
843
+ type: "object";
844
+ properties: {
845
+ error: {
846
+ type: string;
847
+ };
848
+ success: {
849
+ type: string;
850
+ };
851
+ };
852
+ required: string[];
853
+ };
854
+ };
855
+ };
856
+ };
857
+ };
858
+ };
859
+ $Infer: {
860
+ body: {
861
+ permissions: {
862
+ readonly user?: ("set-role" | "delete" | "get" | "create" | "list" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "update")[] | undefined;
863
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
864
+ };
865
+ } & {
866
+ userId?: string | undefined;
867
+ role?: "user" | "admin" | undefined;
868
+ };
869
+ };
870
+ };
871
+ }, {
872
+ error: null;
873
+ success: boolean;
874
+ }>;
875
+ };
876
+ $ERROR_CODES: {
877
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth/*").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
878
+ FAILED_TO_CREATE_USER: import("better-auth/*").RawError<"FAILED_TO_CREATE_USER">;
879
+ USER_ALREADY_EXISTS: import("better-auth/*").RawError<"USER_ALREADY_EXISTS">;
880
+ YOU_CANNOT_BAN_YOURSELF: import("better-auth/*").RawError<"YOU_CANNOT_BAN_YOURSELF">;
881
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
882
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
883
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
884
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
885
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
886
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
887
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
888
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
889
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
890
+ BANNED_USER: import("better-auth/*").RawError<"BANNED_USER">;
891
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
892
+ NO_DATA_TO_UPDATE: import("better-auth/*").RawError<"NO_DATA_TO_UPDATE">;
893
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
894
+ YOU_CANNOT_REMOVE_YOURSELF: import("better-auth/*").RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
895
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: import("better-auth/*").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
896
+ YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth/*").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
897
+ INVALID_ROLE_TYPE: import("better-auth/*").RawError<"INVALID_ROLE_TYPE">;
898
+ };
899
+ schema: {
900
+ user: {
901
+ fields: {
902
+ role: {
903
+ type: "string";
904
+ required: false;
905
+ input: false;
906
+ };
907
+ banned: {
908
+ type: "boolean";
909
+ defaultValue: false;
910
+ required: false;
911
+ input: false;
912
+ };
913
+ banReason: {
914
+ type: "string";
915
+ required: false;
916
+ input: false;
917
+ };
918
+ banExpires: {
919
+ type: "date";
920
+ required: false;
921
+ input: false;
922
+ };
923
+ };
924
+ };
925
+ session: {
926
+ fields: {
927
+ impersonatedBy: {
928
+ type: "string";
929
+ required: false;
930
+ };
931
+ };
932
+ };
933
+ };
934
+ options: {};
935
+ }, {
936
+ id: "username";
937
+ version: string;
938
+ init(ctx: import("better-auth/*").AuthContext): {
939
+ options: {
940
+ databaseHooks: {
941
+ user: {
942
+ create: {
943
+ before(user: {
944
+ id: string;
945
+ createdAt: Date;
946
+ updatedAt: Date;
947
+ email: string;
948
+ emailVerified: boolean;
949
+ name: string;
950
+ image?: string | null | undefined;
951
+ } & Record<string, unknown>, context: import("better-auth/*").GenericEndpointContext | null): Promise<{
952
+ data: {
953
+ username: string;
954
+ displayUsername: string;
955
+ id: string;
956
+ createdAt: Date;
957
+ updatedAt: Date;
958
+ email: string;
959
+ emailVerified: boolean;
960
+ name: string;
961
+ image?: string | null | undefined;
962
+ };
963
+ } | {
964
+ data: {
965
+ displayUsername?: string | undefined;
966
+ id: string;
967
+ createdAt: Date;
968
+ updatedAt: Date;
969
+ email: string;
970
+ emailVerified: boolean;
971
+ name: string;
972
+ image?: string | null | undefined;
973
+ };
974
+ }>;
975
+ };
976
+ update: {
977
+ before(user: Partial<{
978
+ id: string;
979
+ createdAt: Date;
980
+ updatedAt: Date;
981
+ email: string;
982
+ emailVerified: boolean;
983
+ name: string;
984
+ image?: string | null | undefined;
985
+ }> & Record<string, unknown>, context: import("better-auth/*").GenericEndpointContext | null): Promise<{
986
+ data: {
987
+ displayUsername?: string | undefined;
988
+ username: string;
989
+ id?: string | undefined;
990
+ createdAt?: Date | undefined;
991
+ updatedAt?: Date | undefined;
992
+ email?: string | undefined;
993
+ emailVerified?: boolean | undefined;
994
+ name?: string | undefined;
995
+ image?: string | null | undefined;
996
+ };
997
+ } | {
998
+ data: {
999
+ displayUsername?: string | undefined;
1000
+ id?: string | undefined;
1001
+ createdAt?: Date | undefined;
1002
+ updatedAt?: Date | undefined;
1003
+ email?: string | undefined;
1004
+ emailVerified?: boolean | undefined;
1005
+ name?: string | undefined;
1006
+ image?: string | null | undefined;
1007
+ };
1008
+ }>;
1009
+ };
1010
+ };
1011
+ };
1012
+ };
1013
+ };
1014
+ endpoints: {
1015
+ signInUsername: import("better-auth/*").StrictEndpoint<"/sign-in/username", {
1016
+ method: "POST";
1017
+ body: z.ZodObject<{
1018
+ username: z.ZodString;
1019
+ password: z.ZodString;
1020
+ rememberMe: z.ZodOptional<z.ZodBoolean>;
1021
+ callbackURL: z.ZodOptional<z.ZodString>;
1022
+ }, z.core.$strip>;
1023
+ metadata: {
1024
+ openapi: {
1025
+ summary: string;
1026
+ description: string;
1027
+ responses: {
1028
+ 200: {
1029
+ description: string;
1030
+ content: {
1031
+ "application/json": {
1032
+ schema: {
1033
+ type: "object";
1034
+ properties: {
1035
+ redirect: {
1036
+ type: string;
1037
+ description: string;
1038
+ };
1039
+ token: {
1040
+ type: string;
1041
+ description: string;
1042
+ };
1043
+ url: {
1044
+ type: string;
1045
+ nullable: boolean;
1046
+ description: string;
1047
+ };
1048
+ user: {
1049
+ $ref: string;
1050
+ };
1051
+ };
1052
+ required: string[];
1053
+ };
1054
+ };
1055
+ };
1056
+ };
1057
+ 422: {
1058
+ description: string;
1059
+ content: {
1060
+ "application/json": {
1061
+ schema: {
1062
+ type: "object";
1063
+ properties: {
1064
+ message: {
1065
+ type: string;
1066
+ };
1067
+ };
1068
+ };
1069
+ };
1070
+ };
1071
+ };
1072
+ };
1073
+ };
1074
+ };
1075
+ }, {
1076
+ redirect: boolean;
1077
+ token: string;
1078
+ url: string | undefined;
1079
+ user: {
1080
+ id: string;
1081
+ createdAt: Date;
1082
+ updatedAt: Date;
1083
+ email: string;
1084
+ emailVerified: boolean;
1085
+ name: string;
1086
+ image?: string | null | undefined;
1087
+ } & {
1088
+ username: string;
1089
+ displayUsername: string;
1090
+ };
1091
+ }>;
1092
+ isUsernameAvailable: import("better-auth/*").StrictEndpoint<"/is-username-available", {
1093
+ method: "POST";
1094
+ body: z.ZodObject<{
1095
+ username: z.ZodString;
1096
+ }, z.core.$strip>;
1097
+ }, {
1098
+ available: boolean;
1099
+ }>;
1100
+ };
1101
+ schema: {
1102
+ user: {
1103
+ fields: {
1104
+ username: {
1105
+ type: "string";
1106
+ required: false;
1107
+ sortable: true;
1108
+ unique: true;
1109
+ returned: true;
1110
+ transform: {
1111
+ input(value: import("better-auth/*").DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
1112
+ };
1113
+ };
1114
+ displayUsername: {
1115
+ type: "string";
1116
+ required: false;
1117
+ transform: {
1118
+ input(value: import("better-auth/*").DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
1119
+ };
1120
+ };
1121
+ };
1122
+ };
1123
+ };
1124
+ hooks: {
1125
+ before: {
1126
+ matcher(context: import("better-auth/*").HookEndpointContext): boolean;
1127
+ handler: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<void>;
1128
+ }[];
1129
+ };
1130
+ options: import("better-auth/plugins").UsernameOptions | undefined;
1131
+ $ERROR_CODES: {
1132
+ EMAIL_NOT_VERIFIED: import("better-auth/*").RawError<"EMAIL_NOT_VERIFIED">;
1133
+ UNEXPECTED_ERROR: import("better-auth/*").RawError<"UNEXPECTED_ERROR">;
1134
+ INVALID_USERNAME_OR_PASSWORD: import("better-auth/*").RawError<"INVALID_USERNAME_OR_PASSWORD">;
1135
+ USERNAME_IS_ALREADY_TAKEN: import("better-auth/*").RawError<"USERNAME_IS_ALREADY_TAKEN">;
1136
+ USERNAME_TOO_SHORT: import("better-auth/*").RawError<"USERNAME_TOO_SHORT">;
1137
+ USERNAME_TOO_LONG: import("better-auth/*").RawError<"USERNAME_TOO_LONG">;
1138
+ INVALID_USERNAME: import("better-auth/*").RawError<"INVALID_USERNAME">;
1139
+ INVALID_DISPLAY_USERNAME: import("better-auth/*").RawError<"INVALID_DISPLAY_USERNAME">;
1140
+ };
1141
+ }];
3
1142
  }>;