@better-auth/oauth-provider 1.5.5 → 1.5.7-beta.1

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