authhero 9.24.0 → 9.25.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.
- package/dist/assets/u/widget/index.esm.js +1 -1
- package/dist/authhero.cjs +116 -116
- package/dist/authhero.d.ts +470 -178
- package/dist/authhero.mjs +36356 -35927
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/authentication-flows/password.d.ts +6 -0
- package/dist/types/authentication-flows/passwordless.d.ts +7 -3
- package/dist/types/generated/locale-types.d.ts +1 -0
- package/dist/types/helpers/audit-target-types.d.ts +26 -0
- package/dist/types/helpers/client.d.ts +12 -0
- package/dist/types/helpers/reserved-claims.d.ts +2 -2
- package/dist/types/helpers/session-notice.d.ts +17 -0
- package/dist/types/index.d.ts +455 -178
- package/dist/types/routes/auth-api/account.d.ts +2 -2
- package/dist/types/routes/auth-api/index.d.ts +26 -26
- package/dist/types/routes/auth-api/logout.d.ts +2 -2
- package/dist/types/routes/auth-api/oidc-logout.d.ts +3 -3
- package/dist/types/routes/auth-api/passwordless.d.ts +8 -8
- package/dist/types/routes/auth-api/token.d.ts +10 -10
- package/dist/types/routes/auth-api/well-known.d.ts +1 -1
- package/dist/types/routes/management-api/action-executions.d.ts +2 -2
- package/dist/types/routes/management-api/action-triggers.d.ts +8 -2
- package/dist/types/routes/management-api/actions.d.ts +45 -12
- package/dist/types/routes/management-api/branding.d.ts +14 -2
- package/dist/types/routes/management-api/clients.d.ts +8 -2
- package/dist/types/routes/management-api/connections.d.ts +30 -6
- package/dist/types/routes/management-api/email-templates.d.ts +18 -18
- package/dist/types/routes/management-api/emails.d.ts +18 -0
- package/dist/types/routes/management-api/failed-events.d.ts +27 -2
- package/dist/types/routes/management-api/flows.d.ts +8 -8
- package/dist/types/routes/management-api/guardian.d.ts +5 -5
- package/dist/types/routes/management-api/helpers.d.ts +25 -3
- package/dist/types/routes/management-api/hooks.d.ts +105 -0
- package/dist/types/routes/management-api/index.d.ts +406 -129
- package/dist/types/routes/management-api/keys.d.ts +12 -12
- package/dist/types/routes/management-api/log-streams.d.ts +6 -6
- package/dist/types/routes/management-api/logs.d.ts +4 -4
- package/dist/types/routes/management-api/organizations.d.ts +4 -4
- package/dist/types/routes/management-api/prompts.d.ts +12 -6
- package/dist/types/routes/management-api/resource-servers.d.ts +44 -20
- package/dist/types/routes/management-api/tenants.d.ts +4 -0
- package/dist/types/routes/management-api/token-exchange-profiles.d.ts +6 -6
- package/dist/types/routes/management-api/users.d.ts +18 -18
- package/dist/types/routes/saml/index.d.ts +6 -6
- package/dist/types/routes/saml/samlp.d.ts +6 -6
- package/dist/types/routes/universal-login/common.d.ts +18 -2
- package/dist/types/routes/universal-login/continue.d.ts +2 -2
- package/dist/types/routes/universal-login/identifier.d.ts +4 -4
- package/dist/types/routes/universal-login/impersonate.d.ts +4 -4
- package/dist/types/routes/universal-login/index.d.ts +10 -10
- package/dist/types/routes/universal-login/screens/account-mfa-phone-enrollment.d.ts +0 -5
- package/dist/types/routes/universal-login/screens/account-mfa-totp-enrollment.d.ts +0 -5
- package/dist/types/routes/universal-login/screens/account-passkeys.d.ts +0 -5
- package/dist/types/routes/universal-login/screens/connect-tenant-select.d.ts +0 -10
- package/dist/types/routes/universal-login/screens/identifier.d.ts +0 -5
- package/dist/types/routes/universal-login/screens/login-partials.d.ts +8 -0
- package/dist/types/routes/universal-login/screens/login.d.ts +0 -8
- package/dist/types/routes/universal-login/screens/mfa-login-options.d.ts +0 -5
- package/dist/types/routes/universal-login/screens/mfa-phone-challenge.d.ts +0 -5
- package/dist/types/routes/universal-login/screens/mfa-phone-enrollment.d.ts +0 -5
- package/dist/types/routes/universal-login/screens/mfa-totp-challenge.d.ts +0 -5
- package/dist/types/routes/universal-login/screens/mfa-totp-enrollment.d.ts +0 -5
- package/dist/types/routes/universal-login/screens/passkey-challenge.d.ts +0 -14
- package/dist/types/routes/universal-login/screens/passkey-enrollment-nudge.d.ts +0 -15
- package/dist/types/routes/universal-login/screens/passkey-enrollment.d.ts +0 -9
- package/dist/types/routes/universal-login/screens/reset-password-code.d.ts +0 -9
- package/dist/types/routes/universal-login/screens/reset-password.d.ts +2 -6
- package/dist/types/routes/universal-login/u2-index.d.ts +7 -7
- package/dist/types/routes/universal-login/u2-routes.d.ts +7 -7
- package/dist/types/state-machines/index.d.ts +3 -1
- package/dist/types/state-machines/login-session-data.d.ts +19 -0
- package/dist/types/state-machines/login-session.d.ts +67 -3
- package/dist/types/state-machines/password-reset.d.ts +46 -0
- package/dist/types/types/Variables.d.ts +3 -0
- package/dist/types/utils/jwks.d.ts +2 -2
- package/dist/types/utils/jwt.d.ts +2 -0
- 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;
|
|
@@ -136,6 +136,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
136
136
|
updated_at: string;
|
|
137
137
|
friendly_name: string;
|
|
138
138
|
id: string;
|
|
139
|
+
parent_tenant_id?: string | null | undefined;
|
|
139
140
|
audience?: string | undefined;
|
|
140
141
|
picture_url?: string | undefined;
|
|
141
142
|
support_email?: string | undefined;
|
|
@@ -386,7 +387,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
386
387
|
} | undefined;
|
|
387
388
|
unique?: boolean | undefined;
|
|
388
389
|
profile_required?: boolean | undefined;
|
|
389
|
-
verification_method?: "
|
|
390
|
+
verification_method?: "link" | "code" | undefined;
|
|
390
391
|
} | undefined;
|
|
391
392
|
username?: {
|
|
392
393
|
identifier?: {
|
|
@@ -436,6 +437,9 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
436
437
|
} | undefined;
|
|
437
438
|
set_user_root_attributes?: "on_each_login" | "on_first_login" | "never_on_login" | undefined;
|
|
438
439
|
};
|
|
440
|
+
scope?: "shared" | "local" | "platform" | undefined;
|
|
441
|
+
override?: "none" | "secrets" | "fields" | undefined;
|
|
442
|
+
enforce?: boolean | undefined;
|
|
439
443
|
id?: string | undefined;
|
|
440
444
|
display_name?: string | undefined;
|
|
441
445
|
enabled_clients?: string[] | undefined;
|
|
@@ -561,8 +565,8 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
561
565
|
} | undefined;
|
|
562
566
|
authenticated_at?: string | undefined;
|
|
563
567
|
};
|
|
564
|
-
connectionType: "
|
|
565
|
-
authConnection: "
|
|
568
|
+
connectionType: "username" | "email" | "sms";
|
|
569
|
+
authConnection: "username" | "email" | "sms";
|
|
566
570
|
session_id: string | undefined;
|
|
567
571
|
authParams: {
|
|
568
572
|
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;
|
|
@@ -4,3 +4,29 @@
|
|
|
4
4
|
* Shared by `helpers/logging.ts` (write path) and
|
|
5
5
|
* `outbox-destinations/logs.ts` (outbox transform) so the two never drift. */
|
|
6
6
|
export declare const USER_TARGET_TYPES: Set<string>;
|
|
7
|
+
/** The flat log's `user_id` for an audit event: the target for user-scoped
|
|
8
|
+
* operations, otherwise the actor. The caller of a management operation is
|
|
9
|
+
* carried separately in `request.auth`. */
|
|
10
|
+
export declare function logSubjectUserId(event: {
|
|
11
|
+
actor: {
|
|
12
|
+
id?: string;
|
|
13
|
+
};
|
|
14
|
+
target?: {
|
|
15
|
+
type: string;
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
}): string;
|
|
19
|
+
/** The flat log's `user_name` for an audit event. `actor.email` only names the
|
|
20
|
+
* actor, so it is used only when the log subject is the actor — a user-scoped
|
|
21
|
+
* operation by an admin must not pair the target's `user_id` with the admin's
|
|
22
|
+
* email. */
|
|
23
|
+
export declare function logSubjectUserName(event: {
|
|
24
|
+
actor: {
|
|
25
|
+
id?: string;
|
|
26
|
+
email?: string;
|
|
27
|
+
};
|
|
28
|
+
target?: {
|
|
29
|
+
type: string;
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
}): string | undefined;
|
|
@@ -145,6 +145,7 @@ export declare const enrichedClientSchema: z.ZodObject<{
|
|
|
145
145
|
tenant: z.ZodObject<{
|
|
146
146
|
created_at: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string, string | null>>;
|
|
147
147
|
updated_at: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string, string | null>>;
|
|
148
|
+
parent_tenant_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
148
149
|
audience: z.ZodOptional<z.ZodString>;
|
|
149
150
|
friendly_name: z.ZodString;
|
|
150
151
|
picture_url: z.ZodOptional<z.ZodString>;
|
|
@@ -352,6 +353,17 @@ export declare const enrichedClientSchema: z.ZodObject<{
|
|
|
352
353
|
connections: z.ZodArray<z.ZodObject<{
|
|
353
354
|
created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
354
355
|
updated_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
356
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
357
|
+
local: "local";
|
|
358
|
+
shared: "shared";
|
|
359
|
+
platform: "platform";
|
|
360
|
+
}>>;
|
|
361
|
+
override: z.ZodOptional<z.ZodEnum<{
|
|
362
|
+
none: "none";
|
|
363
|
+
secrets: "secrets";
|
|
364
|
+
fields: "fields";
|
|
365
|
+
}>>;
|
|
366
|
+
enforce: z.ZodOptional<z.ZodBoolean>;
|
|
355
367
|
id: z.ZodOptional<z.ZodString>;
|
|
356
368
|
name: z.ZodString;
|
|
357
369
|
display_name: z.ZodOptional<z.ZodString>;
|
|
@@ -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: ("
|
|
17
|
+
export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("sub" | "exp" | "iat" | "tenant_id" | "client_id" | "org_name" | "jti" | "scope" | "gty" | "org_id" | "sid" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "permissions" | "nbf" | "act" | "requested_userinfo_claims")[];
|
|
18
18
|
/** Client-bound mints: `azp` must stay the registered client id. */
|
|
19
|
-
export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("
|
|
19
|
+
export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("sub" | "exp" | "iat" | "tenant_id" | "client_id" | "org_name" | "jti" | "scope" | "azp" | "gty" | "org_id" | "sid" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "permissions" | "nbf" | "act" | "requested_userinfo_claims")[];
|
|
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>;
|