authhero 8.17.4 → 8.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,65 @@
1
+ import { Client, DataAdapters } from "@authhero/adapter-interfaces";
2
+ /**
3
+ * Whether a client can anchor interactive, user-facing flows (universal login,
4
+ * the DCR `/connect/start` consent bounce, etc.).
5
+ *
6
+ * A client is considered interactive unless it is explicitly machine-to-machine:
7
+ * `non_interactive`/`resource_server` app types, or a grant list that only
8
+ * allows `client_credentials`. Clients with no explicit `grant_types` are
9
+ * treated as interactive — that matches how a freshly created "Default App"
10
+ * (which relies on the authorize flow) behaves in AuthHero and Auth0.
11
+ */
12
+ export declare function isInteractiveClient(client: Pick<Client, "app_type" | "grant_types">): boolean;
13
+ /** A single Management API scope entry (`{ value, description }`). */
14
+ export interface ManagementApiScope {
15
+ value: string;
16
+ description?: string;
17
+ }
18
+ export interface ProvisionDefaultClientsOptions {
19
+ /** Display name for an auto-created Default App. Defaults to "Default App". */
20
+ defaultAppName?: string;
21
+ /** Callback URLs for an auto-created Default App. */
22
+ callbacks?: string[];
23
+ /** Allowed logout URLs for an auto-created Default App. */
24
+ allowedLogoutUrls?: string[];
25
+ /** Allowed web origins for an auto-created Default App. */
26
+ webOrigins?: string[];
27
+ /**
28
+ * Also provision an M2M "API Explorer" client authorized against the
29
+ * Management API (Auth0 parity). Defaults to `true`. Requires
30
+ * `managementApiScopes` to seed the resource server when it is missing.
31
+ */
32
+ createManagementClient?: boolean;
33
+ /** Management API identifier. Defaults to `urn:authhero:management`. */
34
+ managementApiIdentifier?: string;
35
+ /**
36
+ * Scopes used to seed the Management API resource server when it does not
37
+ * yet exist, and to authorize the M2M client's grant. When omitted, the
38
+ * resource server is assumed to already exist and the grant is created with
39
+ * no explicit scope.
40
+ */
41
+ managementApiScopes?: ManagementApiScope[];
42
+ /** Emit progress logs (used by the seed script). */
43
+ debug?: boolean;
44
+ }
45
+ export interface ProvisionDefaultClientsResult {
46
+ /** The client the tenant's `default_client_id` now points at. */
47
+ defaultClientId: string;
48
+ /** The auto-provisioned M2M Management API client, if one was created/found. */
49
+ managementClientId?: string;
50
+ }
51
+ /**
52
+ * Ensures a tenant has a designated interactive default client and (optionally)
53
+ * an M2M Management API client, then points `tenant.default_client_id` at the
54
+ * former.
55
+ *
56
+ * Idempotent and import-safe:
57
+ * - Respects an already-set, still-valid `default_client_id`.
58
+ * - Reuses an existing interactive client instead of creating a duplicate.
59
+ * - Skips the M2M client when one already exists.
60
+ *
61
+ * Shared by every tenant-creation path (the seed/bootstrap script and the
62
+ * multi-tenancy provisioning hook) so new tenants come with a sensible anchor
63
+ * client by construction — see issue #1007.
64
+ */
65
+ export declare function provisionDefaultClients(adapters: DataAdapters, tenantId: string, options?: ProvisionDefaultClientsOptions): Promise<ProvisionDefaultClientsResult>;