@protobase/server 0.21.9 → 0.21.11

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.
@@ -6,6 +6,7 @@ import { RoleDefinitions, RolesInput } from "./organizations/role-definitions.js
6
6
  import { OrganizationRole } from "./organizations/store.js";
7
7
  import { OrganizationsOptions, ResolvedOrganizations } from "./organizations/options.js";
8
8
  import { PlatformSignIn } from "./platform-sign-in.js";
9
+ import { SsoOptions } from "./saml-sign-in.js";
9
10
  import { signUpPaths } from "./sign-up/sign-up-plugin.js";
10
11
  import "../index.js";
11
12
  import { BetterAuthOptions } from "better-auth";
@@ -96,6 +97,13 @@ export type CreateAuthOptions = {
96
97
  * environment says. Left out when `socialProviders` has a provider with the same id.
97
98
  */
98
99
  signInProvider?: PlatformSignIn | false;
100
+ /**
101
+ * Single sign-on with the app's SAML 2.0 identity providers, for example `{ saml: [{ id: 'okta', name: 'Okta',
102
+ * domains: ['example.com'], idp: { metadata } }] }` (see `SamlProvider`). Like `socialProviders`, a provider signs up
103
+ * people without an account, with the default role, but only at its `domains`, where it also links to the account
104
+ * with the same address. Default none.
105
+ */
106
+ sso?: SsoOptions;
99
107
  /**
100
108
  * Turns on organizations: people work in one at a time, records of `.tenant` resources are scoped to it, and roles
101
109
  * are held globally (on the user) or per membership. Off by default: the app works as one organization.
@@ -2323,7 +2331,9 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
2323
2331
  userId: string;
2324
2332
  expiresAt: Date;
2325
2333
  token: string;
2326
- ipAddress?: string | null | undefined;
2334
+ ipAddress?
2335
+ /** The app's name it signs in and mails as: `appName`, else `PROTOBASE_APP_NAME`, else `Protobase`. */
2336
+ /** The app's name it signs in and mails as: `appName`, else `PROTOBASE_APP_NAME`, else `Protobase`. */ : string | null | undefined;
2327
2337
  userAgent?: string | null | undefined;
2328
2338
  };
2329
2339
  user: Record<string, any> & {
@@ -3085,208 +3095,33 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
3085
3095
  TOKEN_URL_NOT_FOUND: import("better-auth").RawError<"TOKEN_URL_NOT_FOUND">;
3086
3096
  };
