@djaouad10/shared-types 1.0.0 → 1.0.3

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 (88) hide show
  1. package/dist/api/root.d.ts +2442 -0
  2. package/dist/api/routers/admin/handler-input-schema.d.ts +6 -0
  3. package/dist/api/routers/admin/index.d.ts +56 -0
  4. package/dist/api/routers/cart/handler-input-schema.d.ts +17 -0
  5. package/dist/api/routers/cart/index.d.ts +93 -0
  6. package/dist/api/routers/category/handler-input-schema.d.ts +12 -0
  7. package/dist/api/routers/category/index.d.ts +73 -0
  8. package/dist/api/routers/client/handler-input-schema.d.ts +30 -0
  9. package/dist/api/routers/client/index.d.ts +102 -0
  10. package/dist/api/routers/file/handler-input-schema.d.ts +77 -0
  11. package/dist/api/routers/file/index.d.ts +85 -0
  12. package/dist/api/routers/order/handler-input-schema.d.ts +96 -0
  13. package/dist/api/routers/order/index.d.ts +187 -0
  14. package/dist/api/routers/product/handler-input-schema.d.ts +65 -0
  15. package/dist/api/routers/product/index.d.ts +228 -0
  16. package/dist/api/routers/product/variation/handler-input-schema.d.ts +56 -0
  17. package/dist/api/routers/product/variation/index.d.ts +90 -0
  18. package/dist/api/routers/rating/handler-input-schema.d.ts +41 -0
  19. package/dist/api/routers/rating/index.d.ts +128 -0
  20. package/dist/api/routers/shipping/address/handler-input-schema.d.ts +5 -0
  21. package/dist/api/routers/shipping/address/index.d.ts +66 -0
  22. package/dist/api/routers/shipping/handler-input-schema.d.ts +2 -0
  23. package/dist/api/routers/shipping/index.d.ts +182 -0
  24. package/dist/api/routers/shipping/shipments/handler-input-schema.d.ts +8 -0
  25. package/dist/api/routers/shipping/shipments/index.d.ts +72 -0
  26. package/dist/api/routers/statistics/handler-input-schema.d.ts +2 -0
  27. package/dist/api/routers/statistics/index.d.ts +51 -0
  28. package/dist/api/trpc.d.ts +329 -0
  29. package/dist/data-access-layer/admin.dal.d.ts +12 -0
  30. package/dist/data-access-layer/cart.dal.d.ts +29 -0
  31. package/dist/data-access-layer/category.dal.d.ts +11 -0
  32. package/dist/data-access-layer/client.dal.d.ts +30 -0
  33. package/dist/data-access-layer/file.dal.d.ts +42 -0
  34. package/dist/data-access-layer/order.dal.d.ts +133 -0
  35. package/dist/data-access-layer/product.dal.d.ts +69 -0
  36. package/dist/data-access-layer/rating.dal.d.ts +40 -0
  37. package/dist/data-access-layer/shipping/world-express.dal.d.ts +205 -0
  38. package/dist/data-access-layer/statistic.dal.d.ts +6 -0
  39. package/dist/data-transfer-objects/cart.dto.d.ts +17 -0
  40. package/dist/data-transfer-objects/category.dto.d.ts +5 -0
  41. package/dist/data-transfer-objects/client.dto.d.ts +9 -0
  42. package/dist/data-transfer-objects/file.dto.d.ts +13 -0
  43. package/dist/data-transfer-objects/order.dto.d.ts +52 -0
  44. package/dist/data-transfer-objects/product.dto.d.ts +33 -0
  45. package/dist/data-transfer-objects/rating.dto.d.ts +9 -0
  46. package/dist/errors/index.d.ts +32 -0
  47. package/dist/index.d.ts +2 -0
  48. package/dist/lib/auth.d.ts +1051 -0
  49. package/dist/lib/core.d.ts +15 -0
  50. package/dist/lib/db.d.ts +5 -0
  51. package/dist/lib/env.d.ts +15 -0
  52. package/dist/lib/static.d.ts +8 -0
  53. package/dist/lib/validation/shared-schemas.d.ts +173 -0
  54. package/dist/services/admin.service.d.ts +12 -0
  55. package/dist/services/cart.service.d.ts +24 -0
  56. package/dist/services/category.service.d.ts +12 -0
  57. package/dist/services/client.service.d.ts +25 -0
  58. package/dist/services/email.service.d.ts +11 -0
  59. package/dist/services/file.service.d.ts +37 -0
  60. package/dist/services/index.d.ts +23 -0
  61. package/dist/services/order.service.d.ts +90 -0
  62. package/dist/services/product.service.d.ts +47 -0
  63. package/dist/services/rating.service.d.ts +31 -0
  64. package/dist/services/shipping/service-definitons.d.ts +122 -0
  65. package/dist/services/shipping/world-epress.service.d.ts +86 -0
  66. package/dist/services/statistic.service.d.ts +8 -0
  67. package/dist/shared-types/admin.shared-types.d.ts +6 -0
  68. package/dist/shared-types/cart.shared-types.d.ts +19 -0
  69. package/dist/shared-types/client.shared-types.d.ts +29 -0
  70. package/dist/shared-types/file.shared-types.d.ts +11 -0
  71. package/dist/shared-types/order.shared-types.d.ts +30 -0
  72. package/dist/shared-types/product.shared-types.d.ts +52 -0
  73. package/dist/shared-types/rating.shared-types.d.ts +40 -0
  74. package/dist/test/factories/cart-item.factory.d.ts +2 -0
  75. package/dist/test/factories/category.factory.d.ts +9 -0
  76. package/dist/test/factories/file.factory.d.ts +21 -0
  77. package/dist/test/factories/index.d.ts +11 -0
  78. package/dist/test/factories/order.factory.d.ts +2 -0
  79. package/dist/test/factories/product.factory.d.ts +48 -0
  80. package/dist/test/factories/rating.factory.d.ts +2 -0
  81. package/dist/test/factories/shipping-details.factory.d.ts +2 -0
  82. package/dist/test/factories/types.d.ts +27 -0
  83. package/dist/test/factories/user.factory.d.ts +13 -0
  84. package/dist/test/factories/variation.factory.d.ts +2 -0
  85. package/dist/test/setup.d.ts +2 -0
  86. package/dist/test/verify-test-env.d.ts +2 -0
  87. package/package.json +18 -68
  88. package/README.md +0 -0
