@celsoft/platform 0.4.0 → 0.6.0

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