@voyantjs/auth 0.1.0 → 0.2.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.
package/dist/next.d.ts DELETED
@@ -1,1100 +0,0 @@
1
- /**
2
- * Next.js-specific auth helpers.
3
- *
4
- * These use `next/headers` and `nextCookies()` plugin —
5
- * only import from apps running on Next.js (apps/dash, apps/customer, apps/site-template).
6
- *
7
- * For framework-agnostic usage, import from `@pxmstudio/voyant-auth/server` instead.
8
- */
9
- export declare const betterAuthNext: import("better-auth").Auth<{
10
- secret: string;
11
- database: (options: import("better-auth").BetterAuthOptions) => import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
12
- emailAndPassword: {
13
- enabled: true;
14
- sendResetPassword: ({ user, url }: {
15
- user: import("better-auth").User;
16
- url: string;
17
- token: string;
18
- }) => Promise<void>;
19
- };
20
- socialProviders: {
21
- google: {
22
- clientId: string;
23
- clientSecret: string;
24
- enabled: boolean;
25
- };
26
- };
27
- trustedOrigins: string[];
28
- plugins: [{
29
- id: "api-key";
30
- $ERROR_CODES: {
31
- readonly INVALID_METADATA_TYPE: "metadata must be an object or undefined";
32
- readonly REFILL_AMOUNT_AND_INTERVAL_REQUIRED: "refillAmount is required when refillInterval is provided";
33
- readonly REFILL_INTERVAL_AND_AMOUNT_REQUIRED: "refillInterval is required when refillAmount is provided";
34
- readonly USER_BANNED: "User is banned";
35
- readonly UNAUTHORIZED_SESSION: "Unauthorized or invalid session";
36
- readonly KEY_NOT_FOUND: "API Key not found";
37
- readonly KEY_DISABLED: "API Key is disabled";
38
- readonly KEY_EXPIRED: "API Key has expired";
39
- readonly USAGE_EXCEEDED: "API Key has reached its usage limit";
40
- readonly KEY_NOT_RECOVERABLE: "API Key is not recoverable";
41
- readonly EXPIRES_IN_IS_TOO_SMALL: "The expiresIn is smaller than the predefined minimum value.";
42
- readonly EXPIRES_IN_IS_TOO_LARGE: "The expiresIn is larger than the predefined maximum value.";
43
- readonly INVALID_REMAINING: "The remaining count is either too large or too small.";
44
- readonly INVALID_PREFIX_LENGTH: "The prefix length is either too large or too small.";
45
- readonly INVALID_NAME_LENGTH: "The name length is either too large or too small.";
46
- readonly METADATA_DISABLED: "Metadata is disabled.";
47
- readonly RATE_LIMIT_EXCEEDED: "Rate limit exceeded.";
48
- readonly NO_VALUES_TO_UPDATE: "No values to update.";
49
- readonly KEY_DISABLED_EXPIRATION: "Custom key expiration values are disabled.";
50
- readonly INVALID_API_KEY: "Invalid API key.";
51
- readonly INVALID_USER_ID_FROM_API_KEY: "The user id from the API key is invalid.";
52
- readonly INVALID_API_KEY_GETTER_RETURN_TYPE: "API Key getter returned an invalid key type. Expected string.";
53
- readonly SERVER_ONLY_PROPERTY: "The property you're trying to set can only be set from the server auth instance only.";
54
- readonly FAILED_TO_UPDATE_API_KEY: "Failed to update API key";
55
- readonly NAME_REQUIRED: "API Key name is required.";
56
- };
57
- hooks: {
58
- before: {
59
- matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
60
- handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
61
- user: {
62
- id: string;
63
- createdAt: Date;
64
- updatedAt: Date;
65
- email: string;
66
- emailVerified: boolean;
67
- name: string;
68
- image?: string | null | undefined;
69
- };
70
- session: {
71
- id: string;
72
- token: string;
73
- userId: string;
74
- userAgent: string | null;
75
- ipAddress: string | null;
76
- createdAt: Date;
77
- updatedAt: Date;
78
- expiresAt: Date;
79
- };
80
- } | {
81
- context: import("better-auth").MiddlewareContext<import("better-auth").MiddlewareOptions, {
82
- returned?: unknown | undefined;
83
- responseHeaders?: Headers | undefined;
84
- } & import("better-auth").PluginContext & import("better-auth").InfoContext & {
85
- options: import("better-auth").BetterAuthOptions;
86
- appName: string;
87
- baseURL: string;
88
- trustedOrigins: string[];
89
- isTrustedOrigin: (url: string, settings?: {
90
- allowRelativePaths: boolean;
91
- }) => boolean;
92
- oauthConfig: {
93
- skipStateCookieCheck?: boolean | undefined;
94
- storeStateStrategy: "database" | "cookie";
95
- };
96
- newSession: {
97
- session: import("better-auth").Session & Record<string, any>;
98
- user: import("better-auth").User & Record<string, any>;
99
- } | null;
100
- session: {
101
- session: import("better-auth").Session & Record<string, any>;
102
- user: import("better-auth").User & Record<string, any>;
103
- } | null;
104
- setNewSession: (session: {
105
- session: import("better-auth").Session & Record<string, any>;
106
- user: import("better-auth").User & Record<string, any>;
107
- } | null) => void;
108
- socialProviders: import("better-auth").OAuthProvider[];
109
- authCookies: import("better-auth").BetterAuthCookies;
110
- logger: ReturnType<(options?: import("better-auth").Logger | undefined) => import("better-auth").InternalLogger>;
111
- rateLimit: {
112
- enabled: boolean;
113
- window: number;
114
- max: number;
115
- storage: "memory" | "database" | "secondary-storage";
116
- } & Omit<import("better-auth").BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
117
- adapter: import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
118
- internalAdapter: import("better-auth").InternalAdapter<import("better-auth").BetterAuthOptions>;
119
- createAuthCookie: (cookieName: string, overrideAttributes?: Partial<import("better-auth").CookieOptions> | undefined) => import("better-auth").BetterAuthCookie;
120
- secret: string;
121
- sessionConfig: {
122
- updateAge: number;
123
- expiresIn: number;
124
- freshAge: number;
125
- cookieRefreshCache: false | {
126
- enabled: true;
127
- updateAge: number;
128
- };
129
- };
130
- generateId: (options: {
131
- model: import("better-auth").ModelNames;
132
- size?: number | undefined;
133
- }) => string | false;
134
- secondaryStorage: import("better-auth").SecondaryStorage | undefined;
135
- password: {
136
- hash: (password: string) => Promise<string>;
137
- verify: (data: {
138
- password: string;
139
- hash: string;
140
- }) => Promise<boolean>;
141
- config: {
142
- minPasswordLength: number;
143
- maxPasswordLength: number;
144
- };
145
- checkPassword: (userId: string, ctx: import("better-auth").GenericEndpointContext<import("better-auth").BetterAuthOptions>) => Promise<boolean>;
146
- };
147
- tables: import("better-auth").BetterAuthDBSchema;
148
- runMigrations: () => Promise<void>;
149
- publishTelemetry: (event: {
150
- type: string;
151
- anonymousId?: string | undefined;
152
- payload: Record<string, any>;
153
- }) => Promise<void>;
154
- skipOriginCheck: boolean | string[];
155
- skipCSRFCheck: boolean;
156
- runInBackground: (promise: Promise<unknown>) => void;
157
- runInBackgroundOrAwait: (promise: Promise<unknown> | void) => import("better-auth").Awaitable<unknown>;
158
- }>;
159
- }>;
160
- }[];
161
- };
162
- endpoints: {
163
- createApiKey: import("better-auth").StrictEndpoint<"/api-key/create", {
164
- method: "POST";
165
- body: import("better-auth").ZodObject<{
166
- name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
167
- expiresIn: import("better-auth").ZodDefault<import("better-auth").ZodNullable<import("better-auth").ZodOptional<import("better-auth").ZodNumber>>>;
168
- userId: import("better-auth").ZodOptional<import("better-auth").ZodCoercedString<unknown>>;
169
- prefix: import("better-auth").ZodOptional<import("better-auth").ZodString>;
170
- remaining: import("better-auth").ZodDefault<import("better-auth").ZodNullable<import("better-auth").ZodOptional<import("better-auth").ZodNumber>>>;
171
- metadata: import("better-auth").ZodOptional<import("better-auth").ZodAny>;
172
- refillAmount: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
173
- refillInterval: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
174
- rateLimitTimeWindow: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
175
- rateLimitMax: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
176
- rateLimitEnabled: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
177
- permissions: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>>;
178
- }, import("better-auth").$strip>;
179
- metadata: {
180
- openapi: {
181
- description: string;
182
- responses: {
183
- "200": {
184
- description: string;
185
- content: {
186
- "application/json": {
187
- schema: {
188
- type: "object";
189
- properties: {
190
- id: {
191
- type: string;
192
- description: string;
193
- };
194
- createdAt: {
195
- type: string;
196
- format: string;
197
- description: string;
198
- };
199
- updatedAt: {
200
- type: string;
201
- format: string;
202
- description: string;
203
- };
204
- name: {
205
- type: string;
206
- nullable: boolean;
207
- description: string;
208
- };
209
- prefix: {
210
- type: string;
211
- nullable: boolean;
212
- description: string;
213
- };
214
- start: {
215
- type: string;
216
- nullable: boolean;
217
- description: string;
218
- };
219
- key: {
220
- type: string;
221
- description: string;
222
- };
223
- enabled: {
224
- type: string;
225
- description: string;
226
- };
227
- expiresAt: {
228
- type: string;
229
- format: string;
230
- nullable: boolean;
231
- description: string;
232
- };
233
- userId: {
234
- type: string;
235
- description: string;
236
- };
237
- lastRefillAt: {
238
- type: string;
239
- format: string;
240
- nullable: boolean;
241
- description: string;
242
- };
243
- lastRequest: {
244
- type: string;
245
- format: string;
246
- nullable: boolean;
247
- description: string;
248
- };
249
- metadata: {
250
- type: string;
251
- nullable: boolean;
252
- additionalProperties: boolean;
253
- description: string;
254
- };
255
- rateLimitMax: {
256
- type: string;
257
- nullable: boolean;
258
- description: string;
259
- };
260
- rateLimitTimeWindow: {
261
- type: string;
262
- nullable: boolean;
263
- description: string;
264
- };
265
- remaining: {
266
- type: string;
267
- nullable: boolean;
268
- description: string;
269
- };
270
- refillAmount: {
271
- type: string;
272
- nullable: boolean;
273
- description: string;
274
- };
275
- refillInterval: {
276
- type: string;
277
- nullable: boolean;
278
- description: string;
279
- };
280
- rateLimitEnabled: {
281
- type: string;
282
- description: string;
283
- };
284
- requestCount: {
285
- type: string;
286
- description: string;
287
- };
288
- permissions: {
289
- type: string;
290
- nullable: boolean;
291
- additionalProperties: {
292
- type: string;
293
- items: {
294
- type: string;
295
- };
296
- };
297
- description: string;
298
- };
299
- };
300
- required: string[];
301
- };
302
- };
303
- };
304
- };
305
- };
306
- };
307
- };
308
- }, {
309
- key: string;
310
- metadata: any;
311
- permissions: any;
312
- id: string;
313
- name: string | null;
314
- start: string | null;
315
- prefix: string | null;
316
- userId: string;
317
- refillInterval: number | null;
318
- refillAmount: number | null;
319
- lastRefillAt: Date | null;
320
- enabled: boolean;
321
- rateLimitEnabled: boolean;
322
- rateLimitTimeWindow: number | null;
323
- rateLimitMax: number | null;
324
- requestCount: number;
325
- remaining: number | null;
326
- lastRequest: Date | null;
327
- expiresAt: Date | null;
328
- createdAt: Date;
329
- updatedAt: Date;
330
- }>;
331
- verifyApiKey: import("better-auth").StrictEndpoint<string, {
332
- method: "POST";
333
- body: import("better-auth").ZodObject<{
334
- key: import("better-auth").ZodString;
335
- permissions: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>>;
336
- }, import("better-auth").$strip>;
337
- }, {
338
- valid: boolean;
339
- error: {
340
- message: string | undefined;
341
- code: string;
342
- };
343
- key: null;
344
- } | {
345
- valid: boolean;
346
- error: null;
347
- key: Omit<import("better-auth/plugins").ApiKey, "key"> | null;
348
- }>;
349
- getApiKey: import("better-auth").StrictEndpoint<"/api-key/get", {
350
- method: "GET";
351
- query: import("better-auth").ZodObject<{
352
- id: import("better-auth").ZodString;
353
- }, import("better-auth").$strip>;
354
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
355
- session: {
356
- session: Record<string, any> & {
357
- id: string;
358
- createdAt: Date;
359
- updatedAt: Date;
360
- userId: string;
361
- expiresAt: Date;
362
- token: string;
363
- ipAddress?: string | null | undefined;
364
- userAgent?: string | null | undefined;
365
- };
366
- user: Record<string, any> & {
367
- id: string;
368
- createdAt: Date;
369
- updatedAt: Date;
370
- email: string;
371
- emailVerified: boolean;
372
- name: string;
373
- image?: string | null | undefined;
374
- };
375
- };
376
- }>)[];
377
- metadata: {
378
- openapi: {
379
- description: string;
380
- responses: {
381
- "200": {
382
- description: string;
383
- content: {
384
- "application/json": {
385
- schema: {
386
- type: "object";
387
- properties: {
388
- id: {
389
- type: string;
390
- description: string;
391
- };
392
- name: {
393
- type: string;
394
- nullable: boolean;
395
- description: string;
396
- };
397
- start: {
398
- type: string;
399
- nullable: boolean;
400
- description: string;
401
- };
402
- prefix: {
403
- type: string;
404
- nullable: boolean;
405
- description: string;
406
- };
407
- userId: {
408
- type: string;
409
- description: string;
410
- };
411
- refillInterval: {
412
- type: string;
413
- nullable: boolean;
414
- description: string;
415
- };
416
- refillAmount: {
417
- type: string;
418
- nullable: boolean;
419
- description: string;
420
- };
421
- lastRefillAt: {
422
- type: string;
423
- format: string;
424
- nullable: boolean;
425
- description: string;
426
- };
427
- enabled: {
428
- type: string;
429
- description: string;
430
- default: boolean;
431
- };
432
- rateLimitEnabled: {
433
- type: string;
434
- description: string;
435
- };
436
- rateLimitTimeWindow: {
437
- type: string;
438
- nullable: boolean;
439
- description: string;
440
- };
441
- rateLimitMax: {
442
- type: string;
443
- nullable: boolean;
444
- description: string;
445
- };
446
- requestCount: {
447
- type: string;
448
- description: string;
449
- };
450
- remaining: {
451
- type: string;
452
- nullable: boolean;
453
- description: string;
454
- };
455
- lastRequest: {
456
- type: string;
457
- format: string;
458
- nullable: boolean;
459
- description: string;
460
- };
461
- expiresAt: {
462
- type: string;
463
- format: string;
464
- nullable: boolean;
465
- description: string;
466
- };
467
- createdAt: {
468
- type: string;
469
- format: string;
470
- description: string;
471
- };
472
- updatedAt: {
473
- type: string;
474
- format: string;
475
- description: string;
476
- };
477
- metadata: {
478
- type: string;
479
- nullable: boolean;
480
- additionalProperties: boolean;
481
- description: string;
482
- };
483
- permissions: {
484
- type: string;
485
- nullable: boolean;
486
- description: string;
487
- };
488
- };
489
- required: string[];
490
- };
491
- };
492
- };
493
- };
494
- };
495
- };
496
- };
497
- }, {
498
- metadata: Record<string, any> | null;
499
- permissions: {
500
- [key: string]: string[];
501
- } | null;
502
- id: string;
503
- name: string | null;
504
- start: string | null;
505
- prefix: string | null;
506
- userId: string;
507
- refillInterval: number | null;
508
- refillAmount: number | null;
509
- lastRefillAt: Date | null;
510
- enabled: boolean;
511
- rateLimitEnabled: boolean;
512
- rateLimitTimeWindow: number | null;
513
- rateLimitMax: number | null;
514
- requestCount: number;
515
- remaining: number | null;
516
- lastRequest: Date | null;
517
- expiresAt: Date | null;
518
- createdAt: Date;
519
- updatedAt: Date;
520
- }>;
521
- updateApiKey: import("better-auth").StrictEndpoint<"/api-key/update", {
522
- method: "POST";
523
- body: import("better-auth").ZodObject<{
524
- keyId: import("better-auth").ZodString;
525
- userId: import("better-auth").ZodOptional<import("better-auth").ZodCoercedString<unknown>>;
526
- name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
527
- enabled: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
528
- remaining: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
529
- refillAmount: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
530
- refillInterval: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
531
- metadata: import("better-auth").ZodOptional<import("better-auth").ZodAny>;
532
- expiresIn: import("better-auth").ZodNullable<import("better-auth").ZodOptional<import("better-auth").ZodNumber>>;
533
- rateLimitEnabled: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
534
- rateLimitTimeWindow: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
535
- rateLimitMax: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
536
- permissions: import("better-auth").ZodNullable<import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>>>;
537
- }, import("better-auth").$strip>;
538
- metadata: {
539
- openapi: {
540
- description: string;
541
- responses: {
542
- "200": {
543
- description: string;
544
- content: {
545
- "application/json": {
546
- schema: {
547
- type: "object";
548
- properties: {
549
- id: {
550
- type: string;
551
- description: string;
552
- };
553
- name: {
554
- type: string;
555
- nullable: boolean;
556
- description: string;
557
- };
558
- start: {
559
- type: string;
560
- nullable: boolean;
561
- description: string;
562
- };
563
- prefix: {
564
- type: string;
565
- nullable: boolean;
566
- description: string;
567
- };
568
- userId: {
569
- type: string;
570
- description: string;
571
- };
572
- refillInterval: {
573
- type: string;
574
- nullable: boolean;
575
- description: string;
576
- };
577
- refillAmount: {
578
- type: string;
579
- nullable: boolean;
580
- description: string;
581
- };
582
- lastRefillAt: {
583
- type: string;
584
- format: string;
585
- nullable: boolean;
586
- description: string;
587
- };
588
- enabled: {
589
- type: string;
590
- description: string;
591
- default: boolean;
592
- };
593
- rateLimitEnabled: {
594
- type: string;
595
- description: string;
596
- };
597
- rateLimitTimeWindow: {
598
- type: string;
599
- nullable: boolean;
600
- description: string;
601
- };
602
- rateLimitMax: {
603
- type: string;
604
- nullable: boolean;
605
- description: string;
606
- };
607
- requestCount: {
608
- type: string;
609
- description: string;
610
- };
611
- remaining: {
612
- type: string;
613
- nullable: boolean;
614
- description: string;
615
- };
616
- lastRequest: {
617
- type: string;
618
- format: string;
619
- nullable: boolean;
620
- description: string;
621
- };
622
- expiresAt: {
623
- type: string;
624
- format: string;
625
- nullable: boolean;
626
- description: string;
627
- };
628
- createdAt: {
629
- type: string;
630
- format: string;
631
- description: string;
632
- };
633
- updatedAt: {
634
- type: string;
635
- format: string;
636
- description: string;
637
- };
638
- metadata: {
639
- type: string;
640
- nullable: boolean;
641
- additionalProperties: boolean;
642
- description: string;
643
- };
644
- permissions: {
645
- type: string;
646
- nullable: boolean;
647
- description: string;
648
- };
649
- };
650
- required: string[];
651
- };
652
- };
653
- };
654
- };
655
- };
656
- };
657
- };
658
- }, {
659
- metadata: Record<string, any> | null;
660
- permissions: {
661
- [key: string]: string[];
662
- } | null;
663
- id: string;
664
- name: string | null;
665
- start: string | null;
666
- prefix: string | null;
667
- userId: string;
668
- refillInterval: number | null;
669
- refillAmount: number | null;
670
- lastRefillAt: Date | null;
671
- enabled: boolean;
672
- rateLimitEnabled: boolean;
673
- rateLimitTimeWindow: number | null;
674
- rateLimitMax: number | null;
675
- requestCount: number;
676
- remaining: number | null;
677
- lastRequest: Date | null;
678
- expiresAt: Date | null;
679
- createdAt: Date;
680
- updatedAt: Date;
681
- }>;
682
- deleteApiKey: import("better-auth").StrictEndpoint<"/api-key/delete", {
683
- method: "POST";
684
- body: import("better-auth").ZodObject<{
685
- keyId: import("better-auth").ZodString;
686
- }, import("better-auth").$strip>;
687
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
688
- session: {
689
- session: Record<string, any> & {
690
- id: string;
691
- createdAt: Date;
692
- updatedAt: Date;
693
- userId: string;
694
- expiresAt: Date;
695
- token: string;
696
- ipAddress?: string | null | undefined;
697
- userAgent?: string | null | undefined;
698
- };
699
- user: Record<string, any> & {
700
- id: string;
701
- createdAt: Date;
702
- updatedAt: Date;
703
- email: string;
704
- emailVerified: boolean;
705
- name: string;
706
- image?: string | null | undefined;
707
- };
708
- };
709
- }>)[];
710
- metadata: {
711
- openapi: {
712
- description: string;
713
- requestBody: {
714
- content: {
715
- "application/json": {
716
- schema: {
717
- type: "object";
718
- properties: {
719
- keyId: {
720
- type: string;
721
- description: string;
722
- };
723
- };
724
- required: string[];
725
- };
726
- };
727
- };
728
- };
729
- responses: {
730
- "200": {
731
- description: string;
732
- content: {
733
- "application/json": {
734
- schema: {
735
- type: "object";
736
- properties: {
737
- success: {
738
- type: string;
739
- description: string;
740
- };
741
- };
742
- required: string[];
743
- };
744
- };
745
- };
746
- };
747
- };
748
- };
749
- };
750
- }, {
751
- success: boolean;
752
- }>;
753
- listApiKeys: import("better-auth").StrictEndpoint<"/api-key/list", {
754
- method: "GET";
755
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
756
- session: {
757
- session: Record<string, any> & {
758
- id: string;
759
- createdAt: Date;
760
- updatedAt: Date;
761
- userId: string;
762
- expiresAt: Date;
763
- token: string;
764
- ipAddress?: string | null | undefined;
765
- userAgent?: string | null | undefined;
766
- };
767
- user: Record<string, any> & {
768
- id: string;
769
- createdAt: Date;
770
- updatedAt: Date;
771
- email: string;
772
- emailVerified: boolean;
773
- name: string;
774
- image?: string | null | undefined;
775
- };
776
- };
777
- }>)[];
778
- metadata: {
779
- openapi: {
780
- description: string;
781
- responses: {
782
- "200": {
783
- description: string;
784
- content: {
785
- "application/json": {
786
- schema: {
787
- type: "array";
788
- items: {
789
- type: string;
790
- properties: {
791
- id: {
792
- type: string;
793
- description: string;
794
- };
795
- name: {
796
- type: string;
797
- nullable: boolean;
798
- description: string;
799
- };
800
- start: {
801
- type: string;
802
- nullable: boolean;
803
- description: string;
804
- };
805
- prefix: {
806
- type: string;
807
- nullable: boolean;
808
- description: string;
809
- };
810
- userId: {
811
- type: string;
812
- description: string;
813
- };
814
- refillInterval: {
815
- type: string;
816
- nullable: boolean;
817
- description: string;
818
- };
819
- refillAmount: {
820
- type: string;
821
- nullable: boolean;
822
- description: string;
823
- };
824
- lastRefillAt: {
825
- type: string;
826
- format: string;
827
- nullable: boolean;
828
- description: string;
829
- };
830
- enabled: {
831
- type: string;
832
- description: string;
833
- default: boolean;
834
- };
835
- rateLimitEnabled: {
836
- type: string;
837
- description: string;
838
- };
839
- rateLimitTimeWindow: {
840
- type: string;
841
- nullable: boolean;
842
- description: string;
843
- };
844
- rateLimitMax: {
845
- type: string;
846
- nullable: boolean;
847
- description: string;
848
- };
849
- requestCount: {
850
- type: string;
851
- description: string;
852
- };
853
- remaining: {
854
- type: string;
855
- nullable: boolean;
856
- description: string;
857
- };
858
- lastRequest: {
859
- type: string;
860
- format: string;
861
- nullable: boolean;
862
- description: string;
863
- };
864
- expiresAt: {
865
- type: string;
866
- format: string;
867
- nullable: boolean;
868
- description: string;
869
- };
870
- createdAt: {
871
- type: string;
872
- format: string;
873
- description: string;
874
- };
875
- updatedAt: {
876
- type: string;
877
- format: string;
878
- description: string;
879
- };
880
- metadata: {
881
- type: string;
882
- nullable: boolean;
883
- additionalProperties: boolean;
884
- description: string;
885
- };
886
- permissions: {
887
- type: string;
888
- nullable: boolean;
889
- description: string;
890
- };
891
- };
892
- required: string[];
893
- };
894
- };
895
- };
896
- };
897
- };
898
- };
899
- };
900
- };
901
- }, {
902
- metadata: Record<string, any> | null;
903
- permissions: {
904
- [key: string]: string[];
905
- } | null;
906
- id: string;
907
- name: string | null;
908
- start: string | null;
909
- prefix: string | null;
910
- userId: string;
911
- refillInterval: number | null;
912
- refillAmount: number | null;
913
- lastRefillAt: Date | null;
914
- enabled: boolean;
915
- rateLimitEnabled: boolean;
916
- rateLimitTimeWindow: number | null;
917
- rateLimitMax: number | null;
918
- requestCount: number;
919
- remaining: number | null;
920
- lastRequest: Date | null;
921
- expiresAt: Date | null;
922
- createdAt: Date;
923
- updatedAt: Date;
924
- }[]>;
925
- deleteAllExpiredApiKeys: import("better-auth").StrictEndpoint<string, {
926
- method: "POST";
927
- }, {
928
- success: boolean;
929
- error: unknown;
930
- }>;
931
- };
932
- schema: {
933
- apikey: {
934
- fields: {
935
- name: {
936
- type: "string";
937
- required: false;
938
- input: false;
939
- };
940
- start: {
941
- type: "string";
942
- required: false;
943
- input: false;
944
- };
945
- prefix: {
946
- type: "string";
947
- required: false;
948
- input: false;
949
- };
950
- key: {
951
- type: "string";
952
- required: true;
953
- input: false;
954
- index: true;
955
- };
956
- userId: {
957
- type: "string";
958
- references: {
959
- model: string;
960
- field: string;
961
- onDelete: "cascade";
962
- };
963
- required: true;
964
- input: false;
965
- index: true;
966
- };
967
- refillInterval: {
968
- type: "number";
969
- required: false;
970
- input: false;
971
- };
972
- refillAmount: {
973
- type: "number";
974
- required: false;
975
- input: false;
976
- };
977
- lastRefillAt: {
978
- type: "date";
979
- required: false;
980
- input: false;
981
- };
982
- enabled: {
983
- type: "boolean";
984
- required: false;
985
- input: false;
986
- defaultValue: true;
987
- };
988
- rateLimitEnabled: {
989
- type: "boolean";
990
- required: false;
991
- input: false;
992
- defaultValue: true;
993
- };
994
- rateLimitTimeWindow: {
995
- type: "number";
996
- required: false;
997
- input: false;
998
- defaultValue: number;
999
- };
1000
- rateLimitMax: {
1001
- type: "number";
1002
- required: false;
1003
- input: false;
1004
- defaultValue: number;
1005
- };
1006
- requestCount: {
1007
- type: "number";
1008
- required: false;
1009
- input: false;
1010
- defaultValue: number;
1011
- };
1012
- remaining: {
1013
- type: "number";
1014
- required: false;
1015
- input: false;
1016
- };
1017
- lastRequest: {
1018
- type: "date";
1019
- required: false;
1020
- input: false;
1021
- };
1022
- expiresAt: {
1023
- type: "date";
1024
- required: false;
1025
- input: false;
1026
- };
1027
- createdAt: {
1028
- type: "date";
1029
- required: true;
1030
- input: false;
1031
- };
1032
- updatedAt: {
1033
- type: "date";
1034
- required: true;
1035
- input: false;
1036
- };
1037
- permissions: {
1038
- type: "string";
1039
- required: false;
1040
- input: false;
1041
- };
1042
- metadata: {
1043
- type: "string";
1044
- required: false;
1045
- input: true;
1046
- transform: {
1047
- input(value: import("better-auth").DBPrimitive): string;
1048
- output(value: import("better-auth").DBPrimitive): any;
1049
- };
1050
- };
1051
- };
1052
- };
1053
- };
1054
- options: import("better-auth/plugins").ApiKeyOptions | undefined;
1055
- }, ...import("better-auth").BetterAuthPlugin[]];
1056
- databaseHooks: {
1057
- user: {
1058
- create: {
1059
- before: () => Promise<true>;
1060
- after: (user: {
1061
- id: string;
1062
- createdAt: Date;
1063
- updatedAt: Date;
1064
- email: string;
1065
- emailVerified: boolean;
1066
- name: string;
1067
- image?: string | null | undefined;
1068
- } & Record<string, unknown>) => Promise<void>;
1069
- };
1070
- };
1071
- };
1072
- advanced: {
1073
- useSecureCookies: boolean;
1074
- };
1075
- basePath?: string | undefined;
1076
- appName: string;
1077
- baseURL: string;
1078
- }>;
1079
- export declare const auth: (() => Promise<{
1080
- userId: string | null;
1081
- sessionId?: string;
1082
- sessionStatus: "active" | "signed_out";
1083
- getToken: () => Promise<string | null>;
1084
- }>) & {
1085
- protect: () => Promise<{
1086
- userId: string | null;
1087
- sessionId?: string;
1088
- sessionStatus: "active" | "signed_out";
1089
- getToken: () => Promise<string | null>;
1090
- }>;
1091
- };
1092
- export type AuthResult = Awaited<ReturnType<typeof auth>>;
1093
- export declare function currentUser(): Promise<{
1094
- id: string;
1095
- email: string;
1096
- firstName: string | null;
1097
- lastName: string | null;
1098
- imageUrl: string | null;
1099
- } | null>;
1100
- //# sourceMappingURL=next.d.ts.map