@faable/auth-sdk 2.9.10 → 2.9.12

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.
@@ -1038,6 +1038,7 @@ export declare class FaableAuthApi extends GeneratedFaableAuthApi {
1038
1038
  } | undefined;
1039
1039
  login_flow?: string | null | undefined;
1040
1040
  default_audience?: string | null | undefined;
1041
+ management_scopes?: string[] | undefined;
1041
1042
  saml_sp?: {
1042
1043
  enabled: boolean;
1043
1044
  entity_id: string;
@@ -1122,6 +1123,7 @@ export declare class FaableAuthApi extends GeneratedFaableAuthApi {
1122
1123
  } | undefined;
1123
1124
  login_flow?: string | null | undefined;
1124
1125
  default_audience?: string | null | undefined;
1126
+ management_scopes?: string[] | undefined;
1125
1127
  saml_sp?: {
1126
1128
  enabled: boolean;
1127
1129
  entity_id: string;
@@ -1209,6 +1211,7 @@ export declare class FaableAuthApi extends GeneratedFaableAuthApi {
1209
1211
  } | undefined;
1210
1212
  login_flow?: string | null | undefined;
1211
1213
  default_audience?: string | null | undefined;
1214
+ management_scopes?: string[] | undefined;
1212
1215
  saml_sp?: {
1213
1216
  enabled: boolean;
1214
1217
  entity_id: string;
@@ -1295,6 +1298,7 @@ export declare class FaableAuthApi extends GeneratedFaableAuthApi {
1295
1298
  } | undefined;
1296
1299
  login_flow?: string | null | undefined;
1297
1300
  default_audience?: string | null | undefined;
1301
+ management_scopes?: string[] | undefined;
1298
1302
  saml_sp?: {
1299
1303
  enabled: boolean;
1300
1304
  entity_id: string;
@@ -1576,6 +1576,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
1576
1576
  } | undefined;
1577
1577
  login_flow?: string | null | undefined;
1578
1578
  default_audience?: string | null | undefined;
1579
+ management_scopes?: string[] | undefined;
1579
1580
  saml_sp?: {
1580
1581
  enabled: boolean;
1581
1582
  entity_id: string;
@@ -1676,6 +1677,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
1676
1677
  } | undefined;
1677
1678
  login_flow?: string | null | undefined;
1678
1679
  default_audience?: string | null | undefined;
1680
+ management_scopes?: string[] | undefined;
1679
1681
  saml_sp?: {
1680
1682
  enabled: boolean;
1681
1683
  entity_id: string;
@@ -1777,6 +1779,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
1777
1779
  } | undefined;
1778
1780
  login_flow?: string | null | undefined;
1779
1781
  default_audience?: string | null | undefined;
1782
+ management_scopes?: string[] | undefined;
1780
1783
  saml_sp?: {
1781
1784
  enabled: boolean;
1782
1785
  entity_id: string;
@@ -1879,6 +1882,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
1879
1882
  } | undefined;
1880
1883
  login_flow?: string | null | undefined;
1881
1884
  default_audience?: string | null | undefined;
1885
+ management_scopes?: string[] | undefined;
1882
1886
  saml_sp?: {
1883
1887
  enabled: boolean;
1884
1888
  entity_id: string;
@@ -1963,6 +1967,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
1963
1967
  } | undefined;
1964
1968
  login_flow?: string | null | undefined;
1965
1969
  default_audience?: string | null | undefined;
1970
+ management_scopes?: string[] | undefined;
1966
1971
  saml_sp?: {
1967
1972
  enabled: boolean;
1968
1973
  entity_id: string;
@@ -2050,6 +2055,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
2050
2055
  } | undefined;
2051
2056
  login_flow?: string | null | undefined;
2052
2057
  default_audience?: string | null | undefined;
2058
+ management_scopes?: string[] | undefined;
2053
2059
  saml_sp?: {
2054
2060
  enabled: boolean;
2055
2061
  entity_id: string;
@@ -2153,6 +2159,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
2153
2159
  } | undefined;
2154
2160
  login_flow?: string | null | undefined;
2155
2161
  default_audience?: string | null | undefined;
2162
+ management_scopes?: string[] | undefined;
2156
2163
  saml_sp?: {
2157
2164
  enabled: boolean;
2158
2165
  entity_id: string;
@@ -2254,6 +2261,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
2254
2261
  } | undefined;
2255
2262
  login_flow?: string | null | undefined;
2256
2263
  default_audience?: string | null | undefined;
2264
+ management_scopes?: string[] | undefined;
2257
2265
  saml_sp?: {
2258
2266
  enabled: boolean;
2259
2267
  entity_id: string;
@@ -2271,6 +2279,30 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
2271
2279
  createdAt: string;
2272
2280
  updatedAt?: string | undefined;
2273
2281
  }>;
2282
+ /**
2283
+ * `POST /connect/handoff` — operationId: `connect/createHandoff`
2284
+ *
2285
+ * Create a one-time handoff of a client’s credentials
2286
+ *
2287
+ * Used by the dashboard in the «Connect with Faable» flow. Checks that `client_id` belongs to `account_id` and that its callbacks contain `<site_url>/wp-login.php?faable-auth=callback`, then stores a one-time handoff bound to the PKCE `code_challenge`, valid for 10 minutes. The response `code` is sent to the site, which redeems it with `POST /connect/exchange`. The client secret is never part of this request or response. Requires a management token for `account_id` with `update:clients`.
2288
+ *
2289
+ * @throws {FaableApiError} `account_mismatch` (400) — The `account_id` in the body is not the account the request is scoped to (`x-faableauth-account`).
2290
+ * @throws {FaableApiError} `connect_redirect_uri_missing` (400) — The client's callbacks do not include `<site_url>/wp-login.php?faable-auth=callback`.
2291
+ * @throws {FaableApiError} `invalid_site_url` (400) — `site_url` is not an absolute http(s) URL without query string or fragment.
2292
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
2293
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
2294
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
2295
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
2296
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
2297
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
2298
+ * @throws {FaableApiError} `client_not_found` (404) — No client with that `client_id`.
2299
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
2300
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
2301
+ */
2302
+ connectCreateHandoff(data: OpBody<"connect/createHandoff">): Promise<{
2303
+ code: string;
2304
+ expires_at: string;
2305
+ }>;
2274
2306
  /**
2275
2307
  * `POST /connection` — operationId: `connection/create`
2276
2308
  *
@@ -621,6 +621,29 @@ export class GeneratedFaableAuthApi extends FaableApi {
621
621
  requireId("client_id", client_id);
622
622
  return this.fetcher.post(`/client/${client_id}`, data);
623
623
  }
624
+ /**
625
+ * `POST /connect/handoff` — operationId: `connect/createHandoff`
626
+ *
627
+ * Create a one-time handoff of a client’s credentials
628
+ *
629
+ * Used by the dashboard in the «Connect with Faable» flow. Checks that `client_id` belongs to `account_id` and that its callbacks contain `<site_url>/wp-login.php?faable-auth=callback`, then stores a one-time handoff bound to the PKCE `code_challenge`, valid for 10 minutes. The response `code` is sent to the site, which redeems it with `POST /connect/exchange`. The client secret is never part of this request or response. Requires a management token for `account_id` with `update:clients`.
630
+ *
631
+ * @throws {FaableApiError} `account_mismatch` (400) — The `account_id` in the body is not the account the request is scoped to (`x-faableauth-account`).
632
+ * @throws {FaableApiError} `connect_redirect_uri_missing` (400) — The client's callbacks do not include `<site_url>/wp-login.php?faable-auth=callback`.
633
+ * @throws {FaableApiError} `invalid_site_url` (400) — `site_url` is not an absolute http(s) URL without query string or fragment.
634
+ * @throws {FaableApiError} `validation_error` (400) — The body, query or path failed schema validation. `details.issues` lists each failing field.
635
+ * @throws {FaableApiError} `unauthorized` (401) — The request carries no valid credentials.
636
+ * @throws {FaableApiError} `forbidden` (403) — The credentials are valid but do not allow this operation.
637
+ * @throws {FaableApiError} `insufficient_scope` (403) — The token lacks a scope this operation requires. `message` names it.
638
+ * @throws {FaableApiError} `user_suspended` (403) — The user is suspended and cannot sign in or be modified.
639
+ * @throws {FaableApiError} `account_not_found` (404) — No Auth Account matches the request (domain, header or token).
640
+ * @throws {FaableApiError} `client_not_found` (404) — No client with that `client_id`.
641
+ * @throws {FaableApiError} `too_many_requests` (429) — Rate limit exceeded. Honour the `Retry-After` header.
642
+ * @throws {FaableApiError} `internal_error` (500) — Unexpected server error. Retry later; the request id is logged.
643
+ */
644
+ connectCreateHandoff(data) {
645
+ return this.fetcher.post(`/connect/handoff`, data);
646
+ }
624
647
  /**
625
648
  * `POST /connection` — operationId: `connection/create`
626
649
  *
@@ -2477,6 +2477,46 @@ export interface paths {
2477
2477
  patch?: never;
2478
2478
  trace?: never;
2479
2479
  };
2480
+ "/connect/handoff": {
2481
+ parameters: {
2482
+ query?: never;
2483
+ header?: never;
2484
+ path?: never;
2485
+ cookie?: never;
2486
+ };
2487
+ get?: never;
2488
+ put?: never;
2489
+ /**
2490
+ * Create a one-time handoff of a client’s credentials
2491
+ * @description Used by the dashboard in the «Connect with Faable» flow. Checks that `client_id` belongs to `account_id` and that its callbacks contain `<site_url>/wp-login.php?faable-auth=callback`, then stores a one-time handoff bound to the PKCE `code_challenge`, valid for 10 minutes. The response `code` is sent to the site, which redeems it with `POST /connect/exchange`. The client secret is never part of this request or response. Requires a management token for `account_id` with `update:clients`.
2492
+ */
2493
+ post: operations["connect/createHandoff"];
2494
+ delete?: never;
2495
+ options?: never;
2496
+ head?: never;
2497
+ patch?: never;
2498
+ trace?: never;
2499
+ };
2500
+ "/connect/exchange": {
2501
+ parameters: {
2502
+ query?: never;
2503
+ header?: never;
2504
+ path?: never;
2505
+ cookie?: never;
2506
+ };
2507
+ get?: never;
2508
+ put?: never;
2509
+ /**
2510
+ * Redeem a connect handoff for the client’s credentials
2511
+ * @description Server-to-server, unauthenticated: the PKCE `code_verifier` is the proof. Returns the credentials of the client the handoff names, once — a second redemption answers 410 `handoff_used`. Errors carry `error` (same value as `error_code`). Responses are `Cache-Control: no-store`.
2512
+ */
2513
+ post: operations["connect/exchange"];
2514
+ delete?: never;
2515
+ options?: never;
2516
+ head?: never;
2517
+ patch?: never;
2518
+ trace?: never;
2519
+ };
2480
2520
  "/passwordless/verify_redirect": {
2481
2521
  parameters: {
2482
2522
  query?: never;
@@ -6197,6 +6237,8 @@ export interface components {
6197
6237
  login_flow?: string | null;
6198
6238
  /** @description Audience used when a client_credentials token request sends none (e.g. `faable:management:<account_id>`). An explicit `audience` in the request wins. Absent = `${iss}/userinfo`. */
6199
6239
  default_audience?: string | null;
6240
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. */
6241
+ management_scopes?: string[];
6200
6242
  saml_sp?: {
6201
6243
  /** @description Whether this client answers SAML requests. Off keeps the configuration but every /saml route of the client returns 404. */
6202
6244
  enabled: boolean;
@@ -6246,6 +6288,8 @@ export interface components {
6246
6288
  web_origins?: string[];
6247
6289
  initiate_login_uri?: string;
6248
6290
  grant_types?: ("authorization_code" | "client_credentials" | "refresh_token" | "password" | "http://auth0.com/oauth/grant-type/passwordless/otp" | "urn:ietf:params:oauth:grant-type:token-exchange" | "urn:ietf:params:oauth:grant-type:device_code" | "http://auth0.com/oauth/grant-type/mfa-otp" | "http://auth0.com/oauth/grant-type/mfa-recovery-code")[];
6291
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. Only scopes your own token holds can be granted. */
6292
+ management_scopes?: string[];
6249
6293
  /** @description Add Metadata */
6250
6294
  metadata?: {
6251
6295
  [key: string]: unknown;
@@ -6351,6 +6395,8 @@ export interface components {
6351
6395
  login_flow?: string | null;
6352
6396
  /** @description Audience a client_credentials token request gets when it sends none. An explicit `audience` wins. `null` removes it. */
6353
6397
  default_audience?: string | null;
6398
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. Replaces the whole list; `[]` removes all. Only scopes your own token holds can be added. */
6399
+ management_scopes?: string[];
6354
6400
  saml_sp?: {
6355
6401
  /** @description Whether this client answers SAML requests. Off keeps the configuration but every /saml route of the client returns 404. */
6356
6402
  enabled: boolean;
@@ -8789,9 +8835,16 @@ export interface components {
8789
8835
  * - `not_a_webhook` (400): The operation only applies to `webhook` subscriptions.
8790
8836
  * - `delivery_not_found` (404): No webhook delivery with that id for this subscription.
8791
8837
  * - `delivery_in_progress` (409): The delivery is being attempted right now; retry the redeliver in a minute.
8838
+ * - `account_mismatch` (400): The `account_id` in the body is not the account the request is scoped to (`x-faableauth-account`).
8839
+ * - `connect_redirect_uri_missing` (400): The client's callbacks do not include `<site_url>/wp-login.php?faable-auth=callback`.
8840
+ * - `invalid_site_url` (400): `site_url` is not an absolute http(s) URL without query string or fragment.
8841
+ * - `handoff_not_found` (404): No connect handoff matches that code.
8842
+ * - `handoff_expired` (410): The connect handoff is past its expiry. Start again.
8843
+ * - `handoff_used` (410): The connect handoff was already redeemed.
8844
+ * - `invalid_code_verifier` (400): `code_verifier` does not match the `code_challenge` of the handoff.
8792
8845
  * @enum {string}
8793
8846
  */
8794
- 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" | "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" | "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_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";
8847
+ 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" | "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" | "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_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";
8795
8848
  /** @description Every error response has this shape. Branch on `error_code`, never on `message`: the message is written for a person and may change. */
8796
8849
  ErrorResponse: {
8797
8850
  /** @description The HTTP status, repeated. */
@@ -12965,6 +13018,8 @@ export interface operations {
12965
13018
  web_origins?: string[];
12966
13019
  initiate_login_uri?: string;
12967
13020
  grant_types?: ("authorization_code" | "client_credentials" | "refresh_token" | "password" | "http://auth0.com/oauth/grant-type/passwordless/otp" | "urn:ietf:params:oauth:grant-type:token-exchange" | "urn:ietf:params:oauth:grant-type:device_code" | "http://auth0.com/oauth/grant-type/mfa-otp" | "http://auth0.com/oauth/grant-type/mfa-recovery-code")[];
13021
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. Only scopes your own token holds can be granted. */
13022
+ management_scopes?: string[];
12968
13023
  /** @description Add Metadata */
12969
13024
  metadata?: {
12970
13025
  [key: string]: unknown;
@@ -13080,6 +13135,8 @@ export interface operations {
13080
13135
  login_flow?: string | null;
13081
13136
  /** @description Audience used when a client_credentials token request sends none (e.g. `faable:management:<account_id>`). An explicit `audience` in the request wins. Absent = `${iss}/userinfo`. */
13082
13137
  default_audience?: string | null;
13138
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. */
13139
+ management_scopes?: string[];
13083
13140
  saml_sp?: {
13084
13141
  /** @description Whether this client answers SAML requests. Off keeps the configuration but every /saml route of the client returns 404. */
13085
13142
  enabled: boolean;
@@ -13317,6 +13374,8 @@ export interface operations {
13317
13374
  login_flow?: string | null;
13318
13375
  /** @description Audience used when a client_credentials token request sends none (e.g. `faable:management:<account_id>`). An explicit `audience` in the request wins. Absent = `${iss}/userinfo`. */
13319
13376
  default_audience?: string | null;
13377
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. */
13378
+ management_scopes?: string[];
13320
13379
  saml_sp?: {
13321
13380
  /** @description Whether this client answers SAML requests. Off keeps the configuration but every /saml route of the client returns 404. */
13322
13381
  enabled: boolean;
@@ -13547,6 +13606,8 @@ export interface operations {
13547
13606
  login_flow?: string | null;
13548
13607
  /** @description Audience a client_credentials token request gets when it sends none. An explicit `audience` wins. `null` removes it. */
13549
13608
  default_audience?: string | null;
13609
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. Replaces the whole list; `[]` removes all. Only scopes your own token holds can be added. */
13610
+ management_scopes?: string[];
13550
13611
  saml_sp?: {
13551
13612
  /** @description Whether this client answers SAML requests. Off keeps the configuration but every /saml route of the client returns 404. */
13552
13613
  enabled: boolean;
@@ -13681,6 +13742,8 @@ export interface operations {
13681
13742
  login_flow?: string | null;
13682
13743
  /** @description Audience used when a client_credentials token request sends none (e.g. `faable:management:<account_id>`). An explicit `audience` in the request wins. Absent = `${iss}/userinfo`. */
13683
13744
  default_audience?: string | null;
13745
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. */
13746
+ management_scopes?: string[];
13684
13747
  saml_sp?: {
13685
13748
  /** @description Whether this client answers SAML requests. Off keeps the configuration but every /saml route of the client returns 404. */
13686
13749
  enabled: boolean;
@@ -13924,6 +13987,8 @@ export interface operations {
13924
13987
  login_flow?: string | null;
13925
13988
  /** @description Audience used when a client_credentials token request sends none (e.g. `faable:management:<account_id>`). An explicit `audience` in the request wins. Absent = `${iss}/userinfo`. */
13926
13989
  default_audience?: string | null;
13990
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. */
13991
+ management_scopes?: string[];
13927
13992
  saml_sp?: {
13928
13993
  /** @description Whether this client answers SAML requests. Off keeps the configuration but every /saml route of the client returns 404. */
13929
13994
  enabled: boolean;
@@ -14165,6 +14230,8 @@ export interface operations {
14165
14230
  login_flow?: string | null;
14166
14231
  /** @description Audience used when a client_credentials token request sends none (e.g. `faable:management:<account_id>`). An explicit `audience` in the request wins. Absent = `${iss}/userinfo`. */
14167
14232
  default_audience?: string | null;
14233
+ /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. */
14234
+ management_scopes?: string[];
14168
14235
  saml_sp?: {
14169
14236
  /** @description Whether this client answers SAML requests. Off keeps the configuration but every /saml route of the client returns 404. */
14170
14237
  enabled: boolean;
@@ -33509,6 +33576,245 @@ export interface operations {
33509
33576
  };
33510
33577
  };
33511
33578
  };
33579
+ "connect/createHandoff": {
33580
+ parameters: {
33581
+ query?: never;
33582
+ header?: never;
33583
+ path?: never;
33584
+ cookie?: never;
33585
+ };
33586
+ requestBody: {
33587
+ content: {
33588
+ "application/json": {
33589
+ /** @description The tenant that owns the client. */
33590
+ account_id: string;
33591
+ /** @description The OAuth `client_id` of the client created for the site (the resource `id`, `client_…`, is accepted too). */
33592
+ client_id: string;
33593
+ /** @description The site's PKCE challenge: BASE64URL(SHA256(code_verifier)), unpadded. */
33594
+ code_challenge: string;
33595
+ /** @enum {string} */
33596
+ code_challenge_method: "S256";
33597
+ /** @description The site's base URL. The client's callbacks must contain `<site_url>/wp-login.php?faable-auth=callback`. */
33598
+ site_url: string;
33599
+ };
33600
+ };
33601
+ };
33602
+ responses: {
33603
+ /** @description Default Response */
33604
+ 201: {
33605
+ headers: {
33606
+ [name: string]: unknown;
33607
+ };
33608
+ content: {
33609
+ "application/json": {
33610
+ /** @description One-time code for `POST /connect/exchange`. Shown once; only its hash is stored. */
33611
+ code: string;
33612
+ /** Format: date-time */
33613
+ expires_at: string;
33614
+ };
33615
+ };
33616
+ };
33617
+ /**
33618
+ * @description `account_mismatch` — The `account_id` in the body is not the account the request is scoped to (`x-faableauth-account`).
33619
+ *
33620
+ * `connect_redirect_uri_missing` — The client's callbacks do not include `<site_url>/wp-login.php?faable-auth=callback`.
33621
+ *
33622
+ * `invalid_site_url` — `site_url` is not an absolute http(s) URL without query string or fragment.
33623
+ *
33624
+ * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
33625
+ */
33626
+ 400: {
33627
+ headers: {
33628
+ [name: string]: unknown;
33629
+ };
33630
+ content: {
33631
+ "application/json": components["schemas"]["ErrorResponse"] & {
33632
+ /** @enum {string} */
33633
+ error_code?: "account_mismatch" | "connect_redirect_uri_missing" | "invalid_site_url" | "validation_error";
33634
+ };
33635
+ };
33636
+ };
33637
+ /** @description `unauthorized` — The request carries no valid credentials. */
33638
+ 401: {
33639
+ headers: {
33640
+ [name: string]: unknown;
33641
+ };
33642
+ content: {
33643
+ "application/json": components["schemas"]["ErrorResponse"] & {
33644
+ /** @enum {string} */
33645
+ error_code?: "unauthorized";
33646
+ };
33647
+ };
33648
+ };
33649
+ /**
33650
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
33651
+ *
33652
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
33653
+ *
33654
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
33655
+ */
33656
+ 403: {
33657
+ headers: {
33658
+ [name: string]: unknown;
33659
+ };
33660
+ content: {
33661
+ "application/json": components["schemas"]["ErrorResponse"] & {
33662
+ /** @enum {string} */
33663
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
33664
+ };
33665
+ };
33666
+ };
33667
+ /**
33668
+ * @description `account_not_found` — No Auth Account matches the request (domain, header or token).
33669
+ *
33670
+ * `client_not_found` — No client with that `client_id`.
33671
+ */
33672
+ 404: {
33673
+ headers: {
33674
+ [name: string]: unknown;
33675
+ };
33676
+ content: {
33677
+ "application/json": components["schemas"]["ErrorResponse"] & {
33678
+ /** @enum {string} */
33679
+ error_code?: "account_not_found" | "client_not_found";
33680
+ };
33681
+ };
33682
+ };
33683
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
33684
+ 429: {
33685
+ headers: {
33686
+ [name: string]: unknown;
33687
+ };
33688
+ content: {
33689
+ "application/json": components["schemas"]["ErrorResponse"] & {
33690
+ /** @enum {string} */
33691
+ error_code?: "too_many_requests";
33692
+ };
33693
+ };
33694
+ };
33695
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
33696
+ 500: {
33697
+ headers: {
33698
+ [name: string]: unknown;
33699
+ };
33700
+ content: {
33701
+ "application/json": components["schemas"]["ErrorResponse"] & {
33702
+ /** @enum {string} */
33703
+ error_code?: "internal_error";
33704
+ };
33705
+ };
33706
+ };
33707
+ };
33708
+ };
33709
+ "connect/exchange": {
33710
+ parameters: {
33711
+ query?: never;
33712
+ header?: never;
33713
+ path?: never;
33714
+ cookie?: never;
33715
+ };
33716
+ requestBody: {
33717
+ content: {
33718
+ "application/json": {
33719
+ code: string;
33720
+ /** @description The PKCE verifier behind the handoff `code_challenge`. */
33721
+ code_verifier: string;
33722
+ };
33723
+ };
33724
+ };
33725
+ responses: {
33726
+ /** @description Default Response */
33727
+ 200: {
33728
+ headers: {
33729
+ [name: string]: unknown;
33730
+ };
33731
+ content: {
33732
+ "application/json": {
33733
+ /** @description Base URL of the tenant: `<auth_domain>/.well-known/openid-configuration` is its discovery document. */
33734
+ auth_domain: string;
33735
+ client_id: string;
33736
+ client_secret: string;
33737
+ project_id: string | null;
33738
+ account_id: string;
33739
+ };
33740
+ };
33741
+ };
33742
+ /**
33743
+ * @description `invalid_code_verifier` — `code_verifier` does not match the `code_challenge` of the handoff.
33744
+ *
33745
+ * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
33746
+ */
33747
+ 400: {
33748
+ headers: {
33749
+ [name: string]: unknown;
33750
+ };
33751
+ content: {
33752
+ "application/json": components["schemas"]["ErrorResponse"] & {
33753
+ /** @enum {string} */
33754
+ error_code?: "invalid_code_verifier" | "validation_error";
33755
+ };
33756
+ };
33757
+ };
33758
+ /**
33759
+ * @description `handoff_not_found` — No connect handoff matches that code.
33760
+ *
33761
+ * `client_not_found` — No client with that `client_id`.
33762
+ *
33763
+ * `account_not_found` — No Auth Account matches the request (domain, header or token).
33764
+ */
33765
+ 404: {
33766
+ headers: {
33767
+ [name: string]: unknown;
33768
+ };
33769
+ content: {
33770
+ "application/json": components["schemas"]["ErrorResponse"] & {
33771
+ /** @enum {string} */
33772
+ error_code?: "handoff_not_found" | "client_not_found" | "account_not_found";
33773
+ };
33774
+ };
33775
+ };
33776
+ /**
33777
+ * @description `handoff_expired` — The connect handoff is past its expiry. Start again.
33778
+ *
33779
+ * `handoff_used` — The connect handoff was already redeemed.
33780
+ */
33781
+ 410: {
33782
+ headers: {
33783
+ [name: string]: unknown;
33784
+ };
33785
+ content: {
33786
+ "application/json": components["schemas"]["ErrorResponse"] & {
33787
+ /** @enum {string} */
33788
+ error_code?: "handoff_expired" | "handoff_used";
33789
+ };
33790
+ };
33791
+ };
33792
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
33793
+ 429: {
33794
+ headers: {
33795
+ [name: string]: unknown;
33796
+ };
33797
+ content: {
33798
+ "application/json": components["schemas"]["ErrorResponse"] & {
33799
+ /** @enum {string} */
33800
+ error_code?: "too_many_requests";
33801
+ };
33802
+ };
33803
+ };
33804
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
33805
+ 500: {
33806
+ headers: {
33807
+ [name: string]: unknown;
33808
+ };
33809
+ content: {
33810
+ "application/json": components["schemas"]["ErrorResponse"] & {
33811
+ /** @enum {string} */
33812
+ error_code?: "internal_error";
33813
+ };
33814
+ };
33815
+ };
33816
+ };
33817
+ };
33512
33818
  "passwordless/verify_redirect": {
33513
33819
  parameters: {
33514
33820
  query: {
package/dist/version.js CHANGED
@@ -9,13 +9,13 @@
9
9
  // login pages could not import the SDK at all. Same pattern as auth-js.
10
10
  //
11
11
  // The sentinels MUST stay byte-identical to the `from` values in `.releaserc`.
12
- export const version = "2.9.10";
12
+ export const version = "2.9.12";
13
13
  // Short git SHA of the released commit. The version dates a build; this names
14
14
  // the exact tree, so a canonical log line or an audit entry leads straight to
15
15
  // `git show <sha>`. Deliberately NOT hex: an unreleased build (dev, a local
16
16
  // link) cannot be mistaken for a real commit — auth only records values that
17
17
  // look like a SHA, and this one never will.
18
- export const commit = "048d40a";
18
+ export const commit = "959336c";
19
19
  // What this SDK writes in `x-faable-client`. Exported for a consumer that
20
20
  // builds a strategy on its own (outside `FaableAuthApi`) and still wants the
21
21
  // token request attributed — a bare `authClientCredentials` stamps only what
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/auth-sdk",
3
- "version": "2.9.10",
3
+ "version": "2.9.12",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",