@@ -0,0 +1,1051 @@
1
+ export declare const auth: import("better-auth").Auth<{
2
+ database: (options: import("better-auth").BetterAuthOptions) => import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
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 | null): 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: {
67
+ id: string;
68
+ createdAt: Date;
69
+ updatedAt: Date;
70
+ userId: string;
71
+ expiresAt: Date;
72
+ token: string;
73
+ ipAddress?: string | null | undefined;
74
+ userAgent?: string | null | undefined;
75
+ };
76
+ };
77
+ }>)[];
78
+ metadata: {
79
+ openapi: {
80
+ operationId: string;
81
+ summary: string;
82
+ description: string;
83
+ responses: {
84
+ 200: {
85
+ description: string;
86
+ content: {
87
+ "application/json": {
88
+ schema: {
89
+ type: "object";
90
+ properties: {
91
+ user: {
92
+ $ref: string;
93
+ };
94
+ };
95
+ };
96
+ };
97
+ };
98
+ };
99
+ };
100
+ };
101
+ $Infer: {
102
+ body: {
103
+ userId: string;
104
+ role: "user" | "admin" | ("user" | "admin")[];
105
+ };
106
+ };
107
+ };
108
+ }, {
109
+ user: import("better-auth/plugins").UserWithRole;
110
+ }>;
111
+ getUser: import("better-auth").StrictEndpoint<"/admin/get-user", {
112
+ method: "GET";
113
+ query: import("better-auth").ZodObject<{
114
+ id: import("better-auth").ZodString;
115
+ }, import("better-auth").$strip>;
116
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
117
+ session: {
118
+ user: import("better-auth/plugins").UserWithRole;
119
+ session: {
120
+ id: string;
121
+ createdAt: Date;
122
+ updatedAt: Date;
123
+ userId: string;
124
+ expiresAt: Date;
125
+ token: string;
126
+ ipAddress?: string | null | undefined;
127
+ userAgent?: string | null | undefined;
128
+ };
129
+ };
130
+ }>)[];
131
+ metadata: {
132
+ openapi: {
133
+ operationId: string;
134
+ summary: string;
135
+ description: string;
136
+ responses: {
137
+ 200: {
138
+ description: string;
139
+ content: {
140
+ "application/json": {
141
+ schema: {
142
+ type: "object";
143
+ properties: {
144
+ user: {
145
+ $ref: string;
146
+ };
147
+ };
148
+ };
149
+ };
150
+ };
151
+ };
152
+ };
153
+ };
154
+ };
155
+ }, import("better-auth/plugins").UserWithRole>;
156
+ createUser: import("better-auth").StrictEndpoint<"/admin/create-user", {
157
+ method: "POST";
158
+ body: import("better-auth").ZodObject<{
159
+ email: import("better-auth").ZodString;
160
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
161
+ name: import("better-auth").ZodString;
162
+ role: import("better-auth").ZodOptional<import("better-auth").ZodUnion<readonly [import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>]>>;
163
+ data: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
164
+ }, import("better-auth").$strip>;
165
+ metadata: {
166
+ openapi: {
167
+ operationId: string;
168
+ summary: string;
169
+ description: string;
170
+ responses: {
171
+ 200: {
172
+ description: string;
173
+ content: {
174
+ "application/json": {
175
+ schema: {
176
+ type: "object";
177
+ properties: {
178
+ user: {
179
+ $ref: string;
180
+ };
181
+ };
182
+ };
183
+ };
184
+ };
185
+ };
186
+ };
187
+ };
188
+ $Infer: {
189
+ body: {
190
+ email: string;
191
+ password?: string | undefined;
192
+ name: string;
193
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
194
+ data?: Record<string, any> | undefined;
195
+ };
196
+ };
197
+ };
198
+ }, {
199
+ user: import("better-auth/plugins").UserWithRole;
200
+ }>;
201
+ adminUpdateUser: import("better-auth").StrictEndpoint<"/admin/update-user", {
202
+ method: "POST";
203
+ body: import("better-auth").ZodObject<{
204
+ userId: import("better-auth").ZodCoercedString<unknown>;
205
+ data: import("better-auth").ZodRecord<import("better-auth").ZodAny, import("better-auth").ZodAny>;
206
+ }, import("better-auth").$strip>;
207
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
208
+ session: {
209
+ user: import("better-auth/plugins").UserWithRole;
210
+ session: {
211
+ id: string;
212
+ createdAt: Date;
213
+ updatedAt: Date;
214
+ userId: string;
215
+ expiresAt: Date;
216
+ token: string;
217
+ ipAddress?: string | null | undefined;
218
+ userAgent?: string | null | undefined;
219
+ };
220
+ };
221
+ }>)[];
222
+ metadata: {
223
+ openapi: {
224
+ operationId: string;
225
+ summary: string;
226
+ description: string;
227
+ responses: {
228
+ 200: {
229
+ description: string;
230
+ content: {
231
+ "application/json": {
232
+ schema: {
233
+ type: "object";
234
+ properties: {
235
+ user: {
236
+ $ref: string;
237
+ };
238
+ };
239
+ };
240
+ };
241
+ };
242
+ };
243
+ };
244
+ };
245
+ };
246
+ }, import("better-auth/plugins").UserWithRole>;
247
+ listUsers: import("better-auth").StrictEndpoint<"/admin/list-users", {
248
+ method: "GET";
249
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
250
+ session: {
251
+ user: import("better-auth/plugins").UserWithRole;
252
+ session: {
253
+ id: string;
254
+ createdAt: Date;
255
+ updatedAt: Date;
256
+ userId: string;
257
+ expiresAt: Date;
258
+ token: string;
259
+ ipAddress?: string | null | undefined;
260
+ userAgent?: string | null | undefined;
261
+ };
262
+ };
263
+ }>)[];
264
+ query: import("better-auth").ZodObject<{
265
+ searchValue: import("better-auth").ZodOptional<import("better-auth").ZodString>;
266
+ searchField: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
267
+ name: "name";
268
+ email: "email";
269
+ }>>;
270
+ searchOperator: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
271
+ contains: "contains";
272
+ starts_with: "starts_with";
273
+ ends_with: "ends_with";
274
+ }>>;
275
+ limit: import("better-auth").ZodOptional<import("better-auth").ZodUnion<[import("better-auth").ZodString, import("better-auth").ZodNumber]>>;
276
+ offset: import("better-auth").ZodOptional<import("better-auth").ZodUnion<[import("better-auth").ZodString, import("better-auth").ZodNumber]>>;
277
+ sortBy: import("better-auth").ZodOptional<import("better-auth").ZodString>;
278
+ sortDirection: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
279
+ asc: "asc";
280
+ desc: "desc";
281
+ }>>;
282
+ filterField: import("better-auth").ZodOptional<import("better-auth").ZodString>;
283
+ 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>]>>;
284
+ filterOperator: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
285
+ eq: "eq";
286
+ ne: "ne";
287
+ gt: "gt";
288
+ gte: "gte";
289
+ lt: "lt";
290
+ lte: "lte";
291
+ in: "in";
292
+ not_in: "not_in";
293
+ contains: "contains";
294
+ starts_with: "starts_with";
295
+ ends_with: "ends_with";
296
+ }>>;
297
+ }, import("better-auth").$strip>;
298
+ metadata: {
299
+ openapi: {
300
+ operationId: string;
301
+ summary: string;
302
+ description: string;
303
+ responses: {
304
+ 200: {
305
+ description: string;
306
+ content: {
307
+ "application/json": {
308
+ schema: {
309
+ type: "object";
310
+ properties: {
311
+ users: {
312
+ type: string;
313
+ items: {
314
+ $ref: string;
315
+ };
316
+ };
317
+ total: {
318
+ type: string;
319
+ };
320
+ limit: {
321
+ type: string;
322
+ };
323
+ offset: {
324
+ type: string;
325
+ };
326
+ };
327
+ required: string[];
328
+ };
329
+ };
330
+ };
331
+ };
332
+ };
333
+ };
334
+ };
335
+ }, {
336
+ users: import("better-auth/plugins").UserWithRole[];
337
+ total: number;
338
+ }>;
339
+ listUserSessions: import("better-auth").StrictEndpoint<"/admin/list-user-sessions", {
340
+ method: "POST";
341
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
342
+ session: {
343
+ user: import("better-auth/plugins").UserWithRole;
344
+ session: {
345
+ id: string;
346
+ createdAt: Date;
347
+ updatedAt: Date;
348
+ userId: string;
349
+ expiresAt: Date;
350
+ token: string;
351
+ ipAddress?: string | null | undefined;
352
+ userAgent?: string | null | undefined;
353
+ };
354
+ };
355
+ }>)[];
356
+ body: import("better-auth").ZodObject<{
357
+ userId: import("better-auth").ZodCoercedString<unknown>;
358
+ }, import("better-auth").$strip>;
359
+ metadata: {
360
+ openapi: {
361
+ operationId: string;
362
+ summary: string;
363
+ description: string;
364
+ responses: {
365
+ 200: {
366
+ description: string;
367
+ content: {
368
+ "application/json": {
369
+ schema: {
370
+ type: "object";
371
+ properties: {
372
+ sessions: {
373
+ type: string;
374
+ items: {
375
+ $ref: string;
376
+ };
377
+ };
378
+ };
379
+ };
380
+ };
381
+ };
382
+ };
383
+ };
384
+ };
385
+ };
386
+ }, {
387
+ sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
388
+ }>;
389
+ unbanUser: import("better-auth").StrictEndpoint<"/admin/unban-user", {
390
+ method: "POST";
391
+ body: import("better-auth").ZodObject<{
392
+ userId: import("better-auth").ZodCoercedString<unknown>;
393
+ }, import("better-auth").$strip>;
394
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
395
+ session: {
396
+ user: import("better-auth/plugins").UserWithRole;
397
+ session: {
398
+ id: string;
399
+ createdAt: Date;
400
+ updatedAt: Date;
401
+ userId: string;
402
+ expiresAt: Date;
403
+ token: string;
404
+ ipAddress?: string | null | undefined;
405
+ userAgent?: string | null | undefined;
406
+ };
407
+ };
408
+ }>)[];
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
+ user: {
423
+ $ref: string;
424
+ };
425
+ };
426
+ };
427
+ };
428
+ };
429
+ };
430
+ };
431
+ };
432
+ };
433
+ }, {
434
+ user: import("better-auth/plugins").UserWithRole;
435
+ }>;
436
+ banUser: import("better-auth").StrictEndpoint<"/admin/ban-user", {
437
+ method: "POST";
438
+ body: import("better-auth").ZodObject<{
439
+ userId: import("better-auth").ZodCoercedString<unknown>;
440
+ banReason: import("better-auth").ZodOptional<import("better-auth").ZodString>;
441
+ banExpiresIn: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
442
+ }, import("better-auth").$strip>;
443
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
444
+ session: {
445
+ user: import("better-auth/plugins").UserWithRole;
446
+ session: {
447
+ id: string;
448
+ createdAt: Date;
449
+ updatedAt: Date;
450
+ userId: string;
451
+ expiresAt: Date;
452
+ token: string;
453
+ ipAddress?: string | null | undefined;
454
+ userAgent?: string | null | undefined;
455
+ };
456
+ };
457
+ }>)[];
458
+ metadata: {
459
+ openapi: {
460
+ operationId: string;
461
+ summary: string;
462
+ description: string;
463
+ responses: {
464
+ 200: {
465
+ description: string;
466
+ content: {
467
+ "application/json": {
468
+ schema: {
469
+ type: "object";
470
+ properties: {
471
+ user: {
472
+ $ref: string;
473
+ };
474
+ };
475
+ };
476
+ };
477
+ };
478
+ };
479
+ };
480
+ };
481
+ };
482
+ }, {
483
+ user: import("better-auth/plugins").UserWithRole;
484
+ }>;
485
+ impersonateUser: import("better-auth").StrictEndpoint<"/admin/impersonate-user", {
486
+ method: "POST";
487
+ body: import("better-auth").ZodObject<{
488
+ userId: import("better-auth").ZodCoercedString<unknown>;
489
+ }, import("better-auth").$strip>;
490
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
491
+ session: {
492
+ user: import("better-auth/plugins").UserWithRole;
493
+ session: {
494
+ id: string;
495
+ createdAt: Date;
496
+ updatedAt: Date;
497
+ userId: string;
498
+ expiresAt: Date;
499
+ token: string;
500
+ ipAddress?: string | null | undefined;
501
+ userAgent?: string | null | undefined;
502
+ };
503
+ };
504
+ }>)[];
505
+ metadata: {
506
+ openapi: {
507
+ operationId: string;
508
+ summary: string;
509
+ description: string;
510
+ responses: {
511
+ 200: {
512
+ description: string;
513
+ content: {
514
+ "application/json": {
515
+ schema: {
516
+ type: "object";
517
+ properties: {
518
+ session: {
519
+ $ref: string;
520
+ };
521
+ user: {
522
+ $ref: string;
523
+ };
524
+ };
525
+ };
526
+ };
527
+ };
528
+ };
529
+ };
530
+ };
531
+ };
532
+ }, {
533
+ session: {
534
+ id: string;
535
+ createdAt: Date;
536
+ updatedAt: Date;
537
+ userId: string;
538
+ expiresAt: Date;
539
+ token: string;
540
+ ipAddress?: string | null | undefined;
541
+ userAgent?: string | null | undefined;
542
+ };
543
+ user: import("better-auth/plugins").UserWithRole;
544
+ }>;
545
+ stopImpersonating: import("better-auth").StrictEndpoint<"/admin/stop-impersonating", {
546
+ method: "POST";
547
+ requireHeaders: true;
548
+ }, {
549
+ session: {
550
+ id: string;
551
+ createdAt: Date;
552
+ updatedAt: Date;
553
+ userId: string;
554
+ expiresAt: Date;
555
+ token: string;
556
+ ipAddress?: string | null | undefined;
557
+ userAgent?: string | null | undefined;
558
+ } & Record<string, any>;
559
+ user: {
560
+ id: string;
561
+ createdAt: Date;
562
+ updatedAt: Date;
563
+ email: string;
564
+ emailVerified: boolean;
565
+ name: string;
566
+ image?: string | null | undefined;
567
+ } & Record<string, any>;
568
+ }>;
569
+ revokeUserSession: import("better-auth").StrictEndpoint<"/admin/revoke-user-session", {
570
+ method: "POST";
571
+ body: import("better-auth").ZodObject<{
572
+ sessionToken: import("better-auth").ZodString;
573
+ }, import("better-auth").$strip>;
574
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
575
+ session: {
576
+ user: import("better-auth/plugins").UserWithRole;
577
+ session: {
578
+ id: string;
579
+ createdAt: Date;
580
+ updatedAt: Date;
581
+ userId: string;
582
+ expiresAt: Date;
583
+ token: string;
584
+ ipAddress?: string | null | undefined;
585
+ userAgent?: string | null | undefined;
586
+ };
587
+ };
588
+ }>)[];
589
+ metadata: {
590
+ openapi: {
591
+ operationId: string;
592
+ summary: string;
593
+ description: string;
594
+ responses: {
595
+ 200: {
596
+ description: string;
597
+ content: {
598
+ "application/json": {
599
+ schema: {
600
+ type: "object";
601
+ properties: {
602
+ success: {
603
+ type: string;
604
+ };
605
+ };
606
+ };
607
+ };
608
+ };
609
+ };
610
+ };
611
+ };
612
+ };
613
+ }, {
614
+ success: boolean;
615
+ }>;
616
+ revokeUserSessions: import("better-auth").StrictEndpoint<"/admin/revoke-user-sessions", {
617
+ method: "POST";
618
+ body: import("better-auth").ZodObject<{
619
+ userId: import("better-auth").ZodCoercedString<unknown>;
620
+ }, import("better-auth").$strip>;
621
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
622
+ session: {
623
+ user: import("better-auth/plugins").UserWithRole;
624
+ session: {
625
+ id: string;
626
+ createdAt: Date;
627
+ updatedAt: Date;
628
+ userId: string;
629
+ expiresAt: Date;
630
+ token: string;
631
+ ipAddress?: string | null | undefined;
632
+ userAgent?: string | null | undefined;
633
+ };
634
+ };
635
+ }>)[];
636
+ metadata: {
637
+ openapi: {
638
+ operationId: string;
639
+ summary: string;
640
+ description: string;
641
+ responses: {
642
+ 200: {
643
+ description: string;
644
+ content: {
645
+ "application/json": {
646
+ schema: {
647
+ type: "object";
648
+ properties: {
649
+ success: {
650
+ type: string;
651
+ };
652
+ };
653
+ };
654
+ };
655
+ };
656
+ };
657
+ };
658
+ };
659
+ };
660
+ }, {
661
+ success: boolean;
662
+ }>;
663
+ removeUser: import("better-auth").StrictEndpoint<"/admin/remove-user", {
664
+ method: "POST";
665
+ body: import("better-auth").ZodObject<{
666
+ userId: import("better-auth").ZodCoercedString<unknown>;
667
+ }, import("better-auth").$strip>;
668
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
669
+ session: {
670
+ user: import("better-auth/plugins").UserWithRole;
671
+ session: {
672
+ id: string;
673
+ createdAt: Date;
674
+ updatedAt: Date;
675
+ userId: string;
676
+ expiresAt: Date;
677
+ token: string;
678
+ ipAddress?: string | null | undefined;
679
+ userAgent?: string | null | undefined;
680
+ };
681
+ };
682
+ }>)[];
683
+ metadata: {
684
+ openapi: {
685
+ operationId: string;
686
+ summary: string;
687
+ description: string;
688
+ responses: {
689
+ 200: {
690
+ description: string;
691
+ content: {
692
+ "application/json": {
693
+ schema: {
694
+ type: "object";
695
+ properties: {
696
+ success: {
697
+ type: string;
698
+ };
699
+ };
700
+ };
701
+ };
702
+ };
703
+ };
704
+ };
705
+ };
706
+ };
707
+ }, {
708
+ success: boolean;
709
+ }>;
710
+ setUserPassword: import("better-auth").StrictEndpoint<"/admin/set-user-password", {
711
+ method: "POST";
712
+ body: import("better-auth").ZodObject<{
713
+ newPassword: import("better-auth").ZodString;
714
+ userId: import("better-auth").ZodCoercedString<unknown>;
715
+ }, import("better-auth").$strip>;
716
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
717
+ session: {
718
+ user: import("better-auth/plugins").UserWithRole;
719
+ session: {
720
+ id: string;
721
+ createdAt: Date;
722
+ updatedAt: Date;
723
+ userId: string;
724
+ expiresAt: Date;
725
+ token: string;
726
+ ipAddress?: string | null | undefined;
727
+ userAgent?: string | null | undefined;
728
+ };
729
+ };
730
+ }>)[];
731
+ metadata: {
732
+ openapi: {
733
+ operationId: string;
734
+ summary: string;
735
+ description: string;
736
+ responses: {
737
+ 200: {
738
+ description: string;
739
+ content: {
740
+ "application/json": {
741
+ schema: {
742
+ type: "object";
743
+ properties: {
744
+ status: {
745
+ type: string;
746
+ };
747
+ };
748
+ };
749
+ };
750
+ };
751
+ };
752
+ };
753
+ };
754
+ };
755
+ }, {
756
+ status: boolean;
757
+ }>;
758
+ userHasPermission: import("better-auth").StrictEndpoint<"/admin/has-permission", {
759
+ method: "POST";
760
+ body: import("better-auth").ZodIntersection<import("better-auth").ZodObject<{
761
+ userId: import("better-auth").ZodOptional<import("better-auth").ZodCoercedString<unknown>>;
762
+ role: import("better-auth").ZodOptional<import("better-auth").ZodString>;
763
+ }, import("better-auth").$strip>, import("better-auth").ZodUnion<readonly [import("better-auth").ZodObject<{
764
+ permission: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>;
765
+ permissions: import("better-auth").ZodUndefined;
766
+ }, import("better-auth").$strip>, import("better-auth").ZodObject<{
767
+ permission: import("better-auth").ZodUndefined;
768
+ permissions: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>;
769
+ }, import("better-auth").$strip>]>>;
770
+ metadata: {
771
+ openapi: {
772
+ description: string;
773
+ requestBody: {
774
+ content: {
775
+ "application/json": {
776
+ schema: {
777
+ type: "object";
778
+ properties: {
779
+ permissions: {
780
+ type: string;
781
+ description: string;
782
+ };
783
+ };
784
+ required: string[];
785
+ };
786
+ };
787
+ };
788
+ };
789
+ responses: {
790
+ "200": {
791
+ description: string;
792
+ content: {
793
+ "application/json": {
794
+ schema: {
795
+ type: "object";
796
+ properties: {
797
+ error: {
798
+ type: string;
799
+ };
800
+ success: {
801
+ type: string;
802
+ };
803
+ };
804
+ required: string[];
805
+ };
806
+ };
807
+ };
808
+ };
809
+ };
810
+ };
811
+ $Infer: {
812
+ body: {
813
+ permissions: {
814
+ readonly user?: ("set-role" | "create" | "update" | "delete" | "get" | "list" | "ban" | "impersonate" | "impersonate-admins" | "set-password")[] | undefined;
815
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
816
+ };
817
+ } & {
818
+ userId?: string | undefined;
819
+ role?: "user" | "admin" | undefined;
820
+ };
821
+ };
822
+ };
823
+ }, {
824
+ error: null;
825
+ success: boolean;
826
+ }>;
827
+ };
828
+ $ERROR_CODES: {
829
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
830
+ FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
831
+ USER_ALREADY_EXISTS: import("better-auth").RawError<"USER_ALREADY_EXISTS">;
832
+ YOU_CANNOT_BAN_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_BAN_YOURSELF">;
833
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
834
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
835
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
836
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
837
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
838
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
839
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
840
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
841
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
842
+ BANNED_USER: import("better-auth").RawError<"BANNED_USER">;
843
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
844
+ NO_DATA_TO_UPDATE: import("better-auth").RawError<"NO_DATA_TO_UPDATE">;
845
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
846
+ YOU_CANNOT_REMOVE_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
847
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
848
+ YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
849
+ INVALID_ROLE_TYPE: import("better-auth").RawError<"INVALID_ROLE_TYPE">;
850
+ };
851
+ schema: {
852
+ user: {
853
+ fields: {
854
+ role: {
855
+ type: "string";
856
+ required: false;
857
+ input: false;
858
+ };
859
+ banned: {
860
+ type: "boolean";
861
+ defaultValue: false;
862
+ required: false;
863
+ input: false;
864
+ };
865
+ banReason: {
866
+ type: "string";
867
+ required: false;
868
+ input: false;
869
+ };
870
+ banExpires: {
871
+ type: "date";
872
+ required: false;
873
+ input: false;
874
+ };
875
+ };
876
+ };
877
+ session: {
878
+ fields: {
879
+ impersonatedBy: {
880
+ type: "string";
881
+ required: false;
882
+ };
883
+ };
884
+ };
885
+ };
886
+ options: NoInfer<{
887
+ defaultRole: string;
888
+ }>;
889
+ }, {
890
+ id: "custom-session";
891
+ hooks: {
892
+ after: {
893
+ matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
894
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
895
+ user: {
896
+ id: string;
897
+ createdAt: Date;
898
+ updatedAt: Date;
899
+ email: string;
900
+ emailVerified: boolean;
901
+ name: string;
902
+ image?: string | null | undefined;
903
+ role?: import("@prisma/client").$Enums.Role;
904
+ banned?: boolean | null;
905
+ };
906
+ session: {
907
+ id: string;
908
+ createdAt: Date;
909
+ updatedAt: Date;
910
+ userId: string;
911
+ expiresAt: Date;
912
+ token: string;
913
+ ipAddress?: string | null | undefined;
914
+ userAgent?: string | null | undefined;
915
+ };
916
+ }[] | undefined>;
917
+ }[];
918
+ };
919
+ endpoints: {
920
+ getSession: import("better-auth").StrictEndpoint<"/get-session", {
921
+ method: "GET";
922
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
923
+ disableCookieCache: import("better-auth").ZodOptional<import("better-auth").ZodUnion<[import("better-auth").ZodBoolean, import("better-auth").ZodPipe<import("better-auth").ZodString, import("better-auth").ZodTransform<boolean, string>>]>>;
924
+ disableRefresh: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
925
+ }, import("better-auth").$strip>>;
926
+ metadata: {
927
+ CUSTOM_SESSION: boolean;
928
+ openapi: {
929
+ description: string;
930
+ responses: {
931
+ "200": {
932
+ description: string;
933
+ content: {
934
+ "application/json": {
935
+ schema: {
936
+ type: "array";
937
+ nullable: boolean;
938
+ items: {
939
+ $ref: string;
940
+ };
941
+ };
942
+ };
943
+ };
944
+ };
945
+ };
946
+ };
947
+ };
948
+ requireHeaders: true;
949
+ }, {
950
+ user: {
951
+ id: string;
952
+ createdAt: Date;
953
+ updatedAt: Date;
954
+ email: string;
955
+ emailVerified: boolean;
956
+ name: string;
957
+ image?: string | null | undefined;
958
+ role?: import("@prisma/client").$Enums.Role;
959
+ banned?: boolean | null;
960
+ };
961
+ session: {
962
+ id: string;
963
+ createdAt: Date;
964
+ updatedAt: Date;
965
+ userId: string;
966
+ expiresAt: Date;
967
+ token: string;
968
+ ipAddress?: string | null | undefined;
969
+ userAgent?: string | null | undefined;
970
+ };
971
+ } | null>;
972
+ };
973
+ $Infer: {
974
+ Session: {
975
+ user: {
976
+ id: string;
977
+ createdAt: Date;
978
+ updatedAt: Date;
979
+ email: string;
980
+ emailVerified: boolean;
981
+ name: string;
982
+ image?: string | null | undefined;
983
+ role?: import("@prisma/client").$Enums.Role;
984
+ banned?: boolean | null;
985
+ };
986
+ session: {
987
+ id: string;
988
+ createdAt: Date;
989
+ updatedAt: Date;
990
+ userId: string;
991
+ expiresAt: Date;
992
+ token: string;
993
+ ipAddress?: string | null | undefined;
994
+ userAgent?: string | null | undefined;
995
+ };
996
+ };
997
+ };
998
+ options: import("better-auth/plugins").CustomSessionPluginOptions | undefined;
999
+ }];
1000
+ rateLimit: {
1001
+ enabled: boolean;
1002
+ window: number;
1003
+ max: number;
1004
+ };
1005
+ emailVerification: {
1006
+ sendVerificationEmail: ({ user, url, token }: {
1007
+ user: import("better-auth").User;
1008
+ url: string;
1009
+ token: string;
1010
+ }, request: Request | undefined) => Promise<void>;
1011
+ sendOnSignUp: true;
1012
+ sendOnSignIn: true;
1013
+ autoSignInAfterVerification: true;
1014
+ };
1015
+ emailAndPassword: {
1016
+ enabled: true;
1017
+ requireEmailVerification: true;
1018
+ sendResetPassword: ({ user, url, token }: {
1019
+ user: import("better-auth").User;
1020
+ url: string;
1021
+ token: string;
1022
+ }, request: Request | undefined) => Promise<void>;
1023
+ };
1024
+ }>;
1025
+ export type Auth = typeof auth;
1026
+ export declare const getServerSessionAPI: ({ requestHeaders, }: {
1027
+ requestHeaders: Headers;
1028
+ }) => Promise<{
1029
+ user: {
1030
+ id: string;
1031
+ createdAt: Date;
1032
+ updatedAt: Date;
1033
+ email: string;
1034
+ emailVerified: boolean;
1035
+ name: string;
1036
+ image?: string | null | undefined;
1037
+ role?: import("@prisma/client").$Enums.Role;
1038
+ banned?: boolean | null;
1039
+ };
1040
+ session: {
1041
+ id: string;
1042
+ createdAt: Date;
1043
+ updatedAt: Date;
1044
+ userId: string;
1045
+ expiresAt: Date;
1046
+ token: string;
1047
+ ipAddress?: string | null | undefined;
1048
+ userAgent?: string | null | undefined;
1049
+ };
1050
+ } | null>;
1051
+ //# sourceMappingURL=auth.d.ts.map