authhero 9.37.0 → 9.38.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.
Files changed (76) 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-ce8560f6.entry.js → p-32247347.entry.js} +1 -1
  4. package/dist/assets/u/widget/p-3f908508.entry.js +1 -0
  5. package/dist/assets/u/widget/p-Wx4M-olY.js +2 -0
  6. package/dist/authhero.cjs +110 -89
  7. package/dist/authhero.d.ts +551 -440
  8. package/dist/authhero.mjs +12680 -11723
  9. package/dist/{mfa-DuNbh_YF.js → mfa-DBhvi2B5.js} +1 -1
  10. package/dist/{mfa-BpHxTir1.mjs → mfa-DnCary4g.mjs} +17 -17
  11. package/dist/{mfa-attempts-DDgCBTDW.mjs → mfa-attempts-BK-gWrgJ.mjs} +5034 -5001
  12. package/dist/mfa-attempts-C5kobAHS.js +275 -0
  13. package/dist/{passkey-enrollment-D6ZZmelw.js → passkey-enrollment-CmKahPq7.js} +1 -1
  14. package/dist/tsconfig.types.tsbuildinfo +1 -1
  15. package/dist/types/authentication-flows/passwordless.d.ts +2 -2
  16. package/dist/types/helpers/default-destinations.d.ts +14 -0
  17. package/dist/types/helpers/firehose-client.d.ts +29 -0
  18. package/dist/types/helpers/outbox-destinations/log-streams.d.ts +21 -1
  19. package/dist/types/helpers/prompt-partials.d.ts +1 -1
  20. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  21. package/dist/types/helpers/run-outbox-relay.d.ts +9 -2
  22. package/dist/types/index.d.ts +543 -439
  23. package/dist/types/routes/auth-api/device.d.ts +8 -8
  24. package/dist/types/routes/auth-api/index.d.ts +36 -36
  25. package/dist/types/routes/auth-api/passwordless.d.ts +18 -18
  26. package/dist/types/routes/auth-api/token.d.ts +10 -10
  27. package/dist/types/routes/management-api/action-executions.d.ts +2 -2
  28. package/dist/types/routes/management-api/actions.d.ts +9 -9
  29. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  30. package/dist/types/routes/management-api/branding-preview.d.ts +9 -1
  31. package/dist/types/routes/management-api/branding.d.ts +105 -1
  32. package/dist/types/routes/management-api/client-registration-tokens.d.ts +3 -3
  33. package/dist/types/routes/management-api/clients.d.ts +8 -8
  34. package/dist/types/routes/management-api/connections.d.ts +1 -1
  35. package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
  36. package/dist/types/routes/management-api/email-templates.d.ts +20 -20
  37. package/dist/types/routes/management-api/emails.d.ts +2 -2
  38. package/dist/types/routes/management-api/failed-events.d.ts +4 -4
  39. package/dist/types/routes/management-api/forms.d.ts +144 -144
  40. package/dist/types/routes/management-api/guardian.d.ts +5 -5
  41. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  42. package/dist/types/routes/management-api/hooks.d.ts +4 -4
  43. package/dist/types/routes/management-api/index.d.ts +492 -388
  44. package/dist/types/routes/management-api/keys.d.ts +8 -8
  45. package/dist/types/routes/management-api/log-streams.d.ts +12 -12
  46. package/dist/types/routes/management-api/logs.d.ts +4 -4
  47. package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
  48. package/dist/types/routes/management-api/organizations.d.ts +7 -7
  49. package/dist/types/routes/management-api/prompts.d.ts +8 -8
  50. package/dist/types/routes/management-api/roles.d.ts +1 -1
  51. package/dist/types/routes/management-api/rollouts.d.ts +6 -6
  52. package/dist/types/routes/management-api/self-service-profiles.d.ts +8 -8
  53. package/dist/types/routes/management-api/tenant-export-import.d.ts +5 -5
  54. package/dist/types/routes/management-api/tenant-operations.d.ts +10 -10
  55. package/dist/types/routes/management-api/tenants.d.ts +36 -36
  56. package/dist/types/routes/management-api/themes.d.ts +69 -0
  57. package/dist/types/routes/management-api/users.d.ts +16 -16
  58. package/dist/types/routes/universal-login/common.d.ts +54 -2
  59. package/dist/types/routes/universal-login/dark-theme.d.ts +25 -0
  60. package/dist/types/routes/universal-login/flow-api.d.ts +12 -12
  61. package/dist/types/routes/universal-login/form-node.d.ts +4 -4
  62. package/dist/types/routes/universal-login/identifier.d.ts +2 -2
  63. package/dist/types/routes/universal-login/index.d.ts +6 -6
  64. package/dist/types/routes/universal-login/legal-links.d.ts +18 -0
  65. package/dist/types/routes/universal-login/screen-prompt-map.d.ts +31 -0
  66. package/dist/types/routes/universal-login/screens/login-partials.d.ts +9 -1
  67. package/dist/types/routes/universal-login/u2-form-node.d.ts +2 -2
  68. package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
  69. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  70. package/dist/types/routes/universal-login/u2-widget-page.d.ts +6 -1
  71. package/dist/types/routes/universal-login/universal-login-template.d.ts +1 -0
  72. package/dist/types/state-machines/login-session.d.ts +1 -1
  73. package/package.json +7 -6
  74. package/dist/assets/u/widget/p-FUW5zvoZ.js +0 -2
  75. package/dist/assets/u/widget/p-c6ec4c36.entry.js +0 -1
  76. package/dist/mfa-attempts-D5U1FCSY.js +0 -275
