authhero 9.6.4 → 9.7.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 (27) hide show
  1. package/dist/assets/u/widget/index.esm.js +1 -1
  2. package/dist/authhero.cjs +144 -144
  3. package/dist/authhero.d.ts +286 -66
  4. package/dist/authhero.mjs +13592 -13476
  5. package/dist/tsconfig.types.tsbuildinfo +1 -1
  6. package/dist/types/authentication-flows/common.d.ts +17 -1
  7. package/dist/types/authentication-flows/passwordless.d.ts +5 -5
  8. package/dist/types/helpers/revoke-user-refresh-tokens.d.ts +21 -0
  9. package/dist/types/index.d.ts +286 -66
  10. package/dist/types/routes/auth-api/index.d.ts +6 -6
  11. package/dist/types/routes/auth-api/passwordless.d.ts +6 -6
  12. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  13. package/dist/types/routes/management-api/clients.d.ts +6 -6
  14. package/dist/types/routes/management-api/connections.d.ts +15 -15
  15. package/dist/types/routes/management-api/email-templates.d.ts +18 -18
  16. package/dist/types/routes/management-api/index.d.ts +275 -55
  17. package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
  18. package/dist/types/routes/management-api/organizations.d.ts +5 -5
  19. package/dist/types/routes/management-api/prompts.d.ts +4 -4
  20. package/dist/types/routes/management-api/refresh_tokens.d.ts +7 -0
  21. package/dist/types/routes/management-api/users.d.ts +146 -0
  22. package/dist/types/routes/universal-login/common.d.ts +6 -6
  23. package/dist/types/routes/universal-login/flow-api.d.ts +4 -4
  24. package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
  25. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  26. package/dist/types/utils/user-id.d.ts +19 -1
  27. package/package.json +6 -6
@@ -1,4 +1,4 @@
1
- import { AuthorizationResponseType, AuthParams, LoginSession, RefreshToken, User, TokenResponse } from "@authhero/adapter-interfaces";
1
+ import { AuthorizationResponseType, AuthParams, LoginSession, LoginSessionAuthStrategy, RefreshToken, User, TokenResponse } from "@authhero/adapter-interfaces";
2
2
  import { EnrichedClient } from "../helpers/client";
3
3
  import { Context } from "hono";
4
4
  import { Bindings, Variables } from "../types";
@@ -82,6 +82,22 @@ export interface CreateRefreshTokenParams {
82
82
  login_id: string;
83
83
  scope: string;
84
84
  audience?: string;
85
+ /**
86
+ * The authenticated session this token is issued under — Auth0's
87
+ * `session_id`. Stored so revoking a session can revoke its tokens in one
88
+ * hop, and so the refresh grant never has to resolve it through the
89
+ * short-lived login session. Optional: flows without a session still mint
90
+ * tokens, and the column is nullable for exactly that reason.
91
+ */
92
+ session_id?: string;
93
+ /**
94
+ * Auth-event facts, denormalised from the login session. All are immutable
95
+ * for the life of the token; keeping them here means the grant no longer
96
+ * degrades silently when the login session has been cleaned up.
97
+ */
98
+ organization?: string;
99
+ auth_connection?: string;
100
+ auth_strategy?: LoginSessionAuthStrategy;
85
101
  }
86
102
  export interface CreatedRefreshToken {
87
103
  row: RefreshToken;
@@ -372,7 +372,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
372
372
  active?: boolean | undefined;
373
373
  } | undefined;
374
374
  signup?: {
375
- status?: "optional" | "required" | "disabled" | undefined;
375
+ status?: "required" | "optional" | "disabled" | undefined;
376
376
  verification?: {
377
377
  active?: boolean | undefined;
378
378
  } | undefined;
@@ -389,7 +389,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
389
389
  active?: boolean | undefined;
390
390
  } | undefined;
391
391
  signup?: {
392
- status?: "optional" | "required" | "disabled" | undefined;
392
+ status?: "required" | "optional" | "disabled" | undefined;
393
393
  } | undefined;
394
394
  validation?: {
395
395
  max_length?: number | undefined;
@@ -406,7 +406,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
406
406
  active?: boolean | undefined;
407
407
  } | undefined;
408
408
  signup?: {
409
- status?: "optional" | "required" | "disabled" | undefined;
409
+ status?: "required" | "optional" | "disabled" | undefined;
410
410
  } | undefined;
411
411
  } | undefined;
412
412
  } | undefined;
@@ -554,8 +554,8 @@ export declare function passwordlessGrantUser(ctx: Context<{
554
554
  } | undefined;
555
555
  authenticated_at?: string | undefined;
556
556
  };
557
- connectionType: "username" | "email" | "sms";
558
- authConnection: "username" | "email" | "sms";
557
+ connectionType: "email" | "username" | "sms";
558
+ authConnection: "email" | "username" | "sms";
559
559
  session_id: string | undefined;
560
560
  authParams: {
561
561
  client_id: string;
@@ -0,0 +1,21 @@
1
+ import { Context } from "hono";
2
+ import { Bindings, Variables } from "../types";
3
+ /**
4
+ * Soft-revoke every active refresh token belonging to a user.
5
+ *
6
+ * Unlike the single-token admin delete (which also hard-removes the row), this
7
+ * keeps the rows around with `revoked_at` set so the admin UI and the audit
8
+ * trail can still show what was invalidated and when.
9
+ *
10
+ * Delegates to the adapter so the match is a pair of exact predicates rather
11
+ * than a `q` filter: the Lucene grammar splits on ` OR ` before tokenizing, so
12
+ * a user id containing ` OR user_id:<other> OR ` would widen a `q`-based
13
+ * revoke to another user's tokens. The adapter also skips already-revoked
14
+ * rows, so a concurrent revocation cannot overwrite an existing timestamp.
15
+ *
16
+ * Returns the number of tokens revoked.
17
+ */
18
+ export declare function revokeUserRefreshTokens(ctx: Context<{
19
+ Bindings: Bindings;
20
+ Variables: Variables;
21
+ }>, tenant_id: string, user_id: string): Promise<number>;