@faable/auth-sdk 2.9.46 → 2.9.47

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.
@@ -275,6 +275,86 @@ export interface paths {
275
275
  patch?: never;
276
276
  trace?: never;
277
277
  };
278
+ "/account/{account_id}/disable": {
279
+ parameters: {
280
+ query?: never;
281
+ header?: never;
282
+ path?: never;
283
+ cookie?: never;
284
+ };
285
+ get?: never;
286
+ put?: never;
287
+ /**
288
+ * Disable an Account
289
+ * @description Switches the tenant off without deleting anything: nobody can sign in, management writes are refused (403 `account_disabled`) and reads keep working. Sessions are not revoked — they work again once the tenant is enabled. Idempotent. A tenant disabled by Faable staff answers 403 `account_disabled` with `details.disabled_by: staff`.
290
+ */
291
+ post: operations["account/disable"];
292
+ delete?: never;
293
+ options?: never;
294
+ head?: never;
295
+ patch?: never;
296
+ trace?: never;
297
+ };
298
+ "/account/{account_id}/enable": {
299
+ parameters: {
300
+ query?: never;
301
+ header?: never;
302
+ path?: never;
303
+ cookie?: never;
304
+ };
305
+ get?: never;
306
+ put?: never;
307
+ /**
308
+ * Enable a disabled Account
309
+ * @description Undoes `account/disable`: sign-in, sessions and management writes work again. Idempotent. A tenant disabled by Faable staff cannot be enabled here: 403 `account_disabled` with `details.disabled_by: staff` — contact support@faable.com.
310
+ */
311
+ post: operations["account/enable"];
312
+ delete?: never;
313
+ options?: never;
314
+ head?: never;
315
+ patch?: never;
316
+ trace?: never;
317
+ };
318
+ "/internal/account/{account_id}/disable": {
319
+ parameters: {
320
+ query?: never;
321
+ header?: never;
322
+ path?: never;
323
+ cookie?: never;
324
+ };
325
+ get?: never;
326
+ put?: never;
327
+ /**
328
+ * Disable an Account as Faable staff (platform)
329
+ * @description Same effect as `account/disable`, recorded as `disabled_by: staff`: the owner cannot enable it again. Overrides a disable by the owner. Platform token with `update:accounts`; the deploy api calls it after checking the caller is staff.
330
+ */
331
+ post: operations["internal/accountDisable"];
332
+ delete?: never;
333
+ options?: never;
334
+ head?: never;
335
+ patch?: never;
336
+ trace?: never;
337
+ };
338
+ "/internal/account/{account_id}/enable": {
339
+ parameters: {
340
+ query?: never;
341
+ header?: never;
342
+ path?: never;
343
+ cookie?: never;
344
+ };
345
+ get?: never;
346
+ put?: never;
347
+ /**
348
+ * Enable an Account as Faable staff (platform)
349
+ * @description Enables the tenant whoever disabled it. Platform token with `update:accounts`.
350
+ */
351
+ post: operations["internal/accountEnable"];
352
+ delete?: never;
353
+ options?: never;
354
+ head?: never;
355
+ patch?: never;
356
+ trace?: never;
357
+ };
278
358
  "/connection": {
279
359
  parameters: {
280
360
  query?: never;
@@ -5819,6 +5899,10 @@ export interface components {
5819
5899
  client_id_metadata_documents_enabled?: boolean;
5820
5900
  /** @description The one host this tenant's OIDC issuer and discovery document are always minted with, regardless of which host actually served the request — must be the account's own platform host or one of its verified custom domains. `/authorize` and `/logout` 302 here from any other host of the tenant. Unset (the default): every URL uses whatever host served the request, as before this field existed. Changing it can invalidate every WebAuthn passkey already enrolled unless `webauthn_rp_id` already covers the new host. */
5821
5901
  canonical_host?: string | null;
5902
+ /** @description When the tenant was disabled. While set, nobody can sign in (every end-user endpoint answers 403 `account_disabled`) and management writes are refused; reads keep working. Null or absent: the tenant is active. */
5903
+ disabled_at?: string | null;
5904
+ /** @description Who disabled the tenant: `owner` (from the dashboard; the owner can enable it again) or `staff` (Faable; only Faable support can enable it). */
5905
+ disabled_by?: "owner" | "staff" | null;
5822
5906
  /** @description AuthAccount creation date */
5823
5907
  createdAt: string;
5824
5908
  /** @description AuthAccount updated date */
@@ -8794,6 +8878,8 @@ export interface components {
8794
8878
  * - `invalid_token` (401): The bearer token is missing, malformed, expired or has no subject.
8795
8879
  * - `not_owner` (403): The caller may only perform this operation on their own user.
8796
8880
  * - `user_suspended` (403): The user is suspended and cannot sign in or be modified.
8881
+ * - `account_disabled` (403): The Auth tenant is disabled: nobody can sign in and management writes are refused; reads keep working. `details.disabled_by` is `owner` (enable it again from the dashboard) or `staff` (contact support@faable.com).
8882
+ * - `account_protected` (409): A platform tenant (Faable's own) cannot be disabled: everyone, staff included, signs in through it.
8797
8883
  * - `invalid_credentials` (400): The email/username or password is incorrect.
8798
8884
  * - `login_denied` (401): A post-login Action denied the sign-in. `message` carries the reason it gave. On token grants it is a 403 with `error: invalid_grant`.
8799
8885
  * - `signup_denied` (403): A pre-signup Action or an active block denied the sign-up. `message` carries the reason.
@@ -8933,7 +9019,7 @@ export interface components {
8933
9019
  * - `invalid_code_verifier` (400): `code_verifier` does not match the `code_challenge` of the handoff.
8934
9020
  * @enum {string}
8935
9021
  */
8936
- ErrorCode: "bad_request" | "validation_error" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "method_not_allowed" | "conflict" | "last_sign_in_method" | "payload_too_large" | "unsupported_media_type" | "unprocessable_entity" | "too_many_requests" | "internal_error" | "already_exists" | "invalid_id" | "account_not_found" | "invalid_query" | "search_not_supported" | "invalid_expand" | "access_denied" | "insufficient_scope" | "team_required" | "account_limit_reached" | "invalid_project_id" | "account_transfer_refused" | "email_sender_domain_not_allowed" | "plan_required" | "invalid_canonical_host" | "canonical_host_breaks_passkeys" | "not_logged_in" | "session_already_revoked" | "invalid_token" | "not_owner" | "user_suspended" | "invalid_credentials" | "login_denied" | "signup_denied" | "challenge_required" | "challenge_invalid" | "challenge_unsupported" | "challenge_unavailable" | "origin_required" | "client_credentials_denied" | "m2m_quota_exceeded" | "signup_disabled" | "email_taken" | "username_taken" | "invalid_username" | "invalid_email" | "invalid_name" | "same_email" | "user_has_no_email" | "password_too_weak" | "invalid_password_hash" | "weak_password_hash" | "invalid_code" | "invalid_phone" | "phone_changed" | "phone_already_verified" | "phone_change_requires_verification" | "sms_unavailable" | "sms_failed" | "invalid_state" | "state_mismatch" | "invalid_ticket" | "ticket_used" | "ticket_expired" | "ticket_not_found" | "credential_not_found" | "invalid_link" | "expired_link" | "invalid_otp" | "invalid_client" | "client_not_found" | "client_mismatch" | "invalid_client_metadata" | "invalid_connection" | "no_database_connection" | "connection_required" | "connection_misconfigured" | "passwordless_unavailable" | "ambiguous_connection" | "invalid_redirect_uri" | "invalid_saml_request" | "saml_sp_mismatch" | "saml_not_enabled" | "invalid_client_jwks" | "client_jwks_required" | "invalid_origin_branding" | "invalid_saml_sp" | "origin_not_allowed" | "audience_not_found" | "system_resource" | "invalid_request" | "invalid_device_code" | "provider_error" | "identity_already_linked" | "identity_link_denied" | "identity_conflict" | "identity_orphaned" | "no_provider_token" | "no_refresh_token" | "action_unavailable" | "login_flow_misconfigured" | "mfa_required" | "step_up_required" | "reauth_required" | "invalid_current_password" | "email_not_verified" | "invalid_profile_field" | "interaction_required" | "passkey_login_disabled" | "mfa_pending" | "mfa_invalid_code" | "mfa_invalid_recovery_code" | "too_many_attempts" | "too_many_login_attempts" | "totp_not_allowed" | "no_usable_factor" | "factor_not_found" | "factor_already_confirmed" | "invalid_factor" | "session_missing" | "passkey_verification_failed" | "no_passkey_enrolled" | "malformed_credential" | "unknown_passkey" | "invalid_passkey" | "invalid_invite_url" | "invite_email_mismatch" | "invite_email_unverified" | "invite_not_found" | "invite_used" | "already_member" | "not_a_member" | "consent_options_unavailable" | "consent_choice_invalid" | "oauth21_required" | "registration_disabled" | "invalid_email_domain" | "public_email_domain" | "organization_domain_not_found" | "organization_domain_taken" | "organization_domain_unverified" | "plan_unavailable" | "organization_domain_mismatch" | "team_not_in_organization" | "organization_has_no_idp" | "organization_not_found" | "invalid_user" | "not_an_organization_admin" | "last_organization_admin" | "team_id_unavailable" | "use_team_member_route" | "role_not_found" | "invalid_role" | "invalid_permission" | "flow_not_found" | "revision_not_found" | "invalid_webhook_event" | "invalid_webhook_url" | "not_a_webhook" | "delivery_not_found" | "delivery_in_progress" | "account_mismatch" | "connect_redirect_uri_missing" | "invalid_site_url" | "handoff_not_found" | "handoff_expired" | "handoff_used" | "invalid_code_verifier";
9022
+ ErrorCode: "bad_request" | "validation_error" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "method_not_allowed" | "conflict" | "last_sign_in_method" | "payload_too_large" | "unsupported_media_type" | "unprocessable_entity" | "too_many_requests" | "internal_error" | "already_exists" | "invalid_id" | "account_not_found" | "invalid_query" | "search_not_supported" | "invalid_expand" | "access_denied" | "insufficient_scope" | "team_required" | "account_limit_reached" | "invalid_project_id" | "account_transfer_refused" | "email_sender_domain_not_allowed" | "plan_required" | "invalid_canonical_host" | "canonical_host_breaks_passkeys" | "not_logged_in" | "session_already_revoked" | "invalid_token" | "not_owner" | "user_suspended" | "account_disabled" | "account_protected" | "invalid_credentials" | "login_denied" | "signup_denied" | "challenge_required" | "challenge_invalid" | "challenge_unsupported" | "challenge_unavailable" | "origin_required" | "client_credentials_denied" | "m2m_quota_exceeded" | "signup_disabled" | "email_taken" | "username_taken" | "invalid_username" | "invalid_email" | "invalid_name" | "same_email" | "user_has_no_email" | "password_too_weak" | "invalid_password_hash" | "weak_password_hash" | "invalid_code" | "invalid_phone" | "phone_changed" | "phone_already_verified" | "phone_change_requires_verification" | "sms_unavailable" | "sms_failed" | "invalid_state" | "state_mismatch" | "invalid_ticket" | "ticket_used" | "ticket_expired" | "ticket_not_found" | "credential_not_found" | "invalid_link" | "expired_link" | "invalid_otp" | "invalid_client" | "client_not_found" | "client_mismatch" | "invalid_client_metadata" | "invalid_connection" | "no_database_connection" | "connection_required" | "connection_misconfigured" | "passwordless_unavailable" | "ambiguous_connection" | "invalid_redirect_uri" | "invalid_saml_request" | "saml_sp_mismatch" | "saml_not_enabled" | "invalid_client_jwks" | "client_jwks_required" | "invalid_origin_branding" | "invalid_saml_sp" | "origin_not_allowed" | "audience_not_found" | "system_resource" | "invalid_request" | "invalid_device_code" | "provider_error" | "identity_already_linked" | "identity_link_denied" | "identity_conflict" | "identity_orphaned" | "no_provider_token" | "no_refresh_token" | "action_unavailable" | "login_flow_misconfigured" | "mfa_required" | "step_up_required" | "reauth_required" | "invalid_current_password" | "email_not_verified" | "invalid_profile_field" | "interaction_required" | "passkey_login_disabled" | "mfa_pending" | "mfa_invalid_code" | "mfa_invalid_recovery_code" | "too_many_attempts" | "too_many_login_attempts" | "totp_not_allowed" | "no_usable_factor" | "factor_not_found" | "factor_already_confirmed" | "invalid_factor" | "session_missing" | "passkey_verification_failed" | "no_passkey_enrolled" | "malformed_credential" | "unknown_passkey" | "invalid_passkey" | "invalid_invite_url" | "invite_email_mismatch" | "invite_email_unverified" | "invite_not_found" | "invite_used" | "already_member" | "not_a_member" | "consent_options_unavailable" | "consent_choice_invalid" | "oauth21_required" | "registration_disabled" | "invalid_email_domain" | "public_email_domain" | "organization_domain_not_found" | "organization_domain_taken" | "organization_domain_unverified" | "plan_unavailable" | "organization_domain_mismatch" | "team_not_in_organization" | "organization_has_no_idp" | "organization_not_found" | "invalid_user" | "not_an_organization_admin" | "last_organization_admin" | "team_id_unavailable" | "use_team_member_route" | "role_not_found" | "invalid_role" | "invalid_permission" | "flow_not_found" | "revision_not_found" | "invalid_webhook_event" | "invalid_webhook_url" | "not_a_webhook" | "delivery_not_found" | "delivery_in_progress" | "account_mismatch" | "connect_redirect_uri_missing" | "invalid_site_url" | "handoff_not_found" | "handoff_expired" | "handoff_used" | "invalid_code_verifier";
8937
9023
  /** @description Every error response has this shape. Branch on `error_code`, never on `message`: the message is written for a person and may change. */
8938
9024
  ErrorResponse: {
8939
9025
  /** @description The HTTP status, repeated. */
@@ -9126,6 +9212,10 @@ export interface operations {
9126
9212
  client_id_metadata_documents_enabled?: boolean;
9127
9213
  /** @description The one host this tenant's OIDC issuer and discovery document are always minted with, regardless of which host actually served the request — must be the account's own platform host or one of its verified custom domains. `/authorize` and `/logout` 302 here from any other host of the tenant. Unset (the default): every URL uses whatever host served the request, as before this field existed. Changing it can invalidate every WebAuthn passkey already enrolled unless `webauthn_rp_id` already covers the new host. */
9128
9214
  canonical_host?: string | null;
9215
+ /** @description When the tenant was disabled. While set, nobody can sign in (every end-user endpoint answers 403 `account_disabled`) and management writes are refused; reads keep working. Null or absent: the tenant is active. */
9216
+ disabled_at?: string | null;
9217
+ /** @description Who disabled the tenant: `owner` (from the dashboard; the owner can enable it again) or `staff` (Faable; only Faable support can enable it). */
9218
+ disabled_by?: "owner" | "staff" | null;
9129
9219
  /** @description AuthAccount creation date */
9130
9220
  createdAt: string;
9131
9221
  /** @description AuthAccount updated date */
@@ -9512,6 +9602,10 @@ export interface operations {
9512
9602
  client_id_metadata_documents_enabled?: boolean;
9513
9603
  /** @description The one host this tenant's OIDC issuer and discovery document are always minted with, regardless of which host actually served the request — must be the account's own platform host or one of its verified custom domains. `/authorize` and `/logout` 302 here from any other host of the tenant. Unset (the default): every URL uses whatever host served the request, as before this field existed. Changing it can invalidate every WebAuthn passkey already enrolled unless `webauthn_rp_id` already covers the new host. */
9514
9604
  canonical_host?: string | null;
9605
+ /** @description When the tenant was disabled. While set, nobody can sign in (every end-user endpoint answers 403 `account_disabled`) and management writes are refused; reads keep working. Null or absent: the tenant is active. */
9606
+ disabled_at?: string | null;
9607
+ /** @description Who disabled the tenant: `owner` (from the dashboard; the owner can enable it again) or `staff` (Faable; only Faable support can enable it). */
9608
+ disabled_by?: "owner" | "staff" | null;
9515
9609
  /** @description AuthAccount creation date */
9516
9610
  createdAt: string;
9517
9611
  /** @description AuthAccount updated date */
@@ -9786,6 +9880,10 @@ export interface operations {
9786
9880
  client_id_metadata_documents_enabled?: boolean;
9787
9881
  /** @description The one host this tenant's OIDC issuer and discovery document are always minted with, regardless of which host actually served the request — must be the account's own platform host or one of its verified custom domains. `/authorize` and `/logout` 302 here from any other host of the tenant. Unset (the default): every URL uses whatever host served the request, as before this field existed. Changing it can invalidate every WebAuthn passkey already enrolled unless `webauthn_rp_id` already covers the new host. */
9788
9882
  canonical_host?: string | null;
9883
+ /** @description When the tenant was disabled. While set, nobody can sign in (every end-user endpoint answers 403 `account_disabled`) and management writes are refused; reads keep working. Null or absent: the tenant is active. */
9884
+ disabled_at?: string | null;
9885
+ /** @description Who disabled the tenant: `owner` (from the dashboard; the owner can enable it again) or `staff` (Faable; only Faable support can enable it). */
9886
+ disabled_by?: "owner" | "staff" | null;
9789
9887
  /** @description AuthAccount creation date */
9790
9888
  createdAt: string;
9791
9889
  /** @description AuthAccount updated date */
@@ -10161,6 +10259,10 @@ export interface operations {
10161
10259
  client_id_metadata_documents_enabled?: boolean;
10162
10260
  /** @description The one host this tenant's OIDC issuer and discovery document are always minted with, regardless of which host actually served the request — must be the account's own platform host or one of its verified custom domains. `/authorize` and `/logout` 302 here from any other host of the tenant. Unset (the default): every URL uses whatever host served the request, as before this field existed. Changing it can invalidate every WebAuthn passkey already enrolled unless `webauthn_rp_id` already covers the new host. */
10163
10261
  canonical_host?: string | null;
10262
+ /** @description When the tenant was disabled. While set, nobody can sign in (every end-user endpoint answers 403 `account_disabled`) and management writes are refused; reads keep working. Null or absent: the tenant is active. */
10263
+ disabled_at?: string | null;
10264
+ /** @description Who disabled the tenant: `owner` (from the dashboard; the owner can enable it again) or `staff` (Faable; only Faable support can enable it). */
10265
+ disabled_by?: "owner" | "staff" | null;
10164
10266
  /** @description AuthAccount creation date */
10165
10267
  createdAt: string;
10166
10268
  /** @description AuthAccount updated date */
@@ -11159,6 +11261,9 @@ export interface operations {
11159
11261
  clients: number;
11160
11262
  connections: number;
11161
11263
  custom_domain_verified: boolean;
11264
+ disabled_at: string | null;
11265
+ disabled_by: "owner" | "staff" | null;
11266
+ disabled_reason: string | null;
11162
11267
  }[];
11163
11268
  };
11164
11269
  };
@@ -11558,6 +11663,10 @@ export interface operations {
11558
11663
  client_id_metadata_documents_enabled?: boolean;
11559
11664
  /** @description The one host this tenant's OIDC issuer and discovery document are always minted with, regardless of which host actually served the request — must be the account's own platform host or one of its verified custom domains. `/authorize` and `/logout` 302 here from any other host of the tenant. Unset (the default): every URL uses whatever host served the request, as before this field existed. Changing it can invalidate every WebAuthn passkey already enrolled unless `webauthn_rp_id` already covers the new host. */
11560
11665
  canonical_host?: string | null;
11666
+ /** @description When the tenant was disabled. While set, nobody can sign in (every end-user endpoint answers 403 `account_disabled`) and management writes are refused; reads keep working. Null or absent: the tenant is active. */
11667
+ disabled_at?: string | null;
11668
+ /** @description Who disabled the tenant: `owner` (from the dashboard; the owner can enable it again) or `staff` (Faable; only Faable support can enable it). */
11669
+ disabled_by?: "owner" | "staff" | null;
11561
11670
  /** @description AuthAccount creation date */
11562
11671
  createdAt: string;
11563
11672
  /** @description AuthAccount updated date */
@@ -11649,6 +11758,779 @@ export interface operations {
11649
11758
  };
11650
11759
  };
11651
11760
  };
11761
+ "account/disable": {
11762
+ parameters: {
11763
+ query?: never;
11764
+ header?: never;
11765
+ path: {
11766
+ account_id: string;
11767
+ };
11768
+ cookie?: never;
11769
+ };
11770
+ requestBody?: never;
11771
+ responses: {
11772
+ /** @description AuthAccount */
11773
+ 200: {
11774
+ headers: {
11775
+ [name: string]: unknown;
11776
+ };
11777
+ content: {
11778
+ "application/json": {
11779
+ /** @description AuthAccount ID */
11780
+ id: string;
11781
+ name: string;
11782
+ domain: string;
11783
+ slug: string;
11784
+ logo_src?: string | null;
11785
+ icon_src?: string | null;
11786
+ callback_hostnames: string[];
11787
+ /** @description Shared HMAC secret. Used when token_signing_alg is an HS* algorithm; ignored for RS*\/ES*\/PS*. */
11788
+ token_signature: string;
11789
+ /** @description JWA algorithm used to sign tokens issued by this Account. Today only RS256 is implemented. */
11790
+ token_signing_alg: "RS256";
11791
+ default_connection?: components["schemas"]["Connection"] | string | unknown;
11792
+ enabled_locales: string[];
11793
+ /** @description Free-form labels on the account. The dashboard stores the environment as an `env:<name>` tag (e.g. `env:production`, `env:staging`, `env:test`). */
11794
+ tags?: string[];
11795
+ team?: string | null;
11796
+ notification_settings: {
11797
+ /**
11798
+ * @description Send the built-in welcome email on user.created
11799
+ * @default false
11800
+ */
11801
+ welcome_email_enabled: boolean;
11802
+ /**
11803
+ * @description Send a verification email automatically when a user is created with `email_verified=false` and an email address. The link in the email lands on `GET /verify-email?ticket=...` and flips `email_verified=true` with `email_verified_method=verification_flow`. When `false`, verification emails must be requested explicitly via `POST /user/:id/verify-email/start`.
11804
+ * @default false
11805
+ */
11806
+ verify_email_auto_send: boolean;
11807
+ };
11808
+ /**
11809
+ * Format: email
11810
+ * @description Reply-To on every email this tenant sends to its users. Absent = no Reply-To, so a reply goes to the From address — which is a `no-reply@` mailbox nobody reads. Set it to your own support address if you want your users to be able to answer.
11811
+ */
11812
+ email_reply_to?: string | null;
11813
+ /** @description Display name on every email this tenant sends to its users. Absent = the account `name`. */
11814
+ email_from_name?: string | null;
11815
+ /** @description Sender address of every email this tenant sends to its users. Absent = the platform default. Set by Faable only. */
11816
+ email_from_address?: string | null;
11817
+ welcome_email?: {
11818
+ /**
11819
+ * Format: uri
11820
+ * @description Where the welcome button sends the user. Defaults to `https://<first callback hostname>`. Point it at your app (not your marketing site) so a fresh user lands somewhere useful.
11821
+ */
11822
+ cta_url?: string | null;
11823
+ /** @description Replaces the default one-line body ("Your account on … is ready to go."). Plain text, sent verbatim in every enabled locale. */
11824
+ body?: string | null;
11825
+ /** @description Rendered as a "Follow <account>" block after the button — GitHub, LinkedIn, X, YouTube… Empty or absent hides the block. */
11826
+ social_links?: {
11827
+ label: string;
11828
+ /** Format: uri */
11829
+ url: string;
11830
+ }[] | null;
11831
+ } | null;
11832
+ /** @description The footer of every email this tenant sends to its users, in place of «Powered by Faable Auth». Absent = that line. */
11833
+ email_footer?: {
11834
+ /** @description The footer line, e.g. «Kirbic Booking». */
11835
+ text: string;
11836
+ /**
11837
+ * Format: uri
11838
+ * @description Where the footer line links to.
11839
+ */
11840
+ url?: string;
11841
+ /** @description A small emblem above the line (24 px). PNG or JPG, https. */
11842
+ logo_src?: string;
11843
+ } | null;
11844
+ /** @description Policy for the user email-change flow. `new_only` (default) sends a single confirmation link to the new email. `old_and_new` requires the user to also click a link sent to the previous email before the swap takes effect — stricter, useful for tenants with higher-risk users. */
11845
+ email_change_verification_mode?: "new_only" | "old_and_new";
11846
+ /**
11847
+ * @description Controls what happens to `user.email` on subsequent OAuth/federated logins when the user previously changed their email manually through this auth server (i.e. `user.email_change_locked_at` is set).
11848
+ *
11849
+ * - `preserve_manual` (default): the manually-set email wins. The federated provider's email is ignored on re-sync; `email` and `email_verified` are not touched. The identity link stays valid via `provider_user_id`, so the user can still log in with Google/etc.
11850
+ * - `always_sync`: the federated provider's email is always written back, overwriting any manual change. Useful for tenants whose source of truth for identity is the IdP (corporate SSO, etc.).
11851
+ */
11852
+ email_oauth_sync_policy?: "preserve_manual" | "always_sync";
11853
+ /** @description Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults. */
11854
+ login_methods?: {
11855
+ /** @description Order in which the hosted login screen renders the available methods. Entries are Connection resource ids (`connection_xxx`) or the literal `passkey`. Methods not listed keep the built-in order (passwordless, database, social) after the listed ones; ids that no longer resolve are ignored. Listing an `oidc` connection here is also the only way to surface it on the login screen — see resolveLoginMethods(). */
11856
+ order?: string[];
11857
+ /** @description Connection resource ids (`connection_xxx`) this client does NOT offer. Removing a method here is enforced, not cosmetic: the connection disappears from the login screen AND `/authorize?connection=<id>` is refused for this client, the same as a connection whose `enabled_clients` excludes it. Use it to say "this app does not do Google"; use `enabled_clients` on the connection itself to say "that connection is not for this app". A connection has to pass both. */
11858
+ disabled_connections?: string[];
11859
+ /** @description Offer passkey (WebAuthn) as a primary login method on the hosted login screen. Defaults to false. */
11860
+ passkey_login_enabled?: boolean;
11861
+ /** @description Ask for the email first and only then reveal the methods that apply to it, instead of showing every method up front. Defaults to false. */
11862
+ identifier_first?: boolean;
11863
+ /** @description Surface the method the returning user chose last time. Defaults to false. */
11864
+ remember_last_method?: boolean;
11865
+ /** @description Invite users to create a passkey right after a successful login with another method. `offer` shows a hosted screen once per `passkey_promotion_snooze_days`, at most `passkey_promotion_max_prompts` times, to users who have no second factor yet; it never blocks the login. Requires `passkey_login_enabled`. Defaults to `off`. */
11866
+ passkey_promotion?: "off" | "offer";
11867
+ /** @description Days to wait before offering a passkey again to a user who dismissed it. Defaults to 30. */
11868
+ passkey_promotion_snooze_days?: number;
11869
+ /** @description How many times a user is offered a passkey over their lifetime. `0` switches the offer off for this tenant without changing `passkey_promotion`. Defaults to 3. */
11870
+ passkey_promotion_max_prompts?: number;
11871
+ /** @description Show a "Remember me on this device" checkbox on the password and email-code forms. `optional`: unchecked, the session ends when the browser closes; checked, it lasts `remember_me_days`. `off` (the default): no checkbox, every session lasts the built-in 30 days. */
11872
+ remember_me?: "off" | "optional";
11873
+ /** @description How long a session lasts when the user ticked "Remember me". Defaults to 30. */
11874
+ remember_me_days?: number;
11875
+ /** @description Colour theme of the hosted login screens. `system` (the default): the visitor's OS decides, and the visitor can switch it from the screen. `light` / `dark`: forced, and the switch is hidden — for applications whose own pages are only one of the two. A `theme` query parameter on `/authorize` overrides this for that login. */
11876
+ theme?: "system" | "light" | "dark";
11877
+ };
11878
+ /** @description Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata["faable.com/fields"]`. On a Client it replaces the account's list entirely; absent = inherit. */
11879
+ profile_fields?: {
11880
+ /** @description The field key, as it is stored in `user_metadata["faable.com/fields"]`. */
11881
+ key: string;
11882
+ /** @description `string`: free text up to `max_length`. `enum`: one of `options`. */
11883
+ type: "string" | "enum";
11884
+ /** @description The accepted values when `type` is `enum`. */
11885
+ options?: string[];
11886
+ /** @description Longest accepted value for a `string` field. Default 200. */
11887
+ max_length?: number;
11888
+ }[] | null;
11889
+ /** @description The login flow bound to this account (`loginflow_xxx`). Absent = the flow compiled from the settings. A Client may bind its own. */
11890
+ login_flow?: string | null;
11891
+ /** @description Second-factor policy. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so one app can require MFA without changing the rest. */
11892
+ mfa_policy?: {
11893
+ /** @description `off` (default) never challenges. `optional` challenges a user who has enrolled a factor, and lets everyone else in. `required` challenges everyone and sends users with no factor through enrolment during login — it never locks anyone out in place. */
11894
+ mode?: "off" | "optional" | "required";
11895
+ /** @description Which kinds of second factor satisfy the policy. Empty or unset means all of them. A user whose only factor is of a kind not listed here is treated as having none. */
11896
+ allowed_factors?: ("totp" | "webauthn")[];
11897
+ /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
11898
+ remember_device_days?: number;
11899
+ };
11900
+ /** @description Password-recovery delivery channels. Set on the Account as the tenant default; the same object on a Client overrides it field by field, like `login_methods` and `mfa_policy`. */
11901
+ recovery_channels?: {
11902
+ /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
11903
+ enabled?: ("email" | "sms" | "whatsapp" | "factor")[];
11904
+ /** @description The channel used when the user is not asked to choose. Falls back to `email` when it is not available for that user. */
11905
+ default?: "email" | "sms" | "whatsapp" | "factor";
11906
+ /** @description Channels the recovery screen offers the user to pick from, after they enter their identifier. Empty (the default) keeps today's behaviour: the default channel is used silently and the response never reveals whether the account exists. A non-empty list shows a picker with masked destinations — which does reveal that the account exists and which channels it has, the same trade-off Google and Microsoft make. A tenant decision. */
11907
+ visible?: ("email" | "sms" | "whatsapp" | "factor")[];
11908
+ };
11909
+ /** @description ISO 3166-1 alpha-2 country assumed for phone numbers written without an international prefix (`636647460` → `+34…` with `ES`). Needed before SMS can reach anyone: most people type their number without a prefix. */
11910
+ default_country_iso?: string | null;
11911
+ /** @description WebAuthn Relying Party ID for this tenant's passkeys. Defaults to the account domain. Set it to a registrable suffix you own (e.g. `acme.com`) when the login screen is served from more than one host — the RP ID is frozen into every credential at registration, so changing it afterwards invalidates every passkey already enrolled. */
11912
+ webauthn_rp_id?: string | null;
11913
+ /** @description When true, `/logout` asks the End-User to confirm before ending the session unless the request carries a verified `id_token_hint`. Off by default — a plain link to `/logout` is otherwise enough to sign anyone out (logout CSRF). */
11914
+ logout_confirm_required?: boolean;
11915
+ /** @description When true, anyone can register a client with `POST /oidc/register` (OIDC Dynamic Client Registration / RFC 7591) and the discovery document advertises `registration_endpoint`. Off by default: an open registration lets anyone create a client with their own `redirect_uri`. */
11916
+ dynamic_client_registration_enabled?: boolean;
11917
+ /** @description When true, the tenant enforces OAuth 2.1: `/authorize` accepts only `response_type=code` and requires PKCE (`code_challenge` with `S256`) from every client, a password login without `/authorize` needs PKCE too, and the password grant is refused. Refused requests answer `oauth21_required`. On for new tenants; an existing tenant turns it on when its applications are ready — with `@faable/auth-js` that is version 3.1.0 or later. */
11918
+ oauth21_enabled?: boolean;
11919
+ /** @description When true, signing in with Google, GitHub, GitLab or Apple for the first time attaches that provider to the existing user with the same email instead of creating a second user — only when the provider attests the email as verified, exactly one user of the tenant has that email verified, that user is not suspended and has no other identity of the same connection. Off by default. */
11920
+ oauth_link_verified_email?: boolean;
11921
+ /** @description When true, /authorize accepts a `client_id` that is an https URL serving a Client ID Metadata Document (the MCP authorization way to identify a client without registering it). Such clients always see the consent screen. Off by default. */
11922
+ client_id_metadata_documents_enabled?: boolean;
11923
+ /** @description The one host this tenant's OIDC issuer and discovery document are always minted with, regardless of which host actually served the request — must be the account's own platform host or one of its verified custom domains. `/authorize` and `/logout` 302 here from any other host of the tenant. Unset (the default): every URL uses whatever host served the request, as before this field existed. Changing it can invalidate every WebAuthn passkey already enrolled unless `webauthn_rp_id` already covers the new host. */
11924
+ canonical_host?: string | null;
11925
+ /** @description When the tenant was disabled. While set, nobody can sign in (every end-user endpoint answers 403 `account_disabled`) and management writes are refused; reads keep working. Null or absent: the tenant is active. */
11926
+ disabled_at?: string | null;
11927
+ /** @description Who disabled the tenant: `owner` (from the dashboard; the owner can enable it again) or `staff` (Faable; only Faable support can enable it). */
11928
+ disabled_by?: "owner" | "staff" | null;
11929
+ /** @description AuthAccount creation date */
11930
+ createdAt: string;
11931
+ /** @description AuthAccount updated date */
11932
+ updatedAt?: string;
11933
+ };
11934
+ };
11935
+ };
11936
+ /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
11937
+ 400: {
11938
+ headers: {
11939
+ [name: string]: unknown;
11940
+ };
11941
+ content: {
11942
+ "application/json": components["schemas"]["ErrorResponse"] & {
11943
+ /** @enum {string} */
11944
+ error_code?: "validation_error";
11945
+ };
11946
+ };
11947
+ };
11948
+ /** @description `unauthorized` — The request carries no valid credentials. */
11949
+ 401: {
11950
+ headers: {
11951
+ [name: string]: unknown;
11952
+ };
11953
+ content: {
11954
+ "application/json": components["schemas"]["ErrorResponse"] & {
11955
+ /** @enum {string} */
11956
+ error_code?: "unauthorized";
11957
+ };
11958
+ };
11959
+ };
11960
+ /**
11961
+ * @description `account_disabled` — The Auth tenant is disabled: nobody can sign in and management writes are refused; reads keep working. `details.disabled_by` is `owner` (enable it again from the dashboard) or `staff` (contact support@faable.com).
11962
+ *
11963
+ * `forbidden` — The credentials are valid but do not allow this operation.
11964
+ *
11965
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
11966
+ *
11967
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
11968
+ */
11969
+ 403: {
11970
+ headers: {
11971
+ [name: string]: unknown;
11972
+ };
11973
+ content: {
11974
+ "application/json": components["schemas"]["ErrorResponse"] & {
11975
+ /** @enum {string} */
11976
+ error_code?: "account_disabled" | "forbidden" | "insufficient_scope" | "user_suspended";
11977
+ };
11978
+ };
11979
+ };
11980
+ /** @description `account_not_found` — No Auth Account matches the request (domain, header or token). */
11981
+ 404: {
11982
+ headers: {
11983
+ [name: string]: unknown;
11984
+ };
11985
+ content: {
11986
+ "application/json": components["schemas"]["ErrorResponse"] & {
11987
+ /** @enum {string} */
11988
+ error_code?: "account_not_found";
11989
+ };
11990
+ };
11991
+ };
11992
+ /** @description `account_protected` — A platform tenant (Faable's own) cannot be disabled: everyone, staff included, signs in through it. */
11993
+ 409: {
11994
+ headers: {
11995
+ [name: string]: unknown;
11996
+ };
11997
+ content: {
11998
+ "application/json": components["schemas"]["ErrorResponse"] & {
11999
+ /** @enum {string} */
12000
+ error_code?: "account_protected";
12001
+ };
12002
+ };
12003
+ };
12004
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
12005
+ 429: {
12006
+ headers: {
12007
+ [name: string]: unknown;
12008
+ };
12009
+ content: {
12010
+ "application/json": components["schemas"]["ErrorResponse"] & {
12011
+ /** @enum {string} */
12012
+ error_code?: "too_many_requests";
12013
+ };
12014
+ };
12015
+ };
12016
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
12017
+ 500: {
12018
+ headers: {
12019
+ [name: string]: unknown;
12020
+ };
12021
+ content: {
12022
+ "application/json": components["schemas"]["ErrorResponse"] & {
12023
+ /** @enum {string} */
12024
+ error_code?: "internal_error";
12025
+ };
12026
+ };
12027
+ };
12028
+ };
12029
+ };
12030
+ "account/enable": {
12031
+ parameters: {
12032
+ query?: never;
12033
+ header?: never;
12034
+ path: {
12035
+ account_id: string;
12036
+ };
12037
+ cookie?: never;
12038
+ };
12039
+ requestBody?: never;
12040
+ responses: {
12041
+ /** @description AuthAccount */
12042
+ 200: {
12043
+ headers: {
12044
+ [name: string]: unknown;
12045
+ };
12046
+ content: {
12047
+ "application/json": {
12048
+ /** @description AuthAccount ID */
12049
+ id: string;
12050
+ name: string;
12051
+ domain: string;
12052
+ slug: string;
12053
+ logo_src?: string | null;
12054
+ icon_src?: string | null;
12055
+ callback_hostnames: string[];
12056
+ /** @description Shared HMAC secret. Used when token_signing_alg is an HS* algorithm; ignored for RS*\/ES*\/PS*. */
12057
+ token_signature: string;
12058
+ /** @description JWA algorithm used to sign tokens issued by this Account. Today only RS256 is implemented. */
12059
+ token_signing_alg: "RS256";
12060
+ default_connection?: components["schemas"]["Connection"] | string | unknown;
12061
+ enabled_locales: string[];
12062
+ /** @description Free-form labels on the account. The dashboard stores the environment as an `env:<name>` tag (e.g. `env:production`, `env:staging`, `env:test`). */
12063
+ tags?: string[];
12064
+ team?: string | null;
12065
+ notification_settings: {
12066
+ /**
12067
+ * @description Send the built-in welcome email on user.created
12068
+ * @default false
12069
+ */
12070
+ welcome_email_enabled: boolean;
12071
+ /**
12072
+ * @description Send a verification email automatically when a user is created with `email_verified=false` and an email address. The link in the email lands on `GET /verify-email?ticket=...` and flips `email_verified=true` with `email_verified_method=verification_flow`. When `false`, verification emails must be requested explicitly via `POST /user/:id/verify-email/start`.
12073
+ * @default false
12074
+ */
12075
+ verify_email_auto_send: boolean;
12076
+ };
12077
+ /**
12078
+ * Format: email
12079
+ * @description Reply-To on every email this tenant sends to its users. Absent = no Reply-To, so a reply goes to the From address — which is a `no-reply@` mailbox nobody reads. Set it to your own support address if you want your users to be able to answer.
12080
+ */
12081
+ email_reply_to?: string | null;
12082
+ /** @description Display name on every email this tenant sends to its users. Absent = the account `name`. */
12083
+ email_from_name?: string | null;
12084
+ /** @description Sender address of every email this tenant sends to its users. Absent = the platform default. Set by Faable only. */
12085
+ email_from_address?: string | null;
12086
+ welcome_email?: {
12087
+ /**
12088
+ * Format: uri
12089
+ * @description Where the welcome button sends the user. Defaults to `https://<first callback hostname>`. Point it at your app (not your marketing site) so a fresh user lands somewhere useful.
12090
+ */
12091
+ cta_url?: string | null;
12092
+ /** @description Replaces the default one-line body ("Your account on … is ready to go."). Plain text, sent verbatim in every enabled locale. */
12093
+ body?: string | null;
12094
+ /** @description Rendered as a "Follow <account>" block after the button — GitHub, LinkedIn, X, YouTube… Empty or absent hides the block. */
12095
+ social_links?: {
12096
+ label: string;
12097
+ /** Format: uri */
12098
+ url: string;
12099
+ }[] | null;
12100
+ } | null;
12101
+ /** @description The footer of every email this tenant sends to its users, in place of «Powered by Faable Auth». Absent = that line. */
12102
+ email_footer?: {
12103
+ /** @description The footer line, e.g. «Kirbic Booking». */
12104
+ text: string;
12105
+ /**
12106
+ * Format: uri
12107
+ * @description Where the footer line links to.
12108
+ */
12109
+ url?: string;
12110
+ /** @description A small emblem above the line (24 px). PNG or JPG, https. */
12111
+ logo_src?: string;
12112
+ } | null;
12113
+ /** @description Policy for the user email-change flow. `new_only` (default) sends a single confirmation link to the new email. `old_and_new` requires the user to also click a link sent to the previous email before the swap takes effect — stricter, useful for tenants with higher-risk users. */
12114
+ email_change_verification_mode?: "new_only" | "old_and_new";
12115
+ /**
12116
+ * @description Controls what happens to `user.email` on subsequent OAuth/federated logins when the user previously changed their email manually through this auth server (i.e. `user.email_change_locked_at` is set).
12117
+ *
12118
+ * - `preserve_manual` (default): the manually-set email wins. The federated provider's email is ignored on re-sync; `email` and `email_verified` are not touched. The identity link stays valid via `provider_user_id`, so the user can still log in with Google/etc.
12119
+ * - `always_sync`: the federated provider's email is always written back, overwriting any manual change. Useful for tenants whose source of truth for identity is the IdP (corporate SSO, etc.).
12120
+ */
12121
+ email_oauth_sync_policy?: "preserve_manual" | "always_sync";
12122
+ /** @description Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults. */
12123
+ login_methods?: {
12124
+ /** @description Order in which the hosted login screen renders the available methods. Entries are Connection resource ids (`connection_xxx`) or the literal `passkey`. Methods not listed keep the built-in order (passwordless, database, social) after the listed ones; ids that no longer resolve are ignored. Listing an `oidc` connection here is also the only way to surface it on the login screen — see resolveLoginMethods(). */
12125
+ order?: string[];
12126
+ /** @description Connection resource ids (`connection_xxx`) this client does NOT offer. Removing a method here is enforced, not cosmetic: the connection disappears from the login screen AND `/authorize?connection=<id>` is refused for this client, the same as a connection whose `enabled_clients` excludes it. Use it to say "this app does not do Google"; use `enabled_clients` on the connection itself to say "that connection is not for this app". A connection has to pass both. */
12127
+ disabled_connections?: string[];
12128
+ /** @description Offer passkey (WebAuthn) as a primary login method on the hosted login screen. Defaults to false. */
12129
+ passkey_login_enabled?: boolean;
12130
+ /** @description Ask for the email first and only then reveal the methods that apply to it, instead of showing every method up front. Defaults to false. */
12131
+ identifier_first?: boolean;
12132
+ /** @description Surface the method the returning user chose last time. Defaults to false. */
12133
+ remember_last_method?: boolean;
12134
+ /** @description Invite users to create a passkey right after a successful login with another method. `offer` shows a hosted screen once per `passkey_promotion_snooze_days`, at most `passkey_promotion_max_prompts` times, to users who have no second factor yet; it never blocks the login. Requires `passkey_login_enabled`. Defaults to `off`. */
12135
+ passkey_promotion?: "off" | "offer";
12136
+ /** @description Days to wait before offering a passkey again to a user who dismissed it. Defaults to 30. */
12137
+ passkey_promotion_snooze_days?: number;
12138
+ /** @description How many times a user is offered a passkey over their lifetime. `0` switches the offer off for this tenant without changing `passkey_promotion`. Defaults to 3. */
12139
+ passkey_promotion_max_prompts?: number;
12140
+ /** @description Show a "Remember me on this device" checkbox on the password and email-code forms. `optional`: unchecked, the session ends when the browser closes; checked, it lasts `remember_me_days`. `off` (the default): no checkbox, every session lasts the built-in 30 days. */
12141
+ remember_me?: "off" | "optional";
12142
+ /** @description How long a session lasts when the user ticked "Remember me". Defaults to 30. */
12143
+ remember_me_days?: number;
12144
+ /** @description Colour theme of the hosted login screens. `system` (the default): the visitor's OS decides, and the visitor can switch it from the screen. `light` / `dark`: forced, and the switch is hidden — for applications whose own pages are only one of the two. A `theme` query parameter on `/authorize` overrides this for that login. */
12145
+ theme?: "system" | "light" | "dark";
12146
+ };
12147
+ /** @description Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata["faable.com/fields"]`. On a Client it replaces the account's list entirely; absent = inherit. */
12148
+ profile_fields?: {
12149
+ /** @description The field key, as it is stored in `user_metadata["faable.com/fields"]`. */
12150
+ key: string;
12151
+ /** @description `string`: free text up to `max_length`. `enum`: one of `options`. */
12152
+ type: "string" | "enum";
12153
+ /** @description The accepted values when `type` is `enum`. */
12154
+ options?: string[];
12155
+ /** @description Longest accepted value for a `string` field. Default 200. */
12156
+ max_length?: number;
12157
+ }[] | null;
12158
+ /** @description The login flow bound to this account (`loginflow_xxx`). Absent = the flow compiled from the settings. A Client may bind its own. */
12159
+ login_flow?: string | null;
12160
+ /** @description Second-factor policy. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so one app can require MFA without changing the rest. */
12161
+ mfa_policy?: {
12162
+ /** @description `off` (default) never challenges. `optional` challenges a user who has enrolled a factor, and lets everyone else in. `required` challenges everyone and sends users with no factor through enrolment during login — it never locks anyone out in place. */
12163
+ mode?: "off" | "optional" | "required";
12164
+ /** @description Which kinds of second factor satisfy the policy. Empty or unset means all of them. A user whose only factor is of a kind not listed here is treated as having none. */
12165
+ allowed_factors?: ("totp" | "webauthn")[];
12166
+ /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
12167
+ remember_device_days?: number;
12168
+ };
12169
+ /** @description Password-recovery delivery channels. Set on the Account as the tenant default; the same object on a Client overrides it field by field, like `login_methods` and `mfa_policy`. */
12170
+ recovery_channels?: {
12171
+ /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
12172
+ enabled?: ("email" | "sms" | "whatsapp" | "factor")[];
12173
+ /** @description The channel used when the user is not asked to choose. Falls back to `email` when it is not available for that user. */
12174
+ default?: "email" | "sms" | "whatsapp" | "factor";
12175
+ /** @description Channels the recovery screen offers the user to pick from, after they enter their identifier. Empty (the default) keeps today's behaviour: the default channel is used silently and the response never reveals whether the account exists. A non-empty list shows a picker with masked destinations — which does reveal that the account exists and which channels it has, the same trade-off Google and Microsoft make. A tenant decision. */
12176
+ visible?: ("email" | "sms" | "whatsapp" | "factor")[];
12177
+ };
12178
+ /** @description ISO 3166-1 alpha-2 country assumed for phone numbers written without an international prefix (`636647460` → `+34…` with `ES`). Needed before SMS can reach anyone: most people type their number without a prefix. */
12179
+ default_country_iso?: string | null;
12180
+ /** @description WebAuthn Relying Party ID for this tenant's passkeys. Defaults to the account domain. Set it to a registrable suffix you own (e.g. `acme.com`) when the login screen is served from more than one host — the RP ID is frozen into every credential at registration, so changing it afterwards invalidates every passkey already enrolled. */
12181
+ webauthn_rp_id?: string | null;
12182
+ /** @description When true, `/logout` asks the End-User to confirm before ending the session unless the request carries a verified `id_token_hint`. Off by default — a plain link to `/logout` is otherwise enough to sign anyone out (logout CSRF). */
12183
+ logout_confirm_required?: boolean;
12184
+ /** @description When true, anyone can register a client with `POST /oidc/register` (OIDC Dynamic Client Registration / RFC 7591) and the discovery document advertises `registration_endpoint`. Off by default: an open registration lets anyone create a client with their own `redirect_uri`. */
12185
+ dynamic_client_registration_enabled?: boolean;
12186
+ /** @description When true, the tenant enforces OAuth 2.1: `/authorize` accepts only `response_type=code` and requires PKCE (`code_challenge` with `S256`) from every client, a password login without `/authorize` needs PKCE too, and the password grant is refused. Refused requests answer `oauth21_required`. On for new tenants; an existing tenant turns it on when its applications are ready — with `@faable/auth-js` that is version 3.1.0 or later. */
12187
+ oauth21_enabled?: boolean;
12188
+ /** @description When true, signing in with Google, GitHub, GitLab or Apple for the first time attaches that provider to the existing user with the same email instead of creating a second user — only when the provider attests the email as verified, exactly one user of the tenant has that email verified, that user is not suspended and has no other identity of the same connection. Off by default. */
12189
+ oauth_link_verified_email?: boolean;
12190
+ /** @description When true, /authorize accepts a `client_id` that is an https URL serving a Client ID Metadata Document (the MCP authorization way to identify a client without registering it). Such clients always see the consent screen. Off by default. */
12191
+ client_id_metadata_documents_enabled?: boolean;
12192
+ /** @description The one host this tenant's OIDC issuer and discovery document are always minted with, regardless of which host actually served the request — must be the account's own platform host or one of its verified custom domains. `/authorize` and `/logout` 302 here from any other host of the tenant. Unset (the default): every URL uses whatever host served the request, as before this field existed. Changing it can invalidate every WebAuthn passkey already enrolled unless `webauthn_rp_id` already covers the new host. */
12193
+ canonical_host?: string | null;
12194
+ /** @description When the tenant was disabled. While set, nobody can sign in (every end-user endpoint answers 403 `account_disabled`) and management writes are refused; reads keep working. Null or absent: the tenant is active. */
12195
+ disabled_at?: string | null;
12196
+ /** @description Who disabled the tenant: `owner` (from the dashboard; the owner can enable it again) or `staff` (Faable; only Faable support can enable it). */
12197
+ disabled_by?: "owner" | "staff" | null;
12198
+ /** @description AuthAccount creation date */
12199
+ createdAt: string;
12200
+ /** @description AuthAccount updated date */
12201
+ updatedAt?: string;
12202
+ };
12203
+ };
12204
+ };
12205
+ /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
12206
+ 400: {
12207
+ headers: {
12208
+ [name: string]: unknown;
12209
+ };
12210
+ content: {
12211
+ "application/json": components["schemas"]["ErrorResponse"] & {
12212
+ /** @enum {string} */
12213
+ error_code?: "validation_error";
12214
+ };
12215
+ };
12216
+ };
12217
+ /** @description `unauthorized` — The request carries no valid credentials. */
12218
+ 401: {
12219
+ headers: {
12220
+ [name: string]: unknown;
12221
+ };
12222
+ content: {
12223
+ "application/json": components["schemas"]["ErrorResponse"] & {
12224
+ /** @enum {string} */
12225
+ error_code?: "unauthorized";
12226
+ };
12227
+ };
12228
+ };
12229
+ /**
12230
+ * @description `account_disabled` — The Auth tenant is disabled: nobody can sign in and management writes are refused; reads keep working. `details.disabled_by` is `owner` (enable it again from the dashboard) or `staff` (contact support@faable.com).
12231
+ *
12232
+ * `forbidden` — The credentials are valid but do not allow this operation.
12233
+ *
12234
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
12235
+ *
12236
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
12237
+ */
12238
+ 403: {
12239
+ headers: {
12240
+ [name: string]: unknown;
12241
+ };
12242
+ content: {
12243
+ "application/json": components["schemas"]["ErrorResponse"] & {
12244
+ /** @enum {string} */
12245
+ error_code?: "account_disabled" | "forbidden" | "insufficient_scope" | "user_suspended";
12246
+ };
12247
+ };
12248
+ };
12249
+ /** @description `account_not_found` — No Auth Account matches the request (domain, header or token). */
12250
+ 404: {
12251
+ headers: {
12252
+ [name: string]: unknown;
12253
+ };
12254
+ content: {
12255
+ "application/json": components["schemas"]["ErrorResponse"] & {
12256
+ /** @enum {string} */
12257
+ error_code?: "account_not_found";
12258
+ };
12259
+ };
12260
+ };
12261
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
12262
+ 429: {
12263
+ headers: {
12264
+ [name: string]: unknown;
12265
+ };
12266
+ content: {
12267
+ "application/json": components["schemas"]["ErrorResponse"] & {
12268
+ /** @enum {string} */
12269
+ error_code?: "too_many_requests";
12270
+ };
12271
+ };
12272
+ };
12273
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
12274
+ 500: {
12275
+ headers: {
12276
+ [name: string]: unknown;
12277
+ };
12278
+ content: {
12279
+ "application/json": components["schemas"]["ErrorResponse"] & {
12280
+ /** @enum {string} */
12281
+ error_code?: "internal_error";
12282
+ };
12283
+ };
12284
+ };
12285
+ };
12286
+ };
12287
+ "internal/accountDisable": {
12288
+ parameters: {
12289
+ query?: never;
12290
+ header?: never;
12291
+ path: {
12292
+ account_id: string;
12293
+ };
12294
+ cookie?: never;
12295
+ };
12296
+ requestBody: {
12297
+ content: {
12298
+ "application/json": {
12299
+ /** @description Why staff disabled it. Internal: never shown to the tenant. */
12300
+ reason: string;
12301
+ /** @description The `sub` of the staff member who did it. */
12302
+ actor: string;
12303
+ };
12304
+ };
12305
+ };
12306
+ responses: {
12307
+ /** @description Default Response */
12308
+ 200: {
12309
+ headers: {
12310
+ [name: string]: unknown;
12311
+ };
12312
+ content: {
12313
+ "application/json": {
12314
+ account_id: string;
12315
+ team: string | null;
12316
+ name: string;
12317
+ disabled_at: string | null;
12318
+ disabled_by: "owner" | "staff" | null;
12319
+ disabled_reason: string | null;
12320
+ disabled_actor: string | null;
12321
+ /** @description False when the tenant was already in the requested state. */
12322
+ changed: boolean;
12323
+ };
12324
+ };
12325
+ };
12326
+ /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
12327
+ 400: {
12328
+ headers: {
12329
+ [name: string]: unknown;
12330
+ };
12331
+ content: {
12332
+ "application/json": components["schemas"]["ErrorResponse"] & {
12333
+ /** @enum {string} */
12334
+ error_code?: "validation_error";
12335
+ };
12336
+ };
12337
+ };
12338
+ /** @description `unauthorized` — The request carries no valid credentials. */
12339
+ 401: {
12340
+ headers: {
12341
+ [name: string]: unknown;
12342
+ };
12343
+ content: {
12344
+ "application/json": components["schemas"]["ErrorResponse"] & {
12345
+ /** @enum {string} */
12346
+ error_code?: "unauthorized";
12347
+ };
12348
+ };
12349
+ };
12350
+ /**
12351
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
12352
+ *
12353
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
12354
+ *
12355
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
12356
+ */
12357
+ 403: {
12358
+ headers: {
12359
+ [name: string]: unknown;
12360
+ };
12361
+ content: {
12362
+ "application/json": components["schemas"]["ErrorResponse"] & {
12363
+ /** @enum {string} */
12364
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
12365
+ };
12366
+ };
12367
+ };
12368
+ /** @description `account_not_found` — No Auth Account matches the request (domain, header or token). */
12369
+ 404: {
12370
+ headers: {
12371
+ [name: string]: unknown;
12372
+ };
12373
+ content: {
12374
+ "application/json": components["schemas"]["ErrorResponse"] & {
12375
+ /** @enum {string} */
12376
+ error_code?: "account_not_found";
12377
+ };
12378
+ };
12379
+ };
12380
+ /** @description `account_protected` — A platform tenant (Faable's own) cannot be disabled: everyone, staff included, signs in through it. */
12381
+ 409: {
12382
+ headers: {
12383
+ [name: string]: unknown;
12384
+ };
12385
+ content: {
12386
+ "application/json": components["schemas"]["ErrorResponse"] & {
12387
+ /** @enum {string} */
12388
+ error_code?: "account_protected";
12389
+ };
12390
+ };
12391
+ };
12392
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
12393
+ 429: {
12394
+ headers: {
12395
+ [name: string]: unknown;
12396
+ };
12397
+ content: {
12398
+ "application/json": components["schemas"]["ErrorResponse"] & {
12399
+ /** @enum {string} */
12400
+ error_code?: "too_many_requests";
12401
+ };
12402
+ };
12403
+ };
12404
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
12405
+ 500: {
12406
+ headers: {
12407
+ [name: string]: unknown;
12408
+ };
12409
+ content: {
12410
+ "application/json": components["schemas"]["ErrorResponse"] & {
12411
+ /** @enum {string} */
12412
+ error_code?: "internal_error";
12413
+ };
12414
+ };
12415
+ };
12416
+ };
12417
+ };
12418
+ "internal/accountEnable": {
12419
+ parameters: {
12420
+ query?: never;
12421
+ header?: never;
12422
+ path: {
12423
+ account_id: string;
12424
+ };
12425
+ cookie?: never;
12426
+ };
12427
+ requestBody: {
12428
+ content: {
12429
+ "application/json": {
12430
+ actor: string;
12431
+ };
12432
+ };
12433
+ };
12434
+ responses: {
12435
+ /** @description Default Response */
12436
+ 200: {
12437
+ headers: {
12438
+ [name: string]: unknown;
12439
+ };
12440
+ content: {
12441
+ "application/json": {
12442
+ account_id: string;
12443
+ team: string | null;
12444
+ name: string;
12445
+ disabled_at: string | null;
12446
+ disabled_by: "owner" | "staff" | null;
12447
+ disabled_reason: string | null;
12448
+ disabled_actor: string | null;
12449
+ /** @description False when the tenant was already in the requested state. */
12450
+ changed: boolean;
12451
+ };
12452
+ };
12453
+ };
12454
+ /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
12455
+ 400: {
12456
+ headers: {
12457
+ [name: string]: unknown;
12458
+ };
12459
+ content: {
12460
+ "application/json": components["schemas"]["ErrorResponse"] & {
12461
+ /** @enum {string} */
12462
+ error_code?: "validation_error";
12463
+ };
12464
+ };
12465
+ };
12466
+ /** @description `unauthorized` — The request carries no valid credentials. */
12467
+ 401: {
12468
+ headers: {
12469
+ [name: string]: unknown;
12470
+ };
12471
+ content: {
12472
+ "application/json": components["schemas"]["ErrorResponse"] & {
12473
+ /** @enum {string} */
12474
+ error_code?: "unauthorized";
12475
+ };
12476
+ };
12477
+ };
12478
+ /**
12479
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
12480
+ *
12481
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
12482
+ *
12483
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
12484
+ */
12485
+ 403: {
12486
+ headers: {
12487
+ [name: string]: unknown;
12488
+ };
12489
+ content: {
12490
+ "application/json": components["schemas"]["ErrorResponse"] & {
12491
+ /** @enum {string} */
12492
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
12493
+ };
12494
+ };
12495
+ };
12496
+ /** @description `account_not_found` — No Auth Account matches the request (domain, header or token). */
12497
+ 404: {
12498
+ headers: {
12499
+ [name: string]: unknown;
12500
+ };
12501
+ content: {
12502
+ "application/json": components["schemas"]["ErrorResponse"] & {
12503
+ /** @enum {string} */
12504
+ error_code?: "account_not_found";
12505
+ };
12506
+ };
12507
+ };
12508
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
12509
+ 429: {
12510
+ headers: {
12511
+ [name: string]: unknown;
12512
+ };
12513
+ content: {
12514
+ "application/json": components["schemas"]["ErrorResponse"] & {
12515
+ /** @enum {string} */
12516
+ error_code?: "too_many_requests";
12517
+ };
12518
+ };
12519
+ };
12520
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
12521
+ 500: {
12522
+ headers: {
12523
+ [name: string]: unknown;
12524
+ };
12525
+ content: {
12526
+ "application/json": components["schemas"]["ErrorResponse"] & {
12527
+ /** @enum {string} */
12528
+ error_code?: "internal_error";
12529
+ };
12530
+ };
12531
+ };
12532
+ };
12533
+ };
11652
12534
  "connection/list": {
11653
12535
  parameters: {
11654
12536
  query?: {