authhero 9.23.1 → 9.24.1

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.
Files changed (74) hide show
  1. package/dist/assets/u/widget/authhero-widget.esm.js +1 -1
  2. package/dist/assets/u/widget/index.esm.js +1 -1
  3. package/dist/assets/u/widget/{p-91459994.entry.js → p-210f06bf.entry.js} +1 -1
  4. package/dist/authhero.cjs +116 -116
  5. package/dist/authhero.d.ts +1433 -278
  6. package/dist/authhero.mjs +36511 -35845
  7. package/dist/tsconfig.types.tsbuildinfo +1 -1
  8. package/dist/types/authentication-flows/password.d.ts +6 -0
  9. package/dist/types/authentication-flows/passwordless.d.ts +5 -5
  10. package/dist/types/generated/locale-types.d.ts +1 -0
  11. package/dist/types/helpers/logging.d.ts +7 -0
  12. package/dist/types/helpers/outbox-destinations/log-streams.d.ts +2 -0
  13. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  14. package/dist/types/helpers/session-notice.d.ts +17 -0
  15. package/dist/types/helpers/users.d.ts +5 -0
  16. package/dist/types/index.d.ts +1433 -278
  17. package/dist/types/routes/auth-api/index.d.ts +26 -26
  18. package/dist/types/routes/auth-api/passwordless.d.ts +10 -10
  19. package/dist/types/routes/auth-api/revoke.d.ts +6 -6
  20. package/dist/types/routes/auth-api/token.d.ts +10 -10
  21. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  22. package/dist/types/routes/management-api/actions.d.ts +29 -3
  23. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  24. package/dist/types/routes/management-api/branding.d.ts +5 -5
  25. package/dist/types/routes/management-api/clients.d.ts +8 -8
  26. package/dist/types/routes/management-api/connections.d.ts +7 -7
  27. package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
  28. package/dist/types/routes/management-api/email-templates.d.ts +20 -20
  29. package/dist/types/routes/management-api/emails.d.ts +2 -2
  30. package/dist/types/routes/management-api/failed-events.d.ts +97 -3
  31. package/dist/types/routes/management-api/flows.d.ts +52 -0
  32. package/dist/types/routes/management-api/forms.d.ts +735 -126
  33. package/dist/types/routes/management-api/grants.d.ts +11 -0
  34. package/dist/types/routes/management-api/guardian.d.ts +5 -5
  35. package/dist/types/routes/management-api/helpers.d.ts +34 -4
  36. package/dist/types/routes/management-api/hooks.d.ts +68 -4
  37. package/dist/types/routes/management-api/index.d.ts +1326 -269
  38. package/dist/types/routes/management-api/keys.d.ts +12 -12
  39. package/dist/types/routes/management-api/logs.d.ts +4 -4
  40. package/dist/types/routes/management-api/organizations.d.ts +66 -8
  41. package/dist/types/routes/management-api/prompts.d.ts +6 -6
  42. package/dist/types/routes/management-api/roles.d.ts +1 -1
  43. package/dist/types/routes/management-api/tenant-export-import.d.ts +5 -5
  44. package/dist/types/routes/management-api/tenants.d.ts +9 -9
  45. package/dist/types/routes/management-api/users.d.ts +166 -23
  46. package/dist/types/routes/saml/index.d.ts +98 -0
  47. package/dist/types/routes/saml/samlp.d.ts +98 -0
  48. package/dist/types/routes/universal-login/common.d.ts +10 -10
  49. package/dist/types/routes/universal-login/flow-api.d.ts +12 -12
  50. package/dist/types/routes/universal-login/form-node.d.ts +4 -4
  51. package/dist/types/routes/universal-login/screens/account-mfa-phone-enrollment.d.ts +0 -5
  52. package/dist/types/routes/universal-login/screens/account-mfa-totp-enrollment.d.ts +0 -5
  53. package/dist/types/routes/universal-login/screens/account-passkeys.d.ts +0 -5
  54. package/dist/types/routes/universal-login/screens/connect-tenant-select.d.ts +0 -10
  55. package/dist/types/routes/universal-login/screens/identifier.d.ts +0 -5
  56. package/dist/types/routes/universal-login/screens/login.d.ts +0 -8
  57. package/dist/types/routes/universal-login/screens/mfa-login-options.d.ts +0 -5
  58. package/dist/types/routes/universal-login/screens/mfa-phone-challenge.d.ts +0 -5
  59. package/dist/types/routes/universal-login/screens/mfa-phone-enrollment.d.ts +0 -5
  60. package/dist/types/routes/universal-login/screens/mfa-totp-challenge.d.ts +0 -5
  61. package/dist/types/routes/universal-login/screens/mfa-totp-enrollment.d.ts +0 -5
  62. package/dist/types/routes/universal-login/screens/passkey-challenge.d.ts +0 -14
  63. package/dist/types/routes/universal-login/screens/passkey-enrollment-nudge.d.ts +0 -15
  64. package/dist/types/routes/universal-login/screens/passkey-enrollment.d.ts +0 -9
  65. package/dist/types/routes/universal-login/screens/reset-password-code.d.ts +0 -9
  66. package/dist/types/routes/universal-login/screens/reset-password.d.ts +2 -6
  67. package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
  68. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  69. package/dist/types/state-machines/index.d.ts +3 -1
  70. package/dist/types/state-machines/login-session-data.d.ts +19 -0
  71. package/dist/types/state-machines/login-session.d.ts +67 -3
  72. package/dist/types/state-machines/password-reset.d.ts +46 -0
  73. package/dist/types/strategies/saml.d.ts +1 -1
  74. package/package.json +6 -6
