@protobase/server 0.48.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/admin-options.d.ts +2 -2
  2. package/dist/app-identity.d.ts +2 -2
  3. package/dist/app-name.d.ts +2 -0
  4. package/dist/better-auth/auth-settings.d.ts +8754 -0
  5. package/dist/better-auth/auth-settings.js +43 -0
  6. package/dist/better-auth/authenticate-settings.d.ts +15 -0
  7. package/dist/better-auth/authenticate-settings.js +12 -0
  8. package/dist/better-auth/create-auth.d.ts +23 -11
  9. package/dist/better-auth/create-auth.js +21 -9
  10. package/dist/better-auth/mcp/mcp-auth-plugins.d.ts +2719 -0
  11. package/dist/better-auth/mcp/mcp-auth-plugins.js +68 -0
  12. package/dist/better-auth/mcp/mcp-plugins.d.ts +7 -2
  13. package/dist/better-auth/mcp/mcp-plugins.js +3 -68
  14. package/dist/better-auth/mcp/mcp-token-claims.js +1 -1
  15. package/dist/better-auth/organizations/store.d.ts +1 -0
  16. package/dist/better-auth/saml-plugin.d.ts +993 -0
  17. package/dist/better-auth/saml-plugin.js +36 -0
  18. package/dist/better-auth/saml-sign-in.d.ts +27 -1
  19. package/dist/better-auth/saml-sign-in.js +1 -33
  20. package/dist/better-auth/user-table.js +1 -1
  21. package/dist/better-auth/users.d.ts +1 -1
  22. package/dist/create-admin.d.ts +5 -3
  23. package/dist/create-admin.js +3 -1
  24. package/dist/encryption/keyring.js +1 -1
  25. package/dist/files/options.d.ts +5 -8
  26. package/dist/files/provider-settings.d.ts +16 -0
  27. package/dist/files/provider-settings.js +17 -0
  28. package/dist/files/runtime.js +4 -4
  29. package/dist/forms/runtime.js +3 -3
  30. package/dist/index.d.ts +16 -15
  31. package/dist/index.js +8 -10
  32. package/dist/internal.d.ts +13 -0
  33. package/dist/internal.js +13 -0
  34. package/dist/jobs/declared-job.d.ts +24 -0
  35. package/dist/jobs/declared-job.js +26 -0
  36. package/dist/jobs/job-types.d.ts +1 -1
  37. package/dist/mcp/mcp-authenticator.js +3 -3
  38. package/dist/notifications/device-store-of.d.ts +1 -1
  39. package/dist/notifications/device-store-of.js +1 -1
  40. package/dist/notifications/device-store.d.ts +1 -1
  41. package/dist/notifications/device-store.js +1 -1
  42. package/dist/notifications/history-store-of.d.ts +1 -1
  43. package/dist/notifications/history-store-of.js +1 -1
  44. package/dist/notifications/history-store.d.ts +1 -1
  45. package/dist/notifications/history-store.js +1 -1
  46. package/dist/notifications/options.d.ts +3 -1
  47. package/dist/notifications/options.js +1 -1
  48. package/dist/notifications/schema.d.ts +2 -2
  49. package/dist/notifications/schema.js +7 -7
  50. package/dist/notifications/send-notification.js +1 -1
  51. package/dist/notifications/sender.d.ts +1 -1
  52. package/dist/notifications/sender.js +2 -2
  53. package/dist/notifications/senders-of.d.ts +1 -1
  54. package/dist/notifications/senders-of.js +1 -1
  55. package/dist/package.js +1 -1
  56. package/dist/webhooks/subscription.d.ts +1 -0
  57. package/dist/webhooks/table/options.d.ts +1 -1
  58. package/dist/webhooks/table/schema.d.ts +2 -2
  59. package/dist/webhooks/table/schema.js +2 -2
  60. package/dist/webhooks/table/webhook-table.js +2 -2
  61. package/dist/webhooks/table/webhooks-module.d.ts +108 -0
  62. package/dist/webhooks/table/webhooks-module.js +11 -0
  63. package/package.json +6 -5
  64. package/dist/notifications/plugin.d.ts +0 -13
  65. package/dist/notifications/plugin.js +0 -16
  66. package/dist/project-config.d.ts +0 -54
  67. package/dist/project-config.js +0 -182
  68. package/dist/webhooks/table/plugin.d.ts +0 -10
  69. package/dist/webhooks/table/plugin.js +0 -18