3087
3097
  } | {
3088
- id: "protobase-sign-in-policy";
3089
- schema: {
3090
- readonly signInPolicy: {
3091
- readonly modelName: "sign_in_policy";
3092
- readonly fields: {
3093
- readonly password: {
3094
- readonly type: "string";
3095
- readonly required: true;
3096
- };
3097
- readonly emailCode: {
3098
- readonly type: "string";
3099
- readonly required: true;
3100
- readonly fieldName: "email_code";
3101
- };
3102
- readonly passkey: {
3103
- readonly type: "string";
3104
- readonly required: true;
3105
- };
3106
- readonly twoFactor: {
3107
- readonly type: "string";
3108
- readonly required: true;
3109
- readonly fieldName: "two_factor";
3110
- };
3111
- readonly staffAccess: {
3112
- readonly type: "string";
3113
- readonly required: true;
3114
- readonly defaultValue: "allowed";
3115
- readonly fieldName: "staff_access";
3116
- };
3117
- readonly platformSignIn: {
3118
- readonly type: "string";
3119
- readonly required: true;
3120
- readonly defaultValue: "allowed";
3121
- readonly fieldName: "platform_sign_in";
3122
- };
3123
- readonly createdAt: {
3124
- readonly type: "date";
3125
- readonly required: true;
3126
- readonly fieldName: "created_at";
3127
- };
3128
- readonly createdBy: {
3129
- readonly type: "string";
3130
- readonly required: false;
3131
- readonly fieldName: "created_by";
3132
- };
3133
- };
3134
- };
3135
- };
3098
+ id: "sso";
3099
+ version: string;
3136
3100
  endpoints: {
3137
- getSignInPolicy: import("better-auth").StrictEndpoint<"/policy/sign-in", {
3101
+ spMetadata: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/saml2/sp/metadata", {
3138
3102
  method: "GET";
3139
- use: import("better-auth").Middleware<{
3140
- use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3141
- session: {
3142
- session: Record<string, any> & {
3143
- id: string;
3144
- createdAt: Date;
3145
- updatedAt: Date;
3146
- userId: string;
3147
- expiresAt: Date;
3148
- token: string;
3149
- ipAddress?: string | null | undefined;
3150
- userAgent?: string | null | undefined;
3151
- };
3152
- user: Record<string, any> & {
3153
- id: string;
3154
- createdAt: Date;
3155
- updatedAt: Date;
3156
- email: string;
3157
- emailVerified: boolean;
3158
- name: string;
3159
- image?: string | null | undefined;
3160
- };
3161
- };
3162
- }>>[];
3163
- }, (inputContext: import("better-auth").MiddlewareInputContext<{
3164
- use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3165
- session: {
3166
- session: Record<string, any> & {
3167
- id: string;
3168
- createdAt: Date;
3169
- updatedAt: Date;
3170
- userId: string;
3171
- expiresAt: Date;
3172
- token: string;
3173
- ipAddress?: string | null | undefined;
3174
- userAgent?: string | null | undefined;
3175
- };
3176
- user: Record<string, any> & {
3177
- id: string;
3178
- createdAt: Date;
3179
- updatedAt: Date;
3180
- email: string;
3181
- emailVerified: boolean;
3182
- name: string;
3183
- image?: string | null | undefined;
3103
+ query: import("zod").ZodObject<{
3104
+ providerId: import("zod").ZodString;
3105
+ }, import("zod/v4/core").$strip>;
3106
+ metadata: {
3107
+ openapi: {
3108
+ operationId: string;
3109
+ summary: string;
3110
+ description: string;
3111
+ responses: {
3112
+ "200": {
3113
+ description: string;
3184
3114
  };
3185
3115
  };
3186
- }>>[];
3187
- }>) => Promise<{
3188
- session: {
3189
- session: Record<string, any> & {
3190
- id: string;
3191
- createdAt: Date;
3192
- updatedAt: Date;
3193
- userId: string;
3194
- expiresAt: Date;
3195
- token: string;
3196
- ipAddress?: string | null | undefined;
3197
- userAgent?: string | null | undefined;
3198
- };
3199
- user: Record<string, any> & {
3200
- id: string;
3201
- createdAt: Date;
3202
- updatedAt: Date;
3203
- email: string;
3204
- emailVerified: boolean;
3205
- name: string;
3206
- image?: string | null | undefined;
3207
- };
3208
- } & {
3209
- session: {
3210
- id: string;
3211
- createdAt: Date;
3212
- updatedAt: Date;
3213
- userId: string;
3214
- expiresAt: Date;
3215
- token: string;
3216
- ipAddress?: string | null | undefined;
3217
- userAgent?: string | null | undefined;
3218
- } & Record<string, any>;
3219
- user: {
3220
- id: string;
3221
- createdAt: Date;
3222
- updatedAt: Date;
3223
- email: string;
3224
- emailVerified: boolean;
3225
- name: string;
3226
- image?: string | null | undefined;
3227
- } & Record<string, any>;
3228
3116
  };
3229
- }>>[];
3230
- }, {
3231
- savedBy?: string | undefined;
3232
- savedAt?: string | undefined;
3233
- platformSignIn?: string | undefined;
3234
- operator?: string | undefined;
3235
- policy: SignInPolicy;
3236
- effective: SignInPolicy;
3237
- mail: boolean;
3238
- }>;
3239
- setSignInPolicy: import("better-auth").StrictEndpoint<"/policy/sign-in", {
3117
+ };
3118
+ }, Response>>;
3119
+ registerSSOProvider: import("better-auth").StrictEndpoint<"/sso/register", {
3240
3120
  method: "POST";
3241
- use: import("better-auth").Middleware<{
3242
- use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3243
- session: {
3244
- session: Record<string, any> & {
3245
- id: string;
3246
- createdAt: Date;
3247
- updatedAt: Date;
3248
- userId: string;
3249
- expiresAt: Date;
3250
- token: string;
3251
- ipAddress?: string | null | undefined;
3252
- userAgent?: string | null | undefined;
3253
- };
3254
- user: Record<string, any> & {
3255
- id: string;
3256
- createdAt: Date;
3257
- updatedAt: Date;
3258
- email: string;
3259
- emailVerified: boolean;
3260
- name: string;
3261
- image?: string | null | undefined;
3262
- };
3263
- };
3264
- }>>[];
3265
- }, (inputContext: import("better-auth").MiddlewareInputContext<{
3266
- use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3267
- session: {
3268
- session: Record<string, any> & {
3269
- id: string;
3270
- createdAt: Date;
3271
- updatedAt: Date;
3272
- userId: string;
3273
- expiresAt: Date;
3274
- token: string;
3275
- ipAddress?: string | null | undefined;
3276
- userAgent?: string | null | undefined;
3277
- };
3278
- user: Record<string, any> & {
3279
- id: string;
3280
- createdAt: Date;
3281
- updatedAt: Date;
3282
- email: string;
3283
- emailVerified: boolean;
3284
- name: string;
3285
- image?: string | null | undefined;
3286
- };
3287
- };
3288
- }>>[];
3289
- }>) => Promise<{
3121
+ body: import("zod").ZodObject<{
3122
+ [x: string]: import("zod").ZodOptional<import("zod").ZodAny>;
3123
+ }, import("zod/v4/core").$strip>;
3124
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3290
3125
  session: {
3291
3126
  session: Record<string, any> & {
3292
3127
  id: string;
@@ -3307,50 +3142,1218 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
3307
3142
  name: string;
3308
3143
  image?: string | null | undefined;
3309
3144
  };
3310
- } & {
3311
- session: {
3312
- id: string;
3313
- createdAt: Date;
3314
- updatedAt: Date;
3315
- userId: string;
3316
- expiresAt: Date;
3317
- token: string;
3318
- ipAddress?: string | null | undefined;
3319
- userAgent?: string | null | undefined;
3320
- } & Record<string, any>;
3321
- user: {
3322
- id: string;
3323
- createdAt: Date;
3324
- updatedAt: Date;
3325
- email: string;
3326
- emailVerified: boolean;
3327
- name: string;
3328
- image?: string | null | undefined;
3329
- } & Record<string, any>;
3330
3145
  };
3331
3146
  }>>[];
3332
- body: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
3333
- }, {
3334
- savedBy?: string | undefined;
3335
- savedAt?: string | undefined;
3336
- platformSignIn?: string | undefined;
3337
- operator?: string | undefined;
3338
- policy: SignInPolicy;
3339
- effective: SignInPolicy;
3340
- mail: boolean;
3341
- }>;
3342
- getSignInMethods: import("better-auth").StrictEndpoint<"/account/sign-in-methods", {
3343
- method: "GET";
3344
- use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3345
- session: {
3346
- session: Record<string, any> & {
3347
- id: string;
3348
- createdAt: Date;
3349
- updatedAt: Date;
3350
- userId: string;
3351
- expiresAt: Date;
3352
- token: string;
3353
- ipAddress?: string | null | undefined;
3147
+ metadata: {
3148
+ $Infer: {
3149
+ body: Record<string, any>;
3150
+ };
3151
+ openapi: {
3152
+ operationId: string;
3153
+ summary: string;
3154
+ description: string;
3155
+ responses: {
3156
+ "200": {
3157
+ description: string;
3158
+ content: {
3159
+ "application/json": {
3160
+ schema: {
3161
+ type: "object";
3162
+ properties: {
3163
+ issuer: {
3164
+ type: string;
3165
+ format: string;
3166
+ description: string;
3167
+ };
3168
+ domain: {
3169
+ type: string;
3170
+ description: string;
3171
+ };
3172
+ domainVerified: {
3173
+ type: string;
3174
+ description: string;
3175
+ };
3176
+ domainVerificationToken: {
3177
+ type: string;
3178
+ description: string;
3179
+ };
3180
+ oidcConfig: {
3181
+ type: string;
3182
+ properties: {
3183
+ issuer: {
3184
+ type: string;
3185
+ format: string;
3186
+ description: string;
3187
+ };
3188
+ pkce: {
3189
+ type: string;
3190
+ description: string;
3191
+ };
3192
+ clientId: {
3193
+ type: string;
3194
+ description: string;
3195
+ };
3196
+ clientSecret: {
3197
+ type: string;
3198
+ description: string;
3199
+ };
3200
+ authorizationEndpoint: {
3201
+ type: string;
3202
+ format: string;
3203
+ nullable: boolean;
3204
+ description: string;
3205
+ };
3206
+ discoveryEndpoint: {
3207
+ type: string;
3208
+ format: string;
3209
+ description: string;
3210
+ };
3211
+ userInfoEndpoint: {
3212
+ type: string;
3213
+ format: string;
3214
+ nullable: boolean;
3215
+ description: string;
3216
+ };
3217
+ scopes: {
3218
+ type: string;
3219
+ items: {
3220
+ type: string;
3221
+ };
3222
+ nullable: boolean;
3223
+ description: string;
3224
+ };
3225
+ tokenEndpoint: {
3226
+ type: string;
3227
+ format: string;
3228
+ nullable: boolean;
3229
+ description: string;
3230
+ };
3231
+ tokenEndpointAuthentication: {
3232
+ type: string;
3233
+ enum: string[];
3234
+ nullable: boolean;
3235
+ description: string;
3236
+ };
3237
+ jwksEndpoint: {
3238
+ type: string;
3239
+ format: string;
3240
+ nullable: boolean;
3241
+ description: string;
3242
+ };
3243
+ mapping: {
3244
+ type: string;
3245
+ nullable: boolean;
3246
+ properties: {
3247
+ email: {
3248
+ type: string;
3249
+ description: string;
3250
+ };
3251
+ emailVerified: {
3252
+ type: string;
3253
+ nullable: boolean;
3254
+ description: string;
3255
+ };
3256
+ name: {
3257
+ type: string;
3258
+ description: string;
3259
+ };
3260
+ image: {
3261
+ type: string;
3262
+ nullable: boolean;
3263
+ description: string;
3264
+ };
3265
+ extraFields: {
3266
+ type: string;
3267
+ additionalProperties: {
3268
+ type: string;
3269
+ };
3270
+ nullable: boolean;
3271
+ description: string;
3272
+ };
3273
+ };
3274
+ required: string[];
3275
+ };
3276
+ };
3277
+ required: string[];
3278
+ description: string;
3279
+ };
3280
+ organizationId: {
3281
+ type: string;
3282
+ nullable: boolean;
3283
+ description: string;
3284
+ };
3285
+ userId: {
3286
+ type: string;
3287
+ description: string;
3288
+ };
3289
+ providerId: {
3290
+ type: string;
3291
+ description: string;
3292
+ };
3293
+ redirectURI: {
3294
+ type: string;
3295
+ format: string;
3296
+ description: string;
3297
+ };
3298
+ };
3299
+ required: string[];
3300
+ };
3301
+ };
3302
+ };
3303
+ };
3304
+ };
3305
+ };
3306
+ };
3307
+ }, {
3308
+ redirectURI: string;
3309
+ oidcConfig: import("@better-auth/sso").OIDCConfig | null;
3310
+ samlConfig: import("@better-auth/sso").SAMLConfig | null;
3311
+ } & Omit<{
3312
+ domainVerified: boolean;
3313
+ } & {
3314
+ issuer: string;
3315
+ oidcConfig?: import("@better-auth/sso").OIDCConfig | undefined;
3316
+ samlConfig?: import("@better-auth/sso").SAMLConfig | undefined;
3317
+ userId: string;
3318
+ providerId: string;
3319
+ organizationId?: string | undefined;
3320
+ domain: string;
3321
+ }, "samlConfig" | "oidcConfig"> & {
3322
+ domainVerified: boolean;
3323
+ domainVerificationToken: string;
3324
+ }>;
3325
+ signInSSO: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sign-in/sso", {
3326
+ method: "POST";
3327
+ body: import("zod").ZodObject<{
3328
+ email: import("zod").ZodOptional<import("zod").ZodString>;
3329
+ organizationSlug: import("zod").ZodOptional<import("zod").ZodString>;
3330
+ providerId: import("zod").ZodOptional<import("zod").ZodString>;
3331
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
3332
+ callbackURL: import("zod").ZodString;
3333
+ errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
3334
+ newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
3335
+ scopes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
3336
+ loginHint: import("zod").ZodOptional<import("zod").ZodString>;
3337
+ additionalParams: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
3338
+ requestSignUp: import("zod").ZodOptional<import("zod").ZodBoolean>;
3339
+ providerType: import("zod").ZodOptional<import("zod").ZodEnum<{
3340
+ saml: "saml";
3341
+ oidc: "oidc";
3342
+ }>>;
3343
+ }, import("zod/v4/core").$strip>;
3344
+ metadata: {
3345
+ openapi: {
3346
+ operationId: string;
3347
+ summary: string;
3348
+ description: string;
3349
+ requestBody: {
3350
+ content: {
3351
+ "application/json": {
3352
+ schema: {
3353
+ type: "object";
3354
+ properties: {
3355
+ email: {
3356
+ type: string;
3357
+ description: string;
3358
+ };
3359
+ organizationSlug: {
3360
+ type: string;
3361
+ description: string;
3362
+ };
3363
+ providerId: {
3364
+ type: string;
3365
+ description: string;
3366
+ };
3367
+ domain: {
3368
+ type: string;
3369
+ description: string;
3370
+ };
3371
+ callbackURL: {
3372
+ type: string;
3373
+ description: string;
3374
+ };
3375
+ errorCallbackURL: {
3376
+ type: string;
3377
+ description: string;
3378
+ };
3379
+ newUserCallbackURL: {
3380
+ type: string;
3381
+ description: string;
3382
+ };
3383
+ scopes: {
3384
+ type: string;
3385
+ items: {
3386
+ type: string;
3387
+ };
3388
+ description: string;
3389
+ };
3390
+ loginHint: {
3391
+ type: string;
3392
+ description: string;
3393
+ };
3394
+ additionalParams: {
3395
+ type: string;
3396
+ additionalProperties: {
3397
+ type: string;
3398
+ };
3399
+ description: string;
3400
+ };
3401
+ requestSignUp: {
3402
+ type: string;
3403
+ description: string;
3404
+ };
3405
+ providerType: {
3406
+ type: string;
3407
+ enum: string[];
3408
+ description: string;
3409
+ };
3410
+ };
3411
+ required: string[];
3412
+ };
3413
+ };
3414
+ };
3415
+ };
3416
+ responses: {
3417
+ "200": {
3418
+ description: string;
3419
+ content: {
3420
+ "application/json": {
3421
+ schema: {
3422
+ type: "object";
3423
+ properties: {
3424
+ url: {
3425
+ type: string;
3426
+ format: string;
3427
+ description: string;
3428
+ };
3429
+ redirect: {
3430
+ type: string;
3431
+ description: string;
3432
+ enum: boolean[];
3433
+ };
3434
+ };
3435
+ required: string[];
3436
+ };
3437
+ };
3438
+ };
3439
+ };
3440
+ };
3441
+ };
3442
+ };
3443
+ }, {
3444
+ url: string;
3445
+ redirect: boolean;
3446
+ }>>;
3447
+ callbackSSO: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/callback/:providerId", {
3448
+ method: "GET";
3449
+ query: import("zod").ZodObject<{
3450
+ code: import("zod").ZodOptional<import("zod").ZodString>;
3451
+ state: import("zod").ZodOptional<import("zod").ZodString>;
3452
+ error: import("zod").ZodOptional<import("zod").ZodString>;
3453
+ error_description: import("zod").ZodOptional<import("zod").ZodString>;
3454
+ }, import("zod/v4/core").$strip>;
3455
+ allowedMediaTypes: readonly ["application/x-www-form-urlencoded", "application/json"];
3456
+ metadata: {
3457
+ openapi: {
3458
+ operationId: string;
3459
+ summary: string;
3460
+ description: string;
3461
+ responses: {
3462
+ "302": {
3463
+ description: string;
3464
+ };
3465
+ };
3466
+ };
3467
+ scope: "server";
3468
+ };
3469
+ }, never>>;
3470
+ callbackSSOShared: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/callback", {
3471
+ metadata: {
3472
+ openapi: {
3473
+ operationId: string;
3474
+ summary: string;
3475
+ description: string;
3476
+ responses: {
3477
+ "302": {
3478
+ description: string;
3479
+ };
3480
+ };
3481
+ };
3482
+ scope: "server";
3483
+ };
3484
+ method: "GET";
3485
+ query: import("zod").ZodObject<{
3486
+ code: import("zod").ZodOptional<import("zod").ZodString>;
3487
+ state: import("zod").ZodOptional<import("zod").ZodString>;
3488
+ error: import("zod").ZodOptional<import("zod").ZodString>;
3489
+ error_description: import("zod").ZodOptional<import("zod").ZodString>;
3490
+ }, import("zod/v4/core").$strip>;
3491
+ allowedMediaTypes: readonly ["application/x-www-form-urlencoded", "application/json"];
3492
+ }, never>>;
3493
+ acsEndpoint: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/saml2/sp/acs/:providerId", {
3494
+ method: ("GET" | "POST")[];
3495
+ body: import("zod").ZodOptional<import("zod").ZodObject<{
3496
+ SAMLResponse: import("zod").ZodString;
3497
+ RelayState: import("zod").ZodOptional<import("zod").ZodString>;
3498
+ }, import("zod/v4/core").$strip>>;
3499
+ query: import("zod").ZodOptional<import("zod").ZodObject<{
3500
+ RelayState: import("zod").ZodOptional<import("zod").ZodString>;
3501
+ }, import("zod/v4/core").$strip>>;
3502
+ metadata: {
3503
+ allowedMediaTypes: string[];
3504
+ openapi: {
3505
+ operationId: string;
3506
+ summary: string;
3507
+ description: string;
3508
+ responses: {
3509
+ "302": {
3510
+ description: string;
3511
+ };
3512
+ "400": {
3513
+ description: string;
3514
+ };
3515
+ "404": {
3516
+ description: string;
3517
+ };
3518
+ };
3519
+ };
3520
+ scope: "server";
3521
+ };
3522
+ }, never>>;
3523
+ sloEndpoint: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/saml2/sp/slo/:providerId", {
3524
+ method: ("GET" | "POST")[];
3525
+ body: import("zod").ZodOptional<import("zod").ZodObject<{
3526
+ SAMLRequest: import("zod").ZodOptional<import("zod").ZodString>;
3527
+ SAMLResponse: import("zod").ZodOptional<import("zod").ZodString>;
3528
+ RelayState: import("zod").ZodOptional<import("zod").ZodString>;
3529
+ SigAlg: import("zod").ZodOptional<import("zod").ZodString>;
3530
+ Signature: import("zod").ZodOptional<import("zod").ZodString>;
3531
+ }, import("zod/v4/core").$strip>>;
3532
+ query: import("zod").ZodOptional<import("zod").ZodObject<{
3533
+ SAMLRequest: import("zod").ZodOptional<import("zod").ZodString>;
3534
+ SAMLResponse: import("zod").ZodOptional<import("zod").ZodString>;
3535
+ RelayState: import("zod").ZodOptional<import("zod").ZodString>;
3536
+ SigAlg: import("zod").ZodOptional<import("zod").ZodString>;
3537
+ Signature: import("zod").ZodOptional<import("zod").ZodString>;
3538
+ }, import("zod/v4/core").$strip>>;
3539
+ metadata: {
3540
+ allowedMediaTypes: string[];
3541
+ scope: "server";
3542
+ };
3543
+ }, void | Response>>;
3544
+ initiateSLO: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/saml2/logout/:providerId", {
3545
+ method: "POST";
3546
+ body: import("zod").ZodObject<{
3547
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
3548
+ }, import("zod/v4/core").$strip>;
3549
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3550
+ session: {
3551
+ session: Record<string, any> & {
3552
+ id: string;
3553
+ createdAt: Date;
3554
+ updatedAt: Date;
3555
+ userId: string;
3556
+ expiresAt: Date;
3557
+ token: string;
3558
+ ipAddress?: string | null | undefined;
3559
+ userAgent?: string | null | undefined;
3560
+ };
3561
+ user: Record<string, any> & {
3562
+ id: string;
3563
+ createdAt: Date;
3564
+ updatedAt: Date;
3565
+ email: string;
3566
+ emailVerified: boolean;
3567
+ name: string;
3568
+ image?: string | null | undefined;
3569
+ };
3570
+ };
3571
+ }>>[];
3572
+ metadata: {
3573
+ readonly scope: "server";
3574
+ };
3575
+ }, never>>;
3576
+ listSSOProviders: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/providers", {
3577
+ method: "GET";
3578
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3579
+ session: {
3580
+ session: Record<string, any> & {
3581
+ id: string;
3582
+ createdAt: Date;
3583
+ updatedAt: Date;
3584
+ userId: string;
3585
+ expiresAt: Date;
3586
+ token: string;
3587
+ ipAddress?: string | null | undefined;
3588
+ userAgent?: string | null | undefined;
3589
+ };
3590
+ user: Record<string, any> & {
3591
+ id: string;
3592
+ createdAt: Date;
3593
+ updatedAt: Date;
3594
+ email: string;
3595
+ emailVerified: boolean;
3596
+ name: string;
3597
+ image?: string | null | undefined;
3598
+ };
3599
+ };
3600
+ }>>[];
3601
+ metadata: {
3602
+ openapi: {
3603
+ operationId: string;
3604
+ summary: string;
3605
+ description: string;
3606
+ responses: {
3607
+ "200": {
3608
+ description: string;
3609
+ };
3610
+ };
3611
+ };
3612
+ };
3613
+ }, {
3614
+ providers: {
3615
+ providerId: string;
3616
+ type: string;
3617
+ issuer: string;
3618
+ domain: string;
3619
+ organizationId: string | null;
3620
+ domainVerified: boolean;
3621
+ oidcConfig: {
3622
+ discoveryEndpoint: string;
3623
+ clientIdLastFour: string;
3624
+ pkce: boolean;
3625
+ authorizationEndpoint: string | undefined;
3626
+ tokenEndpoint: string | undefined;
3627
+ userInfoEndpoint: string | undefined;
3628
+ jwksEndpoint: string | undefined;
3629
+ scopes: string[] | undefined;
3630
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | "private_key_jwt" | undefined;
3631
+ } | undefined;
3632
+ samlConfig: {
3633
+ entryPoint: string;
3634
+ callbackUrl: string | undefined;
3635
+ idpInitiatedCallbackUrl: string | undefined;
3636
+ audience: string | undefined;
3637
+ wantAssertionsSigned: boolean | undefined;
3638
+ authnRequestsSigned: boolean | undefined;
3639
+ identifierFormat: string | undefined;
3640
+ signatureAlgorithm: string | undefined;
3641
+ digestAlgorithm: string | undefined;
3642
+ certificate: ({
3643
+ fingerprintSha256: string;
3644
+ notBefore: string;
3645
+ notAfter: string;
3646
+ publicKeyAlgorithm: string;
3647
+ } | {
3648
+ error: string;
3649
+ })[] | undefined;
3650
+ } | undefined;
3651
+ spMetadataUrl: string;
3652
+ }[];
3653
+ }>>;
3654
+ getSSOProvider: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/get-provider", {
3655
+ method: "GET";
3656
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3657
+ session: {
3658
+ session: Record<string, any> & {
3659
+ id: string;
3660
+ createdAt: Date;
3661
+ updatedAt: Date;
3662
+ userId: string;
3663
+ expiresAt: Date;
3664
+ token: string;
3665
+ ipAddress?: string | null | undefined;
3666
+ userAgent?: string | null | undefined;
3667
+ };
3668
+ user: Record<string, any> & {
3669
+ id: string;
3670
+ createdAt: Date;
3671
+ updatedAt: Date;
3672
+ email: string;
3673
+ emailVerified: boolean;
3674
+ name: string;
3675
+ image?: string | null | undefined;
3676
+ };
3677
+ };
3678
+ }>>[];
3679
+ query: import("zod").ZodObject<{
3680
+ providerId: import("zod").ZodString;
3681
+ }, import("zod/v4/core").$strip>;
3682
+ metadata: {
3683
+ openapi: {
3684
+ operationId: string;
3685
+ summary: string;
3686
+ description: string;
3687
+ responses: {
3688
+ "200": {
3689
+ description: string;
3690
+ };
3691
+ "404": {
3692
+ description: string;
3693
+ };
3694
+ "403": {
3695
+ description: string;
3696
+ };
3697
+ };
3698
+ };
3699
+ };
3700
+ }, {
3701
+ providerId: string;
3702
+ type: string;
3703
+ issuer: string;
3704
+ domain: string;
3705
+ organizationId: string | null;
3706
+ domainVerified: boolean;
3707
+ oidcConfig: {
3708
+ discoveryEndpoint: string;
3709
+ clientIdLastFour: string;
3710
+ pkce: boolean;
3711
+ authorizationEndpoint: string | undefined;
3712
+ tokenEndpoint: string | undefined;
3713
+ userInfoEndpoint: string | undefined;
3714
+ jwksEndpoint: string | undefined;
3715
+ scopes: string[] | undefined;
3716
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | "private_key_jwt" | undefined;
3717
+ } | undefined;
3718
+ samlConfig: {
3719
+ entryPoint: string;
3720
+ callbackUrl: string | undefined;
3721
+ idpInitiatedCallbackUrl: string | undefined;
3722
+ audience: string | undefined;
3723
+ wantAssertionsSigned: boolean | undefined;
3724
+ authnRequestsSigned: boolean | undefined;
3725
+ identifierFormat: string | undefined;
3726
+ signatureAlgorithm: string | undefined;
3727
+ digestAlgorithm: string | undefined;
3728
+ certificate: ({
3729
+ fingerprintSha256: string;
3730
+ notBefore: string;
3731
+ notAfter: string;
3732
+ publicKeyAlgorithm: string;
3733
+ } | {
3734
+ error: string;
3735
+ })[] | undefined;
3736
+ } | undefined;
3737
+ spMetadataUrl: string;
3738
+ }>>;
3739
+ updateSSOProvider: ReturnType<(options: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/update-provider", {
3740
+ method: "POST";
3741
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3742
+ session: {
3743
+ session: Record<string, any> & {
3744
+ id: string;
3745
+ createdAt: Date;
3746
+ updatedAt: Date;
3747
+ userId: string;
3748
+ expiresAt: Date;
3749
+ token: string;
3750
+ ipAddress?: string | null | undefined;
3751
+ userAgent?: string | null | undefined;
3752
+ };
3753
+ user: Record<string, any> & {
3754
+ id: string;
3755
+ createdAt: Date;
3756
+ updatedAt: Date;
3757
+ email: string;
3758
+ emailVerified: boolean;
3759
+ name: string;
3760
+ image?: string | null | undefined;
3761
+ };
3762
+ };
3763
+ }>>[];
3764
+ body: import("zod").ZodObject<{
3765
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
3766
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
3767
+ oidcConfig: import("zod").ZodOptional<import("zod").ZodObject<{
3768
+ clientId: import("zod").ZodOptional<import("zod").ZodString>;
3769
+ clientSecret: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3770
+ authorizationEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3771
+ tokenEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3772
+ userInfoEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3773
+ tokenEndpointAuthentication: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodEnum<{
3774
+ client_secret_post: "client_secret_post";
3775
+ client_secret_basic: "client_secret_basic";
3776
+ private_key_jwt: "private_key_jwt";
3777
+ }>>>;
3778
+ privateKeyId: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3779
+ privateKeyAlgorithm: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3780
+ jwksEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3781
+ discoveryEndpoint: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3782
+ skipDiscovery: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodBoolean>>;
3783
+ scopes: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
3784
+ pkce: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>>;
3785
+ overrideUserInfo: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodBoolean>>;
3786
+ mapping: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
3787
+ email: import("zod").ZodString;
3788
+ emailVerified: import("zod").ZodOptional<import("zod").ZodString>;
3789
+ name: import("zod").ZodString;
3790
+ image: import("zod").ZodOptional<import("zod").ZodString>;
3791
+ extraFields: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
3792
+ }, import("zod/v4/core").$strict>>>;
3793
+ }, import("zod/v4/core").$strip>>;
3794
+ samlConfig: import("zod").ZodOptional<import("zod").ZodObject<{
3795
+ audience: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3796
+ mapping: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
3797
+ email: import("zod").ZodString;
3798
+ emailVerified: import("zod").ZodOptional<import("zod").ZodString>;
3799
+ name: import("zod").ZodString;
3800
+ firstName: import("zod").ZodOptional<import("zod").ZodString>;
3801
+ lastName: import("zod").ZodOptional<import("zod").ZodString>;
3802
+ extraFields: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
3803
+ }, import("zod/v4/core").$strict>>>;
3804
+ privateKey: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3805
+ spMetadata: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
3806
+ metadata: import("zod").ZodOptional<import("zod").ZodString>;
3807
+ entityID: import("zod").ZodOptional<import("zod").ZodString>;
3808
+ binding: import("zod").ZodOptional<import("zod").ZodString>;
3809
+ privateKey: import("zod").ZodOptional<import("zod").ZodString>;
3810
+ privateKeyPass: import("zod").ZodOptional<import("zod").ZodString>;
3811
+ isAssertionEncrypted: import("zod").ZodOptional<import("zod").ZodBoolean>;
3812
+ encPrivateKey: import("zod").ZodOptional<import("zod").ZodString>;
3813
+ encPrivateKeyPass: import("zod").ZodOptional<import("zod").ZodString>;
3814
+ }, import("zod/v4/core").$strip>>>;
3815
+ cert: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>>;
3816
+ entryPoint: import("zod").ZodOptional<import("zod").ZodString>;
3817
+ callbackUrl: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3818
+ wantAssertionsSigned: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodBoolean>>;
3819
+ authnRequestsSigned: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodBoolean>>;
3820
+ signatureAlgorithm: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3821
+ digestAlgorithm: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3822
+ identifierFormat: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
3823
+ idpInitiatedCallbackUrl: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
3824
+ idpMetadata: import("zod").ZodOptional<import("zod").ZodObject<{
3825
+ cert: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>;
3826
+ privateKey: import("zod").ZodOptional<import("zod").ZodString>;
3827
+ privateKeyPass: import("zod").ZodOptional<import("zod").ZodString>;
3828
+ isAssertionEncrypted: import("zod").ZodOptional<import("zod").ZodBoolean>;
3829
+ encPrivateKey: import("zod").ZodOptional<import("zod").ZodString>;
3830
+ encPrivateKeyPass: import("zod").ZodOptional<import("zod").ZodString>;
3831
+ singleSignOnService: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
3832
+ Binding: import("zod").ZodString;
3833
+ Location: import("zod").ZodString;
3834
+ }, import("zod/v4/core").$strip>>>;
3835
+ singleLogoutService: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
3836
+ Binding: import("zod").ZodString;
3837
+ Location: import("zod").ZodString;
3838
+ }, import("zod/v4/core").$strip>>>;
3839
+ metadata: import("zod").ZodOptional<import("zod").ZodString>;
3840
+ entityID: import("zod").ZodOptional<import("zod").ZodString>;
3841
+ }, import("zod/v4/core").$strip>>;
3842
+ }, import("zod/v4/core").$strip>>;
3843
+ providerId: import("zod").ZodString;
3844
+ }, import("zod/v4/core").$strip>;
3845
+ metadata: {
3846
+ openapi: {
3847
+ operationId: string;
3848
+ summary: string;
3849
+ description: string;
3850
+ responses: {
3851
+ "200": {
3852
+ description: string;
3853
+ };
3854
+ "404": {
3855
+ description: string;
3856
+ };
3857
+ "403": {
3858
+ description: string;
3859
+ };
3860
+ };
3861
+ };
3862
+ };
3863
+ }, {
3864
+ providerId: string;
3865
+ type: string;
3866
+ issuer: string;
3867
+ domain: string;
3868
+ organizationId: string | null;
3869
+ domainVerified: boolean;
3870
+ oidcConfig: {
3871
+ discoveryEndpoint: string;
3872
+ clientIdLastFour: string;
3873
+ pkce: boolean;
3874
+ authorizationEndpoint: string | undefined;
3875
+ tokenEndpoint: string | undefined;
3876
+ userInfoEndpoint: string | undefined;
3877
+ jwksEndpoint: string | undefined;
3878
+ scopes: string[] | undefined;
3879
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | "private_key_jwt" | undefined;
3880
+ } | undefined;
3881
+ samlConfig: {
3882
+ entryPoint: string;
3883
+ callbackUrl: string | undefined;
3884
+ idpInitiatedCallbackUrl: string | undefined;
3885
+ audience: string | undefined;
3886
+ wantAssertionsSigned: boolean | undefined;
3887
+ authnRequestsSigned: boolean | undefined;
3888
+ identifierFormat: string | undefined;
3889
+ signatureAlgorithm: string | undefined;
3890
+ digestAlgorithm: string | undefined;
3891
+ certificate: ({
3892
+ fingerprintSha256: string;
3893
+ notBefore: string;
3894
+ notAfter: string;
3895
+ publicKeyAlgorithm: string;
3896
+ } | {
3897
+ error: string;
3898
+ })[] | undefined;
3899
+ } | undefined;
3900
+ spMetadataUrl: string;
3901
+ }>>;
3902
+ deleteSSOProvider: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/delete-provider", {
3903
+ method: "POST";
3904
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3905
+ session: {
3906
+ session: Record<string, any> & {
3907
+ id: string;
3908
+ createdAt: Date;
3909
+ updatedAt: Date;
3910
+ userId: string;
3911
+ expiresAt: Date;
3912
+ token: string;
3913
+ ipAddress?: string | null | undefined;
3914
+ userAgent?: string | null | undefined;
3915
+ };
3916
+ user: Record<string, any> & {
3917
+ id: string;
3918
+ createdAt: Date;
3919
+ updatedAt: Date;
3920
+ email: string;
3921
+ emailVerified: boolean;
3922
+ name: string;
3923
+ image?: string | null | undefined;
3924
+ };
3925
+ };
3926
+ }>>[];
3927
+ body: import("zod").ZodObject<{
3928
+ providerId: import("zod").ZodString;
3929
+ }, import("zod/v4/core").$strip>;
3930
+ metadata: {
3931
+ openapi: {
3932
+ operationId: string;
3933
+ summary: string;
3934
+ description: string;
3935
+ responses: {
3936
+ "200": {
3937
+ description: string;
3938
+ };
3939
+ "404": {
3940
+ description: string;
3941
+ };
3942
+ "403": {
3943
+ description: string;
3944
+ };
3945
+ };
3946
+ };
3947
+ };
3948
+ }, {
3949
+ success: boolean;
3950
+ }>>;
3951
+ } & {
3952
+ requestDomainVerification: ReturnType<(options: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/request-domain-verification", {
3953
+ method: "POST";
3954
+ body: import("zod").ZodObject<{
3955
+ providerId: import("zod").ZodString;
3956
+ }, import("zod/v4/core").$strip>;
3957
+ metadata: {
3958
+ openapi: {
3959
+ summary: string;
3960
+ description: string;
3961
+ responses: {
3962
+ "404": {
3963
+ description: string;
3964
+ };
3965
+ "409": {
3966
+ description: string;
3967
+ };
3968
+ "201": {
3969
+ description: string;
3970
+ };
3971
+ };
3972
+ };
3973
+ };
3974
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3975
+ session: {
3976
+ session: Record<string, any> & {
3977
+ id: string;
3978
+ createdAt: Date;
3979
+ updatedAt: Date;
3980
+ userId: string;
3981
+ expiresAt: Date;
3982
+ token: string;
3983
+ ipAddress?: string | null | undefined;
3984
+ userAgent?: string | null | undefined;
3985
+ };
3986
+ user: Record<string, any> & {
3987
+ id: string;
3988
+ createdAt: Date;
3989
+ updatedAt: Date;
3990
+ email: string;
3991
+ emailVerified: boolean;
3992
+ name: string;
3993
+ image?: string | null | undefined;
3994
+ };
3995
+ };
3996
+ }>>[];
3997
+ }, {
3998
+ domainVerificationToken: string;
3999
+ }>>;
4000
+ verifyDomain: ReturnType<(options: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/verify-domain", {
4001
+ method: "POST";
4002
+ body: import("zod").ZodObject<{
4003
+ providerId: import("zod").ZodString;
4004
+ }, import("zod/v4/core").$strip>;
4005
+ metadata: {
4006
+ openapi: {
4007
+ summary: string;
4008
+ description: string;
4009
+ responses: {
4010
+ "404": {
4011
+ description: string;
4012
+ };
4013
+ "409": {
4014
+ description: string;
4015
+ };
4016
+ "502": {
4017
+ description: string;
4018
+ };
4019
+ "204": {
4020
+ description: string;
4021
+ };
4022
+ };
4023
+ };
4024
+ };
4025
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
4026
+ session: {
4027
+ session: Record<string, any> & {
4028
+ id: string;
4029
+ createdAt: Date;
4030
+ updatedAt: Date;
4031
+ userId: string;
4032
+ expiresAt: Date;
4033
+ token: string;
4034
+ ipAddress?: string | null | undefined;
4035
+ userAgent?: string | null | undefined;
4036
+ };
4037
+ user: Record<string, any> & {
4038
+ id: string;
4039
+ createdAt: Date;
4040
+ updatedAt: Date;
4041
+ email: string;
4042
+ emailVerified: boolean;
4043
+ name: string;
4044
+ image?: string | null | undefined;
4045
+ };
4046
+ };
4047
+ }>>[];
4048
+ }, void>>;
4049
+ };
4050
+ $Infer: {
4051
+ SSOProvider: {
4052
+ domainVerified: boolean;
4053
+ } & {
4054
+ issuer: string;
4055
+ oidcConfig?: import("@better-auth/sso").OIDCConfig | undefined;
4056
+ samlConfig?: import("@better-auth/sso").SAMLConfig | undefined;
4057
+ userId: string;
4058
+ providerId: string;
4059
+ organizationId?: string | undefined;
4060
+ domain: string;
4061
+ };
4062
+ };
4063
+ options: NoInfer<{
4064
+ defaultSSO: {
4065
+ domain: string;
4066
+ providerId: string;
4067
+ samlConfig?: import("@better-auth/sso").SAMLConfig;
4068
+ oidcConfig?: import("@better-auth/sso").OIDCConfig;
4069
+ privateKey?: {
4070
+ privateKeyJwk?: JsonWebKey;
4071
+ privateKeyPem?: string;
4072
+ };
4073
+ }[];
4074
+ domainVerification: {
4075
+ enabled: true;
4076
+ };
4077
+ organizationProvisioning: {
4078
+ disabled: true;
4079
+ };
4080
+ providersLimit: number;
4081
+ }>;
4082
+ } | {
4083
+ id: "protobase-saml-guard";
4084
+ hooks: {
4085
+ before: {
4086
+ matcher: (context: import("better-auth").HookEndpointContext) => boolean;
4087
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
4088
+ }[];
4089
+ };
4090
+ } | {
4091
+ id: "protobase-sign-in-policy";
4092
+ schema: {
4093
+ readonly signInPolicy: {
4094
+ readonly modelName: "sign_in_policy";
4095
+ readonly fields: {
4096
+ readonly password: {
4097
+ readonly type: "string";
4098
+ readonly required: true;
4099
+ };
4100
+ readonly emailCode: {
4101
+ readonly type: "string";
4102
+ readonly required: true;
4103
+ readonly fieldName: "email_code";
4104
+ };
4105
+ readonly passkey: {
4106
+ readonly type: "string";
4107
+ readonly required: true;
4108
+ };
4109
+ readonly twoFactor: {
4110
+ readonly type: "string";
4111
+ readonly required: true;
4112
+ readonly fieldName: "two_factor";
4113
+ };
4114
+ readonly staffAccess: {
4115
+ readonly type: "string";
4116
+ readonly required: true;
4117
+ readonly defaultValue: "allowed";
4118
+ readonly fieldName: "staff_access";
4119
+ };
4120
+ readonly platformSignIn: {
4121
+ readonly type: "string";
4122
+ readonly required: true;
4123
+ readonly defaultValue: "allowed";
4124
+ readonly fieldName: "platform_sign_in";
4125
+ };
4126
+ readonly createdAt: {
4127
+ readonly type: "date";
4128
+ readonly required: true;
4129
+ readonly fieldName: "created_at";
4130
+ };
4131
+ readonly createdBy: {
4132
+ readonly type: "string";
4133
+ readonly required: false;
4134
+ readonly fieldName: "created_by";
4135
+ };
4136
+ };
4137
+ };
4138
+ };
4139
+ endpoints: {
4140
+ getSignInPolicy: import("better-auth").StrictEndpoint<"/policy/sign-in", {
4141
+ method: "GET";
4142
+ use: import("better-auth").Middleware<{
4143
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
4144
+ session: {
4145
+ session: Record<string, any> & {
4146
+ id: string;
4147
+ createdAt: Date;
4148
+ updatedAt: Date;
4149
+ userId: string;
4150
+ expiresAt: Date;
4151
+ token: string;
4152
+ ipAddress?: string | null | undefined;
4153
+ userAgent?: string | null | undefined;
4154
+ };
4155
+ user: Record<string, any> & {
4156
+ id: string;
4157
+ createdAt: Date;
4158
+ updatedAt: Date;
4159
+ email: string;
4160
+ emailVerified: boolean;
4161
+ name: string;
4162
+ image?: string | null | undefined;
4163
+ };
4164
+ };
4165
+ }>>[];
4166
+ }, (inputContext: import("better-auth").MiddlewareInputContext<{
4167
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
4168
+ session: {
4169
+ session: Record<string, any> & {
4170
+ id: string;
4171
+ createdAt: Date;
4172
+ updatedAt: Date;
4173
+ userId: string;
4174
+ expiresAt: Date;
4175
+ token: string;
4176
+ ipAddress?: string | null | undefined;
4177
+ userAgent?: string | null | undefined;
4178
+ };
4179
+ user: Record<string, any> & {
4180
+ id: string;
4181
+ createdAt: Date;
4182
+ updatedAt: Date;
4183
+ email: string;
4184
+ emailVerified: boolean;
4185
+ name: string;
4186
+ image?: string | null | undefined;
4187
+ };
4188
+ };
4189
+ }>>[];
4190
+ }>) => Promise<{
4191
+ session: {
4192
+ session: Record<string, any> & {
4193
+ id: string;
4194
+ createdAt: Date;
4195
+ updatedAt: Date;
4196
+ userId: string;
4197
+ expiresAt: Date;
4198
+ token: string;
4199
+ ipAddress?: string | null | undefined;
4200
+ userAgent?: string | null | undefined;
4201
+ };
4202
+ user: Record<string, any> & {
4203
+ id: string;
4204
+ createdAt: Date;
4205
+ updatedAt: Date;
4206
+ email: string;
4207
+ emailVerified: boolean;
4208
+ name: string;
4209
+ image?: string | null | undefined;
4210
+ };
4211
+ } & {
4212
+ session: {
4213
+ id: string;
4214
+ createdAt: Date;
4215
+ updatedAt: Date;
4216
+ userId: string;
4217
+ expiresAt: Date;
4218
+ token: string;
4219
+ ipAddress?: string | null | undefined;
4220
+ userAgent?: string | null | undefined;
4221
+ } & Record<string, any>;
4222
+ user: {
4223
+ id: string;
4224
+ createdAt: Date;
4225
+ updatedAt: Date;
4226
+ email: string;
4227
+ emailVerified: boolean;
4228
+ name: string;
4229
+ image?: string | null | undefined;
4230
+ } & Record<string, any>;
4231
+ };
4232
+ }>>[];
4233
+ }, {
4234
+ savedBy?: string | undefined;
4235
+ savedAt?: string | undefined;
4236
+ platformSignIn?: string | undefined;
4237
+ operator?: string | undefined;
4238
+ policy: SignInPolicy;
4239
+ effective: SignInPolicy;
4240
+ mail: boolean;
4241
+ }>;
4242
+ setSignInPolicy: import("better-auth").StrictEndpoint<"/policy/sign-in", {
4243
+ method: "POST";
4244
+ use: import("better-auth").Middleware<{
4245
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
4246
+ session: {
4247
+ session: Record<string, any> & {
4248
+ id: string;
4249
+ createdAt: Date;
4250
+ updatedAt: Date;
4251
+ userId: string;
4252
+ expiresAt: Date;
4253
+ token: string;
4254
+ ipAddress?: string | null | undefined;
4255
+ userAgent?: string | null | undefined;
4256
+ };
4257
+ user: Record<string, any> & {
4258
+ id: string;
4259
+ createdAt: Date;
4260
+ updatedAt: Date;
4261
+ email: string;
4262
+ emailVerified: boolean;
4263
+ name: string;
4264
+ image?: string | null | undefined;
4265
+ };
4266
+ };
4267
+ }>>[];
4268
+ }, (inputContext: import("better-auth").MiddlewareInputContext<{
4269
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
4270
+ session: {
4271
+ session: Record<string, any> & {
4272
+ id: string;
4273
+ createdAt: Date;
4274
+ updatedAt: Date;
4275
+ userId: string;
4276
+ expiresAt: Date;
4277
+ token: string;
4278
+ ipAddress?: string | null | undefined;
4279
+ userAgent?: string | null | undefined;
4280
+ };
4281
+ user: Record<string, any> & {
4282
+ id: string;
4283
+ createdAt: Date;
4284
+ updatedAt: Date;
4285
+ email: string;
4286
+ emailVerified: boolean;
4287
+ name: string;
4288
+ image?: string | null | undefined;
4289
+ };
4290
+ };
4291
+ }>>[];
4292
+ }>) => Promise<{
4293
+ session: {
4294
+ session: Record<string, any> & {
4295
+ id: string;
4296
+ createdAt: Date;
4297
+ updatedAt: Date;
4298
+ userId: string;
4299
+ expiresAt: Date;
4300
+ token: string;
4301
+ ipAddress?: string | null | undefined;
4302
+ userAgent?: string | null | undefined;
4303
+ };
4304
+ user: Record<string, any> & {
4305
+ id: string;
4306
+ createdAt: Date;
4307
+ updatedAt: Date;
4308
+ email: string;
4309
+ emailVerified: boolean;
4310
+ name: string;
4311
+ image?: string | null | undefined;
4312
+ };
4313
+ } & {
4314
+ session: {
4315
+ id: string;
4316
+ createdAt: Date;
4317
+ updatedAt: Date;
4318
+ userId: string;
4319
+ expiresAt: Date;
4320
+ token: string;
4321
+ ipAddress?: string | null | undefined;
4322
+ userAgent?: string | null | undefined;
4323
+ } & Record<string, any>;
4324
+ user: {
4325
+ id: string;
4326
+ createdAt: Date;
4327
+ updatedAt: Date;
4328
+ email: string;
4329
+ emailVerified: boolean;
4330
+ name: string;
4331
+ image?: string | null | undefined;
4332
+ } & Record<string, any>;
4333
+ };
4334
+ }>>[];
4335
+ body: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
4336
+ }, {
4337
+ savedBy?: string | undefined;
4338
+ savedAt?: string | undefined;
4339
+ platformSignIn?: string | undefined;
4340
+ operator?: string | undefined;
4341
+ policy: SignInPolicy;
4342
+ effective: SignInPolicy;
4343
+ mail: boolean;
4344
+ }>;
4345
+ getSignInMethods: import("better-auth").StrictEndpoint<"/account/sign-in-methods", {
4346
+ method: "GET";
4347
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
4348
+ session: {
4349
+ session: Record<string, any> & {
4350
+ id: string;
4351
+ createdAt: Date;
4352
+ updatedAt: Date;
4353
+ userId: string;
4354
+ expiresAt: Date;
4355
+ token: string;
4356
+ ipAddress?: string | null | undefined;
3354
4357
  userAgent?: string | null | undefined;
3355
4358
  };
3356
4359
  user: Record<string, any> & {
@@ -3749,15 +4752,7 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
3749
4752
  name?: string;
3750
4753
  slug?: string;
3751
4754
  logo?: string | null;
3752
- metadata?
3753
- /**
3754
- * The options `createAuth` gives Better Auth, with the roles, default role, mailer, operator provider and platform
3755
- * sign-in provider already resolved.
3756
- */
3757
- /**
3758
- * The options `createAuth` gives Better Auth, with the roles, default role, mailer, operator provider and platform
3759
- * sign-in provider already resolved.
3760
- */ : Record<string, any>;
4755
+ metadata?: Record<string, any>;
3761
4756
  [key: string]: any;
3762
4757
  };
3763
4758
  }>;
@@ -4381,6 +5376,11 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
4381
5376
  provider: string;
4382
5377
  name: string;
4383
5378
  } | undefined;
5379
+ /** The id and name of each SAML provider, for the sign-in page. */
5380
+ samlProviders: {
5381
+ id: string;
5382
+ name: string;
5383
+ }[];
4384
5384
  };
4385
5385
  export type AdminAuth = ReturnType<typeof createAuth>;
4386
5386
  //#endregion