@@ -19,6 +19,12 @@ export declare function clearFailedLogins(data: Bindings["data"], tenantId: stri
19
19
  * best-effort — the password is already changed by the time this runs.
20
20
  */
21
21
  export declare function recordPasswordReset(data: Bindings["data"], tenantId: string, user: User): Promise<void>;
22
+ /**
23
+ * The password has already changed. Failure to persist the completion notice or
24
+ * flow state must not turn that successful change into a reported failure.
25
+ * The credential was consumed before the password write and remains single-use.
26
+ */
27
+ export declare function recordPasswordResetCompletion(data: Bindings["data"], tenantId: string, loginSessionId: string, requestId: string, fields?: Omit<Partial<LoginSession>, "state_data">): Promise<void>;
22
28
  export declare function passwordGrant(ctx: Context<{
23
29
  Bindings: Bindings;
24
30
  Variables: Variables;
@@ -239,7 +239,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
239
239
  pushed_authorization_requests_supported?: boolean | undefined;
240
240
  authorization_response_iss_parameter_supported?: boolean | undefined;
241
241
  deployment_type?: "shared" | "wfp" | undefined;
242
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
242
+ provisioning_state?: "pending" | "failed" | "ready" | undefined;
243
243
  provisioning_error?: string | undefined;
244
244
  provisioning_state_changed_at?: string | undefined;
245
245
  bundle_configuration?: string | undefined;
@@ -287,7 +287,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
287
287
  } | undefined;
288
288
  } | undefined;
289
289
  mfa?: {
290
- policy?: "never" | "always" | undefined;
290
+ policy?: "always" | "never" | undefined;
291
291
  factors?: {
292
292
  sms: boolean;
293
293
  otp: boolean;
@@ -386,7 +386,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
386
386
  } | undefined;
387
387
  unique?: boolean | undefined;
388
388
  profile_required?: boolean | undefined;
389
- verification_method?: "code" | "link" | undefined;
389
+ verification_method?: "link" | "code" | undefined;
390
390
  } | undefined;
391
391
  username?: {
392
392
  identifier?: {
@@ -561,8 +561,8 @@ export declare function passwordlessGrantUser(ctx: Context<{
561
561
  } | undefined;
562
562
  authenticated_at?: string | undefined;
563
563
  };
564
- connectionType: "sms" | "email" | "username";
565
- authConnection: "sms" | "email" | "username";
564
+ connectionType: "username" | "email" | "sms";
565
+ authConnection: "username" | "email" | "sms";
566
566
  session_id: string | undefined;
567
567
  authParams: {
568
568
  audience?: string | undefined;
@@ -527,6 +527,7 @@ export interface LoginPasswordScreen {
527
527
  sessionExpired: () => string;
528
528
  tooManyRequests: () => string;
529
529
  unexpectedError: () => string;
530
+ passwordResetSuccess: () => string;
530
531
  }
531
532
  export interface LoginPasswordlessScreen {
532
533
  authMethodEmail: () => string;
@@ -70,6 +70,13 @@ export type LogParams = {
70
70
  * linking to the execution (Auth0 reaches executions via the tenant logs).
71
71
  */
72
72
  execution_id?: string;
73
+ /**
74
+ * The login session (the `state`) this event belongs to. Merged into
75
+ * `details` so one login flow can be traced across /authorize, /u/* and
76
+ * /samlp/* log entries. Defaults to `ctx.var.loginSession?.id` when the
77
+ * request has resolved a login session.
78
+ */
79
+ login_session_id?: string;
73
80
  /**
74
81
  * If true, wait for the log to complete before returning.
75
82
  * If false (default), execute logging asynchronously in the background.
@@ -32,6 +32,8 @@ interface LogStreamData {
32
32
  body?: unknown;
33
33
  };
34
34
  execution_id?: string;
35
+ login_session_id?: string;
36
+ [key: string]: unknown;
35
37
  };
36
38
  }
37
39
  interface LogStreamPayload {
@@ -14,9 +14,9 @@ export declare const USERINFO_RESERVED_CLAIMS: readonly ["iss", "sub", "aud", "e
14
14
  * vendor/tenant for downstream APIs while `sub` stays `auth-service`.
15
15
  * Client-bound mints keep `azp` locked (see below).
16
16
  */
17
- export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("sid" | "client_id" | "scope" | "tenant_id" | "org_name" | "sub" | "exp" | "iat" | "org_id" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "permissions" | "nbf" | "jti" | "act" | "requested_userinfo_claims" | "gty")[];
17
+ export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("sub" | "tenant_id" | "client_id" | "org_name" | "scope" | "permissions" | "org_id" | "sid" | "exp" | "iat" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "nbf" | "jti" | "act" | "requested_userinfo_claims" | "gty")[];
18
18
  /** Client-bound mints: `azp` must stay the registered client id. */
19
- export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("sid" | "client_id" | "scope" | "tenant_id" | "org_name" | "sub" | "exp" | "iat" | "org_id" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "azp" | "permissions" | "nbf" | "jti" | "act" | "requested_userinfo_claims" | "gty")[];
19
+ export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("sub" | "tenant_id" | "client_id" | "org_name" | "scope" | "permissions" | "org_id" | "sid" | "exp" | "iat" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "azp" | "nbf" | "jti" | "act" | "requested_userinfo_claims" | "gty")[];
20
20
  export type AccessTokenReservedClaim = (typeof ACCESS_TOKEN_RESERVED_CLAIMS)[number];
21
21
  export type IdTokenReservedClaim = (typeof ID_TOKEN_RESERVED_CLAIMS)[number];
22
22
  /**
@@ -0,0 +1,17 @@
1
+ import { DataAdapters, LoginSession } from "@authhero/adapter-interfaces";
2
+ /** Key under `state_data` holding a one-shot notice for the next screen. */
3
+ export declare const SESSION_NOTICE_STATE_KEY = "notice";
4
+ /**
5
+ * Notices a flow can leave on the login session for the screen the user lands
6
+ * on next. Stored as a code, never as text, so the screen translates it at
7
+ * render time and a language switch still shows it in the right language.
8
+ */
9
+ export type SessionNotice = "password_reset_success";
10
+ export declare function readSessionNotice(loginSession?: LoginSession | null): SessionNotice | undefined;
11
+ export declare function setSessionNotice(data: DataAdapters, tenantId: string, loginSession: LoginSession, notice: SessionNotice): Promise<void>;
12
+ /**
13
+ * Drops the notice once the user has moved past the screen it was meant for.
14
+ * Written as "" when nothing else is left in `state_data`: adapters skip
15
+ * `undefined` properties on update, so omitting the column would leave it be.
16
+ */
17
+ export declare function clearSessionNotice(data: DataAdapters, tenantId: string, loginSession: LoginSession): Promise<void>;
@@ -162,6 +162,11 @@ interface LinkUserToParams {
162
162
  * hook, or internal linking code — is safe by construction rather than by
163
163
  * remembering to call the right helper.
164
164
  *
165
+ * This performs several writes (repoint, and on promotion also unlink), so
166
+ * direct callers should pass an adapter bound to a transaction. The user-update
167
+ * hook already does this via `data.transaction`, so callers going through
168
+ * `users.update(id, { linked_to })` get atomicity automatically.
169
+ *
165
170
  * Returns the cluster root `userId` was actually linked to, which may differ
166
171
  * from the requested `primaryId`.
167
172
  */