authhero 8.26.0 → 8.27.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 +139 -139
- package/dist/authhero.d.ts +201 -116
- package/dist/authhero.mjs +6339 -6281
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/authentication-flows/passwordless.d.ts +6 -6
- package/dist/types/components/stories/IdentifierPage.stories.d.ts +2 -0
- package/dist/types/helpers/codes-cleanup.d.ts +4 -4
- package/dist/types/helpers/dcr/metadata-mapping.d.ts +1 -1
- package/dist/types/helpers/run-retention.d.ts +86 -0
- package/dist/types/index.d.ts +112 -110
- package/dist/types/routes/auth-api/index.d.ts +20 -20
- package/dist/types/routes/auth-api/passwordless.d.ts +12 -12
- package/dist/types/routes/auth-api/register/index.d.ts +2 -2
- package/dist/types/routes/auth-api/revoke.d.ts +6 -6
- package/dist/types/routes/management-api/action-executions.d.ts +2 -2
- package/dist/types/routes/management-api/actions.d.ts +1 -1
- package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
- package/dist/types/routes/management-api/branding.d.ts +9 -9
- package/dist/types/routes/management-api/clients.d.ts +14 -14
- package/dist/types/routes/management-api/connections.d.ts +15 -15
- package/dist/types/routes/management-api/failed-events.d.ts +1 -1
- package/dist/types/routes/management-api/guardian.d.ts +5 -5
- package/dist/types/routes/management-api/helpers.d.ts +1 -1
- package/dist/types/routes/management-api/hook-code.d.ts +2 -2
- package/dist/types/routes/management-api/index.d.ts +83 -83
- 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/migration-sources.d.ts +6 -6
- package/dist/types/routes/management-api/organizations.d.ts +5 -5
- package/dist/types/routes/management-api/prompts.d.ts +4 -4
- package/dist/types/routes/management-api/roles.d.ts +1 -1
- package/dist/types/routes/management-api/tenant-export-import.d.ts +5 -5
- package/dist/types/routes/management-api/tenants.d.ts +5 -5
- package/dist/types/routes/management-api/themes.d.ts +6 -6
- package/dist/types/routes/management-api/users.d.ts +2 -2
- package/dist/types/routes/universal-login/common.d.ts +12 -12
- package/dist/types/routes/universal-login/identifier.d.ts +2 -2
- package/dist/types/routes/universal-login/index.d.ts +2 -2
- package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
- package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
- package/dist/types/types/IdToken.d.ts +1 -1
- package/package.json +6 -6
|
@@ -367,7 +367,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
367
367
|
active?: boolean | undefined;
|
|
368
368
|
} | undefined;
|
|
369
369
|
signup?: {
|
|
370
|
-
status?: "
|
|
370
|
+
status?: "optional" | "required" | "disabled" | undefined;
|
|
371
371
|
verification?: {
|
|
372
372
|
active?: boolean | undefined;
|
|
373
373
|
} | undefined;
|
|
@@ -384,7 +384,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
384
384
|
active?: boolean | undefined;
|
|
385
385
|
} | undefined;
|
|
386
386
|
signup?: {
|
|
387
|
-
status?: "
|
|
387
|
+
status?: "optional" | "required" | "disabled" | undefined;
|
|
388
388
|
} | undefined;
|
|
389
389
|
validation?: {
|
|
390
390
|
max_length?: number | undefined;
|
|
@@ -401,7 +401,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
401
401
|
active?: boolean | undefined;
|
|
402
402
|
} | undefined;
|
|
403
403
|
signup?: {
|
|
404
|
-
status?: "
|
|
404
|
+
status?: "optional" | "required" | "disabled" | undefined;
|
|
405
405
|
} | undefined;
|
|
406
406
|
} | undefined;
|
|
407
407
|
} | undefined;
|
|
@@ -466,7 +466,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
466
466
|
custom_login_page_preview?: string | undefined;
|
|
467
467
|
form_template?: string | undefined;
|
|
468
468
|
addons?: Record<string, any> | undefined;
|
|
469
|
-
token_endpoint_auth_method?: "none" | "
|
|
469
|
+
token_endpoint_auth_method?: "none" | "private_key_jwt" | "client_secret_post" | "client_secret_basic" | "client_secret_jwt" | undefined;
|
|
470
470
|
client_metadata?: Record<string, string> | undefined;
|
|
471
471
|
hide_sign_up_disabled_error?: boolean | undefined;
|
|
472
472
|
mobile?: Record<string, any> | undefined;
|
|
@@ -549,8 +549,8 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
549
549
|
} | undefined;
|
|
550
550
|
authenticated_at?: string | undefined;
|
|
551
551
|
};
|
|
552
|
-
connectionType: "
|
|
553
|
-
authConnection: "
|
|
552
|
+
connectionType: "username" | "sms" | "email";
|
|
553
|
+
authConnection: "username" | "sms" | "email";
|
|
554
554
|
session_id: string | undefined;
|
|
555
555
|
authParams: {
|
|
556
556
|
client_id: string;
|
|
@@ -31,3 +31,5 @@ export declare const SocialOnly: Story;
|
|
|
31
31
|
export declare const UsernamePassword: Story;
|
|
32
32
|
export declare const NoTheming: Story;
|
|
33
33
|
export declare const CustomColors: Story;
|
|
34
|
+
export declare const MultipleSocialConnections: Story;
|
|
35
|
+
export declare const DeveloperSocialLogins: Story;
|
|
@@ -11,11 +11,11 @@ export interface CodesCleanupParams {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Delete codes that expired more than the retention window ago.
|
|
14
|
-
* Intended for use in a scheduled handler / cron job.
|
|
15
14
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* Prefer `runRetention`, which calls this along with every other prunable
|
|
16
|
+
* table — scheduling one call means a future prunable table is covered without
|
|
17
|
+
* editing your handler. Use this directly only when you want to sweep `codes`
|
|
18
|
+
* on its own schedule.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```ts
|
|
@@ -24,10 +24,10 @@ export declare const dcrRequestSchema: z.ZodObject<{
|
|
|
24
24
|
response_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
25
|
token_endpoint_auth_method: z.ZodOptional<z.ZodEnum<{
|
|
26
26
|
none: "none";
|
|
27
|
+
private_key_jwt: "private_key_jwt";
|
|
27
28
|
client_secret_post: "client_secret_post";
|
|
28
29
|
client_secret_basic: "client_secret_basic";
|
|
29
30
|
client_secret_jwt: "client_secret_jwt";
|
|
30
|
-
private_key_jwt: "private_key_jwt";
|
|
31
31
|
}>>;
|
|
32
32
|
jwks_uri: z.ZodOptional<z.ZodString>;
|
|
33
33
|
jwks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { DataAdapters } from "@authhero/adapter-interfaces";
|
|
2
|
+
export interface RunRetentionConfig {
|
|
3
|
+
/** Same `DataAdapters` passed to `init()`. */
|
|
4
|
+
dataAdapter: DataAdapters;
|
|
5
|
+
/** Grace period past expiry for `codes`. Default 1. */
|
|
6
|
+
codesRetentionDays?: number;
|
|
7
|
+
/** Days to keep processed/dead-lettered outbox events. Default 7. */
|
|
8
|
+
outboxRetentionDays?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Scope the session sweep to a single tenant. Codes and outbox events are
|
|
11
|
+
* always swept globally — an expired row is dead regardless of who owns it.
|
|
12
|
+
*/
|
|
13
|
+
tenantId?: string;
|
|
14
|
+
}
|
|
15
|
+
export type RetentionSweepStatus = "swept" | "skipped" | "failed";
|
|
16
|
+
interface RetentionSweepBase {
|
|
17
|
+
/** Table(s) this sweep covers, for logging. */
|
|
18
|
+
table: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RetentionSweepSwept extends RetentionSweepBase {
|
|
21
|
+
status: "swept";
|
|
22
|
+
/**
|
|
23
|
+
* Rows deleted. Absent when the underlying adapter reports no count —
|
|
24
|
+
* `sessionCleanup` returns void, so a session sweep succeeds without one.
|
|
25
|
+
*/
|
|
26
|
+
deleted?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface RetentionSweepSkipped extends RetentionSweepBase {
|
|
29
|
+
status: "skipped";
|
|
30
|
+
/** Why the sweep was skipped — an adapter that does not support it. */
|
|
31
|
+
reason: string;
|
|
32
|
+
}
|
|
33
|
+
export interface RetentionSweepFailed extends RetentionSweepBase {
|
|
34
|
+
status: "failed";
|
|
35
|
+
error: unknown;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Discriminated on `status`, so a sweep cannot carry fields that contradict
|
|
39
|
+
* it — no `error` on a successful sweep, no `deleted` on a failed one.
|
|
40
|
+
*/
|
|
41
|
+
export type RetentionSweep = RetentionSweepSwept | RetentionSweepSkipped | RetentionSweepFailed;
|
|
42
|
+
export interface RunRetentionResult {
|
|
43
|
+
sweeps: RetentionSweep[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Thrown when one or more sweeps failed. The other sweeps still ran — check
|
|
47
|
+
* `result` for what succeeded.
|
|
48
|
+
*/
|
|
49
|
+
export declare class RetentionSweepError extends Error {
|
|
50
|
+
readonly result: RunRetentionResult;
|
|
51
|
+
readonly errors: unknown[];
|
|
52
|
+
constructor(result: RunRetentionResult, errors: unknown[]);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Sweep every prunable AuthHero table in one call.
|
|
56
|
+
*
|
|
57
|
+
* This is the entry point for retention — a deployment that schedules this
|
|
58
|
+
* daily needs nothing else, and gains coverage of future prunable tables
|
|
59
|
+
* without editing its handler.
|
|
60
|
+
*
|
|
61
|
+
* Covers `codes`, `outbox_events`, and (where the adapter supports it)
|
|
62
|
+
* `sessions` / `refresh_tokens` / `login_sessions`. It does **not** drain the
|
|
63
|
+
* outbox: delivery is `runOutboxRelay`'s job, and the two are scheduled
|
|
64
|
+
* independently. Running both is safe — the relay's own cleanup pass and this
|
|
65
|
+
* one are idempotent.
|
|
66
|
+
*
|
|
67
|
+
* `logs` is deliberately excluded. Audit-retention obligations differ per
|
|
68
|
+
* deployment, so AuthHero will not silently delete audit rows on your behalf;
|
|
69
|
+
* prune `logs` on `date` yourself.
|
|
70
|
+
*
|
|
71
|
+
* Every sweep runs even if an earlier one throws, so one broken adapter method
|
|
72
|
+
* cannot stop the rest of the tables being pruned. If any sweep failed, a
|
|
73
|
+
* `RetentionSweepError` carrying the partial result is thrown once at the end.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* export default {
|
|
78
|
+
* async scheduled(_event, env) {
|
|
79
|
+
* const { sweeps } = await runRetention({ dataAdapter });
|
|
80
|
+
* console.log(sweeps);
|
|
81
|
+
* },
|
|
82
|
+
* };
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function runRetention(config: RunRetentionConfig): Promise<RunRetentionResult>;
|
|
86
|
+
export {};
|