@@ -175,8 +175,8 @@ export declare function passwordlessGrantUser(ctx: Context<{
175
175
  authenticated_at?: string | undefined;
176
176
  tenant_id?: string | undefined;
177
177
  };
178
- connectionType: "username" | "email" | "sms";
179
- authConnection: "username" | "email" | "sms";
178
+ connectionType: "username" | "sms" | "email";
179
+ authConnection: "username" | "sms" | "email";
180
180
  session_id: string | undefined;
181
181
  authParams: {
182
182
  audience?: string | undefined;
@@ -60,6 +60,20 @@ export interface CreateDefaultDestinationsConfig {
60
60
  */
61
61
  pipeline?: OutboxPipelineConfig;
62
62
  }
63
+ /**
64
+ * The archive destinations configured on `init({ outbox })`, in delivery
65
+ * order. Shared by the per-request route middleware and
66
+ * `createDefaultDestinations` so both paths archive to the same places.
67
+ *
68
+ * Append these after every other destination: the relay stops an event's
69
+ * destination loop on the first failure, so an archive outage must not be
70
+ * able to block real delivery. Nothing depends on the archives, so they are
71
+ * the destinations that can afford to be blocked — the cost is that an event
72
+ * which permanently fails an earlier destination never reaches them.
73
+ */
74
+ export declare function createArchiveDestinations(outbox: {
75
+ pipeline?: OutboxPipelineConfig;
76
+ } | undefined): EventDestination[];
63
77
  /**
64
78
  * Build the same array of outbox destinations that authhero's per-request
65
79
  * `outboxMiddleware` constructs internally. Intended for consumers that want
@@ -0,0 +1,29 @@
1
+ export declare const FIREHOSE_MAX_RECORD_BYTES: number;
2
+ export interface FirehoseTarget {
3
+ /** AWS region of the delivery stream, e.g. `eu-north-1`. */
4
+ region: string;
5
+ /** Name (not ARN) of the Direct PUT delivery stream. */
6
+ deliveryStreamName: string;
7
+ accessKeyId: string;
8
+ secretAccessKey: string;
9
+ }
10
+ export interface PutFirehoseRecordsOptions {
11
+ /** Per-request timeout (default: 10s). */
12
+ timeoutMs?: number;
13
+ /** Override for tests. */
14
+ fetchImpl?: typeof fetch;
15
+ }
16
+ /**
17
+ * Why a target cannot be used, or `undefined` when it can. The region is
18
+ * interpolated into the endpoint hostname, so anything but a plain region id
19
+ * is rejected — it could otherwise redirect a signed request elsewhere.
20
+ */
21
+ export declare function firehoseTargetError(target: FirehoseTarget): string | undefined;
22
+ export declare function firehoseEndpoint(region: string): string;
23
+ /**
24
+ * Sends already-encoded records to an Amazon Data Firehose Direct PUT stream
25
+ * with SigV4-signed `PutRecordBatch` calls, split at the per-call limits.
26
+ * Callers keep each record within `FIREHOSE_MAX_RECORD_BYTES`; this throws
27
+ * before sending if one is not, since Firehose would reject the whole call.
28
+ */
29
+ export declare function putFirehoseRecords(target: FirehoseTarget, records: Uint8Array[], options?: PutFirehoseRecordsOptions): Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import { AuditEvent, LogStreamsAdapter } from "@authhero/adapter-interfaces";
2
2
  import { EventDestination } from "../outbox-relay";
3
+ import { type FirehoseTarget } from "../firehose-client";
3
4
  interface LogStreamData {
4
5
  date: string;
5
6
  type: string;
@@ -46,8 +47,26 @@ interface StreamDelivery {
46
47
  logType: string;
47
48
  payload: LogStreamPayload;
48
49
  }
50
+ export interface FirehoseSinkConfig {
51
+ target: FirehoseTarget;
52
+ /**
53
+ * Terminate each record with `\n` so records Firehose concatenates into one
54
+ * S3 object are newline-delimited JSON (default: true).
55
+ */
56
+ newlineDelimited: boolean;
57
+ }
58
+ /**
59
+ * Reads a `firehose` log stream's sink. Shared by delivery and the management
60
+ * API, so a sink the API accepts is one delivery can use.
61
+ */
62
+ export declare function parseFirehoseSink(sink: Record<string, unknown>): {
63
+ config: FirehoseSinkConfig;
64
+ } | {
65
+ error: string;
66
+ };
49
67
  /**
50
- * Delivers audit events to tenant-configured HTTP log streams. Mirrors
68
+ * Delivers audit events to tenant-configured `http` and `firehose` log
69
+ * streams. Mirrors
51
70
  * Auth0's log_stream wire shape so Loki / Logstash / Datadog sinks
52
71
  * configured for an Auth0 tenant can be pointed at authhero unchanged.
53
72
  *
@@ -66,6 +85,7 @@ export declare class LogStreamDestination implements EventDestination {
66
85
  accepts(event: AuditEvent): boolean;
67
86
  transform(event: AuditEvent): StreamDelivery;
68
87
  deliver(events: StreamDelivery[]): Promise<void>;
88
+ private deliverToFirehose;
69
89
  private deliverToStream;
70
90
  }
71
91
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { PromptPartials } from "@authhero/adapter-interfaces";
2
- export declare const promptPartialPrompts: readonly ["signup", "signup-id", "signup-password", "login", "login-id", "login-password", "login-passwordless", "login-passwordless-sms-otp", "login-passwordless-email-code"];
2
+ export declare const promptPartialPrompts: readonly ["signup", "signup-id", "signup-password", "login", "login-id", "login-password", "login-passwordless", "login-passwordless-sms-otp", "login-passwordless-email-code", "reset-password", "mfa-otp", "mfa-phone", "mfa-login-options"];
3
3
  export declare const MAX_PROMPT_PARTIAL_LENGTH = 100000;
4
4
  export declare function isAllowedPromptPartialMappingTarget(target: string): boolean;
5
5
  export declare function sanitizePromptPartials(partials: PromptPartials): PromptPartials;
@@ -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: ("tenant_id" | "client_id" | "org_name" | "jti" | "sub" | "scope" | "gty" | "org_id" | "iat" | "sid" | "permissions" | "iss" | "exp" | "aud" | "auth_time" | "acr" | "amr" | "nbf" | "act" | "requested_userinfo_claims")[];
17
+ export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("scope" | "tenant_id" | "client_id" | "org_name" | "sid" | "sub" | "jti" | "iat" | "org_id" | "iss" | "exp" | "aud" | "auth_time" | "acr" | "amr" | "gty" | "nbf" | "act" | "permissions" | "requested_userinfo_claims")[];
18
18
  /** Client-bound mints: `azp` must stay the registered client id. */
19
- export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("tenant_id" | "client_id" | "org_name" | "jti" | "sub" | "scope" | "azp" | "gty" | "org_id" | "iat" | "sid" | "permissions" | "iss" | "exp" | "aud" | "auth_time" | "acr" | "amr" | "nbf" | "act" | "requested_userinfo_claims")[];
19
+ export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("scope" | "tenant_id" | "client_id" | "org_name" | "sid" | "sub" | "jti" | "iat" | "org_id" | "iss" | "exp" | "aud" | "auth_time" | "acr" | "amr" | "azp" | "gty" | "nbf" | "act" | "permissions" | "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
  /**
@@ -1,5 +1,5 @@
1
1
  import { CodeExecutor, DataAdapters } from "@authhero/adapter-interfaces";
2
- import type { ActionExecutionLogCapture, WebhookInvoker } from "../types/AuthHeroConfig";
2
+ import type { ActionExecutionLogCapture, OutboxPipelineConfig, WebhookInvoker } from "../types/AuthHeroConfig";
3
3
  import type { OutboxMetricsSink } from "../types/OutboxMetrics";
4
4
  export interface RunOutboxRelayConfig {
5
5
  /** Same `DataAdapters` passed to `init()`. Must include `outbox` to drain. */
@@ -45,6 +45,12 @@ export interface RunOutboxRelayConfig {
45
45
  * the events this cron drain handles, tagged `source: "cron"`.
46
46
  */
47
47
  metrics?: OutboxMetricsSink;
48
+ /**
49
+ * Same value as `init({ outbox: { pipeline } })`. Pass it so events retried
50
+ * by this drain still reach the archive — otherwise an event whose inline
51
+ * archive delivery failed is marked processed here without being archived.
52
+ */
53
+ pipeline?: OutboxPipelineConfig;
48
54
  }
49
55
  /**
50
56
  * One-call outbox relay for cron / scheduled handlers.
@@ -52,7 +58,8 @@ export interface RunOutboxRelayConfig {
52
58
  * Internally:
53
59
  * 1. Skips gracefully when `dataAdapter.outbox` is undefined.
54
60
  * 2. Builds the same destination array as the inline dispatcher
55
- * (`LogsDestination`, `WebhookDestination`, `RegistrationFinalizerDestination`).
61
+ * (`LogsDestination`, `WebhookDestination`, `RegistrationFinalizerDestination`,
62
+ * plus the Pipelines archive when `pipeline` is passed).
56
63
  * 3. Mints per-tenant service tokens via the same in-process path
57
64
  * (`createServiceTokenCore`) that the request-time webhookInvoker uses,
58
65
  * driven by the supplied dataAdapter.