authhero 8.17.3 → 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.
@@ -1,6 +1,6 @@
1
1
  import * as hono_utils_types from 'hono/utils/types';
2
2
  import * as _authhero_adapter_interfaces from '@authhero/adapter-interfaces';
3
- import { LoginSession, DataAdapters, RolePermissionInsert, AuthorizationResponseMode, AuthorizationResponseType, User, CustomDomain, ProxyRoute, ResourceServer, ResourceServerInsert, Role, RoleInsert, Connection, ConnectionInsert, Tenant, CreateTenantParams, Hook, TenantOperationKind, TenantOperation, CodeExecutor, SigningKey, Theme, Branding, AuthParams, CacheAdapter, EmailServiceAdapter, EmailServiceSendParams, AuditEvent, OutboxAdapter, HooksAdapter, LogsDataAdapter, LogInsert, UserDataAdapter, CustomDomainsAdapter, ProxyRoutesAdapter, ListParams, KeysAdapter, CodeExecutionResult } from '@authhero/adapter-interfaces';
3
+ import { LoginSession, DataAdapters, RolePermissionInsert, AuthorizationResponseMode, AuthorizationResponseType, User, CustomDomain, ProxyRoute, ResourceServer, ResourceServerInsert, Role, RoleInsert, Connection, ConnectionInsert, Tenant, CreateTenantParams, Hook, TenantOperationKind, TenantOperation, CodeExecutor, SigningKey, Theme, Branding, AuthParams, CacheAdapter, EmailServiceAdapter, EmailServiceSendParams, AuditEvent, OutboxAdapter, HooksAdapter, Client, LogsDataAdapter, LogInsert, UserDataAdapter, CustomDomainsAdapter, ProxyRoutesAdapter, ListParams, KeysAdapter, CodeExecutionResult } from '@authhero/adapter-interfaces';
4
4
  export * from '@authhero/adapter-interfaces';
5
5
  import * as hono_types from 'hono/types';
6
6
  import * as hono_utils_http_status from 'hono/utils/http-status';
