@better-auth/oauth-provider 1.5.6 → 1.6.0-beta.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.
@@ -1,2079 +0,0 @@
1
- import { c as OAuthConsent, i as OIDCMetadata, m as Scope, r as OAuthClient, t as AuthServerMetadata, u as OAuthOptions } from "./oauth-4vgZlF-I.mjs";
2
- import * as better_call0 from "better-call";
3
- import * as z from "zod";
4
- import * as better_auth_plugins0 from "better-auth/plugins";
5
- import * as jose from "jose";
6
- import * as better_auth0 from "better-auth";
7
-
8
- //#region src/oauth.d.ts
9
- declare module "@better-auth/core" {
10
- interface BetterAuthPluginRegistry<AuthOptions, Options> {
11
- "oauth-provider": {
12
- creator: typeof oauthProvider;
13
- };
14
- }
15
- }
16
- declare const getOAuthProviderState: () => Promise<{
17
- query?: string;
18
- } | null>;
19
- /**
20
- * oAuth 2.1 provider plugin for Better Auth.
21
- *
22
- * @see https://better-auth.com/docs/plugins/oauth-provider
23
- * @param options - The options for the oAuth Provider plugin.
24
- * @returns A Better Auth plugin.
25
- */
26
- declare const oauthProvider: <O extends OAuthOptions<Scope[]>>(options: O) => {
27
- id: "oauth-provider";
28
- options: NoInfer<O>;
29
- init: (ctx: better_auth0.AuthContext) => void;
30
- hooks: {
31
- before: {
32
- matcher(ctx: better_auth0.HookEndpointContext): any;
33
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
34
- }[];
35
- after: {
36
- matcher(ctx: better_auth0.HookEndpointContext): boolean;
37
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
38
- redirect: boolean;
39
- url: string;
40
- } | undefined>;
41
- }[];
42
- };
43
- endpoints: {
44
- /**
45
- * A server-only endpoint that helps provide the
46
- * oAuth Server configuration at the well-known endpoint.
47
- *
48
- * Provided at /.well-known/oauth-authorization-server/[issuer-path]
49
- * (root if no issuer-path).
50
- */
51
- getOAuthServerConfig: better_call0.StrictEndpoint<"/.well-known/oauth-authorization-server", {
52
- method: "GET";
53
- metadata: {
54
- SERVER_ONLY: true;
55
- };
56
- }, AuthServerMetadata>;
57
- /**
58
- * A server-only endpoint that helps provide the
59
- * OpenId configuration at the well-known endpoint.
60
- *
61
- * Provided at [issuer-path]/.well-known/openid-configuration
62
- * (root if no issuer-path).
63
- */
64
- getOpenIdConfig: better_call0.StrictEndpoint<"/.well-known/openid-configuration", {
65
- method: "GET";
66
- metadata: {
67
- SERVER_ONLY: true;
68
- };
69
- }, Omit<OIDCMetadata, "id_token_signing_alg_values_supported"> & {
70
- id_token_signing_alg_values_supported: better_auth_plugins0.JWSAlgorithms[] | ["HS256"];
71
- }>;
72
- oauth2Authorize: better_call0.StrictEndpoint<"/oauth2/authorize", {
73
- method: "GET";
74
- query: z.ZodObject<{
75
- response_type: z.ZodEnum<{
76
- code: "code";
77
- }>;
78
- client_id: z.ZodString;
79
- redirect_uri: z.ZodOptional<z.ZodURL>;
80
- scope: z.ZodOptional<z.ZodString>;
81
- state: z.ZodOptional<z.ZodString>;
82
- code_challenge: z.ZodOptional<z.ZodString>;
83
- code_challenge_method: z.ZodOptional<z.ZodEnum<{
84
- S256: "S256";
85
- }>>;
86
- nonce: z.ZodOptional<z.ZodString>;
87
- prompt: z.ZodOptional<z.ZodEnum<{
88
- none: "none";
89
- consent: "consent";
90
- login: "login";
91
- create: "create";
92
- select_account: "select_account";
93
- "login consent": "login consent";
94
- "select_account consent": "select_account consent";
95
- }>>;
96
- }, z.core.$strip>;
97
- metadata: {
98
- openapi: {
99
- description: string;
100
- parameters: ({
101
- name: string;
102
- in: "query";
103
- required: true;
104
- schema: {
105
- type: "string";
106
- format?: undefined;
107
- };
108
- description: string;
109
- } | {
110
- name: string;
111
- in: "query";
112
- required: false;
113
- schema: {
114
- type: "string";
115
- format: string;
116
- };
117
- description: string;
118
- } | {
119
- name: string;
120
- in: "query";
121
- required: false;
122
- schema: {
123
- type: "string";
124
- format?: undefined;
125
- };
126
- description: string;
127
- })[];
128
- responses: {
129
- "302": {
130
- description: string;
131
- headers: {
132
- Location: {
133
- description: string;
134
- schema: {
135
- type: string;
136
- format: string;
137
- };
138
- };
139
- };
140
- };
141
- "400": {
142
- description: string;
143
- content: {
144
- "application/json": {
145
- schema: {
146
- type: "object";
147
- properties: {
148
- error: {
149
- type: string;
150
- };
151
- error_description: {
152
- type: string;
153
- };
154
- state: {
155
- type: string;
156
- };
157
- };
158
- required: string[];
159
- };
160
- };
161
- };
162
- };
163
- };
164
- };
165
- };
166
- }, {
167
- redirect: boolean;
168
- url: string;
169
- }>;
170
- oauth2Consent: better_call0.StrictEndpoint<"/oauth2/consent", {
171
- method: "POST";
172
- body: z.ZodObject<{
173
- accept: z.ZodBoolean;
174
- scope: z.ZodOptional<z.ZodString>;
175
- oauth_query: z.ZodOptional<z.ZodString>;
176
- }, z.core.$strip>;
177
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
178
- session: {
179
- session: Record<string, any> & {
180
- id: string;
181
- createdAt: Date;
182
- updatedAt: Date;
183
- userId: string;
184
- expiresAt: Date;
185
- token: string;
186
- ipAddress?: string | null | undefined;
187
- userAgent?: string | null | undefined;
188
- };
189
- user: Record<string, any> & {
190
- id: string;
191
- createdAt: Date;
192
- updatedAt: Date;
193
- email: string;
194
- emailVerified: boolean;
195
- name: string;
196
- image?: string | null | undefined;
197
- };
198
- };
199
- }>)[];
200
- metadata: {
201
- openapi: {
202
- description: string;
203
- responses: {
204
- "200": {
205
- description: string;
206
- content: {
207
- "application/json": {
208
- schema: {
209
- type: "object";
210
- properties: {
211
- redirect_uri: {
212
- type: string;
213
- format: string;
214
- description: string;
215
- };
216
- };
217
- required: string[];
218
- };
219
- };
220
- };
221
- };
222
- };
223
- };
224
- };
225
- }, {
226
- redirect: boolean;
227
- url: string;
228
- }>;
229
- oauth2Continue: better_call0.StrictEndpoint<"/oauth2/continue", {
230
- method: "POST";
231
- body: z.ZodObject<{
232
- selected: z.ZodOptional<z.ZodBoolean>;
233
- created: z.ZodOptional<z.ZodBoolean>;
234
- postLogin: z.ZodOptional<z.ZodBoolean>;
235
- oauth_query: z.ZodOptional<z.ZodString>;
236
- }, z.core.$strip>;
237
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
238
- session: {
239
- session: Record<string, any> & {
240
- id: string;
241
- createdAt: Date;
242
- updatedAt: Date;
243
- userId: string;
244
- expiresAt: Date;
245
- token: string;
246
- ipAddress?: string | null | undefined;
247
- userAgent?: string | null | undefined;
248
- };
249
- user: Record<string, any> & {
250
- id: string;
251
- createdAt: Date;
252
- updatedAt: Date;
253
- email: string;
254
- emailVerified: boolean;
255
- name: string;
256
- image?: string | null | undefined;
257
- };
258
- };
259
- }>)[];
260
- metadata: {
261
- openapi: {
262
- description: string;
263
- responses: {
264
- "200": {
265
- description: string;
266
- content: {
267
- "application/json": {
268
- schema: {
269
- type: "object";
270
- properties: {
271
- redirect_uri: {
272
- type: string;
273
- format: string;
274
- description: string;
275
- };
276
- };
277
- required: string[];
278
- };
279
- };
280
- };
281
- };
282
- };
283
- };
284
- };
285
- }, {
286
- redirect: boolean;
287
- url: string;
288
- }>;
289
- oauth2Token: better_call0.StrictEndpoint<"/oauth2/token", {
290
- method: "POST";
291
- body: z.ZodObject<{
292
- grant_type: z.ZodEnum<{
293
- authorization_code: "authorization_code";
294
- client_credentials: "client_credentials";
295
- refresh_token: "refresh_token";
296
- }>;
297
- client_id: z.ZodOptional<z.ZodString>;
298
- client_secret: z.ZodOptional<z.ZodString>;
299
- code: z.ZodOptional<z.ZodString>;
300
- code_verifier: z.ZodOptional<z.ZodString>;
301
- redirect_uri: z.ZodOptional<z.ZodURL>;
302
- refresh_token: z.ZodOptional<z.ZodString>;
303
- resource: z.ZodOptional<z.ZodString>;
304
- scope: z.ZodOptional<z.ZodString>;
305
- }, z.core.$strip>;
306
- metadata: {
307
- allowedMediaTypes: string[];
308
- openapi: {
309
- description: string;
310
- requestBody: {
311
- required: boolean;
312
- content: {
313
- "application/json": {
314
- schema: {
315
- type: "object";
316
- properties: {
317
- grant_type: {
318
- type: string;
319
- enum: string[];
320
- description: string;
321
- };
322
- client_id: {
323
- type: string;
324
- description: string;
325
- };
326
- client_secret: {
327
- type: string;
328
- description: string;
329
- };
330
- code: {
331
- type: string;
332
- description: string;
333
- };
334
- code_verifier: {
335
- type: string;
336
- description: string;
337
- };
338
- redirect_uri: {
339
- type: string;
340
- format: string;
341
- description: string;
342
- };
343
- refresh_token: {
344
- type: string;
345
- description: string;
346
- };
347
- resource: {
348
- type: string;
349
- description: string;
350
- };
351
- scope: {
352
- type: string;
353
- description: string;
354
- };
355
- };
356
- required: string[];
357
- };
358
- };
359
- };
360
- };
361
- responses: {
362
- "200": {
363
- description: string;
364
- content: {
365
- "application/json": {
366
- schema: {
367
- type: "object";
368
- properties: {
369
- access_token: {
370
- type: string;
371
- description: string;
372
- };
373
- token_type: {
374
- type: string;
375
- description: string;
376
- enum: string[];
377
- };
378
- expires_in: {
379
- type: string;
380
- description: string;
381
- };
382
- refresh_token: {
383
- type: string;
384
- description: string;
385
- };
386
- scope: {
387
- type: string;
388
- description: string;
389
- };
390
- id_token: {
391
- type: string;
392
- description: string;
393
- };
394
- };
395
- required: string[];
396
- };
397
- };
398
- };
399
- };
400
- "400": {
401
- description: string;
402
- content: {
403
- "application/json": {
404
- schema: {
405
- type: "object";
406
- properties: {
407
- error: {
408
- type: string;
409
- };
410
- error_description: {
411
- type: string;
412
- };
413
- error_uri: {
414
- type: string;
415
- };
416
- };
417
- required: string[];
418
- };
419
- };
420
- };
421
- };
422
- };
423
- };
424
- };
425
- }, {
426
- access_token: string;
427
- expires_in: number;
428
- expires_at: number;
429
- token_type: string;
430
- scope: string;
431
- }>;
432
- oauth2Introspect: better_call0.StrictEndpoint<"/oauth2/introspect", {
433
- method: "POST";
434
- body: z.ZodObject<{
435
- client_id: z.ZodOptional<z.ZodString>;
436
- client_secret: z.ZodOptional<z.ZodString>;
437
- token: z.ZodString;
438
- token_type_hint: z.ZodOptional<z.ZodEnum<{
439
- refresh_token: "refresh_token";
440
- access_token: "access_token";
441
- }>>;
442
- }, z.core.$strip>;
443
- metadata: {
444
- allowedMediaTypes: string[];
445
- openapi: {
446
- description: string;
447
- requestBody: {
448
- required: boolean;
449
- content: {
450
- "application/json": {
451
- schema: {
452
- type: "object";
453
- properties: {
454
- client_id: {
455
- type: string;
456
- description: string;
457
- };
458
- client_secret: {
459
- type: string;
460
- description: string;
461
- };
462
- token: {
463
- type: string;
464
- description: string;
465
- };
466
- token_type_hint: {
467
- type: string;
468
- enum: string[];
469
- description: string;
470
- };
471
- resource: {
472
- type: string;
473
- description: string;
474
- };
475
- };
476
- required: string[];
477
- };
478
- };
479
- };
480
- };
481
- responses: {
482
- "200": {
483
- description: string;
484
- content: {
485
- "application/json": {
486
- schema: {
487
- type: "object";
488
- properties: {
489
- active: {
490
- type: string;
491
- description: string;
492
- };
493
- scope: {
494
- type: string;
495
- description: string;
496
- };
497
- client_id: {
498
- type: string;
499
- description: string;
500
- };
501
- username: {
502
- type: string;
503
- description: string;
504
- };
505
- token_type: {
506
- type: string;
507
- description: string;
508
- };
509
- exp: {
510
- type: string;
511
- description: string;
512
- };
513
- iat: {
514
- type: string;
515
- description: string;
516
- };
517
- nbf: {
518
- type: string;
519
- description: string;
520
- };
521
- sub: {
522
- type: string;
523
- description: string;
524
- };
525
- aud: {
526
- type: string;
527
- description: string;
528
- };
529
- iss: {
530
- type: string;
531
- description: string;
532
- };
533
- jti: {
534
- type: string;
535
- description: string;
536
- };
537
- };
538
- required: string[];
539
- };
540
- };
541
- };
542
- };
543
- "400": {
544
- description: string;
545
- content: {
546
- "application/json": {
547
- schema: {
548
- type: "object";
549
- properties: {
550
- error: {
551
- type: string;
552
- };
553
- error_description: {
554
- type: string;
555
- };
556
- error_uri: {
557
- type: string;
558
- };
559
- };
560
- required: string[];
561
- };
562
- };
563
- };
564
- };
565
- };
566
- };
567
- };
568
- }, jose.JWTPayload>;
569
- oauth2Revoke: better_call0.StrictEndpoint<"/oauth2/revoke", {
570
- method: "POST";
571
- body: z.ZodObject<{
572
- client_id: z.ZodOptional<z.ZodString>;
573
- client_secret: z.ZodOptional<z.ZodString>;
574
- token: z.ZodString;
575
- token_type_hint: z.ZodOptional<z.ZodEnum<{
576
- refresh_token: "refresh_token";
577
- access_token: "access_token";
578
- }>>;
579
- }, z.core.$strip>;
580
- metadata: {
581
- allowedMediaTypes: string[];
582
- openapi: {
583
- description: string;
584
- requestBody: {
585
- required: boolean;
586
- content: {
587
- "application/json": {
588
- schema: {
589
- type: "object";
590
- properties: {
591
- client_id: {
592
- type: string;
593
- description: string;
594
- };
595
- client_secret: {
596
- type: string;
597
- description: string;
598
- };
599
- token: {
600
- type: string;
601
- description: string;
602
- };
603
- token_type_hint: {
604
- type: string;
605
- enum: string[];
606
- description: string;
607
- };
608
- };
609
- required: string[];
610
- };
611
- };
612
- };
613
- };
614
- responses: {
615
- "200": {
616
- description: string;
617
- content: {
618
- "application/json": {
619
- schema: {
620
- type: "object";
621
- description: string;
622
- };
623
- };
624
- };
625
- };
626
- "400": {
627
- description: string;
628
- content: {
629
- "application/json": {
630
- schema: {
631
- type: "object";
632
- properties: {
633
- error: {
634
- type: string;
635
- };
636
- error_description: {
637
- type: string;
638
- };
639
- error_uri: {
640
- type: string;
641
- };
642
- };
643
- required: string[];
644
- };
645
- };
646
- };
647
- };
648
- };
649
- };
650
- };
651
- }, null | undefined>;
652
- oauth2UserInfo: better_call0.StrictEndpoint<"/oauth2/userinfo", {
653
- method: "GET";
654
- metadata: {
655
- openapi: {
656
- description: string;
657
- security: ({
658
- bearerAuth: never[];
659
- OAuth2?: undefined;
660
- } | {
661
- OAuth2: string[];
662
- bearerAuth?: undefined;
663
- })[];
664
- parameters: {
665
- name: string;
666
- in: "header";
667
- required: false;
668
- schema: {
669
- type: "string";
670
- };
671
- description: string;
672
- }[];
673
- responses: {
674
- "200": {
675
- description: string;
676
- content: {
677
- "application/json": {
678
- schema: {
679
- type: "object";
680
- properties: {
681
- sub: {
682
- type: string;
683
- description: string;
684
- };
685
- email: {
686
- type: string;
687
- format: string;
688
- nullable: boolean;
689
- description: string;
690
- };
691
- name: {
692
- type: string;
693
- nullable: boolean;
694
- description: string;
695
- };
696
- picture: {
697
- type: string;
698
- format: string;
699
- nullable: boolean;
700
- description: string;
701
- };
702
- given_name: {
703
- type: string;
704
- nullable: boolean;
705
- description: string;
706
- };
707
- family_name: {
708
- type: string;
709
- nullable: boolean;
710
- description: string;
711
- };
712
- email_verified: {
713
- type: string;
714
- nullable: boolean;
715
- description: string;
716
- };
717
- };
718
- required: string[];
719
- };
720
- };
721
- };
722
- };
723
- "401": {
724
- description: string;
725
- content: {
726
- "application/json": {
727
- schema: {
728
- type: "object";
729
- properties: {
730
- error: {
731
- type: string;
732
- };
733
- error_description: {
734
- type: string;
735
- };
736
- };
737
- required: string[];
738
- };
739
- };
740
- };
741
- };
742
- "403": {
743
- description: string;
744
- content: {
745
- "application/json": {
746
- schema: {
747
- type: "object";
748
- properties: {
749
- error: {
750
- type: string;
751
- };
752
- error_description: {
753
- type: string;
754
- };
755
- };
756
- required: string[];
757
- };
758
- };
759
- };
760
- };
761
- };
762
- };
763
- };
764
- }, {
765
- email?: string | undefined;
766
- email_verified?: boolean | undefined;
767
- name?: string | undefined;
768
- picture?: string | undefined;
769
- given_name?: string | undefined;
770
- family_name?: string | undefined;
771
- sub: string;
772
- }>;
773
- oauth2EndSession: better_call0.StrictEndpoint<"/oauth2/end-session", {
774
- method: "GET";
775
- query: z.ZodObject<{
776
- id_token_hint: z.ZodString;
777
- client_id: z.ZodOptional<z.ZodString>;
778
- post_logout_redirect_uri: z.ZodOptional<z.ZodURL>;
779
- state: z.ZodOptional<z.ZodString>;
780
- }, z.core.$strip>;
781
- metadata: {
782
- openapi: {
783
- description: string;
784
- responses: {
785
- "200": {
786
- description: string;
787
- content: {
788
- "application/json": {
789
- schema: {
790
- type: "object";
791
- properties: {
792
- redirect_uri: {
793
- type: string;
794
- format: string;
795
- description: string;
796
- };
797
- message: {
798
- type: string;
799
- description: string;
800
- };
801
- };
802
- };
803
- };
804
- };
805
- };
806
- };
807
- };
808
- };
809
- }, {
810
- redirect: boolean;
811
- url: string;
812
- } | undefined>;
813
- registerOAuthClient: better_call0.StrictEndpoint<"/oauth2/register", {
814
- method: "POST";
815
- body: z.ZodObject<{
816
- redirect_uris: z.ZodArray<z.ZodURL>;
817
- scope: z.ZodOptional<z.ZodString>;
818
- client_name: z.ZodOptional<z.ZodString>;
819
- client_uri: z.ZodOptional<z.ZodString>;
820
- logo_uri: z.ZodOptional<z.ZodString>;
821
- contacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
822
- tos_uri: z.ZodOptional<z.ZodString>;
823
- policy_uri: z.ZodOptional<z.ZodString>;
824
- software_id: z.ZodOptional<z.ZodString>;
825
- software_version: z.ZodOptional<z.ZodString>;
826
- software_statement: z.ZodOptional<z.ZodString>;
827
- post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
828
- token_endpoint_auth_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
829
- none: "none";
830
- client_secret_basic: "client_secret_basic";
831
- client_secret_post: "client_secret_post";
832
- }>>>;
833
- grant_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
834
- authorization_code: "authorization_code";
835
- client_credentials: "client_credentials";
836
- refresh_token: "refresh_token";
837
- }>>>>;
838
- response_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
839
- code: "code";
840
- }>>>>;
841
- type: z.ZodOptional<z.ZodEnum<{
842
- web: "web";
843
- native: "native";
844
- "user-agent-based": "user-agent-based";
845
- }>>;
846
- subject_type: z.ZodOptional<z.ZodEnum<{
847
- public: "public";
848
- pairwise: "pairwise";
849
- }>>;
850
- }, z.core.$strip>;
851
- metadata: {
852
- openapi: {
853
- description: string;
854
- responses: {
855
- "200": {
856
- description: string;
857
- content: {
858
- "application/json": {
859
- schema: {
860
- /** @returns {OauthClient} */type: "object";
861
- properties: {
862
- client_id: {
863
- type: string;
864
- description: string;
865
- };
866
- client_secret: {
867
- type: string;
868
- description: string;
869
- };
870
- client_secret_expires_at: {
871
- type: string;
872
- description: string;
873
- };
874
- scope: {
875
- type: string;
876
- description: string;
877
- };
878
- user_id: {
879
- type: string;
880
- description: string;
881
- };
882
- client_id_issued_at: {
883
- type: string;
884
- description: string;
885
- };
886
- client_name: {
887
- type: string;
888
- description: string;
889
- };
890
- client_uri: {
891
- type: string;
892
- description: string;
893
- };
894
- logo_uri: {
895
- type: string;
896
- description: string;
897
- };
898
- contacts: {
899
- type: string;
900
- items: {
901
- type: string;
902
- };
903
- description: string;
904
- };
905
- tos_uri: {
906
- type: string;
907
- description: string;
908
- };
909
- policy_uri: {
910
- type: string;
911
- description: string;
912
- };
913
- software_id: {
914
- type: string;
915
- description: string;
916
- };
917
- software_version: {
918
- type: string;
919
- description: string;
920
- };
921
- software_statement: {
922
- type: string;
923
- description: string;
924
- };
925
- redirect_uris: {
926
- type: string;
927
- items: {
928
- type: string;
929
- format: string;
930
- };
931
- description: string;
932
- };
933
- post_logout_redirect_uris: {
934
- type: string;
935
- items: {
936
- type: string;
937
- format: string;
938
- };
939
- description: string;
940
- };
941
- token_endpoint_auth_method: {
942
- type: string;
943
- description: string;
944
- enum: string[];
945
- };
946
- grant_types: {
947
- type: string;
948
- items: {
949
- type: string;
950
- enum: string[];
951
- };
952
- description: string;
953
- };
954
- response_types: {
955
- type: string;
956
- items: {
957
- type: string;
958
- enum: string[];
959
- };
960
- description: string;
961
- };
962
- public: {
963
- type: string;
964
- description: string;
965
- };
966
- type: {
967
- type: string;
968
- description: string;
969
- enum: string[];
970
- };
971
- disabled: {
972
- type: string;
973
- description: string;
974
- };
975
- };
976
- required: string[];
977
- };
978
- };
979
- };
980
- };
981
- };
982
- };
983
- };
984
- }, OAuthClient>;
985
- adminCreateOAuthClient: better_call0.StrictEndpoint<"/admin/oauth2/create-client", {
986
- method: "POST";
987
- body: z.ZodObject<{
988
- redirect_uris: z.ZodArray<z.ZodURL>;
989
- scope: z.ZodOptional<z.ZodString>;
990
- client_name: z.ZodOptional<z.ZodString>;
991
- client_uri: z.ZodOptional<z.ZodString>;
992
- logo_uri: z.ZodOptional<z.ZodString>;
993
- contacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
994
- tos_uri: z.ZodOptional<z.ZodString>;
995
- policy_uri: z.ZodOptional<z.ZodString>;
996
- software_id: z.ZodOptional<z.ZodString>;
997
- software_version: z.ZodOptional<z.ZodString>;
998
- software_statement: z.ZodOptional<z.ZodString>;
999
- post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
1000
- token_endpoint_auth_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1001
- none: "none";
1002
- client_secret_basic: "client_secret_basic";
1003
- client_secret_post: "client_secret_post";
1004
- }>>>;
1005
- grant_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
1006
- authorization_code: "authorization_code";
1007
- client_credentials: "client_credentials";
1008
- refresh_token: "refresh_token";
1009
- }>>>>;
1010
- response_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
1011
- code: "code";
1012
- }>>>>;
1013
- type: z.ZodOptional<z.ZodEnum<{
1014
- web: "web";
1015
- native: "native";
1016
- "user-agent-based": "user-agent-based";
1017
- }>>;
1018
- client_secret_expires_at: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
1019
- skip_consent: z.ZodOptional<z.ZodBoolean>;
1020
- enable_end_session: z.ZodOptional<z.ZodBoolean>;
1021
- require_pkce: z.ZodOptional<z.ZodBoolean>;
1022
- subject_type: z.ZodOptional<z.ZodEnum<{
1023
- public: "public";
1024
- pairwise: "pairwise";
1025
- }>>;
1026
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1027
- }, z.core.$strip>;
1028
- metadata: {
1029
- SERVER_ONLY: true;
1030
- openapi: {
1031
- description: string;
1032
- responses: {
1033
- "200": {
1034
- description: string;
1035
- content: {
1036
- "application/json": {
1037
- schema: {
1038
- type: "object";
1039
- properties: {
1040
- client_id: {
1041
- type: string;
1042
- description: string;
1043
- };
1044
- client_secret: {
1045
- type: string;
1046
- description: string;
1047
- };
1048
- client_secret_expires_at: {
1049
- type: string;
1050
- description: string;
1051
- };
1052
- scope: {
1053
- type: string;
1054
- description: string;
1055
- };
1056
- user_id: {
1057
- type: string;
1058
- description: string;
1059
- };
1060
- client_id_issued_at: {
1061
- type: string;
1062
- description: string;
1063
- };
1064
- client_name: {
1065
- type: string;
1066
- description: string;
1067
- };
1068
- client_uri: {
1069
- type: string;
1070
- description: string;
1071
- };
1072
- logo_uri: {
1073
- type: string;
1074
- description: string;
1075
- };
1076
- contacts: {
1077
- type: string;
1078
- items: {
1079
- type: string;
1080
- };
1081
- description: string;
1082
- };
1083
- tos_uri: {
1084
- type: string;
1085
- description: string;
1086
- };
1087
- policy_uri: {
1088
- type: string;
1089
- description: string;
1090
- };
1091
- software_id: {
1092
- type: string;
1093
- description: string;
1094
- };
1095
- software_version: {
1096
- type: string;
1097
- description: string;
1098
- };
1099
- software_statement: {
1100
- type: string;
1101
- description: string;
1102
- };
1103
- redirect_uris: {
1104
- type: string;
1105
- items: {
1106
- type: string;
1107
- format: string;
1108
- };
1109
- description: string;
1110
- };
1111
- token_endpoint_auth_method: {
1112
- type: string;
1113
- description: string;
1114
- enum: string[];
1115
- };
1116
- grant_types: {
1117
- type: string;
1118
- items: {
1119
- type: string;
1120
- enum: string[];
1121
- };
1122
- description: string;
1123
- };
1124
- response_types: {
1125
- type: string;
1126
- items: {
1127
- type: string;
1128
- enum: string[];
1129
- };
1130
- description: string;
1131
- };
1132
- public: {
1133
- type: string;
1134
- description: string;
1135
- };
1136
- type: {
1137
- type: string;
1138
- description: string;
1139
- enum: string[];
1140
- };
1141
- disabled: {
1142
- type: string;
1143
- description: string;
1144
- };
1145
- require_pkce: {
1146
- type: string;
1147
- description: string;
1148
- default: boolean;
1149
- };
1150
- metadata: {
1151
- type: string;
1152
- additionalProperties: boolean;
1153
- nullable: boolean;
1154
- description: string;
1155
- };
1156
- };
1157
- required: string[];
1158
- };
1159
- };
1160
- };
1161
- };
1162
- };
1163
- };
1164
- };
1165
- }, OAuthClient>;
1166
- createOAuthClient: better_call0.StrictEndpoint<"/oauth2/create-client", {
1167
- method: "POST";
1168
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1169
- session: {
1170
- session: Record<string, any> & {
1171
- id: string;
1172
- createdAt: Date;
1173
- updatedAt: Date;
1174
- userId: string;
1175
- expiresAt: Date;
1176
- token: string;
1177
- ipAddress?: string | null | undefined;
1178
- userAgent?: string | null | undefined;
1179
- };
1180
- user: Record<string, any> & {
1181
- id: string;
1182
- createdAt: Date;
1183
- updatedAt: Date;
1184
- email: string;
1185
- emailVerified: boolean;
1186
- name: string;
1187
- image?: string | null | undefined;
1188
- };
1189
- };
1190
- }>)[];
1191
- body: z.ZodObject<{
1192
- redirect_uris: z.ZodArray<z.ZodURL>;
1193
- scope: z.ZodOptional<z.ZodString>;
1194
- client_name: z.ZodOptional<z.ZodString>;
1195
- client_uri: z.ZodOptional<z.ZodString>;
1196
- logo_uri: z.ZodOptional<z.ZodString>;
1197
- contacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
1198
- tos_uri: z.ZodOptional<z.ZodString>;
1199
- policy_uri: z.ZodOptional<z.ZodString>;
1200
- software_id: z.ZodOptional<z.ZodString>;
1201
- software_version: z.ZodOptional<z.ZodString>;
1202
- software_statement: z.ZodOptional<z.ZodString>;
1203
- post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
1204
- token_endpoint_auth_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1205
- none: "none";
1206
- client_secret_basic: "client_secret_basic";
1207
- client_secret_post: "client_secret_post";
1208
- }>>>;
1209
- grant_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
1210
- authorization_code: "authorization_code";
1211
- client_credentials: "client_credentials";
1212
- refresh_token: "refresh_token";
1213
- }>>>>;
1214
- response_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
1215
- code: "code";
1216
- }>>>>;
1217
- type: z.ZodOptional<z.ZodEnum<{
1218
- web: "web";
1219
- native: "native";
1220
- "user-agent-based": "user-agent-based";
1221
- }>>;
1222
- }, z.core.$strip>;
1223
- metadata: {
1224
- openapi: {
1225
- description: string;
1226
- responses: {
1227
- "200": {
1228
- description: string;
1229
- content: {
1230
- "application/json": {
1231
- schema: {
1232
- type: "object";
1233
- properties: {
1234
- client_id: {
1235
- type: string;
1236
- description: string;
1237
- };
1238
- client_secret: {
1239
- type: string;
1240
- description: string;
1241
- };
1242
- client_secret_expires_at: {
1243
- type: string;
1244
- description: string;
1245
- };
1246
- scope: {
1247
- type: string;
1248
- description: string;
1249
- };
1250
- user_id: {
1251
- type: string;
1252
- description: string;
1253
- };
1254
- client_id_issued_at: {
1255
- type: string;
1256
- description: string;
1257
- };
1258
- client_name: {
1259
- type: string;
1260
- description: string;
1261
- };
1262
- client_uri: {
1263
- type: string;
1264
- description: string;
1265
- };
1266
- logo_uri: {
1267
- type: string;
1268
- description: string;
1269
- };
1270
- contacts: {
1271
- type: string;
1272
- items: {
1273
- type: string;
1274
- };
1275
- description: string;
1276
- };
1277
- tos_uri: {
1278
- type: string;
1279
- description: string;
1280
- };
1281
- policy_uri: {
1282
- type: string;
1283
- description: string;
1284
- };
1285
- software_id: {
1286
- type: string;
1287
- description: string;
1288
- };
1289
- software_version: {
1290
- type: string;
1291
- description: string;
1292
- };
1293
- software_statement: {
1294
- type: string;
1295
- description: string;
1296
- };
1297
- redirect_uris: {
1298
- type: string;
1299
- items: {
1300
- type: string;
1301
- format: string;
1302
- };
1303
- description: string;
1304
- };
1305
- token_endpoint_auth_method: {
1306
- type: string;
1307
- description: string;
1308
- enum: string[];
1309
- };
1310
- grant_types: {
1311
- type: string;
1312
- items: {
1313
- type: string;
1314
- enum: string[];
1315
- };
1316
- description: string;
1317
- };
1318
- response_types: {
1319
- type: string;
1320
- items: {
1321
- type: string;
1322
- enum: string[];
1323
- };
1324
- description: string;
1325
- };
1326
- public: {
1327
- type: string;
1328
- description: string;
1329
- };
1330
- type: {
1331
- type: string;
1332
- description: string;
1333
- enum: string[];
1334
- };
1335
- disabled: {
1336
- type: string;
1337
- description: string;
1338
- };
1339
- metadata: {
1340
- type: string;
1341
- additionalProperties: boolean;
1342
- nullable: boolean;
1343
- description: string;
1344
- };
1345
- };
1346
- required: string[];
1347
- };
1348
- };
1349
- };
1350
- };
1351
- };
1352
- };
1353
- };
1354
- }, OAuthClient>;
1355
- getOAuthClient: better_call0.StrictEndpoint<"/oauth2/get-client", {
1356
- method: "GET";
1357
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1358
- session: {
1359
- session: Record<string, any> & {
1360
- id: string;
1361
- createdAt: Date;
1362
- updatedAt: Date;
1363
- userId: string;
1364
- expiresAt: Date;
1365
- token: string;
1366
- ipAddress?: string | null | undefined;
1367
- userAgent?: string | null | undefined;
1368
- };
1369
- user: Record<string, any> & {
1370
- id: string;
1371
- createdAt: Date;
1372
- updatedAt: Date;
1373
- email: string;
1374
- emailVerified: boolean;
1375
- name: string;
1376
- image?: string | null | undefined;
1377
- };
1378
- };
1379
- }>)[];
1380
- query: z.ZodObject<{
1381
- client_id: z.ZodString;
1382
- }, z.core.$strip>;
1383
- metadata: {
1384
- openapi: {
1385
- description: string;
1386
- };
1387
- };
1388
- }, OAuthClient>;
1389
- getOAuthClientPublic: better_call0.StrictEndpoint<"/oauth2/public-client", {
1390
- method: "GET";
1391
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1392
- session: {
1393
- session: Record<string, any> & {
1394
- id: string;
1395
- createdAt: Date;
1396
- updatedAt: Date;
1397
- userId: string;
1398
- expiresAt: Date;
1399
- token: string;
1400
- ipAddress?: string | null | undefined;
1401
- userAgent?: string | null | undefined;
1402
- };
1403
- user: Record<string, any> & {
1404
- id: string;
1405
- createdAt: Date;
1406
- updatedAt: Date;
1407
- email: string;
1408
- emailVerified: boolean;
1409
- name: string;
1410
- image?: string | null | undefined;
1411
- };
1412
- };
1413
- }>)[];
1414
- query: z.ZodObject<{
1415
- client_id: z.ZodString;
1416
- }, z.core.$strip>;
1417
- metadata: {
1418
- openapi: {
1419
- description: string;
1420
- };
1421
- };
1422
- }, OAuthClient>;
1423
- getOAuthClientPublicPrelogin: better_call0.StrictEndpoint<"/oauth2/public-client-prelogin", {
1424
- method: "POST";
1425
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>)[];
1426
- body: z.ZodObject<{
1427
- client_id: z.ZodString;
1428
- oauth_query: z.ZodOptional<z.ZodString>;
1429
- }, z.core.$strip>;
1430
- metadata: {
1431
- openapi: {
1432
- description: string;
1433
- };
1434
- };
1435
- }, OAuthClient>;
1436
- getOAuthClients: better_call0.StrictEndpoint<"/oauth2/get-clients", {
1437
- method: "GET";
1438
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1439
- session: {
1440
- session: Record<string, any> & {
1441
- id: string;
1442
- createdAt: Date;
1443
- updatedAt: Date;
1444
- userId: string;
1445
- expiresAt: Date;
1446
- token: string;
1447
- ipAddress?: string | null | undefined;
1448
- userAgent?: string | null | undefined;
1449
- };
1450
- user: Record<string, any> & {
1451
- id: string;
1452
- createdAt: Date;
1453
- updatedAt: Date;
1454
- email: string;
1455
- emailVerified: boolean;
1456
- name: string;
1457
- image?: string | null | undefined;
1458
- };
1459
- };
1460
- }>)[];
1461
- metadata: {
1462
- openapi: {
1463
- description: string;
1464
- };
1465
- };
1466
- }, OAuthClient[] | null>;
1467
- adminUpdateOAuthClient: better_call0.StrictEndpoint<"/admin/oauth2/update-client", {
1468
- method: "PATCH";
1469
- body: z.ZodObject<{
1470
- client_id: z.ZodString;
1471
- update: z.ZodObject<{
1472
- redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
1473
- scope: z.ZodOptional<z.ZodString>;
1474
- client_name: z.ZodOptional<z.ZodString>;
1475
- client_uri: z.ZodOptional<z.ZodString>;
1476
- logo_uri: z.ZodOptional<z.ZodString>;
1477
- contacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
1478
- tos_uri: z.ZodOptional<z.ZodString>;
1479
- policy_uri: z.ZodOptional<z.ZodString>;
1480
- software_id: z.ZodOptional<z.ZodString>;
1481
- software_version: z.ZodOptional<z.ZodString>;
1482
- software_statement: z.ZodOptional<z.ZodString>;
1483
- post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
1484
- grant_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1485
- authorization_code: "authorization_code";
1486
- client_credentials: "client_credentials";
1487
- refresh_token: "refresh_token";
1488
- }>>>;
1489
- response_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1490
- code: "code";
1491
- }>>>;
1492
- type: z.ZodOptional<z.ZodEnum<{
1493
- web: "web";
1494
- native: "native";
1495
- "user-agent-based": "user-agent-based";
1496
- }>>;
1497
- client_secret_expires_at: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
1498
- skip_consent: z.ZodOptional<z.ZodBoolean>;
1499
- enable_end_session: z.ZodOptional<z.ZodBoolean>;
1500
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1501
- }, z.core.$strip>;
1502
- }, z.core.$strip>;
1503
- metadata: {
1504
- SERVER_ONLY: true;
1505
- openapi: {
1506
- description: string;
1507
- };
1508
- };
1509
- }, OAuthClient>;
1510
- updateOAuthClient: better_call0.StrictEndpoint<"/oauth2/update-client", {
1511
- method: "POST";
1512
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1513
- session: {
1514
- session: Record<string, any> & {
1515
- id: string;
1516
- createdAt: Date;
1517
- updatedAt: Date;
1518
- userId: string;
1519
- expiresAt: Date;
1520
- token: string;
1521
- ipAddress?: string | null | undefined;
1522
- userAgent?: string | null | undefined;
1523
- };
1524
- user: Record<string, any> & {
1525
- id: string;
1526
- createdAt: Date;
1527
- updatedAt: Date;
1528
- email: string;
1529
- emailVerified: boolean;
1530
- name: string;
1531
- image?: string | null | undefined;
1532
- };
1533
- };
1534
- }>)[];
1535
- body: z.ZodObject<{
1536
- client_id: z.ZodString;
1537
- update: z.ZodObject<{
1538
- redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
1539
- scope: z.ZodOptional<z.ZodString>;
1540
- client_name: z.ZodOptional<z.ZodString>;
1541
- client_uri: z.ZodOptional<z.ZodString>;
1542
- logo_uri: z.ZodOptional<z.ZodString>;
1543
- contacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
1544
- tos_uri: z.ZodOptional<z.ZodString>;
1545
- policy_uri: z.ZodOptional<z.ZodString>;
1546
- software_id: z.ZodOptional<z.ZodString>;
1547
- software_version: z.ZodOptional<z.ZodString>;
1548
- software_statement: z.ZodOptional<z.ZodString>;
1549
- post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodURL>>;
1550
- grant_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1551
- authorization_code: "authorization_code";
1552
- client_credentials: "client_credentials";
1553
- refresh_token: "refresh_token";
1554
- }>>>;
1555
- response_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1556
- code: "code";
1557
- }>>>;
1558
- type: z.ZodOptional<z.ZodEnum<{
1559
- web: "web";
1560
- native: "native";
1561
- "user-agent-based": "user-agent-based";
1562
- }>>;
1563
- }, z.core.$strip>;
1564
- }, z.core.$strip>;
1565
- metadata: {
1566
- openapi: {
1567
- description: string;
1568
- };
1569
- };
1570
- }, OAuthClient>;
1571
- rotateClientSecret: better_call0.StrictEndpoint<"/oauth2/client/rotate-secret", {
1572
- method: "POST";
1573
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1574
- session: {
1575
- session: Record<string, any> & {
1576
- id: string;
1577
- createdAt: Date;
1578
- updatedAt: Date;
1579
- userId: string;
1580
- expiresAt: Date;
1581
- token: string;
1582
- ipAddress?: string | null | undefined;
1583
- userAgent?: string | null | undefined;
1584
- };
1585
- user: Record<string, any> & {
1586
- id: string;
1587
- createdAt: Date;
1588
- updatedAt: Date;
1589
- email: string;
1590
- emailVerified: boolean;
1591
- name: string;
1592
- image?: string | null | undefined;
1593
- };
1594
- };
1595
- }>)[];
1596
- body: z.ZodObject<{
1597
- client_id: z.ZodString;
1598
- }, z.core.$strip>;
1599
- metadata: {
1600
- openapi: {
1601
- description: string;
1602
- };
1603
- };
1604
- }, OAuthClient>;
1605
- deleteOAuthClient: better_call0.StrictEndpoint<"/oauth2/delete-client", {
1606
- method: "POST";
1607
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1608
- session: {
1609
- session: Record<string, any> & {
1610
- id: string;
1611
- createdAt: Date;
1612
- updatedAt: Date;
1613
- userId: string;
1614
- expiresAt: Date;
1615
- token: string;
1616
- ipAddress?: string | null | undefined;
1617
- userAgent?: string | null | undefined;
1618
- };
1619
- user: Record<string, any> & {
1620
- id: string;
1621
- createdAt: Date;
1622
- updatedAt: Date;
1623
- email: string;
1624
- emailVerified: boolean;
1625
- name: string;
1626
- image?: string | null | undefined;
1627
- };
1628
- };
1629
- }>)[];
1630
- body: z.ZodObject<{
1631
- client_id: z.ZodString;
1632
- }, z.core.$strip>;
1633
- metadata: {
1634
- openapi: {
1635
- description: string;
1636
- };
1637
- };
1638
- }, void>;
1639
- getOAuthConsent: better_call0.StrictEndpoint<"/oauth2/get-consent", {
1640
- method: "GET";
1641
- query: z.ZodObject<{
1642
- id: z.ZodString;
1643
- }, z.core.$strip>;
1644
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1645
- session: {
1646
- session: Record<string, any> & {
1647
- id: string;
1648
- createdAt: Date;
1649
- updatedAt: Date;
1650
- userId: string;
1651
- expiresAt: Date;
1652
- token: string;
1653
- ipAddress?: string | null | undefined;
1654
- userAgent?: string | null | undefined;
1655
- };
1656
- user: Record<string, any> & {
1657
- id: string;
1658
- createdAt: Date;
1659
- updatedAt: Date;
1660
- email: string;
1661
- emailVerified: boolean;
1662
- name: string;
1663
- image?: string | null | undefined;
1664
- };
1665
- };
1666
- }>)[];
1667
- metadata: {
1668
- openapi: {
1669
- description: string;
1670
- };
1671
- };
1672
- }, OAuthConsent<Scope[]>>;
1673
- getOAuthConsents: better_call0.StrictEndpoint<"/oauth2/get-consents", {
1674
- method: "GET";
1675
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1676
- session: {
1677
- session: Record<string, any> & {
1678
- id: string;
1679
- createdAt: Date;
1680
- updatedAt: Date;
1681
- userId: string;
1682
- expiresAt: Date;
1683
- token: string;
1684
- ipAddress?: string | null | undefined;
1685
- userAgent?: string | null | undefined;
1686
- };
1687
- user: Record<string, any> & {
1688
- id: string;
1689
- createdAt: Date;
1690
- updatedAt: Date;
1691
- email: string;
1692
- emailVerified: boolean;
1693
- name: string;
1694
- image?: string | null | undefined;
1695
- };
1696
- };
1697
- }>)[];
1698
- metadata: {
1699
- openapi: {
1700
- description: string;
1701
- };
1702
- };
1703
- }, OAuthConsent<Scope[]>[]>;
1704
- updateOAuthConsent: better_call0.StrictEndpoint<"/oauth2/update-consent", {
1705
- method: "POST";
1706
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1707
- session: {
1708
- session: Record<string, any> & {
1709
- id: string;
1710
- createdAt: Date;
1711
- updatedAt: Date;
1712
- userId: string;
1713
- expiresAt: Date;
1714
- token: string;
1715
- ipAddress?: string | null | undefined;
1716
- userAgent?: string | null | undefined;
1717
- };
1718
- user: Record<string, any> & {
1719
- id: string;
1720
- createdAt: Date;
1721
- updatedAt: Date;
1722
- email: string;
1723
- emailVerified: boolean;
1724
- name: string;
1725
- image?: string | null | undefined;
1726
- };
1727
- };
1728
- }>)[];
1729
- body: z.ZodObject<{
1730
- id: z.ZodString;
1731
- update: z.ZodObject<{
1732
- scopes: z.ZodArray<z.ZodString>;
1733
- }, z.core.$strip>;
1734
- }, z.core.$strip>;
1735
- metadata: {
1736
- openapi: {
1737
- description: string;
1738
- };
1739
- };
1740
- }, OAuthConsent<Scope[]> | null>;
1741
- deleteOAuthConsent: better_call0.StrictEndpoint<"/oauth2/delete-consent", {
1742
- method: "POST";
1743
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1744
- session: {
1745
- session: Record<string, any> & {
1746
- id: string;
1747
- createdAt: Date;
1748
- updatedAt: Date;
1749
- userId: string;
1750
- expiresAt: Date;
1751
- token: string;
1752
- ipAddress?: string | null | undefined;
1753
- userAgent?: string | null | undefined;
1754
- };
1755
- user: Record<string, any> & {
1756
- id: string;
1757
- createdAt: Date;
1758
- updatedAt: Date;
1759
- email: string;
1760
- emailVerified: boolean;
1761
- name: string;
1762
- image?: string | null | undefined;
1763
- };
1764
- };
1765
- }>)[];
1766
- body: z.ZodObject<{
1767
- id: z.ZodString;
1768
- }, z.core.$strip>;
1769
- metadata: {
1770
- openapi: {
1771
- description: string;
1772
- };
1773
- };
1774
- }, void>;
1775
- };
1776
- schema: {
1777
- oauthClient: {
1778
- modelName: string;
1779
- fields: {
1780
- clientId: {
1781
- type: "string";
1782
- unique: true;
1783
- required: true;
1784
- };
1785
- clientSecret: {
1786
- type: "string";
1787
- required: false;
1788
- };
1789
- disabled: {
1790
- type: "boolean";
1791
- defaultValue: false;
1792
- required: false;
1793
- };
1794
- skipConsent: {
1795
- type: "boolean";
1796
- required: false;
1797
- };
1798
- enableEndSession: {
1799
- type: "boolean";
1800
- required: false;
1801
- };
1802
- subjectType: {
1803
- type: "string";
1804
- required: false;
1805
- };
1806
- scopes: {
1807
- type: "string[]";
1808
- required: false;
1809
- };
1810
- userId: {
1811
- type: "string";
1812
- required: false;
1813
- references: {
1814
- model: string;
1815
- field: string;
1816
- };
1817
- };
1818
- createdAt: {
1819
- type: "date";
1820
- required: false;
1821
- };
1822
- updatedAt: {
1823
- type: "date";
1824
- required: false;
1825
- };
1826
- name: {
1827
- type: "string";
1828
- required: false;
1829
- };
1830
- uri: {
1831
- type: "string";
1832
- required: false;
1833
- };
1834
- icon: {
1835
- type: "string";
1836
- required: false;
1837
- };
1838
- contacts: {
1839
- type: "string[]";
1840
- required: false;
1841
- };
1842
- tos: {
1843
- type: "string";
1844
- required: false;
1845
- };
1846
- policy: {
1847
- type: "string";
1848
- required: false;
1849
- };
1850
- softwareId: {
1851
- type: "string";
1852
- required: false;
1853
- };
1854
- softwareVersion: {
1855
- type: "string";
1856
- required: false;
1857
- };
1858
- softwareStatement: {
1859
- type: "string";
1860
- required: false;
1861
- };
1862
- redirectUris: {
1863
- type: "string[]";
1864
- required: true;
1865
- };
1866
- postLogoutRedirectUris: {
1867
- type: "string[]";
1868
- required: false;
1869
- };
1870
- tokenEndpointAuthMethod: {
1871
- type: "string";
1872
- required: false;
1873
- };
1874
- grantTypes: {
1875
- type: "string[]";
1876
- required: false;
1877
- };
1878
- responseTypes: {
1879
- type: "string[]";
1880
- required: false;
1881
- };
1882
- public: {
1883
- type: "boolean";
1884
- required: false;
1885
- };
1886
- type: {
1887
- type: "string";
1888
- required: false;
1889
- };
1890
- requirePKCE: {
1891
- type: "boolean";
1892
- required: false;
1893
- };
1894
- referenceId: {
1895
- type: "string";
1896
- required: false;
1897
- };
1898
- metadata: {
1899
- type: "json";
1900
- required: false;
1901
- };
1902
- };
1903
- };
1904
- oauthRefreshToken: {
1905
- fields: {
1906
- token: {
1907
- type: "string";
1908
- required: true;
1909
- };
1910
- clientId: {
1911
- type: "string";
1912
- required: true;
1913
- references: {
1914
- model: string;
1915
- field: string;
1916
- };
1917
- };
1918
- sessionId: {
1919
- type: "string";
1920
- required: false;
1921
- references: {
1922
- model: string;
1923
- field: string;
1924
- onDelete: "set null";
1925
- };
1926
- };
1927
- userId: {
1928
- type: "string";
1929
- required: true;
1930
- references: {
1931
- model: string;
1932
- field: string;
1933
- };
1934
- };
1935
- referenceId: {
1936
- type: "string";
1937
- required: false;
1938
- };
1939
- expiresAt: {
1940
- type: "date";
1941
- };
1942
- createdAt: {
1943
- type: "date";
1944
- };
1945
- revoked: {
1946
- type: "date";
1947
- required: false;
1948
- };
1949
- authTime: {
1950
- type: "date";
1951
- required: false;
1952
- };
1953
- scopes: {
1954
- type: "string[]";
1955
- required: true;
1956
- };
1957
- };
1958
- };
1959
- oauthAccessToken: {
1960
- modelName: string;
1961
- fields: {
1962
- token: {
1963
- type: "string";
1964
- unique: true;
1965
- };
1966
- clientId: {
1967
- type: "string";
1968
- required: true;
1969
- references: {
1970
- model: string;
1971
- field: string;
1972
- };
1973
- };
1974
- sessionId: {
1975
- type: "string";
1976
- required: false;
1977
- references: {
1978
- model: string;
1979
- field: string;
1980
- onDelete: "set null";
1981
- };
1982
- };
1983
- userId: {
1984
- type: "string";
1985
- required: false;
1986
- references: {
1987
- model: string;
1988
- field: string;
1989
- };
1990
- };
1991
- referenceId: {
1992
- type: "string";
1993
- required: false;
1994
- };
1995
- refreshId: {
1996
- type: "string";
1997
- required: false;
1998
- references: {
1999
- model: string;
2000
- field: string;
2001
- };
2002
- };
2003
- expiresAt: {
2004
- type: "date";
2005
- };
2006
- createdAt: {
2007
- type: "date";
2008
- };
2009
- scopes: {
2010
- type: "string[]";
2011
- required: true;
2012
- };
2013
- };
2014
- };
2015
- oauthConsent: {
2016
- modelName: string;
2017
- fields: {
2018
- clientId: {
2019
- type: "string";
2020
- required: true;
2021
- references: {
2022
- model: string;
2023
- field: string;
2024
- };
2025
- };
2026
- userId: {
2027
- type: "string";
2028
- required: false;
2029
- references: {
2030
- model: string;
2031
- field: string;
2032
- };
2033
- };
2034
- referenceId: {
2035
- type: "string";
2036
- required: false;
2037
- };
2038
- scopes: {
2039
- type: "string[]";
2040
- required: true;
2041
- };
2042
- createdAt: {
2043
- type: "date";
2044
- };
2045
- updatedAt: {
2046
- type: "date";
2047
- };
2048
- };
2049
- };
2050
- };
2051
- rateLimit: ({
2052
- pathMatcher: (path: string) => path is "/oauth2/token";
2053
- window: number;
2054
- max: number;
2055
- } | {
2056
- pathMatcher: (path: string) => path is "/oauth2/authorize";
2057
- window: number;
2058
- max: number;
2059
- } | {
2060
- pathMatcher: (path: string) => path is "/oauth2/introspect";
2061
- window: number;
2062
- max: number;
2063
- } | {
2064
- pathMatcher: (path: string) => path is "/oauth2/revoke";
2065
- window: number;
2066
- max: number;
2067
- } | {
2068
- pathMatcher: (path: string) => path is "/oauth2/register";
2069
- window: number;
2070
- max: number;
2071
- } | {
2072
- pathMatcher: (path: string) => path is "/oauth2/userinfo";
2073
- window: number;
2074
- max: number;
2075
- })[];
2076
- };
2077
- //#endregion
2078
- export { oauthProvider as n, getOAuthProviderState as t };
2079
- //# sourceMappingURL=oauth-E89Dh-ZC.d.mts.map