@@ -0,0 +1,993 @@
1
+ import { ResolvedSamlProvider } from "./saml-sign-in.js";
2
+ import { SSOOptions } from "@better-auth/sso";
3
+ //#region src/better-auth/saml-plugin.d.ts
4
+ /**
5
+ * Better Auth's SSO plugin with the configured providers. Their domains are trusted, so an address there links to the
6
+ * account that has it; organizations are not assigned by provider, and nobody registers providers.
7
+ */
8
+ export declare const samlPlugin: (providers: ResolvedSamlProvider[], baseURL: string) => {
9
+ id: "sso";
10
+ version: string;
11
+ endpoints: {
12
+ spMetadata: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sso/saml2/sp/metadata", {
13
+ method: "GET";
14
+ query: import("zod").ZodObject<{
15
+ providerId: import("zod").ZodString;
16
+ }, import("zod/v4/core").$strip>;
17
+ metadata: {
18
+ openapi: {
19
+ operationId: string;
20
+ summary: string;
21
+ description: string;
22
+ responses: {
23
+ "200": {
24
+ description: string;
25
+ };
26
+ };
27
+ };
28
+ };
29
+ }, Response>>;
30
+ registerSSOProvider: import("better-call").StrictEndpoint<"/sso/register", {
31
+ method: "POST";
32
+ body: import("zod").ZodObject<{
33
+ [x: string]: import("zod").ZodOptional<import("zod").ZodAny>;
34
+ }, import("zod/v4/core").$strip>;
35
+ use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
36
+ session: {
37
+ session: Record<string, any> & {
38
+ id: string;
39
+ createdAt: Date;
40
+ updatedAt: Date;
41
+ userId: string;
42
+ expiresAt: Date;
43
+ token: string;
44
+ ipAddress?: string | null | undefined;
45
+ userAgent?: string | null | undefined;
46
+ };
47
+ user: Record<string, any> & {
48
+ id: string;
49
+ createdAt: Date;
50
+ updatedAt: Date;
51
+ email: string;
52
+ emailVerified: boolean;
53
+ name: string;
54
+ image?: string | null | undefined;
55
+ };
56
+ };
57
+ }>>[];
58
+ metadata: {
59
+ $Infer: {
60
+ body: Record<string, any>;
61
+ };
62
+ openapi: {
63
+ operationId: string;
64
+ summary: string;
65
+ description: string;
66
+ responses: {
67
+ "200": {
68
+ description: string;
69
+ content: {
70
+ "application/json": {
71
+ schema: {
72
+ type: "object";
73
+ properties: {
74
+ issuer: {
75
+ type: string;
76
+ format: string;
77
+ description: string;
78
+ };
79
+ domain: {
80
+ type: string;
81
+ description: string;
82
+ };
83
+ domainVerified: {
84
+ type: string;
85
+ description: string;
86
+ };
87
+ domainVerificationToken: {
88
+ type: string;
89
+ description: string;
90
+ };
91
+ oidcConfig: {
92
+ type: string;
93
+ properties: {
94
+ issuer: {
95
+ type: string;
96
+ format: string;
97
+ description: string;
98
+ };
99
+ pkce: {
100
+ type: string;
101
+ description: string;
102
+ };
103
+ clientId: {
104
+ type: string;
105
+ description: string;
106
+ };
107
+ clientSecret: {
108
+ type: string;
109
+ description: string;
110
+ };
111
+ authorizationEndpoint: {
112
+ type: string;
113
+ format: string;
114
+ nullable: boolean;
115
+ description: string;
116
+ };
117
+ discoveryEndpoint: {
118
+ type: string;
119
+ format: string;
120
+ description: string;
121
+ };
122
+ userInfoEndpoint: {
123
+ type: string;
124
+ format: string;
125
+ nullable: boolean;
126
+ description: string;
127
+ };
128
+ scopes: {
129
+ type: string;
130
+ items: {
131
+ type: string;
132
+ };
133
+ nullable: boolean;
134
+ description: string;
135
+ };
136
+ tokenEndpoint: {
137
+ type: string;
138
+ format: string;
139
+ nullable: boolean;
140
+ description: string;
141
+ };
142
+ tokenEndpointAuthentication: {
143
+ type: string;
144
+ enum: string[];
145
+ nullable: boolean;
146
+ description: string;
147
+ };
148
+ jwksEndpoint: {
149
+ type: string;
150
+ format: string;
151
+ nullable: boolean;
152
+ description: string;
153
+ };
154
+ mapping: {
155
+ type: string;
156
+ nullable: boolean;
157
+ properties: {
158
+ email: {
159
+ type: string;
160
+ description: string;
161
+ };
162
+ emailVerified: {
163
+ type: string;
164
+ nullable: boolean;
165
+ description: string;
166
+ };
167
+ name: {
168
+ type: string;
169
+ description: string;
170
+ };
171
+ image: {
172
+ type: string;
173
+ nullable: boolean;
174
+ description: string;
175
+ };
176
+ extraFields: {
177
+ type: string;
178
+ additionalProperties: {
179
+ type: string;
180
+ };
181
+ nullable: boolean;
182
+ description: string;
183
+ };
184
+ };
185
+ };
186
+ };
187
+ required: string[];
188
+ description: string;
189
+ };
190
+ organizationId: {
191
+ type: string;
192
+ nullable: boolean;
193
+ description: string;
194
+ };
195
+ userId: {
196
+ type: string;
197
+ description: string;
198
+ };
199
+ providerId: {
200
+ type: string;
201
+ description: string;
202
+ };
203
+ redirectURI: {
204
+ type: string;
205
+ format: string;
206
+ description: string;
207
+ };
208
+ };
209
+ required: string[];
210
+ };
211
+ };
212
+ };
213
+ };
214
+ };
215
+ };
216
+ };
217
+ }, {
218
+ redirectURI: string;
219
+ oidcConfig: import("@better-auth/sso").OIDCConfig | null;
220
+ samlConfig: import("@better-auth/sso").SAMLConfig | null;
221
+ } & Omit<{
222
+ domainVerified: boolean;
223
+ } & {
224
+ issuer: string;
225
+ oidcConfig?: import("@better-auth/sso").OIDCConfig | undefined;
226
+ samlConfig?: import("@better-auth/sso").SAMLConfig | undefined;
227
+ userId: string;
228
+ providerId: string;
229
+ organizationId?: string | undefined;
230
+ domain: string;
231
+ }, "samlConfig" | "oidcConfig"> & {
232
+ domainVerified: boolean;
233
+ domainVerificationToken: string;
234
+ }>;
235
+ signInSSO: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sign-in/sso", {
236
+ method: "POST";
237
+ body: import("zod").ZodObject<{
238
+ email: import("zod").ZodOptional<import("zod").ZodString>;
239
+ organizationSlug: import("zod").ZodOptional<import("zod").ZodString>;
240
+ providerId: import("zod").ZodOptional<import("zod").ZodString>;
241
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
242
+ callbackURL: import("zod").ZodString;
243
+ errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
244
+ newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
245
+ scopes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
246
+ loginHint: import("zod").ZodOptional<import("zod").ZodString>;
247
+ additionalParams: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
248
+ requestSignUp: import("zod").ZodOptional<import("zod").ZodBoolean>;
249
+ providerType: import("zod").ZodOptional<import("zod").ZodEnum<{
250
+ saml: "saml";
251
+ oidc: "oidc";
252
+ }>>;
253
+ }, import("zod/v4/core").$strip>;
254
+ metadata: {
255
+ openapi: {
256
+ operationId: string;
257
+ summary: string;
258
+ description: string;
259
+ requestBody: {
260
+ content: {
261
+ "application/json": {
262
+ schema: {
263
+ type: "object";
264
+ properties: {
265
+ email: {
266
+ type: string;
267
+ description: string;
268
+ };
269
+ organizationSlug: {
270
+ type: string;
271
+ description: string;
272
+ };
273
+ providerId: {
274
+ type: string;
275
+ description: string;
276
+ };
277
+ domain: {
278
+ type: string;
279
+ description: string;
280
+ };
281
+ callbackURL: {
282
+ type: string;
283
+ description: string;
284
+ };
285
+ errorCallbackURL: {
286
+ type: string;
287
+ description: string;
288
+ };
289
+ newUserCallbackURL: {
290
+ type: string;
291
+ description: string;
292
+ };
293
+ scopes: {
294
+ type: string;
295
+ items: {
296
+ type: string;
297
+ };
298
+ description: string;
299
+ };
300
+ loginHint: {
301
+ type: string;
302
+ description: string;
303
+ };
304
+ additionalParams: {
305
+ type: string;
306
+ additionalProperties: {
307
+ type: string;
308
+ };
309
+ description: string;
310
+ };
311
+ requestSignUp: {
312
+ type: string;
313
+ description: string;
314
+ };
315
+ providerType: {
316
+ type: string;
317
+ enum: string[];
318
+ description: string;
319
+ };
320
+ };
321
+ required: string[];
322
+ };
323
+ };
324
+ };
325
+ };
326
+ responses: {
327
+ "200": {
328
+ description: string;
329
+ content: {
330
+ "application/json": {
331
+ schema: {
332
+ type: "object";
333
+ properties: {
334
+ url: {
335
+ type: string;
336
+ format: string;
337
+ description: string;
338
+ };
339
+ redirect: {
340
+ type: string;
341
+ description: string;
342
+ enum: boolean[];
343
+ };
344
+ };
345
+ required: string[];
346
+ };
347
+ };
348
+ };
349
+ };
350
+ };
351
+ };
352
+ };
353
+ }, {
354
+ url: string;
355
+ redirect: boolean;
356
+ }>>;
357
+ callbackSSO: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sso/callback/:providerId", {
358
+ method: "GET";
359
+ query: import("zod").ZodObject<{
360
+ code: import("zod").ZodOptional<import("zod").ZodString>;
361
+ state: import("zod").ZodOptional<import("zod").ZodString>;
362
+ error: import("zod").ZodOptional<import("zod").ZodString>;
363
+ error_description: import("zod").ZodOptional<import("zod").ZodString>;
364
+ }, import("zod/v4/core").$strip>;
365
+ allowedMediaTypes: readonly ["application/x-www-form-urlencoded", "application/json"];
366
+ metadata: {
367
+ openapi: {
368
+ operationId: string;
369
+ summary: string;
370
+ description: string;
371
+ responses: {
372
+ "302": {
373
+ description: string;
374
+ };
375
+ };
376
+ };
377
+ scope: "server";
378
+ };
379
+ }, never>>;
380
+ callbackSSOShared: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sso/callback", {
381
+ metadata: {
382
+ openapi: {
383
+ operationId: string;
384
+ summary: string;
385
+ description: string;
386
+ responses: {
387
+ "302": {
388
+ description: string;
389
+ };
390
+ };
391
+ };
392
+ scope: "server";
393
+ };
394
+ method: "GET";
395
+ query: import("zod").ZodObject<{
396
+ code: import("zod").ZodOptional<import("zod").ZodString>;
397
+ state: import("zod").ZodOptional<import("zod").ZodString>;
398
+ error: import("zod").ZodOptional<import("zod").ZodString>;
399
+ error_description: import("zod").ZodOptional<import("zod").ZodString>;
400
+ }, import("zod/v4/core").$strip>;
401
+ allowedMediaTypes: readonly ["application/x-www-form-urlencoded", "application/json"];
402
+ }, never>>;
403
+ acsEndpoint: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sso/saml2/sp/acs/:providerId", {
404
+ method: ("GET" | "POST")[];
405
+ body: import("zod").ZodOptional<import("zod").ZodObject<{
406
+ SAMLResponse: import("zod").ZodString;
407
+ RelayState: import("zod").ZodOptional<import("zod").ZodString>;
408
+ }, import("zod/v4/core").$strip>>;
409
+ query: import("zod").ZodOptional<import("zod").ZodObject<{
410
+ RelayState: import("zod").ZodOptional<import("zod").ZodString>;
411
+ }, import("zod/v4/core").$strip>>;
412
+ metadata: {
413
+ allowedMediaTypes: string[];
414
+ openapi: {
415
+ operationId: string;
416
+ summary: string;
417
+ description: string;
418
+ responses: {
419
+ "302": {
420
+ description: string;
421
+ };
422
+ "400": {
423
+ description: string;
424
+ };
425
+ "404": {
426
+ description: string;
427
+ };
428
+ };
429
+ };
430
+ scope: "server";
431
+ };
432
+ }, never>>;
433
+ sloEndpoint: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sso/saml2/sp/slo/:providerId", {
434
+ method: ("GET" | "POST")[];
435
+ body: import("zod").ZodOptional<import("zod").ZodObject<{
436
+ SAMLRequest: import("zod").ZodOptional<import("zod").ZodString>;
437
+ SAMLResponse: import("zod").ZodOptional<import("zod").ZodString>;
438
+ RelayState: import("zod").ZodOptional<import("zod").ZodString>;
439
+ SigAlg: import("zod").ZodOptional<import("zod").ZodString>;
440
+ Signature: import("zod").ZodOptional<import("zod").ZodString>;
441
+ }, import("zod/v4/core").$strip>>;
442
+ query: import("zod").ZodOptional<import("zod").ZodObject<{
443
+ SAMLRequest: import("zod").ZodOptional<import("zod").ZodString>;
444
+ SAMLResponse: import("zod").ZodOptional<import("zod").ZodString>;
445
+ RelayState: import("zod").ZodOptional<import("zod").ZodString>;
446
+ SigAlg: import("zod").ZodOptional<import("zod").ZodString>;
447
+ Signature: import("zod").ZodOptional<import("zod").ZodString>;
448
+ }, import("zod/v4/core").$strip>>;
449
+ metadata: {
450
+ allowedMediaTypes: string[];
451
+ scope: "server";
452
+ };
453
+ }, void | Response>>;
454
+ initiateSLO: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sso/saml2/logout/:providerId", {
455
+ method: "POST";
456
+ body: import("zod").ZodObject<{
457
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
458
+ }, import("zod/v4/core").$strip>;
459
+ use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
460
+ session: {
461
+ session: Record<string, any> & {
462
+ id: string;
463
+ createdAt: Date;
464
+ updatedAt: Date;
465
+ userId: string;
466
+ expiresAt: Date;
467
+ token: string;
468
+ ipAddress?: string | null | undefined;
469
+ userAgent?: string | null | undefined;
470
+ };
471
+ user: Record<string, any> & {
472
+ id: string;
473
+ createdAt: Date;
474
+ updatedAt: Date;
475
+ email: string;
476
+ emailVerified: boolean;
477
+ name: string;
478
+ image?: string | null | undefined;
479
+ };
480
+ };
481
+ }>>[];
482
+ metadata: {
483
+ readonly scope: "server";
484
+ };
485
+ }, never>>;
486
+ listSSOProviders: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sso/providers", {
487
+ method: "GET";
488
+ use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
489
+ session: {
490
+ session: Record<string, any> & {
491
+ id: string;
492
+ createdAt: Date;
493
+ updatedAt: Date;
494
+ userId: string;
495
+ expiresAt: Date;
496
+ token: string;
497
+ ipAddress?: string | null | undefined;
498
+ userAgent?: string | null | undefined;
499
+ };
500
+ user: Record<string, any> & {
501
+ id: string;
502
+ createdAt: Date;
503
+ updatedAt: Date;
504
+ email: string;
505
+ emailVerified: boolean;
506
+ name: string;
507
+ image?: string | null | undefined;
508
+ };
509
+ };
510
+ }>>[];
511
+ metadata: {
512
+ openapi: {
513
+ operationId: string;
514
+ summary: string;
515
+ description: string;
516
+ responses: {
517
+ "200": {
518
+ description: string;
519
+ };
520
+ };
521
+ };
522
+ };
523
+ }, {
524
+ providers: {
525
+ providerId: string;
526
+ type: string;
527
+ issuer: string;
528
+ domain: string;
529
+ organizationId: string | null;
530
+ domainVerified: boolean;
531
+ oidcConfig: {
532
+ discoveryEndpoint: string;
533
+ clientIdLastFour: string;
534
+ pkce: boolean;
535
+ authorizationEndpoint: string | undefined;
536
+ tokenEndpoint: string | undefined;
537
+ userInfoEndpoint: string | undefined;
538
+ jwksEndpoint: string | undefined;
539
+ scopes: string[] | undefined;
540
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | "private_key_jwt" | undefined;
541
+ } | undefined;
542
+ samlConfig: {
543
+ entryPoint: string;
544
+ callbackUrl: string | undefined;
545
+ idpInitiatedCallbackUrl: string | undefined;
546
+ audience: string | undefined;
547
+ wantAssertionsSigned: boolean | undefined;
548
+ authnRequestsSigned: boolean | undefined;
549
+ identifierFormat: string | undefined;
550
+ signatureAlgorithm: string | undefined;
551
+ digestAlgorithm: string | undefined;
552
+ certificate: ({
553
+ fingerprintSha256: string;
554
+ notBefore: string;
555
+ notAfter: string;
556
+ publicKeyAlgorithm: string;
557
+ } | {
558
+ error: string;
559
+ })[] | undefined;
560
+ } | undefined;
561
+ spMetadataUrl: string;
562
+ }[];
563
+ }>>;
564
+ getSSOProvider: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sso/get-provider", {
565
+ method: "GET";
566
+ use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
567
+ session: {
568
+ session: Record<string, any> & {
569
+ id: string;
570
+ createdAt: Date;
571
+ updatedAt: Date;
572
+ userId: string;
573
+ expiresAt: Date;
574
+ token: string;
575
+ ipAddress?: string | null | undefined;
576
+ userAgent?: string | null | undefined;
577
+ };
578
+ user: Record<string, any> & {
579
+ id: string;
580
+ createdAt: Date;
581
+ updatedAt: Date;
582
+ email: string;
583
+ emailVerified: boolean;
584
+ name: string;
585
+ image?: string | null | undefined;
586
+ };
587
+ };
588
+ }>>[];
589
+ query: import("zod").ZodObject<{
590
+ providerId: import("zod").ZodString;
591
+ }, import("zod/v4/core").$strip>;
592
+ metadata: {
593
+ openapi: {
594
+ operationId: string;
595
+ summary: string;
596
+ description: string;
597
+ responses: {
598
+ "200": {
599
+ description: string;
600
+ };
601
+ "404": {
602
+ description: string;
603
+ };
604
+ "403": {
605
+ description: string;
606
+ };
607
+ };
608
+ };
609
+ };
610
+ }, {
611
+ providerId: string;
612
+ type: string;
613
+ issuer: string;
614
+ domain: string;
615
+ organizationId: string | null;
616
+ domainVerified: boolean;
617
+ oidcConfig: {
618
+ discoveryEndpoint: string;
619
+ clientIdLastFour: string;
620
+ pkce: boolean;
621
+ authorizationEndpoint: string | undefined;
622
+ tokenEndpoint: string | undefined;
623
+ userInfoEndpoint: string | undefined;
624
+ jwksEndpoint: string | undefined;
625
+ scopes: string[] | undefined;
626
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | "private_key_jwt" | undefined;
627
+ } | undefined;
628
+ samlConfig: {
629
+ entryPoint: string;
630
+ callbackUrl: string | undefined;
631
+ idpInitiatedCallbackUrl: string | undefined;
632
+ audience: string | undefined;
633
+ wantAssertionsSigned: boolean | undefined;
634
+ authnRequestsSigned: boolean | undefined;
635
+ identifierFormat: string | undefined;
636
+ signatureAlgorithm: string | undefined;
637
+ digestAlgorithm: string | undefined;
638
+ certificate: ({
639
+ fingerprintSha256: string;
640
+ notBefore: string;
641
+ notAfter: string;
642
+ publicKeyAlgorithm: string;
643
+ } | {
644
+ error: string;
645
+ })[] | undefined;
646
+ } | undefined;
647
+ spMetadataUrl: string;
648
+ }>>;
649
+ updateSSOProvider: ReturnType<(options: SSOOptions) => import("better-call").StrictEndpoint<"/sso/update-provider", {
650
+ method: "POST";
651
+ use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
652
+ session: {
653
+ session: Record<string, any> & {
654
+ id: string;
655
+ createdAt: Date;
656
+ updatedAt: Date;
657
+ userId: string;
658
+ expiresAt: Date;
659
+ token: string;
660
+ ipAddress?: string | null | undefined;
661
+ userAgent?: string | null | undefined;
662
+ };
663
+ user: Record<string, any> & {
664
+ id: string;
665
+ createdAt: Date;
666
+ updatedAt: Date;
667
+ email: string;
668
+ emailVerified: boolean;
669
+ name: string;
670
+ image?: string | null | undefined;
671
+ };
672
+ };
673
+ }>>[];
674
+ body: import("zod").ZodObject<{
675
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
676
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
677
+ oidcConfig: import("zod").ZodOptional<import("zod").ZodObject<{
678
+ clientId: import("zod").ZodOptional<import("zod").ZodString>;
679
+ clientSecret: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
680
+ authorizationEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
681
+ tokenEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
682
+ userInfoEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
683
+ tokenEndpointAuthentication: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodEnum<{
684
+ client_secret_post: "client_secret_post";
685
+ client_secret_basic: "client_secret_basic";
686
+ private_key_jwt: "private_key_jwt";
687
+ }>>>;
688
+ privateKeyId: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
689
+ privateKeyAlgorithm: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
690
+ jwksEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
691
+ discoveryEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
692
+ skipDiscovery: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodBoolean>>;
693
+ scopes: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
694
+ pkce: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>>;
695
+ overrideUserInfo: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodBoolean>>;
696
+ mapping: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
697
+ email: import("zod").ZodOptional<import("zod").ZodString>;
698
+ emailVerified: import("zod").ZodOptional<import("zod").ZodString>;
699
+ name: import("zod").ZodOptional<import("zod").ZodString>;
700
+ image: import("zod").ZodOptional<import("zod").ZodString>;
701
+ extraFields: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
702
+ }, import("zod/v4/core").$strict>>>;
703
+ }, import("zod/v4/core").$strip>>;
704
+ samlConfig: import("zod").ZodOptional<import("zod").ZodObject<{
705
+ mapping: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
706
+ email: import("zod").ZodOptional<import("zod").ZodString>;
707
+ emailVerified: import("zod").ZodOptional<import("zod").ZodString>;
708
+ name: import("zod").ZodOptional<import("zod").ZodString>;
709
+ firstName: import("zod").ZodOptional<import("zod").ZodString>;
710
+ lastName: import("zod").ZodOptional<import("zod").ZodString>;
711
+ extraFields: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
712
+ }, import("zod/v4/core").$strict>>>;
713
+ privateKey: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
714
+ spMetadata: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
715
+ metadata: import("zod").ZodOptional<import("zod").ZodString>;
716
+ entityID: import("zod").ZodOptional<import("zod").ZodString>;
717
+ binding: import("zod").ZodOptional<import("zod").ZodString>;
718
+ privateKey: import("zod").ZodOptional<import("zod").ZodString>;
719
+ privateKeyPass: import("zod").ZodOptional<import("zod").ZodString>;
720
+ isAssertionEncrypted: import("zod").ZodOptional<import("zod").ZodBoolean>;
721
+ encPrivateKey: import("zod").ZodOptional<import("zod").ZodString>;
722
+ encPrivateKeyPass: import("zod").ZodOptional<import("zod").ZodString>;
723
+ }, import("zod/v4/core").$strip>>>;
724
+ cert: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>>;
725
+ entryPoint: import("zod").ZodOptional<import("zod").ZodString>;
726
+ audience: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
727
+ callbackUrl: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
728
+ wantAssertionsSigned: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodBoolean>>;
729
+ authnRequestsSigned: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodBoolean>>;
730
+ signatureAlgorithm: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
731
+ digestAlgorithm: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
732
+ identifierFormat: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
733
+ idpInitiatedCallbackUrl: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
734
+ idpMetadata: import("zod").ZodOptional<import("zod").ZodObject<{
735
+ cert: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>;
736
+ privateKey: import("zod").ZodOptional<import("zod").ZodString>;
737
+ privateKeyPass: import("zod").ZodOptional<import("zod").ZodString>;
738
+ isAssertionEncrypted: import("zod").ZodOptional<import("zod").ZodBoolean>;
739
+ encPrivateKey: import("zod").ZodOptional<import("zod").ZodString>;
740
+ encPrivateKeyPass: import("zod").ZodOptional<import("zod").ZodString>;
741
+ singleSignOnService: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
742
+ Binding: import("zod").ZodString;
743
+ Location: import("zod").ZodString;
744
+ }, import("zod/v4/core").$strip>>>;
745
+ singleLogoutService: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
746
+ Binding: import("zod").ZodString;
747
+ Location: import("zod").ZodString;
748
+ }, import("zod/v4/core").$strip>>>;
749
+ metadata: import("zod").ZodOptional<import("zod").ZodString>;
750
+ entityID: import("zod").ZodOptional<import("zod").ZodString>;
751
+ }, import("zod/v4/core").$strip>>;
752
+ }, import("zod/v4/core").$strip>>;
753
+ providerId: import("zod").ZodString;
754
+ }, import("zod/v4/core").$strip>;
755
+ metadata: {
756
+ openapi: {
757
+ operationId: string;
758
+ summary: string;
759
+ description: string;
760
+ responses: {
761
+ "200": {
762
+ description: string;
763
+ };
764
+ "404": {
765
+ description: string;
766
+ };
767
+ "403": {
768
+ description: string;
769
+ };
770
+ };
771
+ };
772
+ };
773
+ }, {
774
+ providerId: string;
775
+ type: string;
776
+ issuer: string;
777
+ domain: string;
778
+ organizationId: string | null;
779
+ domainVerified: boolean;
780
+ oidcConfig: {
781
+ discoveryEndpoint: string;
782
+ clientIdLastFour: string;
783
+ pkce: boolean;
784
+ authorizationEndpoint: string | undefined;
785
+ tokenEndpoint: string | undefined;
786
+ userInfoEndpoint: string | undefined;
787
+ jwksEndpoint: string | undefined;
788
+ scopes: string[] | undefined;
789
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | "private_key_jwt" | undefined;
790
+ } | undefined;
791
+ samlConfig: {
792
+ entryPoint: string;
793
+ callbackUrl: string | undefined;
794
+ idpInitiatedCallbackUrl: string | undefined;
795
+ audience: string | undefined;
796
+ wantAssertionsSigned: boolean | undefined;
797
+ authnRequestsSigned: boolean | undefined;
798
+ identifierFormat: string | undefined;
799
+ signatureAlgorithm: string | undefined;
800
+ digestAlgorithm: string | undefined;
801
+ certificate: ({
802
+ fingerprintSha256: string;
803
+ notBefore: string;
804
+ notAfter: string;
805
+ publicKeyAlgorithm: string;
806
+ } | {
807
+ error: string;
808
+ })[] | undefined;
809
+ } | undefined;
810
+ spMetadataUrl: string;
811
+ }>>;
812
+ deleteSSOProvider: ReturnType<(options?: SSOOptions) => import("better-call").StrictEndpoint<"/sso/delete-provider", {
813
+ method: "POST";
814
+ use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
815
+ session: {
816
+ session: Record<string, any> & {
817
+ id: string;
818
+ createdAt: Date;
819
+ updatedAt: Date;
820
+ userId: string;
821
+ expiresAt: Date;
822
+ token: string;
823
+ ipAddress?: string | null | undefined;
824
+ userAgent?: string | null | undefined;
825
+ };
826
+ user: Record<string, any> & {
827
+ id: string;
828
+ createdAt: Date;
829
+ updatedAt: Date;
830
+ email: string;
831
+ emailVerified: boolean;
832
+ name: string;
833
+ image?: string | null | undefined;
834
+ };
835
+ };
836
+ }>>[];
837
+ body: import("zod").ZodObject<{
838
+ providerId: import("zod").ZodString;
839
+ }, import("zod/v4/core").$strip>;
840
+ metadata: {
841
+ openapi: {
842
+ operationId: string;
843
+ summary: string;
844
+ description: string;
845
+ responses: {
846
+ "200": {
847
+ description: string;
848
+ };
849
+ "404": {
850
+ description: string;
851
+ };
852
+ "403": {
853
+ description: string;
854
+ };
855
+ };
856
+ };
857
+ };
858
+ }, {
859
+ success: boolean;
860
+ }>>;
861
+ } & {
862
+ requestDomainVerification: ReturnType<(options: SSOOptions) => import("better-call").StrictEndpoint<"/sso/request-domain-verification", {
863
+ method: "POST";
864
+ body: import("zod").ZodObject<{
865
+ providerId: import("zod").ZodString;
866
+ }, import("zod/v4/core").$strip>;
867
+ metadata: {
868
+ openapi: {
869
+ summary: string;
870
+ description: string;
871
+ responses: {
872
+ "404": {
873
+ description: string;
874
+ };
875
+ "409": {
876
+ description: string;
877
+ };
878
+ "201": {
879
+ description: string;
880
+ };
881
+ };
882
+ };
883
+ };
884
+ use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
885
+ session: {
886
+ session: Record<string, any> & {
887
+ id: string;
888
+ createdAt: Date;
889
+ updatedAt: Date;
890
+ userId: string;
891
+ expiresAt: Date;
892
+ token: string;
893
+ ipAddress?: string | null | undefined;
894
+ userAgent?: string | null | undefined;
895
+ };
896
+ user: Record<string, any> & {
897
+ id: string;
898
+ createdAt: Date;
899
+ updatedAt: Date;
900
+ email: string;
901
+ emailVerified: boolean;
902
+ name: string;
903
+ image?: string | null | undefined;
904
+ };
905
+ };
906
+ }>>[];
907
+ }, {
908
+ domainVerificationToken: string;
909
+ }>>;
910
+ verifyDomain: ReturnType<(options: SSOOptions) => import("better-call").StrictEndpoint<"/sso/verify-domain", {
911
+ method: "POST";
912
+ body: import("zod").ZodObject<{
913
+ providerId: import("zod").ZodString;
914
+ }, import("zod/v4/core").$strip>;
915
+ metadata: {
916
+ openapi: {
917
+ summary: string;
918
+ description: string;
919
+ responses: {
920
+ "404": {
921
+ description: string;
922
+ };
923
+ "409": {
924
+ description: string;
925
+ };
926
+ "502": {
927
+ description: string;
928
+ };
929
+ "204": {
930
+ description: string;
931
+ };
932
+ };
933
+ };
934
+ };
935
+ use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
936
+ session: {
937
+ session: Record<string, any> & {
938
+ id: string;
939
+ createdAt: Date;
940
+ updatedAt: Date;
941
+ userId: string;
942
+ expiresAt: Date;
943
+ token: string;
944
+ ipAddress?: string | null | undefined;
945
+ userAgent?: string | null | undefined;
946
+ };
947
+ user: Record<string, any> & {
948
+ id: string;
949
+ createdAt: Date;
950
+ updatedAt: Date;
951
+ email: string;
952
+ emailVerified: boolean;
953
+ name: string;
954
+ image?: string | null | undefined;
955
+ };
956
+ };
957
+ }>>[];
958
+ }, void>>;
959
+ };
960
+ $Infer: {
961
+ SSOProvider: {
962
+ domainVerified: boolean;
963
+ } & {
964
+ issuer: string;
965
+ oidcConfig?: import("@better-auth/sso").OIDCConfig | undefined;
966
+ samlConfig?: import("@better-auth/sso").SAMLConfig | undefined;
967
+ userId: string;
968
+ providerId: string;
969
+ organizationId?: string | undefined;
970
+ domain: string;
971
+ };
972
+ };
973
+ options: NoInfer<{
974
+ defaultSSO: {
975
+ domain: string;
976
+ providerId: string;
977
+ samlConfig?: import("@better-auth/sso").SAMLConfig;
978
+ oidcConfig?: import("@better-auth/sso").OIDCConfig;
979
+ privateKey?: {
980
+ privateKeyJwk?: JsonWebKey;
981
+ privateKeyPem?: string;
982
+ };
983
+ }[];
984
+ domainVerification: {
985
+ enabled: true;
986
+ };
987
+ organizationProvisioning: {
988
+ disabled: true;
989
+ };
990
+ providersLimit: number;
991
+ }>;
992
+ };
993
+ //#endregion