@@ -2322,6 +2322,71 @@ interface CreateDefaultDestinationsConfig {
2322
2322
  */
2323
2323
  declare function createDefaultDestinations(config: CreateDefaultDestinationsConfig): EventDestination[];
2324
2324
 
2325
+ /**
2326
+ * Whether a client can anchor interactive, user-facing flows (universal login,
2327
+ * the DCR `/connect/start` consent bounce, etc.).
2328
+ *
2329
+ * A client is considered interactive unless it is explicitly machine-to-machine:
2330
+ * `non_interactive`/`resource_server` app types, or a grant list that only
2331
+ * allows `client_credentials`. Clients with no explicit `grant_types` are
2332
+ * treated as interactive — that matches how a freshly created "Default App"
2333
+ * (which relies on the authorize flow) behaves in AuthHero and Auth0.
2334
+ */
2335
+ declare function isInteractiveClient(client: Pick<Client, "app_type" | "grant_types">): boolean;
2336
+ /** A single Management API scope entry (`{ value, description }`). */
2337
+ interface ManagementApiScope {
2338
+ value: string;
2339
+ description?: string;
2340
+ }
2341
+ interface ProvisionDefaultClientsOptions {
2342
+ /** Display name for an auto-created Default App. Defaults to "Default App". */
2343
+ defaultAppName?: string;
2344
+ /** Callback URLs for an auto-created Default App. */
2345
+ callbacks?: string[];
2346
+ /** Allowed logout URLs for an auto-created Default App. */
2347
+ allowedLogoutUrls?: string[];
2348
+ /** Allowed web origins for an auto-created Default App. */
2349
+ webOrigins?: string[];
2350
+ /**
2351
+ * Also provision an M2M "API Explorer" client authorized against the
2352
+ * Management API (Auth0 parity). Defaults to `true`. Requires
2353
+ * `managementApiScopes` to seed the resource server when it is missing.
2354
+ */
2355
+ createManagementClient?: boolean;
2356
+ /** Management API identifier. Defaults to `urn:authhero:management`. */
2357
+ managementApiIdentifier?: string;
2358
+ /**
2359
+ * Scopes used to seed the Management API resource server when it does not
2360
+ * yet exist, and to authorize the M2M client's grant. When omitted, the
2361
+ * resource server is assumed to already exist and the grant is created with
2362
+ * no explicit scope.
2363
+ */
2364
+ managementApiScopes?: ManagementApiScope[];
2365
+ /** Emit progress logs (used by the seed script). */
2366
+ debug?: boolean;
2367
+ }
2368
+ interface ProvisionDefaultClientsResult {
2369
+ /** The client the tenant's `default_client_id` now points at. */
2370
+ defaultClientId: string;
2371
+ /** The auto-provisioned M2M Management API client, if one was created/found. */
2372
+ managementClientId?: string;
2373
+ }
2374
+ /**
2375
+ * Ensures a tenant has a designated interactive default client and (optionally)
2376
+ * an M2M Management API client, then points `tenant.default_client_id` at the
2377
+ * former.
2378
+ *
2379
+ * Idempotent and import-safe:
2380
+ * - Respects an already-set, still-valid `default_client_id`.
2381
+ * - Reuses an existing interactive client instead of creating a duplicate.
2382
+ * - Skips the M2M client when one already exists.
2383
+ *
2384
+ * Shared by every tenant-creation path (the seed/bootstrap script and the
2385
+ * multi-tenancy provisioning hook) so new tenants come with a sensible anchor
2386
+ * client by construction — see issue #1007.
2387
+ */
2388
+ declare function provisionDefaultClients(adapters: DataAdapters, tenantId: string, options?: ProvisionDefaultClientsOptions): Promise<ProvisionDefaultClientsResult>;
2389
+
2325
2390
  interface RunOutboxRelayConfig {
2326
2391
  /** Same `DataAdapters` passed to `init()`. Must include `outbox` to drain. */
2327
2392
  dataAdapter: DataAdapters;
@@ -9862,7 +9927,7 @@ declare function init(config: AuthHeroConfig): {
9862
9927
  };
9863
9928
  };
9864
9929
  output: {
9865
- prompt: "status" | "organizations" | "signup" | "login" | "mfa" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "common" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
9930
+ prompt: "status" | "organizations" | "signup" | "mfa" | "login" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "common" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
9866
9931
  language: string;
9867
9932
  }[];
9868
9933
  outputFormat: "json";
@@ -9900,7 +9965,7 @@ declare function init(config: AuthHeroConfig): {
9900
9965
  $get: {
9901
9966
  input: {
9902
9967
  param: {
9903
- prompt: "status" | "organizations" | "signup" | "login" | "mfa" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "common" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
9968
+ prompt: "status" | "organizations" | "signup" | "mfa" | "login" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "common" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
9904
9969
  language: string;
9905
9970
  };
9906
9971
  } & {
@@ -9922,7 +9987,7 @@ declare function init(config: AuthHeroConfig): {
9922
9987
  $put: {
9923
9988
  input: {
9924
9989
  param: {
9925
- prompt: "status" | "organizations" | "signup" | "login" | "mfa" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "common" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
9990
+ prompt: "status" | "organizations" | "signup" | "mfa" | "login" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "common" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
9926
9991
  language: string;
9927
9992
  };
9928
9993
  } & {
@@ -9946,7 +10011,7 @@ declare function init(config: AuthHeroConfig): {
9946
10011
  $delete: {
9947
10012
  input: {
9948
10013
  param: {
9949
- prompt: "status" | "organizations" | "signup" | "login" | "mfa" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "common" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
10014
+ prompt: "status" | "organizations" | "signup" | "mfa" | "login" | "login-id" | "login-password" | "signup-id" | "signup-password" | "reset-password" | "consent" | "mfa-push" | "mfa-otp" | "mfa-voice" | "mfa-phone" | "mfa-webauthn" | "mfa-email" | "mfa-recovery-code" | "device-flow" | "email-verification" | "email-otp-challenge" | "invitation" | "common" | "passkeys" | "captcha" | "custom-form" | "login-passwordless" | "mfa-login-options";
9950
10015
  language: string;
9951
10016
  };
9952
10017
  } & {
@@ -10844,7 +10909,7 @@ declare function init(config: AuthHeroConfig): {
10844
10909
  tenant_id: string;
10845
10910
  created_at: string;
10846
10911
  updated_at: string;
10847
- deploymentStatus: "deployed" | "failed" | "not_required";
10912
+ deploymentStatus: "failed" | "deployed" | "not_required";
10848
10913
  secrets?: {
10849
10914
  [x: string]: string;
10850
10915
  } | undefined;
@@ -10934,7 +10999,7 @@ declare function init(config: AuthHeroConfig): {
10934
10999
  tenant_id: string;
10935
11000
  created_at: string;
10936
11001
  updated_at: string;
10937
- deploymentStatus: "deployed" | "failed" | "not_required";
11002
+ deploymentStatus: "failed" | "deployed" | "not_required";
10938
11003
  secrets?: {
10939
11004
  [x: string]: string;
10940
11005
  } | undefined;
@@ -14541,6 +14606,7 @@ declare function init(config: AuthHeroConfig): {
14541
14606
  permissions: {
14542
14607
  permission_name: string;
14543
14608
  resource_server_identifier: string;
14609
+ organization_id?: string | undefined;
14544
14610
  }[];
14545
14611
  };
14546
14612
  };
@@ -14565,6 +14631,7 @@ declare function init(config: AuthHeroConfig): {
14565
14631
  permissions: {
14566
14632
  permission_name: string;
14567
14633
  resource_server_identifier: string;
14634
+ organization_id?: string | undefined;
14568
14635
  }[];
14569
14636
  };
14570
14637
  };
@@ -16200,7 +16267,7 @@ declare function init(config: AuthHeroConfig): {
16200
16267
  output: {
16201
16268
  id: string;
16202
16269
  trigger_id: string;
16203
- status: "unspecified" | "pending" | "final" | "partial" | "canceled" | "suspended";
16270
+ status: "pending" | "unspecified" | "final" | "partial" | "canceled" | "suspended";
16204
16271
  results: {
16205
16272
  action_name: string;
16206
16273
  error: {
@@ -16247,7 +16314,7 @@ declare function init(config: AuthHeroConfig): {
16247
16314
  logs: {
16248
16315
  action_name: string;
16249
16316
  lines: {
16250
- level: "error" | "log" | "info" | "warn" | "debug";
16317
+ level: "error" | "log" | "debug" | "info" | "warn";
16251
16318
  message: string;
16252
16319
  }[];
16253
16320
  }[];
@@ -16914,7 +16981,7 @@ declare function init(config: AuthHeroConfig): {
16914
16981
  args: hono_utils_types.JSONValue[];
16915
16982
  }[];
16916
16983
  logs: {
16917
- level: "error" | "log" | "info" | "warn" | "debug";
16984
+ level: "error" | "log" | "debug" | "info" | "warn";
16918
16985
  message: string;
16919
16986
  }[];
16920
16987
  error?: string | undefined;
@@ -17666,11 +17733,11 @@ declare function init(config: AuthHeroConfig): {
17666
17733
  state?: string | undefined;
17667
17734
  response_type?: _authhero_adapter_interfaces.AuthorizationResponseType | undefined;
17668
17735
  response_mode?: _authhero_adapter_interfaces.AuthorizationResponseMode | undefined;
17669
- prompt?: string | undefined;
17670
17736
  act_as?: string | undefined;
17671
17737
  redirect_uri?: string | undefined;
17672
17738
  organization?: string | undefined;
17673
17739
  nonce?: string | undefined;
17740
+ prompt?: string | undefined;
17674
17741
  code_challenge_method?: _authhero_adapter_interfaces.CodeChallengeMethod | undefined;
17675
17742
  code_challenge?: string | undefined;
17676
17743
  ui_locales?: string | undefined;
@@ -17702,11 +17769,11 @@ declare function init(config: AuthHeroConfig): {
17702
17769
  state?: string | undefined;
17703
17770
  response_type?: _authhero_adapter_interfaces.AuthorizationResponseType | undefined;
17704
17771
  response_mode?: _authhero_adapter_interfaces.AuthorizationResponseMode | undefined;
17705
- prompt?: string | undefined;
17706
17772
  act_as?: string | undefined;
17707
17773
  redirect_uri?: string | undefined;
17708
17774
  organization?: string | undefined;
17709
17775
  nonce?: string | undefined;
17776
+ prompt?: string | undefined;
17710
17777
  code_challenge_method?: _authhero_adapter_interfaces.CodeChallengeMethod | undefined;
17711
17778
  code_challenge?: string | undefined;
17712
17779
  ui_locales?: string | undefined;
@@ -19783,5 +19850,5 @@ declare function init(config: AuthHeroConfig): {
19783
19850
  createX509Certificate: typeof createX509Certificate;
19784
19851
  };
19785
19852
 
19786
- export { AppLogo, AuthLayout, Button$1 as Button, Button as ButtonUI, CONTROL_PLANE_SYNC_EVENT_PREFIX, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Card as CardUI, ControlPlaneSyncDestination, EmailValidatedPage, EnterCodePage, EnterPasswordPage, ErrorMessage, Footer, ForgotPasswordPage, ForgotPasswordSentPage, FormComponent, GoBack, Google as GoogleLogo, Icon, IdentifierForm, IdentifierPage, Input as InputUI, InvalidSessionPage as InvalidSession, Label as LabelUI, Layout, LocalCodeExecutor, LogsDestination, MANAGEMENT_API_AUDIENCE, MANAGEMENT_API_SCOPES, MailgunEmailService, MessagePage as Message, PostmarkEmailService, PreSignUpConfirmationPage, PreSignupPage as PreSignUpPage, RegistrationFinalizerDestination, ResendEmailService, ResetPasswordPage, SignupPage as SignUpPage, SocialButton, Spinner, Trans, USERNAME_PASSWORD_PROVIDER, UnverifiedEmailPage, UserNotFound as UserNotFoundPage, VippsLogo, WebhookDestination, addEntityHooks, backfillProxyHostsToKv, cleanupOutbox, cleanupSessions, cleanupUserSessions, clientInfoMiddleware, createApplySyncEvents, createAuthMiddleware, createDefaultDestinations, createEncryptedDataAdapter, createEncryptedDataAdapterWithKeyRing, createInMemoryCache, decryptField, decryptFieldWithRing, deepMergePatch, drainOutbox, encryptField, encryptFieldWithRing, ensureMutableResponse, fetchAll, init, injectTailwindCSS, isAllowedIssuer, isEncrypted, listControlPlaneKeys, loadEncryptionKey, mailgunCredentialsSchema, parseKeyId, postmarkCredentialsSchema, index_d as preDefinedHooks, resendCredentialsSchema, resolveSigningKeyMode, resolveSigningKeys, runOutboxRelay, seed, tailwindCss, tenantMiddleware, toMutableResponse, verifyControlPlaneToken, waitUntil, wrapProxyAdaptersWithKvPublish };
19787
- export type { AuthHeroConfig, BackfillProxyHostsOptions, BackfillResult, ControlPlaneSyncDestinationOptions, CreateApplySyncEventsOptions, CreateDefaultDestinationsConfig, EncryptKeyIdResolver, EnsureUsernameOptions, EntityHookContext, EntityHooks, EntityHooksConfig, EventDestination, FetchAllOptions, GetServiceToken, HookEvent, HookRequest, Hooks, InMemoryCacheConfig, IssuerResolver, KeyRing, KvPublishOptions, MailgunCredentials, MailgunEmailServiceOptions, ManagementApiExtension, ManagementAudienceResolver, OnExecuteCredentialsExchange, OnExecuteCredentialsExchangeAPI, OnExecutePostLogin, OnExecutePostLoginAPI, OnExecutePostUserDeletion, OnExecutePostUserDeletionAPI, OnExecutePostUserRegistration, OnExecutePostUserRegistrationAPI, OnExecutePostUserUpdate, OnExecutePostUserUpdateAPI, OnExecutePreUserDeletion, OnExecutePreUserDeletionAPI, OnExecutePreUserRegistration, OnExecutePreUserRegistrationAPI, OnExecutePreUserUpdate, OnExecutePreUserUpdateAPI, OnExecuteValidateRegistrationUsername, OnExecuteValidateRegistrationUsernameAPI, OnFetchUserInfo, OnFetchUserInfoAPI, OutboxCleanupParams, OutboxConfig, PostmarkCredentials, PostmarkEmailServiceOptions, ResendCredentials, ResendEmailServiceOptions, ResolveSigningKeysOptions, RolePermissionHooks, RunOutboxRelayConfig, SeedOptions, SeedResult, SigningKeyMode, SigningKeyModeOption, SigningKeyModeResolver, SyncEntity, SyncEvent, SyncOp, TenantOperationExecutorBinding, TokenAPI, Transaction, UserInfoEvent, UserLinkingMode, UserLinkingModeOption, UserLinkingModeResolver, UserSessionCleanupParams, UsernamePasswordProviderResolver, VerifyControlPlaneTokenOptions, VerifyControlPlaneTokenResult, WebhookDestinationOptions, WebhookInvoker, WebhookInvokerParams, WrappedProxyAdapters };
19853
+ export { AppLogo, AuthLayout, Button$1 as Button, Button as ButtonUI, CONTROL_PLANE_SYNC_EVENT_PREFIX, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Card as CardUI, ControlPlaneSyncDestination, EmailValidatedPage, EnterCodePage, EnterPasswordPage, ErrorMessage, Footer, ForgotPasswordPage, ForgotPasswordSentPage, FormComponent, GoBack, Google as GoogleLogo, Icon, IdentifierForm, IdentifierPage, Input as InputUI, InvalidSessionPage as InvalidSession, Label as LabelUI, Layout, LocalCodeExecutor, LogsDestination, MANAGEMENT_API_AUDIENCE, MANAGEMENT_API_SCOPES, MailgunEmailService, MessagePage as Message, PostmarkEmailService, PreSignUpConfirmationPage, PreSignupPage as PreSignUpPage, RegistrationFinalizerDestination, ResendEmailService, ResetPasswordPage, SignupPage as SignUpPage, SocialButton, Spinner, Trans, USERNAME_PASSWORD_PROVIDER, UnverifiedEmailPage, UserNotFound as UserNotFoundPage, VippsLogo, WebhookDestination, addEntityHooks, backfillProxyHostsToKv, cleanupOutbox, cleanupSessions, cleanupUserSessions, clientInfoMiddleware, createApplySyncEvents, createAuthMiddleware, createDefaultDestinations, createEncryptedDataAdapter, createEncryptedDataAdapterWithKeyRing, createInMemoryCache, decryptField, decryptFieldWithRing, deepMergePatch, drainOutbox, encryptField, encryptFieldWithRing, ensureMutableResponse, fetchAll, init, injectTailwindCSS, isAllowedIssuer, isEncrypted, isInteractiveClient, listControlPlaneKeys, loadEncryptionKey, mailgunCredentialsSchema, parseKeyId, postmarkCredentialsSchema, index_d as preDefinedHooks, provisionDefaultClients, resendCredentialsSchema, resolveSigningKeyMode, resolveSigningKeys, runOutboxRelay, seed, tailwindCss, tenantMiddleware, toMutableResponse, verifyControlPlaneToken, waitUntil, wrapProxyAdaptersWithKvPublish };
19854
+ export type { AuthHeroConfig, BackfillProxyHostsOptions, BackfillResult, ControlPlaneSyncDestinationOptions, CreateApplySyncEventsOptions, CreateDefaultDestinationsConfig, EncryptKeyIdResolver, EnsureUsernameOptions, EntityHookContext, EntityHooks, EntityHooksConfig, EventDestination, FetchAllOptions, GetServiceToken, HookEvent, HookRequest, Hooks, InMemoryCacheConfig, IssuerResolver, KeyRing, KvPublishOptions, MailgunCredentials, MailgunEmailServiceOptions, ManagementApiExtension, ManagementApiScope, ManagementAudienceResolver, OnExecuteCredentialsExchange, OnExecuteCredentialsExchangeAPI, OnExecutePostLogin, OnExecutePostLoginAPI, OnExecutePostUserDeletion, OnExecutePostUserDeletionAPI, OnExecutePostUserRegistration, OnExecutePostUserRegistrationAPI, OnExecutePostUserUpdate, OnExecutePostUserUpdateAPI, OnExecutePreUserDeletion, OnExecutePreUserDeletionAPI, OnExecutePreUserRegistration, OnExecutePreUserRegistrationAPI, OnExecutePreUserUpdate, OnExecutePreUserUpdateAPI, OnExecuteValidateRegistrationUsername, OnExecuteValidateRegistrationUsernameAPI, OnFetchUserInfo, OnFetchUserInfoAPI, OutboxCleanupParams, OutboxConfig, PostmarkCredentials, PostmarkEmailServiceOptions, ProvisionDefaultClientsOptions, ProvisionDefaultClientsResult, ResendCredentials, ResendEmailServiceOptions, ResolveSigningKeysOptions, RolePermissionHooks, RunOutboxRelayConfig, SeedOptions, SeedResult, SigningKeyMode, SigningKeyModeOption, SigningKeyModeResolver, SyncEntity, SyncEvent, SyncOp, TenantOperationExecutorBinding, TokenAPI, Transaction, UserInfoEvent, UserLinkingMode, UserLinkingModeOption, UserLinkingModeResolver, UserSessionCleanupParams, UsernamePasswordProviderResolver, VerifyControlPlaneTokenOptions, VerifyControlPlaneTokenResult, WebhookDestinationOptions, WebhookInvoker, WebhookInvokerParams, WrappedProxyAdapters };