From ca0585bcd891af33eb75743e5a4ebc38f6a6f3d7 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:05:26 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-typescript-sdk: 3.108.17 --- .shiprc | 6 - AUTH_MIGRATION_GUIDE.md | 14 - LICENSE | 21 - auth-migration/authentication-flows.md | 234 --- auth-migration/index.md | 732 --------- auth-migration/server-side-sessions.md | 163 -- auth-migration/troubleshooting.md | 32 - package.json | 13 +- reference.md | 352 ++++- src/management/Client.ts | 6 + src/management/api/requests/requests.ts | 48 + .../api/resources/agents/client/Client.ts | 3 + .../resources/captcha/client/Client.ts | 3 + .../phoneProviderProtection/client/Client.ts | 3 + .../resources/templates/client/Client.ts | 11 +- .../api/resources/clients/client/Client.ts | 3 + src/management/api/resources/index.ts | 1 + .../workloadIdentityIssuers/client/Client.ts | 484 ++++++ .../workloadIdentityIssuers/client/index.ts | 1 + .../workloadIdentityIssuers/exports.ts | 4 + .../workloadIdentityIssuers/index.ts | 1 + src/management/api/types/types.ts | 1328 ++++++++++++++++- src/management/tests/wire/agents.test.ts | 19 +- .../wire/attackProtection/captcha.test.ts | 26 +- .../phoneProviderProtection.test.ts | 26 +- .../wire/branding/phone/templates.test.ts | 66 +- src/management/tests/wire/clients.test.ts | 5 + .../wire/organizations/clientGrants.test.ts | 4 +- .../wire/workloadIdentityIssuers.test.ts | 640 ++++++++ v6_MIGRATION_GUIDE.md | 158 -- v7_MIGRATION_GUIDE.md | 146 -- yarn.lock | 356 ++--- 32 files changed, 3176 insertions(+), 1733 deletions(-) delete mode 100644 .shiprc delete mode 100644 AUTH_MIGRATION_GUIDE.md delete mode 100644 LICENSE delete mode 100644 auth-migration/authentication-flows.md delete mode 100644 auth-migration/index.md delete mode 100644 auth-migration/server-side-sessions.md delete mode 100644 auth-migration/troubleshooting.md create mode 100644 src/management/api/resources/workloadIdentityIssuers/client/Client.ts create mode 100644 src/management/api/resources/workloadIdentityIssuers/client/index.ts create mode 100644 src/management/api/resources/workloadIdentityIssuers/exports.ts create mode 100644 src/management/api/resources/workloadIdentityIssuers/index.ts create mode 100644 src/management/tests/wire/workloadIdentityIssuers.test.ts delete mode 100644 v6_MIGRATION_GUIDE.md delete mode 100644 v7_MIGRATION_GUIDE.md diff --git a/.shiprc b/.shiprc deleted file mode 100644 index d1791e98e5..0000000000 --- a/.shiprc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "files": { - ".version": [], - "src/management/version.ts": [] - } -} diff --git a/AUTH_MIGRATION_GUIDE.md b/AUTH_MIGRATION_GUIDE.md deleted file mode 100644 index 64626f8067..0000000000 --- a/AUTH_MIGRATION_GUIDE.md +++ /dev/null @@ -1,14 +0,0 @@ -# Authentication Migration Guide - -This guide lives in the [`auth-migration/`](./auth-migration/) directory. - -**→ Start here: [`auth-migration/index.md`](./auth-migration/index.md)**: migrate your authentication code off the `auth0` package to [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js) (stateless token grants) or [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js) (server-managed sessions). - -The directory contains: - -- [`auth-migration/index.md`](./auth-migration/index.md): the main guide covering OIDC token grants and the four cross-cutting breaking changes. -- [`auth-migration/authentication-flows.md`](./auth-migration/authentication-flows.md): database, passwordless, backchannel (CIBA), token exchange, and `UserInfoClient`. -- [`auth-migration/server-side-sessions.md`](./auth-migration/server-side-sessions.md): the `@auth0/auth0-server-js` session layer. -- [`auth-migration/troubleshooting.md`](./auth-migration/troubleshooting.md): FAQ and gotchas. - -> **Migrating with an AI agent?** Point it at the Auth0 migration skill: the `auth0` skill in [`auth0/agent-skills`](https://github.com/auth0/agent-skills), migration intent `migrate-node-auth0`. diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 143ed57b53..0000000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Auth0. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/auth-migration/authentication-flows.md b/auth-migration/authentication-flows.md deleted file mode 100644 index 6f7bace2a1..0000000000 --- a/auth-migration/authentication-flows.md +++ /dev/null @@ -1,234 +0,0 @@ -# Migrating the other authentication flows - -This is the incremental part of the [Authentication Migration Guide](./index.md). Start with the guide's [OIDC token grants](./index.md#oidc-token-grants) and cross-cutting breaking changes before you touch anything here. Everything below builds on those changes, so apply them to every rewrite on this page too. - -> **Migrating with an AI agent?** Point it at the Auth0 migration skill (the `auth0` skill in [`auth0/agent-skills`](https://github.com/auth0/agent-skills), migration intent `migrate-node-auth0`). - -Migrate one flow at a time. Only the flows your app actually uses need attention; skip the rest. - -- [Database connections](#database-connections) -- [Passwordless](#passwordless) -- [Backchannel authentication (CIBA)](#backchannel-authentication-ciba) -- [Token exchange (RFC 8693)](#token-exchange-rfc-8693) -- [UserInfoClient](#userinfoclient) -- [Quick lookup table](#quick-lookup-table) - -Unless a row routes explicitly to `@auth0/auth0-server-js`, the replacement lives on the `@auth0/auth0-auth-js` `AuthClient` (or a sub-client: `authClient.database`, `authClient.passwordless`, `authClient.mfa`, `authClient.passkey`). - -## Database connections - -Database connection operations move to the `authClient.database` sub-client. Names and required parameters stay the same; only casing and return shape change. - -### `database.signUp` → `authClient.database.signUp` - -```ts -// before -const resp = await auth0.database.signUp({ - email, - password, - connection: "Username-Password-Authentication", - given_name: "Ada", - family_name: "Lovelace", - user_metadata: { plan: "free" }, -}); -const userId = resp.data.id; -// after -const result = await authClient.database.signUp({ - email, - password, - connection: "Username-Password-Authentication", - givenName: "Ada", - familyName: "Lovelace", - userMetadata: { plan: "free" }, -}); -const userId = result.id; -``` - -> ID normalization is preserved: node-auth0 mapped the server's `_id | user_id | id` onto a single `id`. The new SDK does the same, so `result.id` is always present. Do not add your own `_id` fallback. - -### `database.changePassword` → `authClient.database.changePassword` - -node-auth0 returned a `TextApiResponse` (read via `.data`); the new SDK returns the plain `string` directly. - -```ts -// before -const resp = await auth0.database.changePassword({ email, connection: "Username-Password-Authentication" }); -const message = resp.data; // plain-text confirmation -// after -const message = await authClient.database.changePassword({ email, connection: "Username-Password-Authentication" }); -``` - -> `changePassword` requires `connection` plus at least one of `email` or `username`: either identifier is accepted, not `email` alone. - -## Passwordless - -node-auth0 lumped "start" (send the code or link) and "login" (redeem the code) onto one sub-client. The new SDK splits them: starting stays on `authClient.passwordless`; redeeming a code becomes a top-level grant method on `AuthClient`. - -### `passwordless.sendEmail` → `authClient.passwordless.sendEmail` - -```ts -// before -await auth0.passwordless.sendEmail({ email, send: "code" }); -// after -await authClient.passwordless.sendEmail({ email, send: "code" }); -``` - -> Default changed: node-auth0 defaulted `send` to `'link'` (magic link). The new SDK defaults `send` to `'code'` (one-time password). If you relied on the implicit default to send magic links, set `send: 'link'` explicitly. - -### `passwordless.sendSMS` → `authClient.passwordless.sendSms` - -Note the casing change: `sendSMS` → `sendSms`, and `phone_number` → `phoneNumber`. - -```ts -// before -await auth0.passwordless.sendSMS({ phone_number: "+15551234567" }); -// after -await authClient.passwordless.sendSms({ phoneNumber: "+15551234567" }); -``` - -### `passwordless.loginWithEmail` → `getTokenByPasswordlessEmail` - -Redeeming the one-time password is now a grant method on `AuthClient`, not on the passwordless sub-client. - -```ts -// before -const resp = await auth0.passwordless.loginWithEmail({ email, code, audience, scope }); -const token = resp.data.access_token; -// after -const tokens = await authClient.getTokenByPasswordlessEmail({ email, code, audience, scope }); -const token = tokens.accessToken; -``` - -### `passwordless.loginWithSMS` → `getTokenByPasswordlessSms` - -```ts -// before -const resp = await auth0.passwordless.loginWithSMS({ phone_number, code }); -// after -const tokens = await authClient.getTokenByPasswordlessSms({ phoneNumber, code }); -``` - -> Session apps: `@auth0/auth0-server-js` exposes `startPasswordless` / `completePasswordless` / `completePasswordlessMagicLink`, which both send the code and establish a session. Use those instead of the two-step auth-js flow when the SDK owns the session. See [Migrating session apps](./server-side-sessions.md). - -## Backchannel authentication (CIBA) - -CIBA is Client-Initiated Backchannel Authentication. - -### `backchannel.authorize` → `initiateBackchannelAuthentication` - -```ts -// before -const resp = await auth0.backchannel.authorize({ - binding_message: "ABC123", - scope: "openid", - userId: "auth0|123", -}); -const authReqId = resp.auth_req_id; -// after -const { authReqId, expiresIn, interval } = await authClient.initiateBackchannelAuthentication({ - bindingMessage: "ABC123", - loginHint: { sub: "auth0|123" }, // login_hint is an object with `sub`, not a bare string - authorizationParams: { scope: "openid" }, // scope goes here, NOT as a top-level key -}); -``` - -### `backchannel.backchannelGrant` → `backchannelAuthenticationGrant` - -```ts -// before -const resp = await auth0.backchannel.backchannelGrant({ auth_req_id: authReqId }); -// after -const tokens = await authClient.backchannelAuthenticationGrant({ authReqId }); -``` - -> One-shot convenience: `authClient.backchannelAuthentication({ ... })` initiates and polls to completion, returning a `TokenResponse`. Use it if your code did the initiate-then-poll loop by hand. -> -> Session apps: for CIBA that also establishes a session, see [Migrating session apps](./server-side-sessions.md). - -## Token exchange (RFC 8693) - -```ts -// before -const resp = await auth0.tokenExchange.exchangeToken({ - subject_token_type: "urn:example:custom", - subject_token: token, - audience: "https://api.example.com", - scope: "read", -}); -// after -const tokens = await authClient.exchangeToken({ - subjectTokenType: "urn:example:custom", - subjectToken: token, - audience: "https://api.example.com", - scope: "read", -}); -``` - -> `exchangeToken` is overloaded: a custom-exchange profile shape (`subjectTokenType` + `subjectToken` + `audience`) and a Token Vault shape (`connection` present). Presence of `connection` routes to the vault path. The custom-exchange profile is the RFC 8693 replacement for `tokenExchange.exchangeToken`. -> -> Session apps: `@auth0/auth0-server-js` exposes `loginWithCustomTokenExchange` (exchange, then establish a session) and `customTokenExchange` (exchange, then return tokens with no session). - -## UserInfoClient - -The standalone `UserInfoClient` from node-auth0 does not exist in the new SDK. Choose the replacement based on what the app needs: - -| Your intent | Replacement | -| --- | --- | -| Wanted user profile claims right after login | Read `TokenResponse.claims` from the grant result; the SDK already decodes the ID token. No extra `/userinfo` round-trip needed. **Preferred.** | -| Wanted a live `/userinfo` response for an arbitrary access token | `await authClient.getUserInfo({ accessToken })`, a direct method on `AuthClient`. | -| Wanted the profile in a server-rendered app with a session | `await serverClient.getUser()` returns the stored user claims from the session. | - -**Before (node-auth0):** - -```ts -import { UserInfoClient } from "auth0"; -const userInfo = new UserInfoClient({ domain }); -const resp = await userInfo.getUserInfo(accessToken); -const profile = resp.data; // { sub, name, email, ... } -``` - -**After (preferred): use the claims you already have:** - -```ts -const tokens = await authClient.getTokenByCode(callbackUrl, {}); -const profile = tokens.claims; // { sub, name, email, ... } decoded from the id_token -``` - -**After (direct method):** for when you only have an access token: - -```ts -// Takes an options object: { accessToken, expectedSubject? } -const profile = await authClient.getUserInfo({ accessToken }); -``` - -> Prefer reading `claims` over any `/userinfo` call: it avoids a network round-trip and the claims are already validated by the SDK. - -## Quick lookup table - -The complete node-auth0 → new SDK map, including the OIDC methods covered in the main guide. - -| node-auth0 | new SDK equivalent | Layer | -| --- | --- | --- | -| `oauth.authorizationCodeGrant` | `authClient.getTokenByCode(url, opts)` | auth-js | -| `oauth.authorizationCodeGrantWithPKCE` | `authClient.getTokenByCode(url, { codeVerifier })` | auth-js | -| `oauth.refreshTokenGrant` | `authClient.getTokenByRefreshToken({ refreshToken })` | auth-js | -| `oauth.passwordGrant` | `authClient.getTokenByPassword({ ... })` | auth-js | -| `oauth.clientCredentialsGrant` | `authClient.getTokenByClientCredentials({ audience })` | auth-js | -| `oauth.revokeRefreshToken` | `authClient.revokeToken({ token })` / `serverClient.revokeRefreshToken()` | auth-js / server-js | -| `oauth.tokenForConnection` | `authClient.exchangeToken({ connection, ... })` | auth-js | -| `oauth.pushedAuthorization` | `authClient.buildAuthorizationUrl({ pushedAuthorizationRequests: true })` | auth-js | -| `database.signUp` | `authClient.database.signUp({ ... })` | auth-js | -| `database.changePassword` | `authClient.database.changePassword({ ... })` | auth-js | -| `passwordless.sendEmail` | `authClient.passwordless.sendEmail({ ... })` | auth-js | -| `passwordless.sendSMS` | `authClient.passwordless.sendSms({ phoneNumber })` | auth-js | -| `passwordless.loginWithEmail` | `authClient.getTokenByPasswordlessEmail({ ... })` | auth-js | -| `passwordless.loginWithSMS` | `authClient.getTokenByPasswordlessSms({ ... })` | auth-js | -| `backchannel.authorize` | `authClient.initiateBackchannelAuthentication({ ... })` | auth-js | -| `backchannel.backchannelGrant` | `authClient.backchannelAuthenticationGrant({ authReqId })` | auth-js | -| `tokenExchange.exchangeToken` | `authClient.exchangeToken({ subjectTokenType, subjectToken, audience })` | auth-js | -| `UserInfoClient.getUserInfo` | `TokenResponse.claims` (preferred) / `authClient.getUserInfo({ accessToken })` / `serverClient.getUser()` | auth-js / server-js | -| (no equivalent): build `/authorize` URL | `authClient.buildAuthorizationUrl({ ... })` | auth-js | -| (no equivalent): build `/v2/logout` URL | `authClient.buildLogoutUrl({ returnTo })` | auth-js | -| `ManagementClient.*` | **not migrated, stays on `auth0`** | n/a | - -When you finish a flow, return to the [verification checklist](./index.md#verification-checklist) and confirm the four cross-cutting changes for every call site you touched. diff --git a/auth-migration/index.md b/auth-migration/index.md deleted file mode 100644 index 85a11c45c7..0000000000 --- a/auth-migration/index.md +++ /dev/null @@ -1,732 +0,0 @@ -# Authentication Migration Guide - -A guide to migrating your authentication code off the `auth0` package (node-auth0) to the modern Auth0 server SDKs: [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js) for stateless token grants, and [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js) for server-managed sessions. - -> **Migrating with an AI agent?** Point it at the Auth0 migration skill first. The skill lives in [`auth0/agent-skills`](https://github.com/auth0/agent-skills) as the `auth0` skill (migration intent: `migrate-node-auth0`). It encodes the target-SDK routing, the four cross-cutting breaking changes, the method-by-method mapping, and a build-until-green verify loop. - -## Contents - -- [How to use this guide](#how-to-use-this-guide) -- [Overview](#overview) - - [Who this is for](#who-this-is-for) - - [Scope](#scope) -- [Choosing your target SDK](#choosing-your-target-sdk) -- [Prerequisites](#prerequisites) -- [Installation and constructor mapping](#installation-and-constructor-mapping) -- [OIDC token grants](#oidc-token-grants) - - [Optional: migrate only OIDC while staying on v6](#optional-migrate-only-oidc-while-staying-on-v6) -- [Cross-cutting breaking changes](#cross-cutting-breaking-changes) - - [1. Return shape](#1-return-shape) - - [2. Casing](#2-casing) - - [3. Token expiry](#3-token-expiry) - - [4. Error model](#4-error-model) -- [Verification checklist](#verification-checklist) -- [Continue the migration](#continue-the-migration) - - [Other authentication flows](#other-authentication-flows) - - [Server-side sessions](#server-side-sessions) - - [Troubleshooting](#troubleshooting) - -## How to use this guide - -This is a reference, not a linear read. You do not have to work through it top to bottom; migrate only the flows your app actually uses, in whatever order suits you. Most apps finish after the [OIDC token grants](#oidc-token-grants) section. - -The work falls into three phases: - -| Phase | What you do | Where | -| --- | --- | --- | -| **Before**: orient and set up | Pick your target SDK, check prerequisites, install the package, map constructor options. | [Choosing your target SDK](#choosing-your-target-sdk), [Prerequisites](#prerequisites), [Installation and constructor mapping](#installation-and-constructor-mapping) | -| **During**: rewrite call sites | Rewrite the OIDC token grants (in this file), then the other flows and the session layer as needed. Apply the four cross-cutting breaking changes to every call site. | [OIDC token grants](#oidc-token-grants), [Cross-cutting breaking changes](#cross-cutting-breaking-changes), [`authentication-flows.md`](./authentication-flows.md), [`server-side-sessions.md`](./server-side-sessions.md) | -| **After**: verify | Run the build-until-green checklist; confirm no residue and that `ManagementClient` code is untouched. | [Verification checklist](#verification-checklist) | - -Suggested order: start with the OIDC grants and cross-cutting changes (the whole job for most apps), then the [other flows](./authentication-flows.md) you actually use, then [session apps](./server-side-sessions.md) if you want the SDK to own sessions. Stuck? See [`troubleshooting.md`](./troubleshooting.md). - -## Overview - -node-auth0's `AuthenticationClient` is a stateless HTTP client. Every method is a single call to an Auth0 Authentication API endpoint that returns a response object. It has no notion of a logged-in user, no session, no cookie, no token store, and no automatic refresh. Anything stateful in a node-auth0 app (persisting tokens, deciding when to refresh, tracking the login across requests) was written by you *around* node-auth0. - -The modern stack splits those two concerns into two packages: - -- `@auth0/auth0-auth-js` is the stateless token layer. It is the direct successor to `AuthenticationClient`: the same "one method equals one API call equals one result" model, with modern ergonomics (camelCase, typed errors, direct return values, per-request options). -- `@auth0/auth0-server-js` is a stateful session layer built on top of auth0-auth-js. It owns the login redirect flow, a pluggable state/transaction store, cookie handling, automatic token refresh, and logout. It is the successor to the *session code you hand-rolled*, not to `AuthenticationClient` itself. - -### Who this is for - -You are running a Node.js backend that imports the `auth0` package and calls `AuthenticationClient` (or `UserInfoClient`) to perform token grants, database signup, passwordless, CIBA, token exchange, or userinfo lookups. You want to move that code to the current first-party server SDKs. This is a surgical rewrite of the authentication layer: routes, controllers, business logic, data access, and framework wiring stay as they are. You touch the smallest possible surface: the files that import and call node-auth0's Authentication API. - -### Scope - -In scope: - -- `AuthenticationClient` and its sub-clients: `.oauth`, `.database`, `.passwordless`, `.backchannel`, `.tokenExchange` -- `UserInfoClient` -- The auth error types (`AuthApiError`) and token-validation types (`IDTokenValidateOptions`, `IdTokenValidatorError`) - -Out of scope, do not touch: - -- `ManagementClient` (Management API v2). It is not being migrated and stays on the `auth0` package. -- Application routes, view/controller logic, database code, and any non-auth use of the `auth0` package. - -> If a file uses `ManagementClient`, leave that code alone. Only rewrite the `AuthenticationClient` / `UserInfoClient` parts. - -## Choosing your target SDK - -The routing question is: do you want to keep owning your session, or hand that responsibility to the SDK? - -### Decision table - -| If your code… | Migrate to | Why | -| --- | --- | --- | -| Only performs token grants / DB signup / passwordless / userinfo and manages its own session (or is a machine-to-machine service backend) | `@auth0/auth0-auth-js` | Direct, near 1:1 replacement for `AuthenticationClient`. Same stateless model. | -| Wants the SDK to own the login redirect flow, session storage, cookies, token refresh, and logout (a server-rendered web app) | `@auth0/auth0-server-js` | Adds a session layer node-auth0 never had. This is a rewrite of the session handling, not a method-for-method port. | - -**Default recommendation:** start with `@auth0/auth0-auth-js` for a faithful parity migration. Choose `@auth0/auth0-server-js` only when you currently hand-roll session/cookie/refresh logic around node-auth0 and would benefit from the SDK owning it. - -### Signals - -Signals that point to auth0-auth-js: - -- Predominant use is `clientCredentialsGrant` (machine-to-machine). There is no user, so there is no session to own. -- The app already has a session framework it is happy with and only calls node-auth0 for token grants. -- The app is an API, worker, or CLI, not a browser-facing web server. -- You want the smallest, most mechanical, lowest-risk migration. - -Signals that point to auth0-server-js: - -- The app performs a browser redirect login and reads `req.session.user` (or equivalent) on later requests. -- You wrote refresh-on-expiry logic, a token cache, or logout-with-revocation by hand. -- You use `express-openid-connect` today and want a first-party, framework-agnostic replacement. -- You are on a server framework (Express, Fastify, Hono, Next.js) and want the SDK to manage cookies. - -### Mixing both - -A single app can use both: auth0-server-js for the user-facing login/session, and auth0-auth-js directly for a separate machine-to-machine `clientCredentialsGrant` to call another API. `ServerClient` even exposes the underlying `AuthClient` via `serverClient.authClient` for occasional low-level needs. Do not force everything onto one package. - -## Prerequisites - -### Node.js version - -Both target SDKs need Node.js 20 LTS or newer. Verify the project's runtime before installing. - -### SDK versions - -- `@auth0/auth0-auth-js` >= `1.13.0` -- `@auth0/auth0-server-js` >= `1.13.0` - -Both are published on npm; install the current `latest`. `1.13.0` is the floor for the full API surface used in this guide (`getUserInfo`, per-request `RequestOptions`, and `fullResponse`). - -## Installation and constructor mapping - -Add the target package: - -```bash -# auth-js target (stateless token grants) -npm install @auth0/auth0-auth-js - -# server-js target (server-managed sessions), pulls in auth0-auth-js transitively -npm install @auth0/auth0-server-js -``` - -Keep the `auth0` package installed if the app still uses `ManagementClient`. - -### Imports - -```ts -// before -import { AuthenticationClient, UserInfoClient, AuthApiError } from "auth0"; - -// after: auth-js target -import { AuthClient, TokenByCodeError, isMfaRequiredError } from "@auth0/auth0-auth-js"; - -// after: server-js target -import { ServerClient } from "@auth0/auth0-server-js"; -``` - -> Keep the `auth0` import if the file also uses `ManagementClient`. It is correct for a file to import both `auth0` (for `ManagementClient`) and `@auth0/auth0-auth-js` (for authentication). Only remove the `auth0` import from files where it was used *solely* for `AuthenticationClient` / `UserInfoClient`. - -### AuthClient options - -The constructor options mostly carry over with camelCase names. A few are renamed or dropped. - -**Before (node-auth0):** - -```ts -new AuthenticationClient({ - domain: "tenant.us.auth0.com", - clientId: "...", - clientSecret: "...", // OR clientAssertionSigningKey - clientAssertionSigningKey: "...", - clientAssertionSigningAlg: "RS256", - idTokenSigningAlg: "RS256", // for manual id_token validation - clockTolerance: 60, // seconds, for validation - useMTLS: false, - telemetry: true, - headers: { "X-Custom": "..." }, // sent on every request - timeoutDuration: 10000, // ms - retry: { - /* ... */ - }, - agent: undiciDispatcher, - fetch: customFetch, - middleware: [ - /* ... */ - ], -}); -``` - -**After (auth0-auth-js):** - -```ts -import { AuthClient } from "@auth0/auth0-auth-js"; - -new AuthClient({ - domain: "tenant.us.auth0.com", // same (no scheme) - clientId: "...", // same - clientSecret: "...", // same - clientAssertionSigningKey: "...", // same (string | CryptoKey) - clientAssertionSigningAlg: "RS256", // same - authorizationParams: { - // NEW: default scope/audience/redirect_uri for URL builders - scope: "openid profile email", - audience: "https://api.example.com", - redirect_uri: "https://app.example.com/callback", - }, - useMtls: false, // RENAMED from useMTLS (lowercase tls) - customFetch: fetch, // RENAMED from fetch - telemetry: { - /* ... */ - }, // structured TelemetryConfig - discoveryCache: { ttl, maxEntries }, // NEW: OIDC discovery / JWKS cache -}); -``` - -Option-by-option: - -| node-auth0 | auth0-auth-js | Notes | -| --- | --- | --- | -| `domain` | `domain` | Unchanged. No `https://` scheme. | -| `clientId` | `clientId` | Unchanged. | -| `clientSecret` | `clientSecret` | Unchanged. | -| `clientAssertionSigningKey` | `clientAssertionSigningKey` | Unchanged. Now also accepts a `CryptoKey`. | -| `clientAssertionSigningAlg` | `clientAssertionSigningAlg` | Unchanged. | -| `useMTLS` | `useMtls` | Renamed (casing). | -| `fetch` | `customFetch` | Renamed. | -| `telemetry: boolean` | `telemetry: TelemetryConfig` | Now a structured object. | -| `headers` (global) | per-request `RequestOptions.headers` | Moved to per-request options; set per call site rather than globally. | -| `timeoutDuration` | per-request `RequestOptions.signal` | Use an `AbortSignal.timeout(ms)` on the call. | -| `retry` | configure via `customFetch` | Wrap your fetch with retry if needed. | -| `agent` | configure via `customFetch` | Set the dispatcher inside your custom fetch. | -| `middleware` | `customFetch` | Compose behavior in the fetch wrapper. | -| `idTokenSigningAlg` | (internal) | ID-token validation is internal; read `TokenResponse.claims`. | -| `clockTolerance` | (internal) | Handled internally during validation. | - -### ServerClient options - -`ServerClient` wraps an `AuthClient` and adds the session machinery. It shares the auth options and adds required stores. This constructor and the stores it needs are covered in [`server-side-sessions.md`](./server-side-sessions.md); reach for it only when you route to server-js. - -### Global config to per-request options - -node-auth0's global constructor options for `headers`, `timeoutDuration`, `agent`, `retry`, and `middleware` have no direct constructor equivalents in auth0-auth-js. Instead, the new SDK's methods accept a trailing `RequestOptions` parameter: - -```ts -import type { RequestOptions } from "@auth0/auth0-server-js"; // or '@auth0/auth0-auth-js' - -const tokens = await authClient.getTokenByClientCredentials( - { audience: "https://api.example.com" }, - { - headers: { "X-Custom": "value" }, - signal: AbortSignal.timeout(5000), // timeout in ms - } satisfies RequestOptions, -); -``` - -`@auth0/auth0-server-js` re-exports `RequestOptions`, `ApiResponse`, and `FullResponseOption` from `@auth0/auth0-auth-js`, so you can import any of them from either package. - -Arity rule: MFA methods (`authClient.mfa.*`) take `requestOptions` as the 2nd argument; store-first methods (session-owning methods on `serverClient`) take it as the 3rd argument after the store context; cache hits ignore it entirely. - -Common patterns: - -- Global headers: apply via `RequestOptions.headers` on each call that needs it, or wrap `customFetch` once to inject it everywhere. -- Timeout: replace `timeoutDuration: 10000` with `signal: AbortSignal.timeout(10000)` on the call. -- Agent (Node.js dispatcher): wrap `customFetch` to inject the agent into the underlying HTTP transport. -- Retry / middleware: compose behavior in a `customFetch` wrapper passed either at construction or per request. - -## OIDC token grants - -This is the core of the migration and, for most apps, the whole of it. These are the `AuthenticationClient.oauth.*` grants that drive OpenID Connect login and machine-to-machine token acquisition. All of them move onto the `AuthClient` instance directly (not a sub-client). - -Before you touch any method, internalize the four [cross-cutting breaking changes](#cross-cutting-breaking-changes); they apply to *every* rewrite here and on the incremental pages. - -Naming conventions used throughout: - -| node-auth0 | new SDKs | -| --- | --- | -| Params and response fields use the snake_case wire shape: `client_id`, `refresh_token`, `access_token`, `expires_in`, `phone_number` | camelCase: `clientId`, `refreshToken`, `accessToken`, `expiresAt`, `phoneNumber` | -| Methods take a `bodyParameters` object (+ optional `initOverrides`) | Methods take a single `options` object (+ optional trailing `RequestOptions` for per-request `signal`, `headers`, `customFetch`) | -| Every method returns a `JSONApiResponse` / `VoidApiResponse` / `TextApiResponse` wrapper | Methods return the domain object directly (`TokenResponse`, `SignUpResult`, `string`, `void`) | - -### `oauth.authorizationCodeGrant` → `getTokenByCode` - -The single most important semantic change in the whole migration. In node-auth0 you pass the raw authorization `code` (and `redirect_uri`) that you extracted from the callback query string yourself. In auth0-auth-js you pass the entire callback `URL`; the SDK extracts `code` and enforces PKCE, and `redirect_uri` comes from the `AuthClient` config / `authorizationParams`. The stateless `AuthClient` does **not** validate OAuth `state` — that is your responsibility (or use `@auth0/auth0-server-js` `completeInteractiveLogin`, which owns a transaction store and validates `state` for you). - -**Before (node-auth0):** - -```ts -import { AuthenticationClient } from "auth0"; - -const auth0 = new AuthenticationClient({ domain, clientId, clientSecret }); - -// You parsed `code` out of the callback URL yourself. -const resp = await auth0.oauth.authorizationCodeGrant({ - code, - redirect_uri: "https://app.example.com/callback", -}); -const accessToken = resp.data.access_token; -const expiresIn = resp.data.expires_in; // relative seconds -const reqId = resp.headers.get("x-request-id"); // metadata on success -``` - -**After (auth0-auth-js):** - -```ts -import { AuthClient } from "@auth0/auth0-auth-js"; - -const authClient = new AuthClient({ domain, clientId, clientSecret }); - -// `url` is a URL object for the full incoming request URL, -// e.g. new URL(req.url, `https://${req.headers.host}`) -const tokens = await authClient.getTokenByCode(url, { - // options; e.g. codeVerifier (PKCE) or organization -}); -const accessToken = tokens.accessToken; -const expiresAt = tokens.expiresAt; // absolute Unix seconds -``` - -> If your code manually parses `req.query.code`, that parsing is now the SDK's job. Delete it and hand the SDK the full URL. The SDK reads `code` from the URL and validates the PKCE verifier; it does **not** validate OAuth `state`. **Keep your existing `state` check** (compare the `state` query parameter against what you stored before the redirect) — or migrate to `@auth0/auth0-server-js` `completeInteractiveLogin`, which handles `state` validation automatically. (`getTokenByCode` options are `codeVerifier` and `organization`.) If the node-auth0 code read `resp.headers.get(...)` on success, see [Reading HTTP response metadata](#reading-http-response-metadata-fullresponse). Error-path metadata remains accessible on the typed error. - -> **Warning:** Do not delete your `state`/CSRF check when migrating to `AuthClient.getTokenByCode`. The stateless client does not validate `state`. Removing the check silently disables CSRF protection on the authorization-code flow. - -### `oauth.authorizationCodeGrantWithPKCE` → `getTokenByCode` (with verifier) - -PKCE (Proof Key for Code Exchange) is folded into the same method; supply the code verifier via options. Typically the verifier was produced earlier by `buildAuthorizationUrl` (below), which returns a `codeVerifier` for you to persist. - -```ts -// before -const resp = await auth0.oauth.authorizationCodeGrantWithPKCE({ - code, - code_verifier: verifier, - redirect_uri: "https://app.example.com/callback", -}); - -// after -const tokens = await authClient.getTokenByCode(url, { - codeVerifier: verifier, -}); -``` - -> If you build the authorization URL yourself today, prefer switching to `authClient.buildAuthorizationUrl()` (below) so the SDK generates and returns the `codeVerifier`, then persist it and pass it back to `getTokenByCode`. - -### `oauth.refreshTokenGrant` → `getTokenByRefreshToken` - -```ts -// before -const resp = await auth0.oauth.refreshTokenGrant({ refresh_token: rt }); -// after -const tokens = await authClient.getTokenByRefreshToken({ refreshToken: rt }); -``` - -### `oauth.passwordGrant` → `getTokenByPassword` - -```ts -// before -const resp = await auth0.oauth.passwordGrant({ - username, - password, - realm: "Username-Password-Authentication", - audience, - scope, -}); -// after -const tokens = await authClient.getTokenByPassword({ - username, - password, - realm: "Username-Password-Authentication", - audience, - scope, -}); -``` - -### `oauth.clientCredentialsGrant` → `getTokenByClientCredentials` - -The canonical machine-to-machine grant. This is the most common reason to stay on auth0-auth-js rather than adopt server-js: there is no user session involved. - -```ts -// before -const resp = await auth0.oauth.clientCredentialsGrant({ audience: "https://api.example.com" }); -const token = resp.data.access_token; -// after -const tokens = await authClient.getTokenByClientCredentials({ audience: "https://api.example.com" }); -const token = tokens.accessToken; -``` - -### `oauth.revokeRefreshToken` → `revokeToken` - -Renamed, and simplified return (was `VoidApiResponse`, now `void`). - -```ts -// before -await auth0.oauth.revokeRefreshToken({ token: rt }); -// after -await authClient.revokeToken({ token: rt }); -``` - -> **Session apps:** if you are migrating to server-js and this revoke was part of logout, use `serverClient.revokeRefreshToken()` instead of the low-level `revokeToken`. By default it reads the refresh token from the session; you can also pass an explicit `{ token }` in its options. - -### Build the authorization and logout URLs - -node-auth0 left `/authorize` URL construction to the caller (or to `express-openid-connect`). The new SDK gives you `buildAuthorizationUrl()` and `buildLogoutUrl()`. When migrating a redirect login, replace hand-built `/authorize` and `/v2/logout` URLs with these: - -```ts -const { authorizationUrl, codeVerifier } = await authClient.buildAuthorizationUrl({ - authorizationParams: { redirect_uri, scope: "openid profile email", audience }, -}); -// ... later, on logout: -const logoutUrl = await authClient.buildLogoutUrl({ returnTo: "https://app.example.com" }); -``` - -> Pushed Authorization Requests (PAR): there is no standalone PAR method. Pass `pushedAuthorizationRequests: true` to `buildAuthorizationUrl`: the SDK performs the PAR POST and returns an authorization URL that references the resulting `request_uri`. Requires the tenant to expose a `pushed_authorization_request_endpoint`; the SDK throws if PAR is requested but unsupported. This replaces node-auth0's `oauth.pushedAuthorization`. - -Once the OIDC grants are rewritten and the [cross-cutting breaking changes](#cross-cutting-breaking-changes) are applied, run the [verification checklist](#verification-checklist). If your app also uses database, passwordless, CIBA, token exchange, or `UserInfoClient`, continue with [`authentication-flows.md`](./authentication-flows.md). If you want the SDK to own sessions, see [`server-side-sessions.md`](./server-side-sessions.md). - -### Optional: migrate only OIDC while staying on v6 - -You do not have to migrate everything at once, and you do not have to wait for v7. node-auth0 v6 still ships `AuthenticationClient` alongside `ManagementClient`, so you can move your OIDC login and token grant code off `AuthenticationClient` to `@auth0/auth0-auth-js` now, incrementally, while the rest of the app keeps using `auth0` v6 unchanged. - -A common and fully supported end state: - -- OIDC / token grant code: migrated to `@auth0/auth0-auth-js` (the grants covered in this section). -- Other auth flows you have not gotten to yet: still on `AuthenticationClient` from `auth0` v6. -- Management API: still on `ManagementClient` from `auth0` (never migrates). - -The OIDC grants above are a complete, shippable step on their own; finishing them is a valid stopping point even if you migrate nothing else. Move on to [`authentication-flows.md`](./authentication-flows.md) and [`server-side-sessions.md`](./server-side-sessions.md) later, at your own pace. When you eventually upgrade to v7 (which removes the Authentication API from the main entrypoint; see the [v7 Migration Guide](../v7_MIGRATION_GUIDE.md)), the OIDC work is already done. - -## Cross-cutting breaking changes - -Every call-site rewrite in this guide and on the incremental pages is subject to four changes that cut across all methods. They cause the overwhelming majority of migration defects, and three of the four are *silent*: the code compiles and often runs, but produces wrong behavior at runtime. Apply each one deliberately. - -1. [Return shape: `JSONApiResponse` → domain object](#1-return-shape) -2. [Casing: snake_case wire shape → camelCase](#2-casing) -3. [Token expiry: `expires_in` (relative) → `expiresAt` (absolute)](#3-token-expiry), most dangerous -4. [Error model: `AuthApiError` → typed per-operation errors](#4-error-model) - -### 1. Return shape - -node-auth0 wraps most Authentication API results in a response envelope: - -- `JSONApiResponse`: has `.data` (the payload), `.status` (number), `.statusText`, `.headers` (a `Headers` object). -- `VoidApiResponse`: same envelope, `.data` is `undefined` (used by `sendEmail`, `revokeRefreshToken`, …). -- `TextApiResponse`: `.data` is a `string` (used by `database.changePassword`). - -Exception: `backchannel.authorize`, `backchannel.backchannelGrant`, and `tokenExchange.exchangeToken` return domain objects directly (no `.data` wrapper) in node-auth0. - -The new SDKs drop the envelope and return the domain object directly: - -- Token grants return a `TokenResponse` instance. -- `database.signUp` returns a `SignUpResult` object. -- `database.changePassword` returns a `string`. -- `sendEmail` / `sendSms` / `revokeToken` return `void`. - -HTTP metadata (status code, response headers such as `x-request-id`, `retry-after`, rate-limit headers) is available through the typed error objects on failure paths. On success paths, metadata is available via the opt-in `fullResponse` envelope (see [Reading HTTP response metadata](#reading-http-response-metadata-fullresponse)). It is no longer on the bare success value by default. - -The rewrite: delete `.data` indirection on every success path: - -```ts -// before -const resp = await auth0.oauth.clientCredentialsGrant({ audience }); -const token = resp.data.access_token; -const status = resp.status; - -// after -const tokens = await authClient.getTokenByClientCredentials({ audience }); -const token = tokens.accessToken; -``` - -```ts -// before: changePassword returned TextApiResponse -const resp = await auth0.database.changePassword({ email, connection }); -console.log(resp.data); - -// after: returns the string directly -const message = await authClient.database.changePassword({ email, connection }); -console.log(message); -``` - -> `changePassword` requires `connection` plus at least one of `email` or `username`: either identifier is accepted, not `email` alone. - -#### Reading HTTP response metadata (fullResponse) - -When your node-auth0 code reads HTTP response metadata (status, headers) on a success path, migrate to the opt-in envelope rather than dropping the read. This is most common when you track rate limits, log request IDs, or check retry-after headers for dashboard telemetry. - -```ts -// before (node-auth0): metadata on the success envelope -const resp = await auth0.oauth.clientCredentialsGrant({ audience }); -const remaining = resp.headers.get("x-ratelimit-remaining"); -const token = resp.data.access_token; - -// after: opt in to the envelope, read the native Response -const { data, response } = await authClient.getTokenByClientCredentials({ audience, fullResponse: true }); -const remaining = response.headers.get("x-ratelimit-remaining"); -const token = data.accessToken; -``` - -The same opt-in covers the non-token Authentication API methods that node-auth0 wrapped in a `JSONApiResponse` / `TextApiResponse` / `VoidApiResponse`: - -| Method | Bare return | `fullResponse: true` return | -| --- | --- | --- | -| `database.signUp` | `SignUpResult` | `ApiResponse` | -| `database.changePassword` | `string` | `ApiResponse` | -| `passwordless.sendEmail` | `void` | `ApiResponse` (`data` is `undefined`) | -| `passwordless.sendSms` | `void` | `ApiResponse` (`data` is `undefined`) | - -```ts -// before (node-auth0): read the request id off the signup envelope -const resp = await auth0.database.signUp({ email, password, connection }); -const reqId = resp.headers.get("x-request-id"); - -// after: opt in to the envelope -const { data, response } = await authClient.database.signUp({ email, password, connection, fullResponse: true }); -const reqId = response.headers.get("x-request-id"); - -// void-returning methods expose the Response with an undefined `data` -const { response: sendResp } = await authClient.passwordless.sendEmail({ email, fullResponse: true }); -const rateLimit = sendResp.headers.get("x-ratelimit-remaining"); -``` - -Caveats: - -- Pass `fullResponse: true` as a literal, not a variable. Using spread (`{ ...opts, fullResponse: true }`) widens `true` to `boolean`, causing TypeScript overload resolution to fall back to the bare return type. Fix: pass `{ ...opts, fullResponse: true as const }` or include `fullResponse` as an inline literal in the options object. -- Performance: `@auth0/auth0-auth-js` does not cache tokens: every `AuthClient` grant method performs a live token-endpoint round-trip regardless of `fullResponse`, so the flag adds no extra network cost at this layer. (Token caching and reuse live in `@auth0/auth0-server-js`'s session store, not in the auth-js `AuthClient`.) The only in-memory cache in auth-js is for OIDC discovery / JWKS metadata, which is unrelated to `fullResponse`. -- Reserved headers: a caller `Authorization` header is ignored and the telemetry `Auth0-Client` header always wins; `RequestOptions.headers` cannot override them. -- Per-request `customFetch` replaces the base transport for that call but does not inherit mutual TLS (mTLS). If you rely on mTLS, the supplied fetch must itself be mTLS-capable. - -Default to the bare return type. Reach for `fullResponse` only where you actually consumed response metadata on success: rate-limit dashboards, request-id logging for support investigations, or retry-after handling. `MissingCapturedResponseError` is an internal-bug sentinel; you do not normally catch it. - -Gotchas: - -- **Void methods.** Code that did `const r = await auth0.passwordless.sendEmail(...)` and then checked `r.status === 200` must drop that check: by default the method returns `void` and throws on failure. Rely on the thrown error instead (see [Error model](#4-error-model)). -- **Header reads.** Any code reading `resp.headers.get('x-ratelimit-remaining')` on a success path needs the opt-in `fullResponse` envelope. Error paths still surface metadata on the typed error. Search your code for `.headers` on response values. -- **Do not hand-roll a compatibility shim.** Resist reintroducing a custom `{ data, status }` shape to minimize downstream diff. Let the domain object flow through; the SDK's opt-in `fullResponse` envelope is the sanctioned channel when you genuinely need the HTTP Response. - -### 2. Casing - -node-auth0's public API exposes the snake_case wire shape verbatim, on both inputs and outputs. The new SDKs use camelCase for the public API and only translate to snake_case at the HTTP boundary internally. - -Input parameters, field map: - -| node-auth0 (snake_case) | new SDK (camelCase) | -| --- | --- | -| `client_id` | `clientId` | -| `client_secret` | `clientSecret` | -| `refresh_token` | `refreshToken` | -| `redirect_uri` | (via `authorizationParams.redirect_uri` on config / builder) | -| `code_verifier` | `codeVerifier` | -| `phone_number` | `phoneNumber` | -| `auth_req_id` | `authReqId` | -| `binding_message` | `bindingMessage` | -| `subject_token` / `subject_token_type` | `subjectToken` / `subjectTokenType` | -| `given_name` / `family_name` | `givenName` / `familyName` | -| `user_metadata` | `userMetadata` | -| `login_hint` | `loginHint` | - -Output fields, `TokenResponse` field map: - -| node-auth0 `TokenSet` (snake_case) | new SDK `TokenResponse` (camelCase) | -| --- | --- | -| `access_token` | `accessToken` | -| `refresh_token` | `refreshToken` | -| `id_token` | `idToken` | -| `token_type` | `tokenType` | -| `expires_in` (relative) | `expiresAt` (absolute, see [Token expiry](#3-token-expiry)) | -| `scope` | `scope` | -| (none): had to decode id_token yourself | `claims` (already-decoded ID token claims) | -| `authorization_details` | `authorizationDetails` | - -Rename fields on both the arguments you pass in and the fields you read out: - -```ts -// before -const resp = await auth0.oauth.refreshTokenGrant({ refresh_token: rt }); -const newRt = resp.data.refresh_token; -const idToken = resp.data.id_token; - -// after -const tokens = await authClient.getTokenByRefreshToken({ refreshToken: rt }); -const newRt = tokens.refreshToken; -const idToken = tokens.idToken; -``` - -> **Gotcha: keys that look renamed but are your data.** `user_metadata` → `userMetadata` is a rename of the *SDK's* parameter. The object *inside* it (e.g. `{ plan: 'free' }`) is passed through untouched. Do not rename your own metadata keys. The same applies to `authorization_details`. - -### 3. Token expiry - -**This is the highest-risk change in the migration. It is silent, it compiles, and it corrupts session lifetimes.** - -- node-auth0 `TokenSet.expires_in` = the token's lifetime in seconds relative to now (e.g. `86400` for a 24-hour token). This is the raw OAuth `expires_in` from the wire. -- new SDK `TokenResponse.expiresAt` = an absolute Unix timestamp in seconds (e.g. `1786000000`) computed by the SDK as roughly `now + expires_in`. - -Existing node-auth0 code almost always converts the relative value to an absolute deadline itself: - -```ts -// before: very common node-auth0 pattern -const resp = await auth0.oauth.refreshTokenGrant({ refresh_token: rt }); -const expiresAtMs = Date.now() + resp.data.expires_in * 1000; // stored deadline -``` - -If you mechanically rename `expires_in` → `expiresAt` and leave the arithmetic, you get: - -```ts -// WRONG: double-counts "now" -const tokens = await authClient.getTokenByRefreshToken({ refreshToken: rt }); -const expiresAtMs = Date.now() + tokens.expiresAt * 1000; // ~ now + (now + lifetime) → far future -``` - -The stored deadline lands decades in the future, so the token is treated as valid long after it has actually expired. The app does not refresh it, so production 401s follow. - -The rewrite: `expiresAt` is *already* the deadline. Do not add `Date.now()`: - -```ts -// after: correct -const tokens = await authClient.getTokenByRefreshToken({ refreshToken: rt }); -const expiresAtMs = tokens.expiresAt * 1000; // absolute; convert s → ms only if you store ms -``` - -If downstream code genuinely needs the *relative* remaining lifetime (e.g. to set a cookie `Max-Age`), compute it from the absolute value: - -```ts -const secondsRemaining = tokens.expiresAt - Math.floor(Date.now() / 1000); -``` - -To find every instance, grep your code for these patterns and inspect each by hand: - -- `expires_in` -- `Date.now() +` near a token result -- `+ expires` / `* 1000` near a token result -- any stored field named `expiresAt`, `expires_at`, `expiry`, `tokenExpiry` fed from a grant - -Every one of these is a candidate for the double-count bug. - -> **Session apps get this for free.** If you migrate to server-js, the SDK owns expiry math inside `getAccessToken`. Delete your `Date.now() + expires_in * 1000` bookkeeping entirely. - -### 4. Error model - -node-auth0 throws a single error type for Authentication API failures: - -```ts -class AuthApiError extends Error { - name: "AuthApiError"; - error: string; // OAuth error code, e.g. 'invalid_grant' - error_description: string; - statusCode: number; - body: string; - headers: Headers; -} -``` - -The new SDKs throw typed, operation-specific error classes: `TokenByCodeError`, `TokenByRefreshTokenError`, `TokenByClientCredentialsError`, `TokenByPasswordError`, `TokenExchangeError`, `TokenRevocationError`, `PasswordlessStartError`, `PasswordlessChallengeError`, `PasswordlessDbGetTokenError`, `MfaEnrollmentError`, and so on. Each carries a structured `.cause` (the underlying OAuth2 error) rather than flat `error` / `error_description` strings. - -The rewrite: generic catch: - -```ts -// before -try { - await auth0.oauth.refreshTokenGrant({ refresh_token: rt }); -} catch (e) { - if (e instanceof AuthApiError && e.error === "invalid_grant") { - // refresh token revoked/expired - } -} - -// after -import { TokenByRefreshTokenError } from "@auth0/auth0-auth-js"; -try { - await authClient.getTokenByRefreshToken({ refreshToken: rt }); -} catch (e) { - if (e instanceof TokenByRefreshTokenError && e.cause?.error === "invalid_grant") { - // refresh token revoked/expired - } -} -``` - -Import the specific error class for the operation you are calling. If you had one broad `catch (e instanceof AuthApiError)` around several different operations, either widen to catch each operation's error type or check the shared base behavior. Prefer the specific type per call site, since it documents which operation can fail. - -#### MFA detection: use the type guard, not the string - -Multi-factor authentication (MFA). A very common node-auth0 pattern is detecting `mfa_required` by string comparison to route the user into an MFA challenge: - -```ts -// before -try { - await auth0.oauth.passwordGrant({ username, password }); -} catch (e) { - if (e instanceof AuthApiError && e.error === "mfa_required") { - // start MFA flow using e (mfa_token is in the body) - } -} -``` - -The new SDK provides `isMfaRequiredError()`, a type guard that narrows the error and gives typed access to the MFA context (including the `mfa_token`). Use it instead of matching the string: - -```ts -// after -import { isMfaRequiredError } from "@auth0/auth0-auth-js"; -try { - await authClient.getTokenByPassword({ username, password }); -} catch (e) { - if (isMfaRequiredError(e)) { - // e is narrowed; drive the MFA challenge via authClient.mfa.* - } -} -``` - -> After detecting `mfa_required`, the MFA enroll/challenge/verify flow that node-auth0 handled ad hoc now lives on `authClient.mfa.*` (`listAuthenticators`, `enrollAuthenticator`, `challengeAuthenticator`, `verify`, and `deleteAuthenticator`). In server-js, `serverClient.mfa.verify()` also persists the resulting tokens to the session. - -#### ID-token validation types - -node-auth0 exposed `IDTokenValidateOptions` and `IdTokenValidatorError` for callers doing manual ID-token validation. The new SDK validates ID tokens internally during grants and exposes the decoded, validated result as `TokenResponse.claims`. Replace manual validation: - -- Options like `organization`, `nonce`, `maxAge` are passed to the grant call (e.g. `getTokenByCode`), and the SDK validates them and throws a typed error on mismatch, so you no longer construct a validator or catch `IdTokenValidatorError` yourself. -- Read the validated claims from `TokenResponse.claims` instead of decoding the `id_token` string. - -## Verification checklist - -The migration is not complete until every check passes in a single pass. For every node-auth0 auth call you rewrote (here or on the incremental pages), confirm all four cross-cutting changes: - -- [ ] **Return shape**: removed `.data` / `.status` / `.headers` access on the success path. -- [ ] **Casing**: renamed every snake_case field on input args and output reads to camelCase. -- [ ] **Expiry**: any code using the old `expires_in` now uses `expiresAt` as an *absolute* timestamp; no `Date.now() +` was left in front of it. -- [ ] **Errors**: `AuthApiError` catches replaced with the specific typed error (`.cause.error`); `mfa_required` string checks replaced with `isMfaRequiredError()`. - -Then run the project gates and repeat the whole loop if any step fails: - -- [ ] Grep for residue: unmigrated `from 'auth0'` auth imports, `.data.` reads on auth responses, and relative `expires_in` arithmetic. -- [ ] `tsc --noEmit`: catches structural mismatches and type errors. -- [ ] `npm test` (or the project's test command): confirms behavior is preserved. -- [ ] Run the linter if the project has one configured. -- [ ] Confirm files that use `ManagementClient` still import and call it from `auth0`; that code must be untouched. - -Do not declare the migration complete until the loop converges: all steps pass in a single iteration. - -## Continue the migration - -Once the OIDC grants and the four cross-cutting changes are in, migrate the rest at your own pace. Each area lives in its own page. - -### Other authentication flows - -Database signup, passwordless, backchannel (CIBA), token exchange, and `UserInfoClient` lookups: see [`authentication-flows.md`](./authentication-flows.md). - -### Server-side sessions - -Routing to `@auth0/auth0-server-js`, where the SDK owns the login redirect flow, session storage, cookies, token refresh, and logout: see [`server-side-sessions.md`](./server-side-sessions.md). - -### Troubleshooting - -Common questions and failure modes (tokens valid for decades, missing `resp.data`, magic-link default flip, `getUserInfo`, `mfa_required` detection, global config): see [`troubleshooting.md`](./troubleshooting.md). diff --git a/auth-migration/server-side-sessions.md b/auth-migration/server-side-sessions.md deleted file mode 100644 index d040e2986b..0000000000 --- a/auth-migration/server-side-sessions.md +++ /dev/null @@ -1,163 +0,0 @@ -# Migrating session apps to `@auth0/auth0-server-js` - -This page is part of the [Authentication Migration Guide](./index.md). Read it only when you are routing to **`@auth0/auth0-server-js`**: when you want the SDK to own the login redirect flow, session storage, cookies, token refresh, and logout, instead of hand-rolling that around node-auth0. If you only need stateless token grants, stay on the main guide and [`authentication-flows.md`](./authentication-flows.md); you do not need this page. - -> **Migrating with an AI agent?** Point it at the Auth0 migration skill (the `auth0` skill in [`auth0/agent-skills`](https://github.com/auth0/agent-skills), migration intent `migrate-node-auth0`). It walks the session lifecycle step by step. - -**This is a rewrite of the session handling, not a method-for-method port.** node-auth0 had no session concept, so there is nothing to translate line-for-line. Instead you *replace* your existing session code (your `express-session` wiring, your token cache, your refresh-on-expiry logic, your logout handler) with the ServerClient lifecycle. You still touch only the auth/session code; routes, views, and business logic stay put. - -- [Mental model](#mental-model) -- [Store setup](#store-setup) -- [The redirect-login lifecycle](#the-redirect-login-lifecycle) -- [Logins without a browser redirect](#logins-without-a-browser-redirect) -- [Backchannel logout](#backchannel-logout) - -## Mental model - -A ServerClient login has three durable pieces: - -1. **Transaction store**: short-lived. Holds the in-flight login: the OAuth `state` and the PKCE (Proof Key for Code Exchange) `code_verifier` between the moment you redirect the user to Auth0 and the moment they come back to your callback. Created at `startInteractiveLogin`, consumed at `completeInteractiveLogin`. -2. **State store**: long-lived. Holds the established session: the user claims plus the access / refresh / ID tokens and their absolute expiry. Read on every subsequent request via `getUser`, `getSession`, `getAccessToken`. -3. **Cookies**: how the two stores key themselves to the browser. With a *stateless* store the session data lives encrypted in the cookie itself; with a *stateful* store the cookie holds only an identifier and the data lives in your backend (Redis, database, and so on). - -node-auth0 exposed none of this; you built equivalents by hand. You are swapping your implementation for the SDK's. - -## Store setup - -`@auth0/auth0-server-js` ships store base classes and cookie-backed implementations: - -- `CookieTransactionStore`: transaction store backed entirely by a cookie. Good default. -- `StatelessStateStore`: session lives encrypted in the cookie. No server-side storage; good for serverless or horizontally-scaled deployments with small sessions. -- `StatefulStateStore`: session lives server-side; the cookie holds an id. Use for large sessions or when you need server-side revocation. -- `AbstractTransactionStore` / `AbstractStateStore`: extend these to back a store with your own storage (Redis, Postgres, and so on). These are the exported base-class names. - -All stores accept a `CookieHandler` so they can integrate with any framework's cookie API. The `storeOptions` generic (`TStoreOptions`) is how you thread per-request context (like the framework `req` / `res`) into store reads and writes; every ServerClient method takes an optional trailing `storeOptions` argument for exactly this. - -```ts -import { ServerClient, CookieTransactionStore, StatelessStateStore } from "@auth0/auth0-server-js"; - -const serverClient = new ServerClient({ - domain: process.env.AUTH0_DOMAIN!, - clientId: process.env.AUTH0_CLIENT_ID!, - clientSecret: process.env.AUTH0_CLIENT_SECRET!, - authorizationParams: { - redirect_uri: "https://app.example.com/callback", - scope: "openid profile email offline_access", // offline_access ⇒ refresh token - audience: "https://api.example.com", - }, - transactionStore: new CookieTransactionStore( - { secret: process.env.SESSION_SECRET! }, - cookieHandler, // CookieHandler implementation - ), - stateStore: new StatelessStateStore( - { secret: process.env.SESSION_SECRET! }, - cookieHandler, // CookieHandler implementation - ), -}); -``` - -## The redirect-login lifecycle - -### 1. Start login: replace the hand-built `/authorize` redirect - -Whatever you did to send the user to Auth0 (a hand-constructed `/authorize` URL, or `express-openid-connect`'s `/login`) becomes: - -```ts -// GET /login -app.get("/login", async (req, res) => { - const authorizationUrl = await serverClient.startInteractiveLogin( - { - authorizationParams: { - /* optional per-login overrides */ - }, - appState: { returnTo: req.query.returnTo || "/" }, // seed appState for round-trip - }, - { req, res }, // storeOptions: lets the transaction store write its cookie - ); - res.redirect(authorizationUrl.href); -}); -``` - -`startInteractiveLogin` generates `state` and PKCE, writes them to the transaction store, and returns the fully-formed authorization URL. - -### 2. Complete login: replace the manual code exchange - -The callback handler that used to call `oauth.authorizationCodeGrant` (or `authorizationCodeGrantWithPKCE`) and then stuff tokens into the session becomes a single call: - -```ts -// GET /callback -app.get("/callback", async (req, res) => { - const callbackUrl = new URL(req.url, `https://${req.headers.host}`); - const { appState } = await serverClient.completeInteractiveLogin(callbackUrl, { req, res }); - // Session is now established in the state store. Tokens are NOT your concern anymore. - res.redirect(appState?.returnTo ?? "/"); -}); -``` - -`completeInteractiveLogin` validates `state`, exchanges the code, validates the ID token, writes the session (user + tokens + absolute expiry) to the state store, and clears the transaction. - -### 3. Read the user or session on later requests - -Replace `req.session.user` reads: - -```ts -const user = await serverClient.getUser({ req, res }); // user claims, or undefined -const session = await serverClient.getSession({ req, res }); // full session data, or undefined -``` - -`getUser` / `getSession` return `undefined` when there is no session or it has expired (the store deletes expired sessions on read), so use that as your "not logged in" signal. - -### 4. Get an access token to call an API: refresh is automatic - -Replace your manual "is the token expired? if so refresh" block: - -```ts -const { accessToken } = await serverClient.getAccessToken({ req, res }); -// If the stored access token is expired and a refresh token exists, -// the SDK refreshes and persists the new tokens transparently. -``` - -This is where the `expires_in` → `expiresAt` hazard disappears entirely: the SDK owns expiry math. For a downstream federated connection token (Token Vault), use `serverClient.getAccessTokenForConnection({ connection }, { req, res })`. - -### 5. Logout: replace manual revoke, session clear, and `/v2/logout` redirect - -```ts -// GET /logout -app.get("/logout", async (req, res) => { - const logoutUrl = await serverClient.logout({ returnTo: "https://app.example.com" }, { req, res }); - res.redirect(logoutUrl.href); -}); -``` - -`logout` clears the session from the state store and returns the Auth0 `/v2/logout` URL. If you also revoked the refresh token on logout (via `oauth.revokeRefreshToken`), call `serverClient.revokeRefreshToken({ req, res })` before redirecting; by default it reads the refresh token from the session, so you do not handle the raw token yourself (it also accepts an explicit `{ token }` if you need to revoke a specific one). - -## Logins without a browser redirect - -Some logins do not use a browser redirect: the password grant, passwordless, CIBA, and custom token exchange. If you used node-auth0 for one of these *and* want a server-js session out of it, use the ServerClient methods that both authenticate and write the session, rather than the low-level auth-js grants: - -| Flow | ServerClient method | -| --- | --- | -| Backchannel / CIBA | `loginBackchannel({ ... }, storeOptions)` | -| Passwordless (send) | `startPasswordless({ connection, email \| phoneNumber, ... }, storeOptions)` | -| Passwordless (verify code → session) | `completePasswordless({ connection, email \| phoneNumber, verificationCode }, storeOptions)` | -| Passwordless magic link (callback → session) | `completePasswordlessMagicLink(url, storeOptions)` | -| Custom token exchange → session | `loginWithCustomTokenExchange({ ... }, storeOptions)` | -| MFA verify → session | `serverClient.mfa.verify({ ... }, storeOptions)` | - -Each of these performs the underlying grant *and* persists the resulting tokens to the state store, so the user is logged in afterward, exactly the behavior you previously wrote by hand after a node-auth0 grant. - -## Backchannel logout - -If you implemented an Auth0 back-channel logout endpoint by hand (validating the logout token, then clearing your session store), replace it with: - -```ts -// POST /backchannel-logout -app.post("/backchannel-logout", async (req, res) => { - await serverClient.handleBackchannelLogout(req.body.logout_token, { req, res }); - res.sendStatus(204); -}); -``` - -It validates the logout token and clears the corresponding session. - -When the session layer is wired, return to the [verification checklist](./index.md#verification-checklist) in the main guide. diff --git a/auth-migration/troubleshooting.md b/auth-migration/troubleshooting.md deleted file mode 100644 index 334a37a698..0000000000 --- a/auth-migration/troubleshooting.md +++ /dev/null @@ -1,32 +0,0 @@ -# Troubleshooting: FAQ and gotchas - -Common questions and failure modes when migrating off the `auth0` package's Authentication API. This page is part of the [Authentication Migration Guide](./index.md); it assumes the terms defined there. - -> **Migrating with an AI agent?** Point it at the Auth0 migration skill (the `auth0` skill in [`auth0/agent-skills`](https://github.com/auth0/agent-skills), migration intent `migrate-node-auth0`). - -### Do I have to migrate everything at once? -No. The OIDC / token-grant work is a complete, shippable step on its own. You can stay on `auth0` v6 and migrate only OIDC, leaving other auth flows on `AuthenticationClient` for now. See [Optional: migrate only OIDC while staying on v6](./index.md#optional-migrate-only-oidc-while-staying-on-v6). - -### Do I have to migrate the Management API too? -No. `ManagementClient` is out of scope and stays on the `auth0` package. A file importing both `auth0` (for management) and `@auth0/auth0-auth-js` (for authentication) is correct. - -### auth0-auth-js or auth0-server-js: which do I pick? -Default to auth0-auth-js for a low-risk parity migration. Pick auth0-server-js only when you want the SDK to own the login redirect flow, session storage, cookies, refresh, and logout. See [Choosing your target SDK](./index.md#choosing-your-target-sdk). - -### My tokens suddenly look valid for decades. What happened? -You almost certainly left `Date.now() +` in front of `expiresAt`. `expiresAt` is already an absolute Unix timestamp, not a relative lifetime. See [Token expiry](./index.md#3-token-expiry). - -### Where did `resp.data` go? -The new SDKs return the domain object directly. Read `tokens.accessToken`, not `resp.data.access_token`. If you truly need HTTP response metadata on a success path, opt into `fullResponse`. - -### My magic-link passwordless flow stopped sending links. -The `send` default changed from `'link'` (node-auth0) to `'code'` (new SDK). Set `send: 'link'` explicitly if you want magic links. See [Passwordless](./authentication-flows.md#passwordless). - -### Where is `getUserInfo`? -Prefer `TokenResponse.claims`; they are already decoded and validated, with no extra round-trip. For an arbitrary access token, use `authClient.getUserInfo({ accessToken })`. In a session app, use `serverClient.getUser()`. See [UserInfoClient](./authentication-flows.md#userinfoclient). - -### Can I still set a global `headers` / `timeout` / `agent` on the client? -Not on the constructor. Move them to the per-call `RequestOptions` argument (`headers`, `signal: AbortSignal.timeout(ms)`) or wrap `customFetch`. - -### How do I detect `mfa_required` now? -Use the `isMfaRequiredError()` type guard, not a string comparison. It narrows the error and exposes the `mfa_token`. Drive the challenge via `authClient.mfa.*`. See [Error model](./index.md#4-error-model). diff --git a/package.json b/package.json index 5b319ee7c8..3621c56e49 100644 --- a/package.json +++ b/package.json @@ -474,6 +474,17 @@ }, "default": "./dist/cjs/management/api/resources/users/exports.js" }, + "./workloadIdentityIssuers": { + "import": { + "types": "./dist/esm/management/api/resources/workloadIdentityIssuers/exports.d.mts", + "default": "./dist/esm/management/api/resources/workloadIdentityIssuers/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/workloadIdentityIssuers/exports.d.ts", + "default": "./dist/cjs/management/api/resources/workloadIdentityIssuers/exports.js" + }, + "default": "./dist/cjs/management/api/resources/workloadIdentityIssuers/exports.js" + }, "./actions/versions": { "import": { "types": "./dist/esm/management/api/resources/actions/resources/versions/exports.d.mts", @@ -1843,6 +1854,7 @@ "bugs": { "url": "https://github.com/auth0/node-auth0/issues" }, + "description": "Auth0 Node.js SDK for the Management API v2.", "homepage": "https://github.com/auth0/node-auth0", "keywords": [ "auth0", @@ -1853,7 +1865,6 @@ "management api", "json web token" ], - "description": "Auth0 Node.js SDK for the Management API v2.", "lint-staged": { "*.{js,ts,tsx}": [ "eslint --fix", diff --git a/reference.md b/reference.md index e6ecca685d..d3d64519b0 100644 --- a/reference.md +++ b/reference.md @@ -1835,6 +1835,7 @@ const pageableResponse = await client.clients.list({ app_type: "app_type", external_client_id: "external_client_id", agent_id: "agent_id", + workload_identity_issuer_id: "workload_identity_issuer_id", q: "q", }); for await (const item of pageableResponse) { @@ -1853,6 +1854,7 @@ let page = await client.clients.list({ app_type: "app_type", external_client_id: "external_client_id", agent_id: "agent_id", + workload_identity_issuer_id: "workload_identity_issuer_id", q: "q", }); while (page.hasNextPage()) { @@ -13876,6 +13878,352 @@ await client.users.revokeAccess("id"); +## WorkloadIdentityIssuers + +
client.workloadIdentityIssuers.list({ ...params }) -> core.Page<Management.WorkloadIdentityIssuer, Management.ListWorkloadIdentityIssuersPaginatedResponseContent> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List the tenant's workload identity issuers, newest first by created_at. Uses checkpoint pagination: pass the next cursor from a previous response as the from query parameter to retrieve the following page. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +const pageableResponse = await client.workloadIdentityIssuers.list({ + from: "from", + take: 1, +}); +for await (const item of pageableResponse) { + console.log(item); +} + +// Or you can manually iterate page-by-page +let page = await client.workloadIdentityIssuers.list({ + from: "from", + take: 1, +}); +while (page.hasNextPage()) { + page = await page.getNextPage(); +} + +// You can also access the underlying response +const response = page.response; +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Management.ListWorkloadIdentityIssuersRequestParameters` + +
+
+ +
+
+ +**requestOptions:** `WorkloadIdentityIssuersClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.workloadIdentityIssuers.create({ ...params }) -> Management.WorkloadIdentityIssuer +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a workload identity issuer for the tenant. A tenant may hold at most 10 issuers, and the issuer URL is unique per tenant, so a duplicate returns 409 Conflict. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.workloadIdentityIssuers.create({ + issuer: "issuer", + jwks_uri: "jwks_uri", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Management.CreateWorkloadIdentityIssuerRequestContent` + +
+
+ +
+
+ +**requestOptions:** `WorkloadIdentityIssuersClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.workloadIdentityIssuers.get(issuer_id) -> Management.WorkloadIdentityIssuer +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a single workload identity issuer by its identifier. Returns 404 if no issuer with the given ID exists for the tenant. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.workloadIdentityIssuers.get("issuer_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**issuer_id:** `Management.WorkloadIdentityIssuerId` — ID of the workload identity issuer. + +
+
+ +
+
+ +**requestOptions:** `WorkloadIdentityIssuersClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.workloadIdentityIssuers.delete(issuer_id) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a workload identity issuer. Idempotent: returns 204 No Content whether or not an issuer with the given ID existed. Deleting an issuer that a client is still associated with returns 409 Conflict. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.workloadIdentityIssuers.delete("issuer_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**issuer_id:** `Management.WorkloadIdentityIssuerId` — ID of the workload identity issuer. + +
+
+ +
+
+ +**requestOptions:** `WorkloadIdentityIssuersClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.workloadIdentityIssuers.update(issuer_id, { ...params }) -> Management.WorkloadIdentityIssuer +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a workload identity issuer. Omitted top-level fields remain unchanged, and a supplied mappings replaces the stored array. issuer and jwks_uri cannot be cleared. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.workloadIdentityIssuers.update("issuer_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**issuer_id:** `Management.WorkloadIdentityIssuerId` — ID of the workload identity issuer. + +
+
+ +
+
+ +**request:** `Management.UpdateWorkloadIdentityIssuerRequestContent` + +
+
+ +
+
+ +**requestOptions:** `WorkloadIdentityIssuersClient.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Actions Versions
client.actions.versions.list(actionId, { ...params }) -> core.Page<Management.ActionVersion, Management.ListActionVersionsPaginatedResponseContent> @@ -17268,9 +17616,7 @@ await client.branding.phone.templates.update("id");
```typescript -await client.branding.phone.templates.reset("id", { - key: "value", -}); +await client.branding.phone.templates.reset("id"); ```
diff --git a/src/management/Client.ts b/src/management/Client.ts index 8872f83701..742bf9ac6b 100644 --- a/src/management/Client.ts +++ b/src/management/Client.ts @@ -49,6 +49,7 @@ import { UserBlocksClient } from "./api/resources/userBlocks/client/Client.js"; import { UserGrantsClient } from "./api/resources/userGrants/client/Client.js"; import { UsersClient } from "./api/resources/users/client/Client.js"; import { VerifiableCredentialsClient } from "./api/resources/verifiableCredentials/client/Client.js"; +import { WorkloadIdentityIssuersClient } from "./api/resources/workloadIdentityIssuers/client/Client.js"; import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js"; import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "./BaseClient.js"; import * as core from "./core/index.js"; @@ -103,6 +104,7 @@ export class ManagementClient { protected _userAttributeProfiles: UserAttributeProfilesClient | undefined; protected _userBlocks: UserBlocksClient | undefined; protected _users: UsersClient | undefined; + protected _workloadIdentityIssuers: WorkloadIdentityIssuersClient | undefined; protected _anomaly: AnomalyClient | undefined; protected _attackProtection: AttackProtectionClient | undefined; protected _emails: EmailsClient | undefined; @@ -280,6 +282,10 @@ export class ManagementClient { return (this._users ??= new UsersClient(this._options)); } + public get workloadIdentityIssuers(): WorkloadIdentityIssuersClient { + return (this._workloadIdentityIssuers ??= new WorkloadIdentityIssuersClient(this._options)); + } + public get anomaly(): AnomalyClient { return (this._anomaly ??= new AnomalyClient(this._options)); } diff --git a/src/management/api/requests/requests.ts b/src/management/api/requests/requests.ts index a4a210bef8..181a3fc8ba 100644 --- a/src/management/api/requests/requests.ts +++ b/src/management/api/requests/requests.ts @@ -313,6 +313,7 @@ export interface UpdateClientProfileRequestContent { * app_type: "app_type", * external_client_id: "external_client_id", * agent_id: "agent_id", + * workload_identity_issuer_id: "workload_identity_issuer_id", * q: "q" * } */ @@ -337,6 +338,8 @@ export interface ListClientsRequestParameters { external_client_id?: string | null; /** Optional filter by the agent associated with the client.
Additional Restrictions:
  • Cannot be used in combination with other filters
  • Only fields, include_fields, page, per_page, and include_totals are supported alongside it
  • Checkpoint pagination (from, take) is not supported
*/ agent_id?: string | null; + /** Optional filter by the workload identity issuer associated with the client. */ + workload_identity_issuer_id?: string | null; /** Advanced Query in Lucene syntax.
Permitted Queries:
  • client_grant.organization_id:{organization_id}
  • client_grant.allow_any_organization:true
Additional Restrictions:
  • Cannot be used in combination with other filters
  • Requires use of the from and take paging parameters (checkpoint paginatinon)
  • Reduced rate limits apply. See Rate Limit Configurations
Note: Recent updates may not be immediately reflected in query results */ q?: string | null; } @@ -2365,6 +2368,45 @@ export interface RevokeUserAccessRequestContent { preserve_refresh_tokens?: boolean; } +/** + * @example + * { + * from: "from", + * take: 1 + * } + */ +export interface ListWorkloadIdentityIssuersRequestParameters { + /** Optional Id from which to start selection. */ + from?: string | null; + /** Number of results per page. Defaults to 50; values that are not a positive integer fall back to 50 and values above 100 are capped at 100. */ + take?: number | null; +} + +/** + * @example + * { + * issuer: "issuer", + * jwks_uri: "jwks_uri" + * } + */ +export interface CreateWorkloadIdentityIssuerRequestContent { + display_name?: Management.WorkloadIdentityIssuerDisplayName; + issuer: Management.WorkloadIdentityIssuerUrl; + jwks_uri: Management.WorkloadIdentityIssuerJwksUri; + mappings?: Management.WorkloadIdentityIssuerRequestMappings; +} + +/** + * @example + * {} + */ +export interface UpdateWorkloadIdentityIssuerRequestContent { + display_name?: (Management.WorkloadIdentityIssuerDisplayNameNullable | undefined) | null; + issuer?: Management.WorkloadIdentityIssuerUrl; + jwks_uri?: Management.WorkloadIdentityIssuerJwksUri; + mappings?: (Management.WorkloadIdentityIssuerRequestMappingsNullable | undefined) | null; +} + /** * @example * { @@ -2841,6 +2883,12 @@ export interface UpdatePhoneTemplateRequestContent { disabled?: boolean; } +/** + * @example + * {} + */ +export interface ResetPhoneTemplateRequestContent {} + /** * @example * { diff --git a/src/management/api/resources/agents/client/Client.ts b/src/management/api/resources/agents/client/Client.ts index b29c34531d..af4ab04314 100644 --- a/src/management/api/resources/agents/client/Client.ts +++ b/src/management/api/resources/agents/client/Client.ts @@ -219,6 +219,7 @@ export class AgentsClient { * @param {string} id - The agent ID * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.NotFoundError} @@ -268,6 +269,8 @@ export class AgentsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { + case 400: + throw new Management.BadRequestError(_response.error.body as unknown, _response.rawResponse); case 401: throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); case 403: diff --git a/src/management/api/resources/attackProtection/resources/captcha/client/Client.ts b/src/management/api/resources/attackProtection/resources/captcha/client/Client.ts index 098e8e7470..f66665ae29 100644 --- a/src/management/api/resources/attackProtection/resources/captcha/client/Client.ts +++ b/src/management/api/resources/attackProtection/resources/captcha/client/Client.ts @@ -104,6 +104,7 @@ export class CaptchaClient { * @param {Management.UpdateAttackProtectionCaptchaRequestContent} request * @param {CaptchaClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.NotFoundError} @@ -159,6 +160,8 @@ export class CaptchaClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { + case 400: + throw new Management.BadRequestError(_response.error.body as unknown, _response.rawResponse); case 401: throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); case 403: diff --git a/src/management/api/resources/attackProtection/resources/phoneProviderProtection/client/Client.ts b/src/management/api/resources/attackProtection/resources/phoneProviderProtection/client/Client.ts index 65734e4837..075b841793 100644 --- a/src/management/api/resources/attackProtection/resources/phoneProviderProtection/client/Client.ts +++ b/src/management/api/resources/attackProtection/resources/phoneProviderProtection/client/Client.ts @@ -109,6 +109,7 @@ export class PhoneProviderProtectionClient { * @param {Management.PatchPhoneProviderProtectionRequestContent} request * @param {PhoneProviderProtectionClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.TooManyRequestsError} @@ -165,6 +166,8 @@ export class PhoneProviderProtectionClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { + case 400: + throw new Management.BadRequestError(_response.error.body as unknown, _response.rawResponse); case 401: throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); case 403: diff --git a/src/management/api/resources/branding/resources/phone/resources/templates/client/Client.ts b/src/management/api/resources/branding/resources/phone/resources/templates/client/Client.ts index a7b64a7748..9b4f77f228 100644 --- a/src/management/api/resources/branding/resources/phone/resources/templates/client/Client.ts +++ b/src/management/api/resources/branding/resources/phone/resources/templates/client/Client.ts @@ -454,18 +454,17 @@ export class TemplatesClient { * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} + * @throws {@link Management.NotFoundError} * @throws {@link Management.TooManyRequestsError} * @throws {@link errors.ManagementError} * @throws {@link errors.ManagementTimeoutError} * * @example - * await client.branding.phone.templates.reset("id", { - * "key": "value" - * }) + * await client.branding.phone.templates.reset("id") */ public reset( id: string, - request?: Management.ResetPhoneTemplateRequestContent, + request: Management.ResetPhoneTemplateRequestContent = {}, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__reset(id, request, requestOptions)); @@ -473,7 +472,7 @@ export class TemplatesClient { private async __reset( id: string, - request?: Management.ResetPhoneTemplateRequestContent, + request: Management.ResetPhoneTemplateRequestContent = {}, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -516,6 +515,8 @@ export class TemplatesClient { throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); case 403: throw new Management.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Management.NotFoundError(_response.error.body as unknown, _response.rawResponse); case 429: throw new Management.TooManyRequestsError(_response.error.body as unknown, _response.rawResponse); default: diff --git a/src/management/api/resources/clients/client/Client.ts b/src/management/api/resources/clients/client/Client.ts index 668a215305..6ab171135e 100644 --- a/src/management/api/resources/clients/client/Client.ts +++ b/src/management/api/resources/clients/client/Client.ts @@ -84,6 +84,7 @@ export class ClientsClient { * app_type: "app_type", * external_client_id: "external_client_id", * agent_id: "agent_id", + * workload_identity_issuer_id: "workload_identity_issuer_id", * q: "q" * }) */ @@ -106,6 +107,7 @@ export class ClientsClient { app_type: appType, external_client_id: externalClientId, agent_id: agentId, + workload_identity_issuer_id: workloadIdentityIssuerId, q, } = request; const _queryParams: Record = { @@ -119,6 +121,7 @@ export class ClientsClient { app_type: appType, external_client_id: externalClientId, agent_id: agentId, + workload_identity_issuer_id: workloadIdentityIssuerId, q, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); diff --git a/src/management/api/resources/index.ts b/src/management/api/resources/index.ts index ee1686711d..253db86875 100644 --- a/src/management/api/resources/index.ts +++ b/src/management/api/resources/index.ts @@ -48,3 +48,4 @@ export * as userBlocks from "./userBlocks/index.js"; export * as userGrants from "./userGrants/index.js"; export * as users from "./users/index.js"; export * as verifiableCredentials from "./verifiableCredentials/index.js"; +export * as workloadIdentityIssuers from "./workloadIdentityIssuers/index.js"; diff --git a/src/management/api/resources/workloadIdentityIssuers/client/Client.ts b/src/management/api/resources/workloadIdentityIssuers/client/Client.ts new file mode 100644 index 0000000000..84e026eddc --- /dev/null +++ b/src/management/api/resources/workloadIdentityIssuers/client/Client.ts @@ -0,0 +1,484 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; +import * as core from "../../../../core/index.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Management from "../../../index.js"; + +export declare namespace WorkloadIdentityIssuersClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class WorkloadIdentityIssuersClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: WorkloadIdentityIssuersClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * List the tenant's workload identity issuers, newest first by created_at. Uses checkpoint pagination: pass the next cursor from a previous response as the from query parameter to retrieve the following page. + * + * @param {Management.ListWorkloadIdentityIssuersRequestParameters} request + * @param {WorkloadIdentityIssuersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Management.BadRequestError} + * @throws {@link Management.UnauthorizedError} + * @throws {@link Management.ForbiddenError} + * @throws {@link Management.TooManyRequestsError} + * @throws {@link errors.ManagementError} + * @throws {@link errors.ManagementTimeoutError} + * + * @example + * await client.workloadIdentityIssuers.list({ + * from: "from", + * take: 1 + * }) + */ + public async list( + request: Management.ListWorkloadIdentityIssuersRequestParameters = {}, + requestOptions?: WorkloadIdentityIssuersClient.RequestOptions, + ): Promise< + core.Page + > { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: Management.ListWorkloadIdentityIssuersRequestParameters, + ): Promise> => { + const { from: from_, take = 50 } = request; + const _queryParams: Record = { + from: from_, + take, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + let _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ManagementEnvironment.Default, + "workload-identity-issuers", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Management.ListWorkloadIdentityIssuersPaginatedResponseContent, + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Management.BadRequestError( + _response.error.body as unknown, + _response.rawResponse, + ); + case 401: + throw new Management.UnauthorizedError( + _response.error.body as unknown, + _response.rawResponse, + ); + case 403: + throw new Management.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Management.TooManyRequestsError( + _response.error.body as unknown, + _response.rawResponse, + ); + default: + throw new errors.ManagementError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/workload-identity-issuers", + ); + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Page< + Management.WorkloadIdentityIssuer, + Management.ListWorkloadIdentityIssuersPaginatedResponseContent + >({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.next != null && !(typeof response?.next === "string" && response?.next === ""), + getItems: (response) => response?.workload_identity_issuers ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "from", response?.next)); + }, + }); + } + + /** + * Create a workload identity issuer for the tenant. A tenant may hold at most 10 issuers, and the issuer URL is unique per tenant, so a duplicate returns 409 Conflict. + * + * @param {Management.CreateWorkloadIdentityIssuerRequestContent} request + * @param {WorkloadIdentityIssuersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Management.BadRequestError} + * @throws {@link Management.UnauthorizedError} + * @throws {@link Management.ForbiddenError} + * @throws {@link Management.ConflictError} + * @throws {@link Management.TooManyRequestsError} + * @throws {@link errors.ManagementError} + * @throws {@link errors.ManagementTimeoutError} + * + * @example + * await client.workloadIdentityIssuers.create({ + * issuer: "issuer", + * jwks_uri: "jwks_uri" + * }) + */ + public create( + request: Management.CreateWorkloadIdentityIssuerRequestContent, + requestOptions?: WorkloadIdentityIssuersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + + private async __create( + request: Management.CreateWorkloadIdentityIssuerRequestContent, + requestOptions?: WorkloadIdentityIssuersClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + let _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ManagementEnvironment.Default, + "workload-identity-issuers", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Management.WorkloadIdentityIssuer, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Management.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Management.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Management.ConflictError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Management.TooManyRequestsError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.ManagementError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/workload-identity-issuers"); + } + + /** + * Retrieve a single workload identity issuer by its identifier. Returns 404 if no issuer with the given ID exists for the tenant. + * + * @param {Management.WorkloadIdentityIssuerId} issuer_id - ID of the workload identity issuer. + * @param {WorkloadIdentityIssuersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Management.BadRequestError} + * @throws {@link Management.UnauthorizedError} + * @throws {@link Management.ForbiddenError} + * @throws {@link Management.NotFoundError} + * @throws {@link Management.TooManyRequestsError} + * @throws {@link errors.ManagementError} + * @throws {@link errors.ManagementTimeoutError} + * + * @example + * await client.workloadIdentityIssuers.get("issuer_id") + */ + public get( + issuer_id: Management.WorkloadIdentityIssuerId, + requestOptions?: WorkloadIdentityIssuersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(issuer_id, requestOptions)); + } + + private async __get( + issuer_id: Management.WorkloadIdentityIssuerId, + requestOptions?: WorkloadIdentityIssuersClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + let _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ManagementEnvironment.Default, + `workload-identity-issuers/${core.url.encodePathParam(issuer_id, errors.ManagementError)}`, + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Management.WorkloadIdentityIssuer, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Management.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Management.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Management.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Management.TooManyRequestsError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.ManagementError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/workload-identity-issuers/{issuer_id}", + ); + } + + /** + * Delete a workload identity issuer. Idempotent: returns 204 No Content whether or not an issuer with the given ID existed. Deleting an issuer that a client is still associated with returns 409 Conflict. + * + * @param {Management.WorkloadIdentityIssuerId} issuer_id - ID of the workload identity issuer. + * @param {WorkloadIdentityIssuersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Management.BadRequestError} + * @throws {@link Management.UnauthorizedError} + * @throws {@link Management.ForbiddenError} + * @throws {@link Management.ConflictError} + * @throws {@link Management.TooManyRequestsError} + * @throws {@link errors.ManagementError} + * @throws {@link errors.ManagementTimeoutError} + * + * @example + * await client.workloadIdentityIssuers.delete("issuer_id") + */ + public delete( + issuer_id: Management.WorkloadIdentityIssuerId, + requestOptions?: WorkloadIdentityIssuersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(issuer_id, requestOptions)); + } + + private async __delete( + issuer_id: Management.WorkloadIdentityIssuerId, + requestOptions?: WorkloadIdentityIssuersClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + let _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ManagementEnvironment.Default, + `workload-identity-issuers/${core.url.encodePathParam(issuer_id, errors.ManagementError)}`, + ), + method: "DELETE", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Management.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Management.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Management.ConflictError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Management.TooManyRequestsError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.ManagementError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/workload-identity-issuers/{issuer_id}", + ); + } + + /** + * Update a workload identity issuer. Omitted top-level fields remain unchanged, and a supplied mappings replaces the stored array. issuer and jwks_uri cannot be cleared. + * + * @param {Management.WorkloadIdentityIssuerId} issuer_id - ID of the workload identity issuer. + * @param {Management.UpdateWorkloadIdentityIssuerRequestContent} request + * @param {WorkloadIdentityIssuersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Management.BadRequestError} + * @throws {@link Management.UnauthorizedError} + * @throws {@link Management.ForbiddenError} + * @throws {@link Management.NotFoundError} + * @throws {@link Management.ConflictError} + * @throws {@link Management.TooManyRequestsError} + * @throws {@link errors.ManagementError} + * @throws {@link errors.ManagementTimeoutError} + * + * @example + * await client.workloadIdentityIssuers.update("issuer_id") + */ + public update( + issuer_id: Management.WorkloadIdentityIssuerId, + request: Management.UpdateWorkloadIdentityIssuerRequestContent = {}, + requestOptions?: WorkloadIdentityIssuersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__update(issuer_id, request, requestOptions)); + } + + private async __update( + issuer_id: Management.WorkloadIdentityIssuerId, + request: Management.UpdateWorkloadIdentityIssuerRequestContent = {}, + requestOptions?: WorkloadIdentityIssuersClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + let _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ManagementEnvironment.Default, + `workload-identity-issuers/${core.url.encodePathParam(issuer_id, errors.ManagementError)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Management.WorkloadIdentityIssuer, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Management.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Management.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Management.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Management.ConflictError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Management.TooManyRequestsError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.ManagementError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PATCH", + "/workload-identity-issuers/{issuer_id}", + ); + } +} diff --git a/src/management/api/resources/workloadIdentityIssuers/client/index.ts b/src/management/api/resources/workloadIdentityIssuers/client/index.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/src/management/api/resources/workloadIdentityIssuers/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/management/api/resources/workloadIdentityIssuers/exports.ts b/src/management/api/resources/workloadIdentityIssuers/exports.ts new file mode 100644 index 0000000000..81415c7623 --- /dev/null +++ b/src/management/api/resources/workloadIdentityIssuers/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { WorkloadIdentityIssuersClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/management/api/resources/workloadIdentityIssuers/index.ts b/src/management/api/resources/workloadIdentityIssuers/index.ts new file mode 100644 index 0000000000..914b8c3c72 --- /dev/null +++ b/src/management/api/resources/workloadIdentityIssuers/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/management/api/types/types.ts b/src/management/api/types/types.ts index a714897e77..1d5293e3bb 100644 --- a/src/management/api/types/types.ts +++ b/src/management/api/types/types.ts @@ -747,6 +747,18 @@ export const OauthScope = { /** * Delete Client Profiles */ DeleteClientProfiles: "delete:client_profiles", + /** + * Create Workload Identity Issuers */ + CreateWorkloadIdentityIssuers: "create:workload_identity_issuers", + /** + * Read Workload Identity Issuers */ + ReadWorkloadIdentityIssuers: "read:workload_identity_issuers", + /** + * Update Workload Identity Issuers */ + UpdateWorkloadIdentityIssuers: "update:workload_identity_issuers", + /** + * Delete Workload Identity Issuers */ + DeleteWorkloadIdentityIssuers: "delete:workload_identity_issuers", /** * Create Organization Client Associations */ CreateOrganizationClients: "create:organization_clients", @@ -1506,7 +1518,7 @@ export type AssessorsTypeEnum = (typeof AssessorsTypeEnum)[keyof typeof Assessor export interface AssociateOrganizationClientGrantResponseContent { /** ID of the client grant. */ - id?: string | undefined; + grant_id?: string | undefined; /** ID of the client. */ client_id?: string | undefined; /** The audience (API identifier) of this client grant */ @@ -2882,6 +2894,7 @@ export interface ClientAuthenticationMethod { private_key_jwt?: Management.ClientAuthenticationMethodPrivateKeyJwt | undefined; tls_client_auth?: Management.ClientAuthenticationMethodTlsClientAuth | undefined; self_signed_tls_client_auth?: Management.ClientAuthenticationMethodSelfSignedTlsClientAuth | undefined; + workload_federation?: Management.ClientAuthenticationMethodWorkloadFederation | undefined; } /** @@ -2920,6 +2933,28 @@ export interface ClientAuthenticationMethodTlsClientAuth { */ export type ClientAuthenticationMethodTlsClientAuthCredentials = Management.CredentialId[]; +/** + * Defines the workload_federation client authentication method. If this property is defined, the client is enabled to use the Workload Federation authentication method. It can only be set when the client is created, and the authentication method cannot be changed afterwards. Its issuer_id and rules can be updated, provided that rules are not set without an issuer_id and all rule claims are mapped by the referenced issuer + */ +export interface ClientAuthenticationMethodWorkloadFederation { + /** The ID of the workload identity issuer this client trusts. Must reference an existing workload identity issuer in the tenant. */ + issuer_id?: string | undefined; + rules?: Management.ClientAuthenticationMethodWorkloadFederationRules | undefined; +} + +export interface ClientAuthenticationMethodWorkloadFederationRule { + /** The claim this rule checks. Must be a claim the referenced issuer maps. */ + claim: string; + /** The value the claim must match. An exact value, or a prefix ending in `*`. */ + pattern: string; +} + +/** + * The rules an incoming token must match to authenticate as this client. Every rule must match. A claim may be used by at most one rule. Requires `issuer_id`. + */ +export type ClientAuthenticationMethodWorkloadFederationRules = + Management.ClientAuthenticationMethodWorkloadFederationRule[]; + /** Defines the compliance level for this client, which may restrict it's capabilities */ export const ClientComplianceLevelEnum = { None: "none", @@ -2937,6 +2972,7 @@ export interface ClientCreateAuthenticationMethod { private_key_jwt?: Management.ClientCreateAuthenticationMethodPrivateKeyJwt | undefined; tls_client_auth?: Management.ClientCreateAuthenticationMethodTlsClientAuth | undefined; self_signed_tls_client_auth?: Management.CreateClientAuthenticationMethodSelfSignedTlsClientAuth | undefined; + workload_federation?: Management.ClientCreateAuthenticationMethodWorkloadFederation | undefined; } /** @@ -2963,6 +2999,28 @@ export interface ClientCreateAuthenticationMethodTlsClientAuth { */ export type ClientCreateAuthenticationMethodTlsClientAuthCredentials = Management.CertificateSubjectDnCredential[]; +/** + * Defines the workload_federation client authentication method. If this property is defined, the client is enabled to use the Workload Federation authentication method. It can only be set when the client is created, and the authentication method cannot be changed afterwards. Its issuer_id and rules can be updated, provided that rules are not set without an issuer_id and all rule claims are mapped by the referenced issuer + */ +export interface ClientCreateAuthenticationMethodWorkloadFederation { + /** The ID of the workload identity issuer this client trusts. Must reference an existing workload identity issuer in the tenant. */ + issuer_id?: string | undefined; + rules?: Management.ClientCreateAuthenticationMethodWorkloadFederationRules | undefined; +} + +export interface ClientCreateAuthenticationMethodWorkloadFederationRule { + /** The claim this rule checks. Must be a claim the referenced issuer maps. */ + claim: string; + /** The value the claim must match. An exact value, or a prefix ending in `*`. */ + pattern: string; +} + +/** + * The rules an incoming token must match to authenticate as this client. Every rule must match. A claim may be used by at most one rule. Requires `issuer_id`. + */ +export type ClientCreateAuthenticationMethodWorkloadFederationRules = + Management.ClientCreateAuthenticationMethodWorkloadFederationRule[]; + export interface ClientCredential { /** ID of the credential. Generated on creation. */ id?: string | undefined; @@ -8928,7 +8986,7 @@ export interface CreateBrandingThemeResponseContent { borders: Management.BrandingThemeBorders; colors: Management.BrandingThemeColors; /** Display Name */ - displayName: string; + displayName?: string | undefined; fonts: Management.BrandingThemeFonts; identifiers?: Management.BrandingThemeIdentifiers | undefined; page_background: Management.BrandingThemePageBackground; @@ -11044,6 +11102,10 @@ export interface CreatePhoneTemplateResponseContent { type: Management.PhoneTemplateNotificationTypeEnum; /** Whether the template is enabled (false) or disabled (true). */ disabled: boolean; + /** The date and time the template was created, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + created_at: string; + /** The date and time the template was last updated, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + updated_at: string; } export interface CreatePhoneTemplateTestNotificationResponseContent { @@ -24310,6 +24372,320 @@ export const EventStreamCloudEventOffsetOnlyMessageTypeEnum = { export type EventStreamCloudEventOffsetOnlyMessageTypeEnum = (typeof EventStreamCloudEventOffsetOnlyMessageTypeEnum)[keyof typeof EventStreamCloudEventOffsetOnlyMessageTypeEnum]; +/** + * SSE message for organization.client.added. + */ +export interface EventStreamCloudEventOrgClientAdded { + /** Opaque cursor representing position in the stream. Pass as the `from` query parameter to resume. */ + offset: string; + event: Management.EventStreamCloudEventOrgClientAddedCloudEvent; +} + +/** + * Represents an event that occurs when a client is added to an organization. + */ +export interface EventStreamCloudEventOrgClientAddedCloudEvent { + specversion: Management.EventStreamCloudEventSpecVersionEnum; + type: Management.EventStreamCloudEventOrgClientAddedCloudEventTypeEnum; + /** The source of the event. This will take the form 'urn:auth0:.'. */ + source: string; + /** A unique identifier for the event. */ + id: string; + /** An ISO-8601 timestamp indicating when the event physically occurred. */ + time: string; + data: Management.EventStreamCloudEventOrgClientAddedData; + /** The auth0 tenant ID to which the event is associated. */ + a0tenant: string; + /** + * The auth0 event stream ID of the stream the event was delivered on. + * Present when the event is delivered via an event stream; omitted when + * events are retrieved via the Events API (GET /api/v2/events). + */ + a0stream?: string | undefined; + a0purpose?: Management.EventStreamCloudEventA0PurposeEnum | undefined; +} + +/** The type of the event which has happened. */ +export const EventStreamCloudEventOrgClientAddedCloudEventTypeEnum = { + OrganizationClientAdded: "organization.client.added", +} as const; +export type EventStreamCloudEventOrgClientAddedCloudEventTypeEnum = + (typeof EventStreamCloudEventOrgClientAddedCloudEventTypeEnum)[keyof typeof EventStreamCloudEventOrgClientAddedCloudEventTypeEnum]; + +/** + * The event payload. + */ +export interface EventStreamCloudEventOrgClientAddedData { + object: Management.EventStreamCloudEventOrgClientAddedObject; + previous_object?: Management.EventStreamCloudEventOrgClientAddedPreviousObject | undefined; + context?: Management.EventStreamCloudEventContext | undefined; +} + +/** + * The event content. + */ +export interface EventStreamCloudEventOrgClientAddedObject { + organization: Management.EventStreamCloudEventOrgClientAddedObjectOrganization; + client: Management.EventStreamCloudEventOrgClientAddedObjectClient; + /** When true, this client is used for member access to the organization. */ + use_for_member_access?: boolean | undefined; +} + +export interface EventStreamCloudEventOrgClientAddedObjectClient { + /** The ID of the client. */ + id: string; +} + +/** + * Information about an Auth0 Organization. + */ +export interface EventStreamCloudEventOrgClientAddedObjectOrganization { + /** The human-readable identifier for the organization that will be used by end-users to direct them to their organization in your application.. */ + name?: string | undefined; + /** ID of the organization. */ + id: string; +} + +/** + * The event content as it was prior to the change described by this event, when applicable. + */ +export interface EventStreamCloudEventOrgClientAddedPreviousObject { + organization: Management.EventStreamCloudEventOrgClientAddedPreviousObjectOrganization; + client: Management.EventStreamCloudEventOrgClientAddedPreviousObjectClient; + /** When true, this client is used for member access to the organization. */ + use_for_member_access?: boolean | undefined; +} + +export interface EventStreamCloudEventOrgClientAddedPreviousObjectClient { + /** The ID of the client. */ + id: string; +} + +/** + * Information about an Auth0 Organization. + */ +export interface EventStreamCloudEventOrgClientAddedPreviousObjectOrganization { + /** The human-readable identifier for the organization that will be used by end-users to direct them to their organization in your application.. */ + name?: string | undefined; + /** ID of the organization. */ + id: string; +} + +/** The event type (injected from the SSE event field). */ +export const EventStreamCloudEventOrgClientAddedTypeEnum = { + OrganizationClientAdded: "organization.client.added", +} as const; +export type EventStreamCloudEventOrgClientAddedTypeEnum = + (typeof EventStreamCloudEventOrgClientAddedTypeEnum)[keyof typeof EventStreamCloudEventOrgClientAddedTypeEnum]; + +/** + * SSE message for organization.client.removed. + */ +export interface EventStreamCloudEventOrgClientRemoved { + /** Opaque cursor representing position in the stream. Pass as the `from` query parameter to resume. */ + offset: string; + event: Management.EventStreamCloudEventOrgClientRemovedCloudEvent; +} + +/** + * Represents an event that occurs when a client is removed from an organization. + */ +export interface EventStreamCloudEventOrgClientRemovedCloudEvent { + specversion: Management.EventStreamCloudEventSpecVersionEnum; + type: Management.EventStreamCloudEventOrgClientRemovedCloudEventTypeEnum; + /** The source of the event. This will take the form 'urn:auth0:.'. */ + source: string; + /** A unique identifier for the event. */ + id: string; + /** An ISO-8601 timestamp indicating when the event physically occurred. */ + time: string; + data: Management.EventStreamCloudEventOrgClientRemovedData; + /** The auth0 tenant ID to which the event is associated. */ + a0tenant: string; + /** + * The auth0 event stream ID of the stream the event was delivered on. + * Present when the event is delivered via an event stream; omitted when + * events are retrieved via the Events API (GET /api/v2/events). + */ + a0stream?: string | undefined; + a0purpose?: Management.EventStreamCloudEventA0PurposeEnum | undefined; +} + +/** The type of the event which has happened. */ +export const EventStreamCloudEventOrgClientRemovedCloudEventTypeEnum = { + OrganizationClientRemoved: "organization.client.removed", +} as const; +export type EventStreamCloudEventOrgClientRemovedCloudEventTypeEnum = + (typeof EventStreamCloudEventOrgClientRemovedCloudEventTypeEnum)[keyof typeof EventStreamCloudEventOrgClientRemovedCloudEventTypeEnum]; + +/** + * The event payload. + */ +export interface EventStreamCloudEventOrgClientRemovedData { + object: Management.EventStreamCloudEventOrgClientRemovedObject; + previous_object?: Management.EventStreamCloudEventOrgClientRemovedPreviousObject | undefined; + context?: Management.EventStreamCloudEventContext | undefined; +} + +/** + * The event content. + */ +export interface EventStreamCloudEventOrgClientRemovedObject { + organization: Management.EventStreamCloudEventOrgClientRemovedObjectOrganization; + client: Management.EventStreamCloudEventOrgClientRemovedObjectClient; +} + +export interface EventStreamCloudEventOrgClientRemovedObjectClient { + /** The ID of the client. */ + id: string; +} + +/** + * Information about an Auth0 Organization. + */ +export interface EventStreamCloudEventOrgClientRemovedObjectOrganization { + /** The human-readable identifier for the organization that will be used by end-users to direct them to their organization in your application.. */ + name?: string | undefined; + /** ID of the organization. */ + id: string; +} + +/** + * The event content as it was prior to the change described by this event, when applicable. + */ +export interface EventStreamCloudEventOrgClientRemovedPreviousObject { + organization: Management.EventStreamCloudEventOrgClientRemovedPreviousObjectOrganization; + client: Management.EventStreamCloudEventOrgClientRemovedPreviousObjectClient; +} + +export interface EventStreamCloudEventOrgClientRemovedPreviousObjectClient { + /** The ID of the client. */ + id: string; +} + +/** + * Information about an Auth0 Organization. + */ +export interface EventStreamCloudEventOrgClientRemovedPreviousObjectOrganization { + /** The human-readable identifier for the organization that will be used by end-users to direct them to their organization in your application.. */ + name?: string | undefined; + /** ID of the organization. */ + id: string; +} + +/** The event type (injected from the SSE event field). */ +export const EventStreamCloudEventOrgClientRemovedTypeEnum = { + OrganizationClientRemoved: "organization.client.removed", +} as const; +export type EventStreamCloudEventOrgClientRemovedTypeEnum = + (typeof EventStreamCloudEventOrgClientRemovedTypeEnum)[keyof typeof EventStreamCloudEventOrgClientRemovedTypeEnum]; + +/** + * SSE message for organization.client.updated. + */ +export interface EventStreamCloudEventOrgClientUpdated { + /** Opaque cursor representing position in the stream. Pass as the `from` query parameter to resume. */ + offset: string; + event: Management.EventStreamCloudEventOrgClientUpdatedCloudEvent; +} + +/** + * Represents an event that occurs when an organization client is updated. + */ +export interface EventStreamCloudEventOrgClientUpdatedCloudEvent { + specversion: Management.EventStreamCloudEventSpecVersionEnum; + type: Management.EventStreamCloudEventOrgClientUpdatedCloudEventTypeEnum; + /** The source of the event. This will take the form 'urn:auth0:.'. */ + source: string; + /** A unique identifier for the event. */ + id: string; + /** An ISO-8601 timestamp indicating when the event physically occurred. */ + time: string; + data: Management.EventStreamCloudEventOrgClientUpdatedData; + /** The auth0 tenant ID to which the event is associated. */ + a0tenant: string; + /** + * The auth0 event stream ID of the stream the event was delivered on. + * Present when the event is delivered via an event stream; omitted when + * events are retrieved via the Events API (GET /api/v2/events). + */ + a0stream?: string | undefined; + a0purpose?: Management.EventStreamCloudEventA0PurposeEnum | undefined; +} + +/** The type of the event which has happened. */ +export const EventStreamCloudEventOrgClientUpdatedCloudEventTypeEnum = { + OrganizationClientUpdated: "organization.client.updated", +} as const; +export type EventStreamCloudEventOrgClientUpdatedCloudEventTypeEnum = + (typeof EventStreamCloudEventOrgClientUpdatedCloudEventTypeEnum)[keyof typeof EventStreamCloudEventOrgClientUpdatedCloudEventTypeEnum]; + +/** + * The event payload. + */ +export interface EventStreamCloudEventOrgClientUpdatedData { + object: Management.EventStreamCloudEventOrgClientUpdatedObject; + previous_object?: Management.EventStreamCloudEventOrgClientUpdatedPreviousObject | undefined; + context?: Management.EventStreamCloudEventContext | undefined; +} + +/** + * The event content. + */ +export interface EventStreamCloudEventOrgClientUpdatedObject { + organization: Management.EventStreamCloudEventOrgClientUpdatedObjectOrganization; + client: Management.EventStreamCloudEventOrgClientUpdatedObjectClient; + /** When true, this client is used for member access to the organization. */ + use_for_member_access?: boolean | undefined; +} + +export interface EventStreamCloudEventOrgClientUpdatedObjectClient { + /** The ID of the client. */ + id: string; +} + +/** + * Information about an Auth0 Organization. + */ +export interface EventStreamCloudEventOrgClientUpdatedObjectOrganization { + /** The human-readable identifier for the organization that will be used by end-users to direct them to their organization in your application.. */ + name?: string | undefined; + /** ID of the organization. */ + id: string; +} + +/** + * The event content as it was prior to the change described by this event, when applicable. + */ +export interface EventStreamCloudEventOrgClientUpdatedPreviousObject { + organization: Management.EventStreamCloudEventOrgClientUpdatedPreviousObjectOrganization; + client: Management.EventStreamCloudEventOrgClientUpdatedPreviousObjectClient; + /** When true, this client is used for member access to the organization. */ + use_for_member_access?: boolean | undefined; +} + +export interface EventStreamCloudEventOrgClientUpdatedPreviousObjectClient { + /** The ID of the client. */ + id: string; +} + +/** + * Information about an Auth0 Organization. + */ +export interface EventStreamCloudEventOrgClientUpdatedPreviousObjectOrganization { + /** The human-readable identifier for the organization that will be used by end-users to direct them to their organization in your application.. */ + name?: string | undefined; + /** ID of the organization. */ + id: string; +} + +/** The event type (injected from the SSE event field). */ +export const EventStreamCloudEventOrgClientUpdatedTypeEnum = { + OrganizationClientUpdated: "organization.client.updated", +} as const; +export type EventStreamCloudEventOrgClientUpdatedTypeEnum = + (typeof EventStreamCloudEventOrgClientUpdatedTypeEnum)[keyof typeof EventStreamCloudEventOrgClientUpdatedTypeEnum]; + /** * SSE message for organization.connection.added. */ @@ -25037,6 +25413,8 @@ export interface EventStreamCloudEventOrgCreatedObject { display_name?: string | undefined; metadata?: Management.EventStreamCloudEventOrgCreatedObjectMetadata | undefined; branding?: Management.EventStreamCloudEventOrgCreatedObjectBranding | undefined; + /** Whether app entitlement is active for this organization. */ + is_app_entitlement_active?: boolean | undefined; } /** @@ -25077,6 +25455,8 @@ export interface EventStreamCloudEventOrgCreatedPreviousObject { display_name?: string | undefined; metadata?: Management.EventStreamCloudEventOrgCreatedPreviousObjectMetadata | undefined; branding?: Management.EventStreamCloudEventOrgCreatedPreviousObjectBranding | undefined; + /** Whether app entitlement is active for this organization. */ + is_app_entitlement_active?: boolean | undefined; } /** @@ -25172,6 +25552,8 @@ export interface EventStreamCloudEventOrgDeletedObject { /** If set, the name that will be displayed to end-users for this organization in any interaction with them. */ display_name?: string | undefined; metadata?: Management.EventStreamCloudEventOrgDeletedObjectMetadata | undefined; + /** Whether app entitlement is active for this organization. */ + is_app_entitlement_active?: boolean | undefined; } /** @@ -25192,6 +25574,8 @@ export interface EventStreamCloudEventOrgDeletedPreviousObject { /** If set, the name that will be displayed to end-users for this organization in any interaction with them. */ display_name?: string | undefined; metadata?: Management.EventStreamCloudEventOrgDeletedPreviousObjectMetadata | undefined; + /** Whether app entitlement is active for this organization. */ + is_app_entitlement_active?: boolean | undefined; } /** @@ -26243,6 +26627,8 @@ export interface EventStreamCloudEventOrgUpdatedObject { display_name?: string | undefined; metadata?: Management.EventStreamCloudEventOrgUpdatedObjectMetadata | undefined; branding?: Management.EventStreamCloudEventOrgUpdatedObjectBranding | undefined; + /** Whether app entitlement is active for this organization. */ + is_app_entitlement_active?: boolean | undefined; } /** @@ -26283,6 +26669,8 @@ export interface EventStreamCloudEventOrgUpdatedPreviousObject { display_name?: string | undefined; metadata?: Management.EventStreamCloudEventOrgUpdatedPreviousObjectMetadata | undefined; branding?: Management.EventStreamCloudEventOrgUpdatedPreviousObjectBranding | undefined; + /** Whether app entitlement is active for this organization. */ + is_app_entitlement_active?: boolean | undefined; } /** @@ -26318,6 +26706,462 @@ export const EventStreamCloudEventOrgUpdatedTypeEnum = { export type EventStreamCloudEventOrgUpdatedTypeEnum = (typeof EventStreamCloudEventOrgUpdatedTypeEnum)[keyof typeof EventStreamCloudEventOrgUpdatedTypeEnum]; +/** + * SSE message for role.created. + */ +export interface EventStreamCloudEventRoleCreated { + /** Opaque cursor representing position in the stream. Pass as the `from` query parameter to resume. */ + offset: string; + event: Management.EventStreamCloudEventRoleCreatedCloudEvent; +} + +/** + * Represents an event that occurs when a role is created. + */ +export interface EventStreamCloudEventRoleCreatedCloudEvent { + specversion: Management.EventStreamCloudEventSpecVersionEnum; + type: Management.EventStreamCloudEventRoleCreatedCloudEventTypeEnum; + /** The source of the event. This will take the form 'urn:auth0:.'. */ + source: string; + /** A unique identifier for the event. */ + id: string; + /** An ISO-8601 timestamp indicating when the event physically occurred. */ + time: string; + data: Management.EventStreamCloudEventRoleCreatedData; + /** The auth0 tenant ID to which the event is associated. */ + a0tenant: string; + /** + * The auth0 event stream ID of the stream the event was delivered on. + * Present when the event is delivered via an event stream; omitted when + * events are retrieved via the Events API (GET /api/v2/events). + */ + a0stream?: string | undefined; + a0purpose?: Management.EventStreamCloudEventA0PurposeEnum | undefined; +} + +/** The type of the event which has happened. */ +export const EventStreamCloudEventRoleCreatedCloudEventTypeEnum = { + RoleCreated: "role.created", +} as const; +export type EventStreamCloudEventRoleCreatedCloudEventTypeEnum = + (typeof EventStreamCloudEventRoleCreatedCloudEventTypeEnum)[keyof typeof EventStreamCloudEventRoleCreatedCloudEventTypeEnum]; + +/** + * The event payload. + */ +export interface EventStreamCloudEventRoleCreatedData { + object: Management.EventStreamCloudEventRoleCreatedObject; + previous_object?: Management.EventStreamCloudEventRoleCreatedPreviousObject | undefined; + context?: Management.EventStreamCloudEventContext | undefined; +} + +/** + * The event content. + */ +export interface EventStreamCloudEventRoleCreatedObject { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; + /** An optional description of the role. */ + description?: string | undefined; + type: Management.EventStreamCloudEventRoleCreatedObjectType; + owner_id?: Management.EventStreamCloudEventRoleCreatedObjectOwnerId | undefined; +} + +/** + * The owner of the role: the organization ID for org-scoped roles, or `auth0` for + * Auth0-managed system roles. Not present for other tenant-scoped roles. + */ +export type EventStreamCloudEventRoleCreatedObjectOwnerId = + /** + * An auth0 organization identifier. */ + string | Management.EventStreamCloudEventRoleCreatedObjectOwnerId1Enum; + +export const EventStreamCloudEventRoleCreatedObjectOwnerId1Enum = { + Auth0: "auth0", +} as const; +export type EventStreamCloudEventRoleCreatedObjectOwnerId1Enum = + (typeof EventStreamCloudEventRoleCreatedObjectOwnerId1Enum)[keyof typeof EventStreamCloudEventRoleCreatedObjectOwnerId1Enum]; + +/** + * The scope of the role. + */ +export type EventStreamCloudEventRoleCreatedObjectType = + | Management.EventStreamCloudEventRoleCreatedObjectType0Enum + | Management.EventStreamCloudEventRoleCreatedObjectType1Enum; + +export const EventStreamCloudEventRoleCreatedObjectType0Enum = { + Tenant: "tenant", +} as const; +export type EventStreamCloudEventRoleCreatedObjectType0Enum = + (typeof EventStreamCloudEventRoleCreatedObjectType0Enum)[keyof typeof EventStreamCloudEventRoleCreatedObjectType0Enum]; + +export const EventStreamCloudEventRoleCreatedObjectType1Enum = { + Organization: "organization", +} as const; +export type EventStreamCloudEventRoleCreatedObjectType1Enum = + (typeof EventStreamCloudEventRoleCreatedObjectType1Enum)[keyof typeof EventStreamCloudEventRoleCreatedObjectType1Enum]; + +/** + * The event content as it was prior to the change described by this event, when applicable. + */ +export interface EventStreamCloudEventRoleCreatedPreviousObject { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; + /** An optional description of the role. */ + description?: string | undefined; + type: Management.EventStreamCloudEventRoleCreatedPreviousObjectType; + owner_id?: Management.EventStreamCloudEventRoleCreatedPreviousObjectOwnerId | undefined; +} + +/** + * The owner of the role: the organization ID for org-scoped roles, or `auth0` for + * Auth0-managed system roles. Not present for other tenant-scoped roles. + */ +export type EventStreamCloudEventRoleCreatedPreviousObjectOwnerId = + /** + * An auth0 organization identifier. */ + string | Management.EventStreamCloudEventRoleCreatedPreviousObjectOwnerId1Enum; + +export const EventStreamCloudEventRoleCreatedPreviousObjectOwnerId1Enum = { + Auth0: "auth0", +} as const; +export type EventStreamCloudEventRoleCreatedPreviousObjectOwnerId1Enum = + (typeof EventStreamCloudEventRoleCreatedPreviousObjectOwnerId1Enum)[keyof typeof EventStreamCloudEventRoleCreatedPreviousObjectOwnerId1Enum]; + +/** + * The scope of the role. + */ +export type EventStreamCloudEventRoleCreatedPreviousObjectType = + | Management.EventStreamCloudEventRoleCreatedPreviousObjectType0Enum + | Management.EventStreamCloudEventRoleCreatedPreviousObjectType1Enum; + +export const EventStreamCloudEventRoleCreatedPreviousObjectType0Enum = { + Tenant: "tenant", +} as const; +export type EventStreamCloudEventRoleCreatedPreviousObjectType0Enum = + (typeof EventStreamCloudEventRoleCreatedPreviousObjectType0Enum)[keyof typeof EventStreamCloudEventRoleCreatedPreviousObjectType0Enum]; + +export const EventStreamCloudEventRoleCreatedPreviousObjectType1Enum = { + Organization: "organization", +} as const; +export type EventStreamCloudEventRoleCreatedPreviousObjectType1Enum = + (typeof EventStreamCloudEventRoleCreatedPreviousObjectType1Enum)[keyof typeof EventStreamCloudEventRoleCreatedPreviousObjectType1Enum]; + +/** The event type (injected from the SSE event field). */ +export const EventStreamCloudEventRoleCreatedTypeEnum = { + RoleCreated: "role.created", +} as const; +export type EventStreamCloudEventRoleCreatedTypeEnum = + (typeof EventStreamCloudEventRoleCreatedTypeEnum)[keyof typeof EventStreamCloudEventRoleCreatedTypeEnum]; + +/** + * SSE message for role.deleted. + */ +export interface EventStreamCloudEventRoleDeleted { + /** Opaque cursor representing position in the stream. Pass as the `from` query parameter to resume. */ + offset: string; + event: Management.EventStreamCloudEventRoleDeletedCloudEvent; +} + +/** + * Represents an event that occurs when a role is deleted. + */ +export interface EventStreamCloudEventRoleDeletedCloudEvent { + specversion: Management.EventStreamCloudEventSpecVersionEnum; + type: Management.EventStreamCloudEventRoleDeletedCloudEventTypeEnum; + /** The source of the event. This will take the form 'urn:auth0:.'. */ + source: string; + /** A unique identifier for the event. */ + id: string; + /** An ISO-8601 timestamp indicating when the event physically occurred. */ + time: string; + data: Management.EventStreamCloudEventRoleDeletedData; + /** The auth0 tenant ID to which the event is associated. */ + a0tenant: string; + /** + * The auth0 event stream ID of the stream the event was delivered on. + * Present when the event is delivered via an event stream; omitted when + * events are retrieved via the Events API (GET /api/v2/events). + */ + a0stream?: string | undefined; + a0purpose?: Management.EventStreamCloudEventA0PurposeEnum | undefined; +} + +/** The type of the event which has happened. */ +export const EventStreamCloudEventRoleDeletedCloudEventTypeEnum = { + RoleDeleted: "role.deleted", +} as const; +export type EventStreamCloudEventRoleDeletedCloudEventTypeEnum = + (typeof EventStreamCloudEventRoleDeletedCloudEventTypeEnum)[keyof typeof EventStreamCloudEventRoleDeletedCloudEventTypeEnum]; + +/** + * The event payload. + */ +export interface EventStreamCloudEventRoleDeletedData { + object: Management.EventStreamCloudEventRoleDeletedObject; + previous_object?: Management.EventStreamCloudEventRoleDeletedPreviousObject | undefined; + context?: Management.EventStreamCloudEventContext | undefined; +} + +/** + * The event content. + */ +export interface EventStreamCloudEventRoleDeletedObject { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; + /** An optional description of the role. */ + description?: string | undefined; + type: Management.EventStreamCloudEventRoleDeletedObjectType; + owner_id?: Management.EventStreamCloudEventRoleDeletedObjectOwnerId | undefined; +} + +/** + * The owner of the role: the organization ID for org-scoped roles, or `auth0` for + * Auth0-managed system roles. Not present for other tenant-scoped roles. + */ +export type EventStreamCloudEventRoleDeletedObjectOwnerId = + /** + * An auth0 organization identifier. */ + string | Management.EventStreamCloudEventRoleDeletedObjectOwnerId1Enum; + +export const EventStreamCloudEventRoleDeletedObjectOwnerId1Enum = { + Auth0: "auth0", +} as const; +export type EventStreamCloudEventRoleDeletedObjectOwnerId1Enum = + (typeof EventStreamCloudEventRoleDeletedObjectOwnerId1Enum)[keyof typeof EventStreamCloudEventRoleDeletedObjectOwnerId1Enum]; + +/** + * The scope of the role. + */ +export type EventStreamCloudEventRoleDeletedObjectType = + | Management.EventStreamCloudEventRoleDeletedObjectType0Enum + | Management.EventStreamCloudEventRoleDeletedObjectType1Enum; + +export const EventStreamCloudEventRoleDeletedObjectType0Enum = { + Tenant: "tenant", +} as const; +export type EventStreamCloudEventRoleDeletedObjectType0Enum = + (typeof EventStreamCloudEventRoleDeletedObjectType0Enum)[keyof typeof EventStreamCloudEventRoleDeletedObjectType0Enum]; + +export const EventStreamCloudEventRoleDeletedObjectType1Enum = { + Organization: "organization", +} as const; +export type EventStreamCloudEventRoleDeletedObjectType1Enum = + (typeof EventStreamCloudEventRoleDeletedObjectType1Enum)[keyof typeof EventStreamCloudEventRoleDeletedObjectType1Enum]; + +/** + * The event content as it was prior to the change described by this event, when applicable. + */ +export interface EventStreamCloudEventRoleDeletedPreviousObject { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; + /** An optional description of the role. */ + description?: string | undefined; + type: Management.EventStreamCloudEventRoleDeletedPreviousObjectType; + owner_id?: Management.EventStreamCloudEventRoleDeletedPreviousObjectOwnerId | undefined; +} + +/** + * The owner of the role: the organization ID for org-scoped roles, or `auth0` for + * Auth0-managed system roles. Not present for other tenant-scoped roles. + */ +export type EventStreamCloudEventRoleDeletedPreviousObjectOwnerId = + /** + * An auth0 organization identifier. */ + string | Management.EventStreamCloudEventRoleDeletedPreviousObjectOwnerId1Enum; + +export const EventStreamCloudEventRoleDeletedPreviousObjectOwnerId1Enum = { + Auth0: "auth0", +} as const; +export type EventStreamCloudEventRoleDeletedPreviousObjectOwnerId1Enum = + (typeof EventStreamCloudEventRoleDeletedPreviousObjectOwnerId1Enum)[keyof typeof EventStreamCloudEventRoleDeletedPreviousObjectOwnerId1Enum]; + +/** + * The scope of the role. + */ +export type EventStreamCloudEventRoleDeletedPreviousObjectType = + | Management.EventStreamCloudEventRoleDeletedPreviousObjectType0Enum + | Management.EventStreamCloudEventRoleDeletedPreviousObjectType1Enum; + +export const EventStreamCloudEventRoleDeletedPreviousObjectType0Enum = { + Tenant: "tenant", +} as const; +export type EventStreamCloudEventRoleDeletedPreviousObjectType0Enum = + (typeof EventStreamCloudEventRoleDeletedPreviousObjectType0Enum)[keyof typeof EventStreamCloudEventRoleDeletedPreviousObjectType0Enum]; + +export const EventStreamCloudEventRoleDeletedPreviousObjectType1Enum = { + Organization: "organization", +} as const; +export type EventStreamCloudEventRoleDeletedPreviousObjectType1Enum = + (typeof EventStreamCloudEventRoleDeletedPreviousObjectType1Enum)[keyof typeof EventStreamCloudEventRoleDeletedPreviousObjectType1Enum]; + +/** The event type (injected from the SSE event field). */ +export const EventStreamCloudEventRoleDeletedTypeEnum = { + RoleDeleted: "role.deleted", +} as const; +export type EventStreamCloudEventRoleDeletedTypeEnum = + (typeof EventStreamCloudEventRoleDeletedTypeEnum)[keyof typeof EventStreamCloudEventRoleDeletedTypeEnum]; + +/** + * SSE message for role.updated. + */ +export interface EventStreamCloudEventRoleUpdated { + /** Opaque cursor representing position in the stream. Pass as the `from` query parameter to resume. */ + offset: string; + event: Management.EventStreamCloudEventRoleUpdatedCloudEvent; +} + +/** + * Represents an event that occurs when a role is updated. + */ +export interface EventStreamCloudEventRoleUpdatedCloudEvent { + specversion: Management.EventStreamCloudEventSpecVersionEnum; + type: Management.EventStreamCloudEventRoleUpdatedCloudEventTypeEnum; + /** The source of the event. This will take the form 'urn:auth0:.'. */ + source: string; + /** A unique identifier for the event. */ + id: string; + /** An ISO-8601 timestamp indicating when the event physically occurred. */ + time: string; + data: Management.EventStreamCloudEventRoleUpdatedData; + /** The auth0 tenant ID to which the event is associated. */ + a0tenant: string; + /** + * The auth0 event stream ID of the stream the event was delivered on. + * Present when the event is delivered via an event stream; omitted when + * events are retrieved via the Events API (GET /api/v2/events). + */ + a0stream?: string | undefined; + a0purpose?: Management.EventStreamCloudEventA0PurposeEnum | undefined; +} + +/** The type of the event which has happened. */ +export const EventStreamCloudEventRoleUpdatedCloudEventTypeEnum = { + RoleUpdated: "role.updated", +} as const; +export type EventStreamCloudEventRoleUpdatedCloudEventTypeEnum = + (typeof EventStreamCloudEventRoleUpdatedCloudEventTypeEnum)[keyof typeof EventStreamCloudEventRoleUpdatedCloudEventTypeEnum]; + +/** + * The event payload. + */ +export interface EventStreamCloudEventRoleUpdatedData { + object: Management.EventStreamCloudEventRoleUpdatedObject; + previous_object?: Management.EventStreamCloudEventRoleUpdatedPreviousObject | undefined; + context?: Management.EventStreamCloudEventContext | undefined; +} + +/** + * The event content. + */ +export interface EventStreamCloudEventRoleUpdatedObject { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; + /** An optional description of the role. */ + description?: string | undefined; + type: Management.EventStreamCloudEventRoleUpdatedObjectType; + owner_id?: Management.EventStreamCloudEventRoleUpdatedObjectOwnerId | undefined; +} + +/** + * The owner of the role: the organization ID for org-scoped roles, or `auth0` for + * Auth0-managed system roles. Not present for other tenant-scoped roles. + */ +export type EventStreamCloudEventRoleUpdatedObjectOwnerId = + /** + * An auth0 organization identifier. */ + string | Management.EventStreamCloudEventRoleUpdatedObjectOwnerId1Enum; + +export const EventStreamCloudEventRoleUpdatedObjectOwnerId1Enum = { + Auth0: "auth0", +} as const; +export type EventStreamCloudEventRoleUpdatedObjectOwnerId1Enum = + (typeof EventStreamCloudEventRoleUpdatedObjectOwnerId1Enum)[keyof typeof EventStreamCloudEventRoleUpdatedObjectOwnerId1Enum]; + +/** + * The scope of the role. + */ +export type EventStreamCloudEventRoleUpdatedObjectType = + | Management.EventStreamCloudEventRoleUpdatedObjectType0Enum + | Management.EventStreamCloudEventRoleUpdatedObjectType1Enum; + +export const EventStreamCloudEventRoleUpdatedObjectType0Enum = { + Tenant: "tenant", +} as const; +export type EventStreamCloudEventRoleUpdatedObjectType0Enum = + (typeof EventStreamCloudEventRoleUpdatedObjectType0Enum)[keyof typeof EventStreamCloudEventRoleUpdatedObjectType0Enum]; + +export const EventStreamCloudEventRoleUpdatedObjectType1Enum = { + Organization: "organization", +} as const; +export type EventStreamCloudEventRoleUpdatedObjectType1Enum = + (typeof EventStreamCloudEventRoleUpdatedObjectType1Enum)[keyof typeof EventStreamCloudEventRoleUpdatedObjectType1Enum]; + +/** + * The event content as it was prior to the change described by this event, when applicable. + */ +export interface EventStreamCloudEventRoleUpdatedPreviousObject { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; + /** An optional description of the role. */ + description?: string | undefined; + type: Management.EventStreamCloudEventRoleUpdatedPreviousObjectType; + owner_id?: Management.EventStreamCloudEventRoleUpdatedPreviousObjectOwnerId | undefined; +} + +/** + * The owner of the role: the organization ID for org-scoped roles, or `auth0` for + * Auth0-managed system roles. Not present for other tenant-scoped roles. + */ +export type EventStreamCloudEventRoleUpdatedPreviousObjectOwnerId = + /** + * An auth0 organization identifier. */ + string | Management.EventStreamCloudEventRoleUpdatedPreviousObjectOwnerId1Enum; + +export const EventStreamCloudEventRoleUpdatedPreviousObjectOwnerId1Enum = { + Auth0: "auth0", +} as const; +export type EventStreamCloudEventRoleUpdatedPreviousObjectOwnerId1Enum = + (typeof EventStreamCloudEventRoleUpdatedPreviousObjectOwnerId1Enum)[keyof typeof EventStreamCloudEventRoleUpdatedPreviousObjectOwnerId1Enum]; + +/** + * The scope of the role. + */ +export type EventStreamCloudEventRoleUpdatedPreviousObjectType = + | Management.EventStreamCloudEventRoleUpdatedPreviousObjectType0Enum + | Management.EventStreamCloudEventRoleUpdatedPreviousObjectType1Enum; + +export const EventStreamCloudEventRoleUpdatedPreviousObjectType0Enum = { + Tenant: "tenant", +} as const; +export type EventStreamCloudEventRoleUpdatedPreviousObjectType0Enum = + (typeof EventStreamCloudEventRoleUpdatedPreviousObjectType0Enum)[keyof typeof EventStreamCloudEventRoleUpdatedPreviousObjectType0Enum]; + +export const EventStreamCloudEventRoleUpdatedPreviousObjectType1Enum = { + Organization: "organization", +} as const; +export type EventStreamCloudEventRoleUpdatedPreviousObjectType1Enum = + (typeof EventStreamCloudEventRoleUpdatedPreviousObjectType1Enum)[keyof typeof EventStreamCloudEventRoleUpdatedPreviousObjectType1Enum]; + +/** The event type (injected from the SSE event field). */ +export const EventStreamCloudEventRoleUpdatedTypeEnum = { + RoleUpdated: "role.updated", +} as const; +export type EventStreamCloudEventRoleUpdatedTypeEnum = + (typeof EventStreamCloudEventRoleUpdatedTypeEnum)[keyof typeof EventStreamCloudEventRoleUpdatedTypeEnum]; + /** The version of the CloudEvents specification which the event uses. */ export const EventStreamCloudEventSpecVersionEnum = { One0: "1.0", @@ -27935,6 +28779,230 @@ export const EventStreamCloudEventUserDeletedTypeEnum = { export type EventStreamCloudEventUserDeletedTypeEnum = (typeof EventStreamCloudEventUserDeletedTypeEnum)[keyof typeof EventStreamCloudEventUserDeletedTypeEnum]; +/** + * SSE message for user.role.assigned. + */ +export interface EventStreamCloudEventUserRoleAssigned { + /** Opaque cursor representing position in the stream. Pass as the `from` query parameter to resume. */ + offset: string; + event: Management.EventStreamCloudEventUserRoleAssignedCloudEvent; +} + +/** + * Represents an event that occurs when a role is assigned to a user at tenant level. + */ +export interface EventStreamCloudEventUserRoleAssignedCloudEvent { + specversion: Management.EventStreamCloudEventSpecVersionEnum; + type: Management.EventStreamCloudEventUserRoleAssignedCloudEventTypeEnum; + /** The source of the event. This will take the form 'urn:auth0:.'. */ + source: string; + /** A unique identifier for the event. */ + id: string; + /** An ISO-8601 timestamp indicating when the event physically occurred. */ + time: string; + data: Management.EventStreamCloudEventUserRoleAssignedData; + /** The auth0 tenant ID to which the event is associated. */ + a0tenant: string; + /** + * The auth0 event stream ID of the stream the event was delivered on. + * Present when the event is delivered via an event stream; omitted when + * events are retrieved via the Events API (GET /api/v2/events). + */ + a0stream?: string | undefined; + a0purpose?: Management.EventStreamCloudEventA0PurposeEnum | undefined; +} + +/** The type of the event which has happened. */ +export const EventStreamCloudEventUserRoleAssignedCloudEventTypeEnum = { + UserRoleAssigned: "user.role.assigned", +} as const; +export type EventStreamCloudEventUserRoleAssignedCloudEventTypeEnum = + (typeof EventStreamCloudEventUserRoleAssignedCloudEventTypeEnum)[keyof typeof EventStreamCloudEventUserRoleAssignedCloudEventTypeEnum]; + +/** + * The event payload. + */ +export interface EventStreamCloudEventUserRoleAssignedData { + object: Management.EventStreamCloudEventUserRoleAssignedObject; + previous_object?: Management.EventStreamCloudEventUserRoleAssignedPreviousObject | undefined; + context?: Management.EventStreamCloudEventContext | undefined; +} + +/** + * The event content. + */ +export interface EventStreamCloudEventUserRoleAssignedObject { + user: Management.EventStreamCloudEventUserRoleAssignedObjectUser; + role: Management.EventStreamCloudEventUserRoleAssignedObjectRole; +} + +/** + * The role that was assigned or removed. + */ +export interface EventStreamCloudEventUserRoleAssignedObjectRole { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; +} + +/** + * The user to whom the role is assigned or from whom it was removed. + */ +export interface EventStreamCloudEventUserRoleAssignedObjectUser { + /** ID of the user which can be used when interacting with other APIs. */ + user_id: string; + /** Accepts any additional properties */ + [key: string]: any; +} + +/** + * The event content as it was prior to the change described by this event, when applicable. + */ +export interface EventStreamCloudEventUserRoleAssignedPreviousObject { + user: Management.EventStreamCloudEventUserRoleAssignedPreviousObjectUser; + role: Management.EventStreamCloudEventUserRoleAssignedPreviousObjectRole; +} + +/** + * The role that was assigned or removed. + */ +export interface EventStreamCloudEventUserRoleAssignedPreviousObjectRole { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; +} + +/** + * The user to whom the role is assigned or from whom it was removed. + */ +export interface EventStreamCloudEventUserRoleAssignedPreviousObjectUser { + /** ID of the user which can be used when interacting with other APIs. */ + user_id: string; + /** Accepts any additional properties */ + [key: string]: any; +} + +/** The event type (injected from the SSE event field). */ +export const EventStreamCloudEventUserRoleAssignedTypeEnum = { + UserRoleAssigned: "user.role.assigned", +} as const; +export type EventStreamCloudEventUserRoleAssignedTypeEnum = + (typeof EventStreamCloudEventUserRoleAssignedTypeEnum)[keyof typeof EventStreamCloudEventUserRoleAssignedTypeEnum]; + +/** + * SSE message for user.role.deleted. + */ +export interface EventStreamCloudEventUserRoleDeleted { + /** Opaque cursor representing position in the stream. Pass as the `from` query parameter to resume. */ + offset: string; + event: Management.EventStreamCloudEventUserRoleDeletedCloudEvent; +} + +/** + * Represents an event that occurs when a role is removed from a user at tenant level. + */ +export interface EventStreamCloudEventUserRoleDeletedCloudEvent { + specversion: Management.EventStreamCloudEventSpecVersionEnum; + type: Management.EventStreamCloudEventUserRoleDeletedCloudEventTypeEnum; + /** The source of the event. This will take the form 'urn:auth0:.'. */ + source: string; + /** A unique identifier for the event. */ + id: string; + /** An ISO-8601 timestamp indicating when the event physically occurred. */ + time: string; + data: Management.EventStreamCloudEventUserRoleDeletedData; + /** The auth0 tenant ID to which the event is associated. */ + a0tenant: string; + /** + * The auth0 event stream ID of the stream the event was delivered on. + * Present when the event is delivered via an event stream; omitted when + * events are retrieved via the Events API (GET /api/v2/events). + */ + a0stream?: string | undefined; + a0purpose?: Management.EventStreamCloudEventA0PurposeEnum | undefined; +} + +/** The type of the event which has happened. */ +export const EventStreamCloudEventUserRoleDeletedCloudEventTypeEnum = { + UserRoleDeleted: "user.role.deleted", +} as const; +export type EventStreamCloudEventUserRoleDeletedCloudEventTypeEnum = + (typeof EventStreamCloudEventUserRoleDeletedCloudEventTypeEnum)[keyof typeof EventStreamCloudEventUserRoleDeletedCloudEventTypeEnum]; + +/** + * The event payload. + */ +export interface EventStreamCloudEventUserRoleDeletedData { + object: Management.EventStreamCloudEventUserRoleDeletedObject; + previous_object?: Management.EventStreamCloudEventUserRoleDeletedPreviousObject | undefined; + context?: Management.EventStreamCloudEventContext | undefined; +} + +/** + * The event content. + */ +export interface EventStreamCloudEventUserRoleDeletedObject { + user: Management.EventStreamCloudEventUserRoleDeletedObjectUser; + role: Management.EventStreamCloudEventUserRoleDeletedObjectRole; +} + +/** + * The role that was assigned or removed. + */ +export interface EventStreamCloudEventUserRoleDeletedObjectRole { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; +} + +/** + * The user to whom the role is assigned or from whom it was removed. + */ +export interface EventStreamCloudEventUserRoleDeletedObjectUser { + /** ID of the user which can be used when interacting with other APIs. */ + user_id: string; + /** Accepts any additional properties */ + [key: string]: any; +} + +/** + * The event content as it was prior to the change described by this event, when applicable. + */ +export interface EventStreamCloudEventUserRoleDeletedPreviousObject { + user: Management.EventStreamCloudEventUserRoleDeletedPreviousObjectUser; + role: Management.EventStreamCloudEventUserRoleDeletedPreviousObjectRole; +} + +/** + * The role that was assigned or removed. + */ +export interface EventStreamCloudEventUserRoleDeletedPreviousObjectRole { + /** The ID of the role. */ + id: string; + /** The name of the role. */ + name: string; +} + +/** + * The user to whom the role is assigned or from whom it was removed. + */ +export interface EventStreamCloudEventUserRoleDeletedPreviousObjectUser { + /** ID of the user which can be used when interacting with other APIs. */ + user_id: string; + /** Accepts any additional properties */ + [key: string]: any; +} + +/** The event type (injected from the SSE event field). */ +export const EventStreamCloudEventUserRoleDeletedTypeEnum = { + UserRoleDeleted: "user.role.deleted", +} as const; +export type EventStreamCloudEventUserRoleDeletedTypeEnum = + (typeof EventStreamCloudEventUserRoleDeletedTypeEnum)[keyof typeof EventStreamCloudEventUserRoleDeletedTypeEnum]; + /** * SSE message for user.updated. */ @@ -28776,6 +29844,9 @@ export const EventStreamDeliveryEventTypeEnum = { GroupRoleAssigned: "group.role.assigned", GroupRoleDeleted: "group.role.deleted", GroupUpdated: "group.updated", + OrganizationClientAdded: "organization.client.added", + OrganizationClientRemoved: "organization.client.removed", + OrganizationClientUpdated: "organization.client.updated", OrganizationConnectionAdded: "organization.connection.added", OrganizationConnectionRemoved: "organization.connection.removed", OrganizationConnectionUpdated: "organization.connection.updated", @@ -28788,8 +29859,13 @@ export const EventStreamDeliveryEventTypeEnum = { OrganizationMemberRoleAssigned: "organization.member.role.assigned", OrganizationMemberRoleDeleted: "organization.member.role.deleted", OrganizationUpdated: "organization.updated", + RoleCreated: "role.created", + RoleDeleted: "role.deleted", + RoleUpdated: "role.updated", UserCreated: "user.created", UserDeleted: "user.deleted", + UserRoleAssigned: "user.role.assigned", + UserRoleDeleted: "user.role.deleted", UserUpdated: "user.updated", } as const; export type EventStreamDeliveryEventTypeEnum = @@ -28896,6 +29972,9 @@ export const EventStreamEventTypeEnum = { GroupRoleAssigned: "group.role.assigned", GroupRoleDeleted: "group.role.deleted", GroupUpdated: "group.updated", + OrganizationClientAdded: "organization.client.added", + OrganizationClientRemoved: "organization.client.removed", + OrganizationClientUpdated: "organization.client.updated", OrganizationConnectionAdded: "organization.connection.added", OrganizationConnectionRemoved: "organization.connection.removed", OrganizationConnectionUpdated: "organization.connection.updated", @@ -28908,8 +29987,13 @@ export const EventStreamEventTypeEnum = { OrganizationMemberRoleAssigned: "organization.member.role.assigned", OrganizationMemberRoleDeleted: "organization.member.role.deleted", OrganizationUpdated: "organization.updated", + RoleCreated: "role.created", + RoleDeleted: "role.deleted", + RoleUpdated: "role.updated", UserCreated: "user.created", UserDeleted: "user.deleted", + UserRoleAssigned: "user.role.assigned", + UserRoleDeleted: "user.role.deleted", UserUpdated: "user.updated", } as const; export type EventStreamEventTypeEnum = (typeof EventStreamEventTypeEnum)[keyof typeof EventStreamEventTypeEnum]; @@ -28937,6 +30021,9 @@ export const EventStreamSubscribeEventsEventTypeEnum = { GroupRoleAssigned: "group.role.assigned", GroupRoleDeleted: "group.role.deleted", GroupUpdated: "group.updated", + OrganizationClientAdded: "organization.client.added", + OrganizationClientRemoved: "organization.client.removed", + OrganizationClientUpdated: "organization.client.updated", OrganizationConnectionAdded: "organization.connection.added", OrganizationConnectionRemoved: "organization.connection.removed", OrganizationConnectionUpdated: "organization.connection.updated", @@ -28949,8 +30036,13 @@ export const EventStreamSubscribeEventsEventTypeEnum = { OrganizationMemberRoleAssigned: "organization.member.role.assigned", OrganizationMemberRoleDeleted: "organization.member.role.deleted", OrganizationUpdated: "organization.updated", + RoleCreated: "role.created", + RoleDeleted: "role.deleted", + RoleUpdated: "role.updated", UserCreated: "user.created", UserDeleted: "user.deleted", + UserRoleAssigned: "user.role.assigned", + UserRoleDeleted: "user.role.deleted", UserUpdated: "user.updated", } as const; export type EventStreamSubscribeEventsEventTypeEnum = @@ -28975,6 +30067,9 @@ export type EventStreamSubscribeEventsResponseContent = | Management.EventStreamSubscribeEventsResponseContent.GroupRoleAssigned | Management.EventStreamSubscribeEventsResponseContent.GroupRoleDeleted | Management.EventStreamSubscribeEventsResponseContent.GroupUpdated + | Management.EventStreamSubscribeEventsResponseContent.OrganizationClientAdded + | Management.EventStreamSubscribeEventsResponseContent.OrganizationClientRemoved + | Management.EventStreamSubscribeEventsResponseContent.OrganizationClientUpdated | Management.EventStreamSubscribeEventsResponseContent.OrganizationConnectionAdded | Management.EventStreamSubscribeEventsResponseContent.OrganizationConnectionRemoved | Management.EventStreamSubscribeEventsResponseContent.OrganizationConnectionUpdated @@ -28987,8 +30082,13 @@ export type EventStreamSubscribeEventsResponseContent = | Management.EventStreamSubscribeEventsResponseContent.OrganizationMemberRoleAssigned | Management.EventStreamSubscribeEventsResponseContent.OrganizationMemberRoleDeleted | Management.EventStreamSubscribeEventsResponseContent.OrganizationUpdated + | Management.EventStreamSubscribeEventsResponseContent.RoleCreated + | Management.EventStreamSubscribeEventsResponseContent.RoleDeleted + | Management.EventStreamSubscribeEventsResponseContent.RoleUpdated | Management.EventStreamSubscribeEventsResponseContent.UserCreated | Management.EventStreamSubscribeEventsResponseContent.UserDeleted + | Management.EventStreamSubscribeEventsResponseContent.UserRoleAssigned + | Management.EventStreamSubscribeEventsResponseContent.UserRoleDeleted | Management.EventStreamSubscribeEventsResponseContent.UserUpdated | Management.EventStreamSubscribeEventsResponseContent.Error | Management.EventStreamSubscribeEventsResponseContent.OffsetOnly; @@ -29034,6 +30134,18 @@ export namespace EventStreamSubscribeEventsResponseContent { type: "group.updated"; } + export interface OrganizationClientAdded extends Management.EventStreamCloudEventOrgClientAdded { + type: "organization.client.added"; + } + + export interface OrganizationClientRemoved extends Management.EventStreamCloudEventOrgClientRemoved { + type: "organization.client.removed"; + } + + export interface OrganizationClientUpdated extends Management.EventStreamCloudEventOrgClientUpdated { + type: "organization.client.updated"; + } + export interface OrganizationConnectionAdded extends Management.EventStreamCloudEventOrgConnectionAdded { type: "organization.connection.added"; } @@ -29082,6 +30194,18 @@ export namespace EventStreamSubscribeEventsResponseContent { type: "organization.updated"; } + export interface RoleCreated extends Management.EventStreamCloudEventRoleCreated { + type: "role.created"; + } + + export interface RoleDeleted extends Management.EventStreamCloudEventRoleDeleted { + type: "role.deleted"; + } + + export interface RoleUpdated extends Management.EventStreamCloudEventRoleUpdated { + type: "role.updated"; + } + export interface UserCreated extends Management.EventStreamCloudEventUserCreated { type: "user.created"; } @@ -29090,6 +30214,14 @@ export namespace EventStreamSubscribeEventsResponseContent { type: "user.deleted"; } + export interface UserRoleAssigned extends Management.EventStreamCloudEventUserRoleAssigned { + type: "user.role.assigned"; + } + + export interface UserRoleDeleted extends Management.EventStreamCloudEventUserRoleDeleted { + type: "user.role.deleted"; + } + export interface UserUpdated extends Management.EventStreamCloudEventUserUpdated { type: "user.updated"; } @@ -29122,6 +30254,9 @@ export const EventStreamTestEventTypeEnum = { GroupRoleAssigned: "group.role.assigned", GroupRoleDeleted: "group.role.deleted", GroupUpdated: "group.updated", + OrganizationClientAdded: "organization.client.added", + OrganizationClientRemoved: "organization.client.removed", + OrganizationClientUpdated: "organization.client.updated", OrganizationConnectionAdded: "organization.connection.added", OrganizationConnectionRemoved: "organization.connection.removed", OrganizationConnectionUpdated: "organization.connection.updated", @@ -29134,8 +30269,13 @@ export const EventStreamTestEventTypeEnum = { OrganizationMemberRoleAssigned: "organization.member.role.assigned", OrganizationMemberRoleDeleted: "organization.member.role.deleted", OrganizationUpdated: "organization.updated", + RoleCreated: "role.created", + RoleDeleted: "role.deleted", + RoleUpdated: "role.updated", UserCreated: "user.created", UserDeleted: "user.deleted", + UserRoleAssigned: "user.role.assigned", + UserRoleDeleted: "user.role.deleted", UserUpdated: "user.updated", } as const; export type EventStreamTestEventTypeEnum = @@ -33135,7 +34275,7 @@ export interface GetBrandingDefaultThemeResponseContent { borders: Management.BrandingThemeBorders; colors: Management.BrandingThemeColors; /** Display Name */ - displayName: string; + displayName?: string | undefined; fonts: Management.BrandingThemeFonts; identifiers?: Management.BrandingThemeIdentifiers | undefined; page_background: Management.BrandingThemePageBackground; @@ -33177,7 +34317,7 @@ export interface GetBrandingThemeResponseContent { borders: Management.BrandingThemeBorders; colors: Management.BrandingThemeColors; /** Display Name */ - displayName: string; + displayName?: string | undefined; fonts: Management.BrandingThemeFonts; identifiers?: Management.BrandingThemeIdentifiers | undefined; page_background: Management.BrandingThemePageBackground; @@ -34187,6 +35327,10 @@ export interface GetPhoneTemplateResponseContent { type: Management.PhoneTemplateNotificationTypeEnum; /** Whether the template is enabled (false) or disabled (true). */ disabled: boolean; + /** The date and time the template was created, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + created_at: string; + /** The date and time the template was last updated, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + updated_at: string; } export interface GetRateLimitPolicyResponseContent { @@ -34708,6 +35852,15 @@ export interface GetVerifiableCredentialTemplateResponseContent { [key: string]: any; } +/** + * A webtask in the tenant's container. Code and decrypted secrets are only included when requested. + */ +export interface GetWebtaskResponseContent extends Management.Webtask { + /** JavaScript code of the webtask. Only returned with fetch_code=true. */ + code?: string | undefined; + secrets?: Management.WebtaskResponseSecrets | undefined; +} + /** * Configuration for Google account linking. */ @@ -35732,6 +36885,15 @@ export interface ListVerifiableCredentialTemplatesPaginatedResponseContent { templates?: Management.VerifiableCredentialTemplateResponse[] | undefined; } +/** + * Checkpoint paginated list of workload identity issuers, newest first. + */ +export interface ListWorkloadIdentityIssuersPaginatedResponseContent { + /** A cursor to be used as the "from" query parameter for the next page of results. */ + next?: string | undefined; + workload_identity_issuers: Management.WorkloadIdentityIssuer[]; +} + export interface Log { date?: Management.LogDate | undefined; /** Type of event. */ @@ -36667,6 +37829,9 @@ export interface OrganizationClientGrant { organization_usage?: Management.OrganizationUsageEnum | undefined; /** If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations. */ allow_any_organization?: boolean | undefined; + subject_type: Management.ClientGrantSubjectTypeEnum; + /** If enabled, all scopes configured on the resource server are allowed for this grant. */ + allow_all_scopes?: boolean | undefined; } /** @@ -36885,6 +38050,7 @@ export type PageComponent = | Management.PageComponent.PageComponentAuth0MyOrganizationDomainTable | Management.PageComponent.PageComponentAuth0MyOrganizationMemberManagement | Management.PageComponent.PageComponentAuth0MyOrganizationDetailsEdit + | Management.PageComponent.PageComponentAuth0MyOrganizationSsoProviderManagement | Management.PageComponent.PageComponentAuth0MyAccountPasskeyManagement | Management.PageComponent.PageComponentAuth0MyAccountMfaManagement; @@ -36928,6 +38094,11 @@ export namespace PageComponent { type: "page:component:auth0:my_organization:details_edit"; } + export interface PageComponentAuth0MyOrganizationSsoProviderManagement + extends Management.PageComponentAuth0MyOrganizationSsoProviderManagement { + type: "page:component:auth0:my_organization:sso_provider_management"; + } + export interface PageComponentAuth0MyAccountPasskeyManagement extends Management.PageComponentAuth0MyAccountPasskeyManagement { type: "page:component:auth0:my_account:passkey_management"; @@ -37000,6 +38171,12 @@ export interface PageComponentAuth0MyOrganizationMemberManagement { export interface PageComponentAuth0MyOrganizationMemberManagementConfig {} +export interface PageComponentAuth0MyOrganizationSsoProviderManagement { + config?: Management.PageComponentAuth0MyOrganizationSsoProviderManagementConfig | undefined; +} + +export interface PageComponentAuth0MyOrganizationSsoProviderManagementConfig {} + export interface PageComponentAuth0StructureSection { config: Management.PageComponentAuth0StructureSectionConfig; } @@ -37070,6 +38247,7 @@ export type PageComponentNoChildren = | Management.PageComponentNoChildren.PageComponentAuth0MyOrganizationDomainTable | Management.PageComponentNoChildren.PageComponentAuth0MyOrganizationMemberManagement | Management.PageComponentNoChildren.PageComponentAuth0MyOrganizationDetailsEdit + | Management.PageComponentNoChildren.PageComponentAuth0MyOrganizationSsoProviderManagement | Management.PageComponentNoChildren.PageComponentAuth0MyAccountPasskeyManagement | Management.PageComponentNoChildren.PageComponentAuth0MyAccountMfaManagement; @@ -37109,6 +38287,11 @@ export namespace PageComponentNoChildren { type: "page:component:auth0:my_organization:details_edit"; } + export interface PageComponentAuth0MyOrganizationSsoProviderManagement + extends Management.PageComponentAuth0MyOrganizationSsoProviderManagement { + type: "page:component:auth0:my_organization:sso_provider_management"; + } + export interface PageComponentAuth0MyAccountPasskeyManagement extends Management.PageComponentAuth0MyAccountPasskeyManagement { type: "page:component:auth0:my_account:passkey_management"; @@ -37348,6 +38531,10 @@ export interface PhoneTemplate { type: Management.PhoneTemplateNotificationTypeEnum; /** Whether the template is enabled (false) or disabled (true). */ disabled: boolean; + /** The date and time the template was created, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + created_at: string; + /** The date and time the template was last updated, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + updated_at: string; } export interface PhoneTemplateBody { @@ -37854,8 +39041,6 @@ export interface RegisterCimdClientResponseContent { [key: string]: any; } -export type ResetPhoneTemplateRequestContent = unknown; - export interface ResetPhoneTemplateResponseContent { id?: string | undefined; channel?: string | undefined; @@ -37865,6 +39050,10 @@ export interface ResetPhoneTemplateResponseContent { type: Management.PhoneTemplateNotificationTypeEnum; /** Whether the template is enabled (false) or disabled (true). */ disabled: boolean; + /** The date and time the template was created, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + created_at: string; + /** The date and time the template was last updated, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + updated_at: string; } export interface ResourceServer { @@ -39773,7 +40962,7 @@ export interface TenantSettingsFlags { enable_client_connections?: boolean | undefined; /** Whether advanced API Authorization scenarios are enabled (true) or disabled (false). */ enable_pipeline2?: boolean | undefined; - /** If enabled, clients are able to add legacy delegation grants. */ + /** DEPRECATED property. If enabled, first-party applications can add the legacy delegation grant types. It does not enable the /delegation endpoint. */ allow_legacy_delegation_grant_types?: boolean | undefined; /** If enabled, clients are able to add legacy RO grants. */ allow_legacy_ro_grant_types?: boolean | undefined; @@ -40297,7 +41486,7 @@ export interface UpdateBrandingThemeResponseContent { borders: Management.BrandingThemeBorders; colors: Management.BrandingThemeColors; /** Display Name */ - displayName: string; + displayName?: string | undefined; fonts: Management.BrandingThemeFonts; identifiers?: Management.BrandingThemeIdentifiers | undefined; page_background: Management.BrandingThemePageBackground; @@ -41402,6 +42591,10 @@ export interface UpdatePhoneTemplateResponseContent { type: Management.PhoneTemplateNotificationTypeEnum; /** Whether the template is enabled (false) or disabled (true). */ disabled: boolean; + /** The date and time the template was created, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + created_at: string; + /** The date and time the template was last updated, in ISO 8601 format. For a default template (one without an id), this is the time of the request. */ + updated_at: string; } export interface UpdateRateLimitPolicyResponseContent { @@ -42496,6 +43689,125 @@ export interface VerifyEmailTicketResponseContent { [key: string]: any; } +/** + * A webtask in the tenant's container. + */ +export interface Webtask { + container: Management.WebtaskContainer; + name: Management.WebtaskName; + token?: Management.WebtaskToken | undefined; + meta: Management.WebtaskResponseMeta; + webtask_url?: Management.WebtaskUrl | undefined; + /** Accepts any additional properties */ + [key: string]: any; +} + +/** + * Webtask container of the tenant. Hooks run in the same container. + */ +export type WebtaskContainer = string; + +/** + * Name of the webtask. It is part of the webtask URL. + */ +export type WebtaskName = string; + +/** + * Metadata of the webtask. Values have no length limit, since webtasks written by other tools, such as hooks, are returned too. + */ +export type WebtaskResponseMeta = { + [key: string]: string; +}; + +/** + * Secrets of the webtask, decrypted. Only returned by GET /api/v2/webtasks/{name} with decrypt=true. Values have no length limit, since webtasks written by other tools are returned too. + */ +export type WebtaskResponseSecrets = { + [key: string]: string; +}; + +/** + * Webtask token issued for this webtask. + */ +export type WebtaskToken = string; + +/** + * URL the webtask runs at. + */ +export type WebtaskUrl = string; + +export interface WorkloadIdentityIssuer { + id?: Management.WorkloadIdentityIssuerId | undefined; + display_name?: Management.WorkloadIdentityIssuerDisplayName | undefined; + issuer: Management.WorkloadIdentityIssuerUrl; + jwks_uri: Management.WorkloadIdentityIssuerJwksUri; + mappings: Management.WorkloadIdentityIssuerMappings; + /** Timestamp of creation. */ + created_at?: string | undefined; + /** Timestamp of last update. */ + updated_at?: string | undefined; +} + +/** + * A claim name. + */ +export type WorkloadIdentityIssuerClaim = string; + +/** + * Human-readable name for the issuer. Rejects control characters (C0, DEL, C1). + */ +export type WorkloadIdentityIssuerDisplayName = string; + +export type WorkloadIdentityIssuerDisplayNameNullable = + | (Management.WorkloadIdentityIssuerDisplayName | null) + | undefined; + +/** + * Read-only, opaque identifier of the workload identity issuer. Do not parse or rely on how it is derived. + */ +export type WorkloadIdentityIssuerId = string; + +/** + * HTTPS URL of the issuer's JWKS. Must resolve to a valid JWKS. + */ +export type WorkloadIdentityIssuerJwksUri = string; + +export interface WorkloadIdentityIssuerMapping { + /** The name of the claim in the token that the workload presents. */ + source_claim: Management.WorkloadIdentityIssuerClaim; + /** The name the claim takes in Auth0. The rules of a client refer to this name. */ + target_claim: Management.WorkloadIdentityIssuerClaim; +} + +/** + * The issuer's claim mappings. + */ +export type WorkloadIdentityIssuerMappings = Management.WorkloadIdentityIssuerMapping[]; + +/** + * A claim mapping in a request body. Unknown properties are ignored. + */ +export interface WorkloadIdentityIssuerRequestMapping { + /** The name of the claim in the token that the workload presents. */ + source_claim: Management.WorkloadIdentityIssuerClaim; + /** The name the claim takes in Auth0. The rules of a client refer to this name. */ + target_claim: Management.WorkloadIdentityIssuerClaim; +} + +/** + * Claim mappings. target_claim is unique across mappings. When no mapping has target_claim set to subject, a mapping from sub to subject is added automatically, and it counts toward the 10-mapping limit. + */ +export type WorkloadIdentityIssuerRequestMappings = Management.WorkloadIdentityIssuerRequestMapping[]; + +export type WorkloadIdentityIssuerRequestMappingsNullable = + | (Management.WorkloadIdentityIssuerRequestMappings | null) + | undefined; + +/** + * HTTPS URL that identifies the issuer. Unique per tenant. + */ +export type WorkloadIdentityIssuerUrl = string; + export interface X509CertificateCredential { credential_type: Management.X509CertificateCredentialTypeEnum; /** Friendly name for a credential. */ diff --git a/src/management/tests/wire/agents.test.ts b/src/management/tests/wire/agents.test.ts index 9806500dd2..40ecab69f7 100644 --- a/src/management/tests/wire/agents.test.ts +++ b/src/management/tests/wire/agents.test.ts @@ -258,6 +258,19 @@ describe("AgentsClient", () => { const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/agents/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.agents.read("id"); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("read (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/agents/id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -265,7 +278,7 @@ describe("AgentsClient", () => { }).rejects.toThrow(Management.UnauthorizedError); }); - test("read (3)", async () => { + test("read (4)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); @@ -278,7 +291,7 @@ describe("AgentsClient", () => { }).rejects.toThrow(Management.ForbiddenError); }); - test("read (4)", async () => { + test("read (5)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); @@ -291,7 +304,7 @@ describe("AgentsClient", () => { }).rejects.toThrow(Management.NotFoundError); }); - test("read (5)", async () => { + test("read (6)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); diff --git a/src/management/tests/wire/attackProtection/captcha.test.ts b/src/management/tests/wire/attackProtection/captcha.test.ts index 0768469451..6e2b87b455 100644 --- a/src/management/tests/wire/attackProtection/captcha.test.ts +++ b/src/management/tests/wire/attackProtection/captcha.test.ts @@ -152,6 +152,26 @@ describe("CaptchaClient", () => { const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/attack-protection/captcha") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.attackProtection.captcha.update(); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/attack-protection/captcha") @@ -166,7 +186,7 @@ describe("CaptchaClient", () => { }).rejects.toThrow(Management.UnauthorizedError); }); - test("update (3)", async () => { + test("update (4)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = {}; @@ -186,7 +206,7 @@ describe("CaptchaClient", () => { }).rejects.toThrow(Management.ForbiddenError); }); - test("update (4)", async () => { + test("update (5)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = {}; @@ -206,7 +226,7 @@ describe("CaptchaClient", () => { }).rejects.toThrow(Management.NotFoundError); }); - test("update (5)", async () => { + test("update (6)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = {}; diff --git a/src/management/tests/wire/attackProtection/phoneProviderProtection.test.ts b/src/management/tests/wire/attackProtection/phoneProviderProtection.test.ts index c824388df9..b85e2e9592 100644 --- a/src/management/tests/wire/attackProtection/phoneProviderProtection.test.ts +++ b/src/management/tests/wire/attackProtection/phoneProviderProtection.test.ts @@ -126,6 +126,28 @@ describe("PhoneProviderProtectionClient", () => { const rawRequestBody = { type: "exponential" }; const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/attack-protection/phone-provider-protection") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.attackProtection.phoneProviderProtection.patch({ + type: "exponential", + }); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("patch (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { type: "exponential" }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/attack-protection/phone-provider-protection") @@ -142,7 +164,7 @@ describe("PhoneProviderProtectionClient", () => { }).rejects.toThrow(Management.UnauthorizedError); }); - test("patch (3)", async () => { + test("patch (4)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = { type: "exponential" }; @@ -164,7 +186,7 @@ describe("PhoneProviderProtectionClient", () => { }).rejects.toThrow(Management.ForbiddenError); }); - test("patch (4)", async () => { + test("patch (5)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = { type: "exponential" }; diff --git a/src/management/tests/wire/branding/phone/templates.test.ts b/src/management/tests/wire/branding/phone/templates.test.ts index e12e8b157e..c30d3f29dc 100644 --- a/src/management/tests/wire/branding/phone/templates.test.ts +++ b/src/management/tests/wire/branding/phone/templates.test.ts @@ -19,6 +19,8 @@ describe("TemplatesClient", () => { content: {}, type: "otp_verify", disabled: true, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", }, ], }; @@ -125,6 +127,8 @@ describe("TemplatesClient", () => { content: { syntax: "syntax", from: "from", body: { text: "text", voice: "voice" } }, type: "otp_verify", disabled: true, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", }; server @@ -252,6 +256,8 @@ describe("TemplatesClient", () => { content: { syntax: "syntax", from: "from", body: { text: "text", voice: "voice" } }, type: "otp_verify", disabled: true, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", }; server @@ -478,6 +484,8 @@ describe("TemplatesClient", () => { content: { syntax: "syntax", from: "from", body: { text: "text", voice: "voice" } }, type: "otp_verify", disabled: true, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", }; server @@ -596,15 +604,17 @@ describe("TemplatesClient", () => { test("reset (1)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { key: "value" }; + const rawRequestBody = {}; const rawResponseBody = { - id: "x", + id: "id", channel: "channel", customizable: true, - tenant: "x", - content: { syntax: "syntax", from: "x", body: { text: "x", voice: "x" } }, + tenant: "tenant", + content: { syntax: "syntax", from: "from", body: { text: "text", voice: "voice" } }, type: "otp_verify", disabled: true, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", }; server @@ -616,16 +626,14 @@ describe("TemplatesClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.branding.phone.templates.reset("id", { - key: "value", - }); + const response = await client.branding.phone.templates.reset("id"); expect(response).toEqual(rawResponseBody); }); test("reset (2)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { key: "value" }; + const rawRequestBody = {}; const rawResponseBody = { key: "value" }; server @@ -638,16 +646,14 @@ describe("TemplatesClient", () => { .build(); await expect(async () => { - return await client.branding.phone.templates.reset("id", { - key: "value", - }); + return await client.branding.phone.templates.reset("id"); }).rejects.toThrow(Management.BadRequestError); }); test("reset (3)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { key: "value" }; + const rawRequestBody = {}; const rawResponseBody = { key: "value" }; server @@ -660,16 +666,14 @@ describe("TemplatesClient", () => { .build(); await expect(async () => { - return await client.branding.phone.templates.reset("id", { - key: "value", - }); + return await client.branding.phone.templates.reset("id"); }).rejects.toThrow(Management.UnauthorizedError); }); test("reset (4)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { key: "value" }; + const rawRequestBody = {}; const rawResponseBody = { key: "value" }; server @@ -682,16 +686,34 @@ describe("TemplatesClient", () => { .build(); await expect(async () => { - return await client.branding.phone.templates.reset("id", { - key: "value", - }); + return await client.branding.phone.templates.reset("id"); }).rejects.toThrow(Management.ForbiddenError); }); test("reset (5)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { key: "value" }; + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/branding/phone/templates/id/reset") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.branding.phone.templates.reset("id"); + }).rejects.toThrow(Management.NotFoundError); + }); + + test("reset (6)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; const rawResponseBody = { key: "value" }; server @@ -704,9 +726,7 @@ describe("TemplatesClient", () => { .build(); await expect(async () => { - return await client.branding.phone.templates.reset("id", { - key: "value", - }); + return await client.branding.phone.templates.reset("id"); }).rejects.toThrow(Management.TooManyRequestsError); }); diff --git a/src/management/tests/wire/clients.test.ts b/src/management/tests/wire/clients.test.ts index 6735adc4bb..685aa15034 100644 --- a/src/management/tests/wire/clients.test.ts +++ b/src/management/tests/wire/clients.test.ts @@ -109,6 +109,7 @@ describe("ClientsClient", () => { app_type: "app_type", external_client_id: "external_client_id", agent_id: "agent_id", + workload_identity_issuer_id: "workload_identity_issuer_id", q: "q", }); @@ -347,6 +348,7 @@ describe("ClientsClient", () => { private_key_jwt: { credentials: [{ id: "id" }] }, tls_client_auth: { credentials: [{ id: "id" }] }, self_signed_tls_client_auth: { credentials: [{ id: "id" }] }, + workload_federation: { issuer_id: "issuer_id", rules: [{ claim: "claim", pattern: "pattern" }] }, }, require_pushed_authorization_requests: true, require_proof_of_possession: true, @@ -1241,6 +1243,7 @@ describe("ClientsClient", () => { private_key_jwt: { credentials: [{ id: "id" }] }, tls_client_auth: { credentials: [{ id: "id" }] }, self_signed_tls_client_auth: { credentials: [{ id: "id" }] }, + workload_federation: { issuer_id: "issuer_id", rules: [{ claim: "claim", pattern: "pattern" }] }, }, require_pushed_authorization_requests: true, require_proof_of_possession: true, @@ -1608,6 +1611,7 @@ describe("ClientsClient", () => { private_key_jwt: { credentials: [{ id: "id" }] }, tls_client_auth: { credentials: [{ id: "id" }] }, self_signed_tls_client_auth: { credentials: [{ id: "id" }] }, + workload_federation: { issuer_id: "issuer_id", rules: [{ claim: "claim", pattern: "pattern" }] }, }, require_pushed_authorization_requests: true, require_proof_of_possession: true, @@ -1952,6 +1956,7 @@ describe("ClientsClient", () => { private_key_jwt: { credentials: [{ id: "id" }] }, tls_client_auth: { credentials: [{ id: "id" }] }, self_signed_tls_client_auth: { credentials: [{ id: "id" }] }, + workload_federation: { issuer_id: "issuer_id", rules: [{ claim: "claim", pattern: "pattern" }] }, }, require_pushed_authorization_requests: true, require_proof_of_possession: true, diff --git a/src/management/tests/wire/organizations/clientGrants.test.ts b/src/management/tests/wire/organizations/clientGrants.test.ts index 273e2477ed..f1b4f05265 100644 --- a/src/management/tests/wire/organizations/clientGrants.test.ts +++ b/src/management/tests/wire/organizations/clientGrants.test.ts @@ -21,6 +21,8 @@ describe("ClientGrantsClient", () => { scope: ["scope"], organization_usage: "deny", allow_any_organization: true, + subject_type: "client", + allow_all_scopes: true, }, ], }; @@ -130,7 +132,7 @@ describe("ClientGrantsClient", () => { const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = { grant_id: "grant_id" }; const rawResponseBody = { - id: "id", + grant_id: "grant_id", client_id: "client_id", audience: "audience", scope: ["scope"], diff --git a/src/management/tests/wire/workloadIdentityIssuers.test.ts b/src/management/tests/wire/workloadIdentityIssuers.test.ts new file mode 100644 index 0000000000..7225931c3e --- /dev/null +++ b/src/management/tests/wire/workloadIdentityIssuers.test.ts @@ -0,0 +1,640 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Management from "../../api/index"; +import { ManagementClient } from "../../Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("WorkloadIdentityIssuersClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + next: "next", + workload_identity_issuers: [ + { + id: "id", + display_name: "display_name", + issuer: "issuer", + jwks_uri: "jwks_uri", + mappings: [{ source_claim: "source_claim", target_claim: "target_claim" }], + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + }; + + server + .mockEndpoint({ once: false }) + .get("/workload-identity-issuers") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = rawResponseBody; + const page = await client.workloadIdentityIssuers.list({ + from: "from", + take: 1, + }); + + expect(expected.workload_identity_issuers).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.workload_identity_issuers).toEqual(nextPage.data); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/workload-identity-issuers") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.list(); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/workload-identity-issuers") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.list(); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/workload-identity-issuers") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.list(); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/workload-identity-issuers") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.list(); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("create (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { issuer: "issuer", jwks_uri: "jwks_uri" }; + const rawResponseBody = { + id: "id", + display_name: "display_name", + issuer: "issuer", + jwks_uri: "jwks_uri", + mappings: [{ source_claim: "source_claim", target_claim: "target_claim" }], + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + }; + + server + .mockEndpoint() + .post("/workload-identity-issuers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.workloadIdentityIssuers.create({ + issuer: "issuer", + jwks_uri: "jwks_uri", + }); + expect(response).toEqual(rawResponseBody); + }); + + test("create (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { issuer: "x", jwks_uri: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/workload-identity-issuers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.create({ + issuer: "x", + jwks_uri: "x", + }); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { issuer: "x", jwks_uri: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/workload-identity-issuers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.create({ + issuer: "x", + jwks_uri: "x", + }); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { issuer: "x", jwks_uri: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/workload-identity-issuers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.create({ + issuer: "x", + jwks_uri: "x", + }); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { issuer: "x", jwks_uri: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/workload-identity-issuers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.create({ + issuer: "x", + jwks_uri: "x", + }); + }).rejects.toThrow(Management.ConflictError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { issuer: "x", jwks_uri: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/workload-identity-issuers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.create({ + issuer: "x", + jwks_uri: "x", + }); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "id", + display_name: "display_name", + issuer: "issuer", + jwks_uri: "jwks_uri", + mappings: [{ source_claim: "source_claim", target_claim: "target_claim" }], + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + }; + + server + .mockEndpoint() + .get("/workload-identity-issuers/issuer_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.workloadIdentityIssuers.get("issuer_id"); + expect(response).toEqual(rawResponseBody); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/workload-identity-issuers/x") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.get("x"); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/workload-identity-issuers/x") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.get("x"); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/workload-identity-issuers/x") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.get("x"); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/workload-identity-issuers/x") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.get("x"); + }).rejects.toThrow(Management.NotFoundError); + }); + + test("get (6)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/workload-identity-issuers/x") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.get("x"); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("delete (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/workload-identity-issuers/issuer_id").respondWith().statusCode(200).build(); + + const response = await client.workloadIdentityIssuers.delete("issuer_id"); + expect(response).toEqual(undefined); + }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/workload-identity-issuers/x") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.delete("x"); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/workload-identity-issuers/x") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.delete("x"); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/workload-identity-issuers/x") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.delete("x"); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("delete (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/workload-identity-issuers/x") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.delete("x"); + }).rejects.toThrow(Management.ConflictError); + }); + + test("delete (6)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/workload-identity-issuers/x") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.delete("x"); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("update (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + id: "id", + display_name: "display_name", + issuer: "issuer", + jwks_uri: "jwks_uri", + mappings: [{ source_claim: "source_claim", target_claim: "target_claim" }], + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + }; + + server + .mockEndpoint() + .patch("/workload-identity-issuers/issuer_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.workloadIdentityIssuers.update("issuer_id"); + expect(response).toEqual(rawResponseBody); + }); + + test("update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/workload-identity-issuers/x") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.update("x"); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/workload-identity-issuers/x") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.update("x"); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/workload-identity-issuers/x") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.update("x"); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/workload-identity-issuers/x") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.update("x"); + }).rejects.toThrow(Management.NotFoundError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/workload-identity-issuers/x") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.update("x"); + }).rejects.toThrow(Management.ConflictError); + }); + + test("update (7)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/workload-identity-issuers/x") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workloadIdentityIssuers.update("x"); + }).rejects.toThrow(Management.TooManyRequestsError); + }); +}); diff --git a/v6_MIGRATION_GUIDE.md b/v6_MIGRATION_GUIDE.md deleted file mode 100644 index d1eb6bd699..0000000000 --- a/v6_MIGRATION_GUIDE.md +++ /dev/null @@ -1,158 +0,0 @@ -# V6 Migration Guide - -A guide to migrating the Auth0 Node.js SDK from `5.x` to `6.x`. - -- [Overall changes](#overall-changes) -- [Breaking changes](#breaking-changes) - - [ConnectionAttributeIdentifier replaced with identifier-specific types](#connectionattributeidentifier-replaced-with-identifier-specific-types) - - [PhoneProviderProtectionBackoffStrategyEnum value change](#phoneproviderprotectionbackoffstrategyenum-value-change) - - [users.federatedConnectionsTokensets removed](#usersfederatedconnectionstokensets-removed) - - [federated_connections_access_tokens removed from connection options](#federated_connections_access_tokens-removed-from-connection-options) - -## Overall changes - -V6 addresses type correctness for database connection attribute identifiers, aligns the phone provider backoff strategy enum with the updated API, and removes the federated connections tokensets user sub-client. There are no changes to the Authentication API — any code written for the Authentication API in `5.x` will continue to work in `6.x`. - -## Breaking changes - -### ConnectionAttributeIdentifier replaced with identifier-specific types - -In v5, all three attribute identifiers (email, phone number, and username) shared a single `ConnectionAttributeIdentifier` type for their `identifier` field. This was incorrect — each identifier type supports different values for `default_method`. - -In v6, `ConnectionAttributeIdentifier` has been removed and replaced with three separate types: - -| Attribute | Old type | New type | `default_method` values | -| -------------- | ------------------------------- | ----------------------------- | ----------------------------- | -| `email` | `ConnectionAttributeIdentifier` | `EmailAttributeIdentifier` | `"password"` \| `"email_otp"` | -| `phone_number` | `ConnectionAttributeIdentifier` | `PhoneAttributeIdentifier` | `"password"` \| `"phone_otp"` | -| `username` | `ConnectionAttributeIdentifier` | `UsernameAttributeIdentifier` | _(no `default_method`)_ | - -**Before (v5):** - -```ts -import { Management } from "auth0"; - -const identifier: Management.ConnectionAttributeIdentifier = { - active: true, - default_method: "email_otp", -}; -``` - -**After (v6):** - -```ts -import { Management } from "auth0"; - -// For email attribute -const emailIdentifier: Management.EmailAttributeIdentifier = { - active: true, - default_method: "email_otp", -}; - -// For phone_number attribute -const phoneIdentifier: Management.PhoneAttributeIdentifier = { - active: true, - default_method: "phone_otp", -}; - -// For username attribute (no default_method) -const usernameIdentifier: Management.UsernameAttributeIdentifier = { - active: true, -}; -``` - -If you were using `ConnectionAttributeIdentifier` as a type annotation in your own code, update it to the appropriate identifier-specific type based on which attribute it applies to. - ---- - -### PhoneProviderProtectionBackoffStrategyEnum value change - -The `PhoneProviderProtectionBackoffStrategyEnum` enum has been updated to reflect a change in the Auth0 API. The `None` variant has been renamed to `Default`, and its string value has changed from `"none"` to `"default"`. - -**Before (v5):** - -```ts -import { Management } from "auth0"; - -const strategy = Management.PhoneProviderProtectionBackoffStrategyEnum.None; // "none" -``` - -**After (v6):** - -```ts -import { Management } from "auth0"; - -const strategy = Management.PhoneProviderProtectionBackoffStrategyEnum.Default; // "default" -``` - -If you were passing this value directly as a string `"none"`, update it to `"default"` to match the updated API. - ---- - -### users.federatedConnectionsTokensets removed - -The `client.users.federatedConnectionsTokensets` sub-client has been removed. This includes the `list()` and `delete()` methods. - -**Before (v5):** - -```ts -// List active federated connection tokensets for a user -const tokensets = await client.users.federatedConnectionsTokensets.list("user_id"); - -// Delete a tokenset -await client.users.federatedConnectionsTokensets.delete("user_id", "tokenset_id"); -``` - -**After (v6):** - -These methods are no longer available. Remove any calls to `client.users.federatedConnectionsTokensets` from your code. - ---- - -### federated_connections_access_tokens removed from connection options - -The `federated_connections_access_tokens` field has been removed from all connection option types, including create and update. This affects OIDC, Azure AD, Google Apps, and other connection strategies. Remove it from any create or update payloads. - -**Before (v5):** - -```ts -// On create -await client.connections.create({ - strategy: "oidc", - name: "my-connection", - options: { - federated_connections_access_tokens: { ... }, - // other options - }, -}); - -// On update -await client.connections.update("connection_id", { - options: { - federated_connections_access_tokens: { ... }, - // other options - }, -}); -``` - -**After (v6):** - -```ts -// On create -await client.connections.create({ - strategy: "oidc", - name: "my-connection", - options: { - // remove federated_connections_access_tokens - // other options - }, -}); - -// On update -await client.connections.update("connection_id", { - options: { - // remove federated_connections_access_tokens - // other options - }, -}); -``` diff --git a/v7_MIGRATION_GUIDE.md b/v7_MIGRATION_GUIDE.md deleted file mode 100644 index d1dba04a5c..0000000000 --- a/v7_MIGRATION_GUIDE.md +++ /dev/null @@ -1,146 +0,0 @@ -# V7 Migration Guide - -A guide to migrating the Auth0 Node.js SDK from `6.x` to `7.x`. - -> **Migrating with an AI agent?** Point it at the Auth0 migration skill first. The skill lives in [`auth0/agent-skills`](https://github.com/auth0/agent-skills) as the `auth0` skill (migration intent: `migrate-node-auth0`). It encodes the authentication-layer rewrite rules and a verify loop. - -- [Overall changes](#overall-changes) -- [Breaking changes](#breaking-changes) - - [Authentication API removed from the main entrypoint](#authentication-api-removed-from-the-main-entrypoint) - - [Removed exports](#removed-exports) - - [ManagementClient mTLS requires an explicit `fetch`](#managementclient-mtls-requires-an-explicit-fetch) - - [mTLS works with both client secret and client assertion](#mtls-works-with-both-client-secret-and-client-assertion) - - [`domain` must be a bare hostname](#domain-must-be-a-bare-hostname) - - [Token acquisition failures throw `ManagementError`](#token-acquisition-failures-throw-managementerror) - - [`uuid` dependency removed](#uuid-dependency-removed) -- [Migrating authentication code](#migrating-authentication-code) -- [Staying on the legacy entrypoint](#staying-on-the-legacy-entrypoint) - -## Overall changes - -V7 makes `node-auth0` a **Management-API-only SDK**. The Authentication API layer (`AuthenticationClient`, its sub-clients, and `UserInfoClient`) has been removed from the main entrypoint. `ManagementClient` continues to work exactly as before; it now acquires its internal token directly via the client credentials grant rather than through the removed authentication layer. - -If your code only uses `ManagementClient`, the upgrade is small: address the Management-side breaking changes below (mTLS, domain validation, error type) and you are done. If your code uses `AuthenticationClient` or `UserInfoClient`, that code must move to a dedicated package; see [Migrating authentication code](#migrating-authentication-code). - -## Breaking changes - -### Authentication API removed from the main entrypoint - -`AuthenticationClient` and `UserInfoClient` are no longer exported from the `auth0` main entrypoint. The stateless authentication layer now lives in [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js), and the server-managed session layer lives in [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js). - -**Before (v6):** - -```ts -import { AuthenticationClient, UserInfoClient } from "auth0"; - -const auth = new AuthenticationClient({ domain, clientId, clientSecret }); -const tokens = await auth.oauth.clientCredentialsGrant({ audience }); -``` - -**After (v7):** - -```ts -import { AuthClient } from "@auth0/auth0-auth-js"; - -const auth = new AuthClient({ domain, clientId, clientSecret }); -const tokens = await auth.getTokenByClientCredentials({ audience }); -``` - -The complete method-by-method mapping, the four cross-cutting behavior changes (return shape, casing, token expiry, error model), and the session-app wiring are documented in the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). This guide does not repeat that detail. - -If you need the old clients unchanged as a stopgap, they still ship from the [legacy entrypoint](#staying-on-the-legacy-entrypoint). - -### Removed exports - -The following symbols were exported from the main entrypoint in v6 and are removed in v7. Each moves to `@auth0/auth0-auth-js`, or remains available from the `auth0/legacy` entrypoint at its v4.x shape. - -| Removed export (v6) | Replacement in v7 | -| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `AuthenticationClient` | `AuthClient` from `@auth0/auth0-auth-js` | -| `UserInfoClient` | `AuthClient.getUserInfo()` from `@auth0/auth0-auth-js`, or read `TokenResponse.claims` | -| `AuthApiError` | Per-operation typed errors from `@auth0/auth0-auth-js` (`TokenByCodeError`, `TokenByRefreshTokenError`, …); use their `.cause` | -| `AuthenticationClientOptions` | `AuthClientOptions` from `@auth0/auth0-auth-js` | -| `IDTokenValidateOptions` | Validation is internal to the grant call; pass `organization` / `nonce` / `maxAge` to the grant and read `TokenResponse.claims` | -| `IdTokenValidatorError` | Thrown internally by the grant as a typed error on claim mismatch | -| `TokenSet` | `TokenResponse` from `@auth0/auth0-auth-js` (camelCase fields; `expiresAt` is absolute) | -| `SUBJECT_TOKEN_TYPES` | Pass the token-type URN string directly to `exchangeToken` in `@auth0/auth0-auth-js` | -| `UserInfoResponse` | Return type of `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | -| `UserInfoError` | Typed error from `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | -| `ResponseError` | Management API calls throw `ManagementError` | -| `FetchError` | Management API calls throw `ManagementError` | -| `JSONApiResponse` | Responses return the data directly (no wrapper) | - -`ManagementClient`, the `Management` namespace, and `ManagementError` are unchanged and still exported. - -### ManagementClient mTLS requires an explicit `fetch` - -A `ManagementClient` constructed with `useMTLS: true` must now supply an explicit `fetch` option carrying the client certificate. The client throws at construction if `useMTLS` is set without a `fetch`. Previously a missing fetch surfaced as silent `401`s at request time; failing at construction makes the misconfiguration obvious. - -The token endpoint automatically uses the `mtls.{domain}` host when `useMTLS` is enabled. - -```ts -// v7: throws at construction if `fetch` is omitted -const mgmt = new ManagementClient({ - domain, - clientId, - clientSecret, - useMTLS: true, - fetch: mtlsCapableFetch, // now required -}); -``` - -### mTLS works with both client secret and client assertion - -`useMTLS` works with both `clientSecret` and `clientAssertionSigningKey`. mTLS (RFC 8705) is a transport-layer concern: the TLS client certificate yields a certificate-bound token regardless of which client authentication method is used. An explicit `fetch` option is always required when `useMTLS` is set. - -### `domain` must be a bare hostname - -`domain` must be a bare host such as `tenant.us.auth0.com`. A value that is empty, or that contains a scheme, a path, a query string, a fragment, credentials (`@`), or whitespace, now throws at construction instead of producing malformed request URLs later. The check applies to every authentication mode (`token`, `clientSecret`, and `clientAssertionSigningKey`), and to `createManagementAuth` and `TokenProvider` as well as `ManagementClient`. - -```ts -// throws in v7 -new ManagementClient({ domain: "https://tenant.us.auth0.com/", ... }); -// correct -new ManagementClient({ domain: "tenant.us.auth0.com", ... }); -``` - -### Token acquisition failures throw `ManagementError` - -When the internal client-credentials token request fails, the client now throws a `ManagementError` (previously a plain `Error`). The error carries `statusCode` and a parsed `body` with the OAuth error details. A request that exceeds the 10-second timeout throws `ManagementError` with status `408`. - -```ts -import { ManagementError } from "auth0"; - -try { - await mgmt.users.getAll(); -} catch (e) { - if (e instanceof ManagementError) { - console.error(e.statusCode, e.body); - } -} -``` - -### `uuid` dependency removed - -The `uuid` package is no longer a dependency. If your project imported `uuid` transitively through `auth0`, add it to your own `dependencies`. - -## Migrating authentication code - -If your app calls `AuthenticationClient` or `UserInfoClient`, follow the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). Start with [`auth-migration/index.md`](https://github.com/auth0/node-auth0/blob/master/auth-migration/index.md) for the OIDC token grants section; the incremental flow, session, and troubleshooting pages live in the same [`auth-migration/`](https://github.com/auth0/node-auth0/tree/master/auth-migration) directory. It covers: - -- Choosing between `@auth0/auth0-auth-js` (stateless token grants) and `@auth0/auth0-server-js` (server-managed sessions). -- The complete method-by-method API mapping for `.oauth`, `.database`, `.passwordless`, `.backchannel`, `.tokenExchange`, and `UserInfoClient`. -- The four cross-cutting behavior changes: return shape (envelope dropped), casing (snake_case → camelCase), token expiry (`expires_in` relative → `expiresAt` absolute, a silent high-risk change), and the typed error model with `isMfaRequiredError()`. -- Wiring the `auth0-server-js` session lifecycle when you want the SDK to own login, cookies, refresh, and logout. - -The Management API is explicitly out of scope in that guide: a file that keeps using `ManagementClient` from `auth0` while importing `@auth0/auth0-auth-js` for authentication is correct and expected. - -## Staying on the legacy entrypoint - -If you cannot migrate the authentication code immediately, the `auth0/legacy` entrypoint still ships `AuthenticationClient` and `UserInfoClient` at their v4.x configuration format and method signatures. This is a stopgap, not a destination; the legacy shapes differ from the current API and will not receive new features. - -```ts -import { AuthenticationClient } from "auth0/legacy"; -``` - -Plan the move to `@auth0/auth0-auth-js` / `@auth0/auth0-server-js` rather than treating the legacy entrypoint as permanent. diff --git a/yarn.lock b/yarn.lock index 516a953294..650cbce39d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,19 +17,19 @@ integrity sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg== "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": - version "7.29.13" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.29.13.tgz#dcfa718e09c1bde8531b72b6d0d1830481397b1d" - integrity sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw== + version "7.29.16" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.29.16.tgz#f1ed5b7ddcfadfb91e86f957defc465fecdbda15" + integrity sha512-qK40pOeReBJY7B0JX6CCIfauMLAa0IlvuVYJ+aZBYLVJwmNUTvsQcEu0En9hVMmNjeSUSQYwvpi1JgXn5imIQw== dependencies: "@babel/code-frame" "^7.29.7" - "@babel/generator" "^7.29.13" + "@babel/generator" "^7.29.16" "@babel/helper-compilation-targets" "^7.29.13" - "@babel/helper-module-transforms" "^7.29.13" - "@babel/helpers" "^7.29.13" - "@babel/parser" "^7.29.13" + "@babel/helper-module-transforms" "^7.29.16" + "@babel/helpers" "^7.29.16" + "@babel/parser" "^7.29.15" "@babel/template" "^7.29.7" - "@babel/traverse" "^7.29.13" - "@babel/types" "^7.29.11" + "@babel/traverse" "^7.29.16" + "@babel/types" "^7.29.15" "@jridgewell/remapping" "^2.3.5" convert-source-map "^2.0.0" debug "^4.1.0" @@ -37,13 +37,13 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.29.13", "@babel/generator@^7.29.14", "@babel/generator@^7.7.2": - version "7.29.14" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.29.14.tgz#59a04e5ad227cec73a04291303e3906512a9999a" - integrity sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g== +"@babel/generator@^7.29.16", "@babel/generator@^7.7.2": + version "7.29.16" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.29.16.tgz#10dccbde534cc9a9bdb70d93e7156049e3d1974f" + integrity sha512-yRtddtrcYdLJt0l70aP7usb2YpMHNXAdAvJW2hXdka5boR4vKMS/F5BTR5sULkbht9xPk/EKzbY2mCczMutZqQ== dependencies: - "@babel/parser" "^7.29.14" - "@babel/types" "^7.29.14" + "@babel/parser" "^7.29.15" + "@babel/types" "^7.29.15" "@jridgewell/gen-mapping" "^0.3.12" "@jridgewell/trace-mapping" "^0.3.28" jsesc "^3.0.2" @@ -72,24 +72,24 @@ "@babel/traverse" "^7.29.7" "@babel/types" "^7.29.7" -"@babel/helper-module-transforms@^7.29.13": - version "7.29.14" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.29.14.tgz#77f5b40efc02286f9b8d5a1b50dcdecfd24871a0" - integrity sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA== +"@babel/helper-module-transforms@^7.29.16": + version "7.29.16" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.29.16.tgz#257e04ef34d3911534093c8d9d523e20307bb0db" + integrity sha512-jzdW9nRNJXbNAfcbtfZA75vcQK8c/PRniwNL1KIQukiptryb5JlCl+nwi3idOSj611tMgiZxb9PuKg1FI0BvVQ== dependencies: "@babel/helper-module-imports" "^7.29.7" "@babel/helper-validator-identifier" "^7.29.7" - "@babel/traverse" "^7.29.14" + "@babel/traverse" "^7.29.16" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.29.7", "@babel/helper-plugin-utils@^7.8.0": version "7.29.7" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz#c0a0766f1a13617d8a17407d7ab8f9d486225ea4" integrity sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw== -"@babel/helper-string-parser@^7.29.14": - version "7.29.14" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.29.14.tgz#580738bad73cc713688e6bbc0b59ac8760066fe1" - integrity sha512-CXvKMFvM80ihI7Vox9jb+kQjnyjESQNPM+vB7U0Zz6TWuZA+Z/FL0QPMH300h33qJtIx+REeBhXqWOPW48TcAQ== +"@babel/helper-string-parser@^7.29.15": + version "7.29.15" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.29.15.tgz#97d33964c3622accda81fc81ed7a34c7bb5f863b" + integrity sha512-C2FuapQ2Kh1OnVHAoLi5rD3GBJ8COb9Q609T6HEpLqaBAo560PDP5OxBE5dCI/h951MBO/+bCUYU5SZ+8ZlV+w== "@babel/helper-validator-identifier@^7.29.7": version "7.29.7" @@ -101,20 +101,20 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz#cf315be940213b354eb4abcc0bd01ebe3f73bc2a" integrity sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw== -"@babel/helpers@^7.29.13": - version "7.29.14" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.29.14.tgz#edc82d7dc43a4785c1c1bb80dcda2e2b6f6ab27e" - integrity sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ== +"@babel/helpers@^7.29.16": + version "7.29.16" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.29.16.tgz#f97b9fce60fabdea58f328cf84b3209ad06c69d2" + integrity sha512-JGNbyEyvOAvceLDQoO6b/w/HbW6KX3sdWgrPCFcAyHfhfsqRoRN14vfaG3GZ90g2dVK7UEe65giopuldeimBjg== dependencies: "@babel/template" "^7.29.7" - "@babel/types" "^7.29.14" + "@babel/types" "^7.29.15" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.29.13", "@babel/parser@^7.29.14", "@babel/parser@^7.29.7": - version "7.29.14" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.29.14.tgz#9d3f5e3d62d725aa036ab489057e72fb446d1fad" - integrity sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.29.15", "@babel/parser@^7.29.7": + version "7.29.15" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.29.15.tgz#2e2bcf6e51bfc99e1a00417f0a122ba27a441dba" + integrity sha512-RpKWyisHoP81twtSCgmE02iU0RnPcq1DN5bBEbpUePrjA9Q3wXhufnCJrrayPpoZieqFh3zyZQqwtSK0gGccRA== dependencies: - "@babel/types" "^7.29.14" + "@babel/types" "^7.29.15" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -244,25 +244,25 @@ "@babel/parser" "^7.29.7" "@babel/types" "^7.29.7" -"@babel/traverse@^7.29.13", "@babel/traverse@^7.29.14", "@babel/traverse@^7.29.7": - version "7.29.14" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.29.14.tgz#97af2f5e45248b06f94d7e72f4433287cf385339" - integrity sha512-RAdQJrBgmIH1FWvN0X+1hoDxzMzlP4cv/1Zi4dn4tG1H0cTb+rw7CzUxQJhp1f4ANd8j5vH3fy8BAWFGkBDEsA== +"@babel/traverse@^7.29.16", "@babel/traverse@^7.29.7": + version "7.29.16" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.29.16.tgz#94e261eee90b23a3e1e2e0ab8383ec5814a88b0e" + integrity sha512-a16ah9dTLOLUq5BL7NElJ7keefg/276vgfTfExDf1PizddYboqRnQXDTooVPb0VArIqrKe8KLlghnTxlZFEZtQ== dependencies: "@babel/code-frame" "^7.29.7" - "@babel/generator" "^7.29.14" + "@babel/generator" "^7.29.16" "@babel/helper-globals" "^7.29.7" - "@babel/parser" "^7.29.14" + "@babel/parser" "^7.29.15" "@babel/template" "^7.29.7" - "@babel/types" "^7.29.14" + "@babel/types" "^7.29.15" debug "^4.3.1" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.2", "@babel/types@^7.29.11", "@babel/types@^7.29.14", "@babel/types@^7.29.7", "@babel/types@^7.3.3": - version "7.29.14" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.29.14.tgz#ba8598f80d0eb450d9f8a940270c1e650ef76206" - integrity sha512-UjI/dKmwJwT9pOszJitq2G6EObZPnsZUfdCr92z2TlF3EZK9J3EdfOKUrCzHl6wFthbzwhzl1Soc/UIwxRiq6w== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.2", "@babel/types@^7.29.15", "@babel/types@^7.29.7", "@babel/types@^7.3.3": + version "7.29.15" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.29.15.tgz#92f0fa3501405b132ac7a5acd064052e8a455f09" + integrity sha512-/XKpKDakL//LZ66bq1XsZOswuqeI5MZqPLDu18o3XdkU1fNJ7bdPtzgnc4ZNS+bBGHV0FJG8jjb8SwcC3nNVQQ== dependencies: - "@babel/helper-string-parser" "^7.29.14" + "@babel/helper-string-parser" "^7.29.15" "@babel/helper-validator-identifier" "^7.29.7" "@bcoe/v8-coverage@^0.2.3": @@ -297,9 +297,9 @@ eslint-visitor-keys "^3.4.3" "@eslint-community/regexpp@^4.12.1", "@eslint-community/regexpp@^4.12.2": - version "4.12.3" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.3.tgz#332c2660e7dd03ce7017ea3354123fb19b21cdd6" - integrity sha512-R76UKbvsqI68DJJVTVyqFKqU98CN4+B+acxNfEA2IFarSzP0SjtKf/3+fFiXzTyv5Fj3PxLkGHe2wnVWWMxobQ== + version "4.12.4" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.4.tgz#b1717296e3e9814785ada3e3b0e431ac67253af3" + integrity sha512-1qH3WeISXHFS8P3QI0lntHlMrlfTh1OarxlRbPNDEkSCqoyXC3apBE7MDyRKOL8HpuW48aQtff30wvEFww/4ww== "@eslint/config-array@^0.21.2": version "0.21.2" @@ -843,9 +843,9 @@ integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA== "@types/estree@^1.0.6", "@types/estree@^1.0.8": - version "1.0.10" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.10.tgz#8a4a266065af8c2fcf5983153cd97c11b313d0c6" - integrity sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g== + version "1.0.11" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.11.tgz#34689679c1d4868100519b746d3f9d21d4a6954b" + integrity sha512-YBdNe5JcjYR0sPhJW1QIeRCmI11YhYvaRuGCs9+WCeTTb+Yhb2BE2XMe5/wAqF10FK5g3+q1PDhQABfT7aX0gg== "@types/graceful-fs@^4.1.3": version "4.1.9" @@ -903,9 +903,9 @@ integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node@*": - version "26.6.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-26.6.6.tgz#9ed7b5817e728ed9216ef7c5b7d373fe3b777104" - integrity sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog== + version "26.6.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-26.6.11.tgz#17799a1ddc1edfc99222a906a0952b3c9be8794a" + integrity sha512-uUyQ2XLEz+EXh34lmS3GhKrkqn/8FU7KUiKRpk347At2bmnMVWss45yz8b4FG/tUtmV1tV/+TVkITItPROyeeQ== dependencies: undici-types "~8.9.0" @@ -949,99 +949,99 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^8.38.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.73.0.tgz#a30066ac95875d9b0bdece795d6671550a175859" - integrity sha512-UkygMFer53Yzn29MCYFTHf34hGXf5KJhiDWfIm1tXtXRrym1CS6l5H9Y3yCtPWChpC0/f93H88gdj8tN0dd4kw== + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.74.0.tgz#153c657b8c6b844986a25f7a7814c4a983f1512b" + integrity sha512-z3KXk1+Vm+d82ZRplOoC89ho4Rf1da5ju6sx8//92GnN532U62DGPjECXkkVqtYzIv0zoJlpO39SX2Z9tk6LVw== dependencies: "@eslint-community/regexpp" "^4.12.2" - "@typescript-eslint/scope-manager" "8.73.0" - "@typescript-eslint/type-utils" "8.73.0" - "@typescript-eslint/utils" "8.73.0" - "@typescript-eslint/visitor-keys" "8.73.0" + "@typescript-eslint/scope-manager" "8.74.0" + "@typescript-eslint/type-utils" "8.74.0" + "@typescript-eslint/utils" "8.74.0" + "@typescript-eslint/visitor-keys" "8.74.0" ignore "^7.0.5" natural-compare "^1.4.0" ts-api-utils "^2.5.0" "@typescript-eslint/parser@^8.38.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.73.0.tgz#fbef99f6a3dd5546375ba03fbc0c75181971e46e" - integrity sha512-AuL45bVcmssHfZ3Di3cs9Q0l4gBm4ZFVrJOQEE7VpqW+PVgQaEwSwazz4TVIiFabXkk6U51EprYDwqw+HR8ePw== - dependencies: - "@typescript-eslint/scope-manager" "8.73.0" - "@typescript-eslint/types" "8.73.0" - "@typescript-eslint/typescript-estree" "8.73.0" - "@typescript-eslint/visitor-keys" "8.73.0" + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.74.0.tgz#9e6f795443f596585acc289ad0846366e69fa1d6" + integrity sha512-ecr8AYdig7avVkxaHdQvxHnIJ/mOyliO4Gv/uWF8q69vBew/z3sexqBwHUZX5Vql+Ns0w4sH6gBLkICGbOvJkA== + dependencies: + "@typescript-eslint/scope-manager" "8.74.0" + "@typescript-eslint/types" "8.74.0" + "@typescript-eslint/typescript-estree" "8.74.0" + "@typescript-eslint/visitor-keys" "8.74.0" debug "^4.4.3" -"@typescript-eslint/project-service@8.73.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.73.0.tgz#cea2f3cf6dd2b32add1dfe513f3433d210947eb1" - integrity sha512-/pEf8Rc4Mjk+qJnY0uO1+Gadeal8uv50xpuic+srG2vIVatA0XxvWMUeMtFvs6OCHqftiQ7/+qH4aehG5stzIA== +"@typescript-eslint/project-service@8.74.0": + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.74.0.tgz#cc8aa21c94f2c43040a50b750f4bb0c698d6f814" + integrity sha512-z/mymuE+JlEeSFIv3Mo70EvgG1Zz74Hl0IDfExfXutARAP834bt+MppTD7mVAwmZO0GdxdOAi0jbTam749eH6g== dependencies: - "@typescript-eslint/tsconfig-utils" "^8.73.0" - "@typescript-eslint/types" "^8.73.0" + "@typescript-eslint/tsconfig-utils" "^8.74.0" + "@typescript-eslint/types" "^8.74.0" debug "^4.4.3" -"@typescript-eslint/scope-manager@8.73.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.73.0.tgz#447b2f20517b55750cc33828ed74b26baec03484" - integrity sha512-/TjD738Iq2rzj5z0ixVOi+TsvgjAzZPLPaH1yWdDBytR/HTR5gMpyYWZeCe5WTQZLwk3ho8AV7U3muoQCRtXBQ== +"@typescript-eslint/scope-manager@8.74.0": + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.74.0.tgz#bcda0d13d06d9e97e2c431062c8919c3e8ad61c5" + integrity sha512-kpOdpu4CpWN5U38ox3f727DwWRBtUAVhyUJtqTBYe5gf2wYoxac7PgKP14txrxN7ICVtcjlLdzjqfRgpSnDKvQ== dependencies: - "@typescript-eslint/types" "8.73.0" - "@typescript-eslint/visitor-keys" "8.73.0" + "@typescript-eslint/types" "8.74.0" + "@typescript-eslint/visitor-keys" "8.74.0" -"@typescript-eslint/tsconfig-utils@8.73.0", "@typescript-eslint/tsconfig-utils@^8.73.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.73.0.tgz#72e40e4c694064b5e9c660fb839fdb7e9e26a266" - integrity sha512-lmtCFOfYaJfpqZywGuXi4FpNtE+NQ+YLe3T0K9rtEDcW8ZuGWvfI++pj8r05sYMI8vWT2CYK4rWyedmD6Rp4og== +"@typescript-eslint/tsconfig-utils@8.74.0", "@typescript-eslint/tsconfig-utils@^8.74.0": + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.74.0.tgz#bba10080a0068d0a9113cb13debb9c24451a36e4" + integrity sha512-p07wAuaS6BjCYgOSXKJi4YhvTnAf7fiG37e9THcpnYaQEt2QiTTYZWKwUFNgeRiywiMudazhzgddAirZ0GgHtQ== -"@typescript-eslint/type-utils@8.73.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.73.0.tgz#4ebae458f229c7221ed0b07f46051e73cf8eb596" - integrity sha512-MOC9i4xy1F7KcDde7Ip8jf1SrRiALb2Km4UWxGNjUE2YlhjIEo1ayE27GHIwIQyfWuHTmEonQT14uyurlyC6aA== +"@typescript-eslint/type-utils@8.74.0": + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.74.0.tgz#069f4f119c44e2228052333974ebfcbd5fb0475f" + integrity sha512-CV3Y3la8l3F9ANfxcfpgSSiQgJTe4IeLEoZV4O/gcW86Ugp8X6SKiQ0vm+QegXaRIbbDMokZZSF3A1CgiU/kPw== dependencies: - "@typescript-eslint/types" "8.73.0" - "@typescript-eslint/typescript-estree" "8.73.0" - "@typescript-eslint/utils" "8.73.0" + "@typescript-eslint/types" "8.74.0" + "@typescript-eslint/typescript-estree" "8.74.0" + "@typescript-eslint/utils" "8.74.0" debug "^4.4.3" ts-api-utils "^2.5.0" -"@typescript-eslint/types@8.73.0", "@typescript-eslint/types@^8.73.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.73.0.tgz#785586de1325a973b24e4e762bcd0093b248a2a7" - integrity sha512-O/1ytYzflF16QDKXx4/qOXg1IuZp+n7hr9t+S0nv7N/2Tl8rJiNCshztV1gcSUvHbPtoX3+zmNbtSAyVbzxVfw== +"@typescript-eslint/types@8.74.0", "@typescript-eslint/types@^8.74.0": + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.74.0.tgz#db010a2b419d9a57717eda8d97eafea0cad3ae97" + integrity sha512-MpnMrJCVNpP1iVL8NiHkQZgQqIMBH5ewDGUPBh1pqQXwFtMFjsl1M03QcYPXmv6stCKEiF0PN7CGbU1ZbXFzEA== -"@typescript-eslint/typescript-estree@8.73.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.73.0.tgz#3aba5f6fde4f902c5abb0dce73b4326dd237deb0" - integrity sha512-InjlBkSdWceIwIBWSwS3ENUp+i0O02PGX3Zv2wnihWJC1WDVGvG7mTHuf8b57uAaITj94d6tRPDH+sUEtXdRQQ== +"@typescript-eslint/typescript-estree@8.74.0": + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz#8345c99473c8383feaeb2c201b91807cca2c093d" + integrity sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw== dependencies: - "@typescript-eslint/project-service" "8.73.0" - "@typescript-eslint/tsconfig-utils" "8.73.0" - "@typescript-eslint/types" "8.73.0" - "@typescript-eslint/visitor-keys" "8.73.0" + "@typescript-eslint/project-service" "8.74.0" + "@typescript-eslint/tsconfig-utils" "8.74.0" + "@typescript-eslint/types" "8.74.0" + "@typescript-eslint/visitor-keys" "8.74.0" debug "^4.4.3" minimatch "^11.0.1" semver "^7.7.3" tinyglobby "^0.2.15" ts-api-utils "^2.5.0" -"@typescript-eslint/utils@8.73.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.73.0.tgz#566a437a6a9492fd81b58a169bb7114bdf205639" - integrity sha512-j2SVJJvVkXdUL0WcEzo4vEH1mO1vIi8KlVukcYA2MgMZvYN2LlZR4PmsW+GTSxSW24j6Q/EP7+MOifLtg5hmsA== +"@typescript-eslint/utils@8.74.0": + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.74.0.tgz#1702ab33b301e81530607b538b7358cb71007295" + integrity sha512-IpWXPxXXomzxyTcvjhZJexgdvtTR1TooLAPpuxzaGqQ8BHll1lf4Ysp/BTE/l0U5TJ+x1j7B4bEM8pLRrvY+XA== dependencies: "@eslint-community/eslint-utils" "^4.9.1" - "@typescript-eslint/scope-manager" "8.73.0" - "@typescript-eslint/types" "8.73.0" - "@typescript-eslint/typescript-estree" "8.73.0" + "@typescript-eslint/scope-manager" "8.74.0" + "@typescript-eslint/types" "8.74.0" + "@typescript-eslint/typescript-estree" "8.74.0" -"@typescript-eslint/visitor-keys@8.73.0": - version "8.73.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.73.0.tgz#b5e802c5f300cf7768ddb3c7e46bd7013744e57c" - integrity sha512-k4lsFVpRZICbltkIEEH4hZRkwXkqDF1GHBpClKQOHQY+RkoZAAuyc1ci3I6p+CB6v3U4jaHIUshc4RzzQXZWLg== +"@typescript-eslint/visitor-keys@8.74.0": + version "8.74.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.74.0.tgz#6a0821eb6b9a8f101ac3ed769610d524716b1b90" + integrity sha512-XSZmOtMUbWCBIM+2BK134FyMFxmll1mW2mPLk/PSwYQYzGIPMgJAqL929U4qXVizLv7Xq5b7r41/o7Ombuwk0g== dependencies: - "@typescript-eslint/types" "8.73.0" + "@typescript-eslint/types" "8.74.0" eslint-visitor-keys "^5.0.0" "@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1": @@ -1395,9 +1395,9 @@ balanced-match@^4.0.2: integrity sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA== baseline-browser-mapping@^2.11.37: - version "2.11.39" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.39.tgz#4e99c4845e0c2100b6b1ef189bce3643d11e604e" - integrity sha512-Q9buOYhr2ggrEZpImICecZTJHCCd8yXkRUokFlUEQ8uiD6oP82F4W4jWnhOHZYV+wlvrC51V7Wy0ULyWjil5Wg== + version "2.11.41" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.41.tgz#a6c7113e6b56fed236cb5bf341fc3469e3529e74" + integrity sha512-yjL/sZCpbpL0ocwmrUe1YFUelyMcifcByF4UYCBDyubFXQRs3lUjo9VoPKdjoFFhmzLAAGNJb1GBBCQJ6B4eyg== brace-expansion@^1.1.7: version "1.1.22" @@ -1408,9 +1408,9 @@ brace-expansion@^1.1.7: concat-map "0.0.1" brace-expansion@^5.0.12, brace-expansion@^5.0.8: - version "5.0.13" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.0.13.tgz#e2d4497370f7e385e6f96b57bd7ff11d77d85851" - integrity sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ== + version "5.1.2" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.1.2.tgz#00a21136b1c780e3c7050614fd1cc78f0df2c093" + integrity sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw== dependencies: balanced-match "^4.0.2" @@ -1475,9 +1475,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001826: - version "1.0.30001826" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001826.tgz#6c2cc43e4858e54d6f7200fa87b4de93cb39aa77" - integrity sha512-wTB+9tIbLro/BCXwLuNV1meHE4L9dS6dArMDwgYfNBPMYScqClHyGunhkCSDtHhe/69Xl0sHlKgBVZ+fNsYtWA== + version "1.0.30001829" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001829.tgz#27657d53df825b26b71196e8fca5a00dbccd09aa" + integrity sha512-FeVvlaVr3r+cdHIYXyZhtVkqroSYjYaoNxItxQNjusurUE+IqODawDsbzk02HJgi2RdKiaGGFm+EKbXku+yITg== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1609,9 +1609,9 @@ create-jest@^29.7.0: prompts "^2.0.1" cross-spawn@^7.0.3, cross-spawn@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" - integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + version "7.1.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.1.2.tgz#3e2739b30512a074fd9d40681f087ec1dc961f43" + integrity sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" @@ -1702,9 +1702,9 @@ dunder-proto@^1.0.1: gopd "^1.2.0" electron-to-chromium@^1.5.486: - version "1.5.492" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.492.tgz#bd63a064a6ab036db630af5dfe83f4533de7cbf0" - integrity sha512-4uMs7omhajKiud0GqALLTazS/zyvHLTLmDWVTR+e6BnyJo5bSNrph/JoRWEFJJmY75ct9hCiSGsbFF9fLe5gDw== + version "1.5.497" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.497.tgz#e8501f0c66100c66cfb4710b41c075497f042510" + integrity sha512-6AOdatCqk0KqRbYrO2+ZfyE6I4ukT07lGc0uXBPapvIg4vZ00hg+8kdO19nL7PVfS2pQBTb9yzdt1efkz02vvw== emittery@^0.13.1: version "0.13.1" @@ -1722,9 +1722,9 @@ emoji-regex@^8.0.0: integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== enhanced-resolve@^5.27.0: - version "5.27.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.27.0.tgz#5a5b25b79e79500f3710995c7a50cabe08fdcdb1" - integrity sha512-Do6BB2xzlcc/odFg+XEYyneAx4T/WfywO71yw9ePS2tVfRsf7JVR4mUeELadIeHzixkzbG5DpluiEFPi2WGfYQ== + version "5.27.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.27.1.tgz#892c5761e5096a5ea522f50b2252db9f035903ad" + integrity sha512-QnT3ioXm47iCbUZ4yz+I04XStINU9hslvd0XuifFqp9VjkEP3tOAhmhfbRCn4W5uFlpP76XqzFh4eQ8wRGRWMQ== dependencies: graceful-fs "^4.2.4" tapable "^2.3.3" @@ -1805,9 +1805,9 @@ escodegen@^2.0.0: source-map "~0.6.1" eslint-config-prettier@^10.1.8: - version "10.1.8" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz#15734ce4af8c2778cc32f0b01b37b0b5cd1ecb97" - integrity sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w== + version "10.1.9" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.9.tgz#748a96b6537d6dae9580b29e26014c4fbe791faa" + integrity sha512-JnOR0K4u67CWOiSS3vaduGlLUWS32lGiyglMIV6AyvK9DBRpS+QhR2ESKaUe2eWGRsdVmrxy77yaOk2hzDa4Bg== eslint-plugin-prettier@^5.5.3: version "5.5.7" @@ -2035,9 +2035,9 @@ flat-cache@^4.0.0: keyv "^4.5.4" flatted@^3.2.9: - version "3.4.4" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.4.4.tgz#aeeca2a506303f0cee61c59e6c9f2a88d2f29fc6" - integrity sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q== + version "3.5.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.5.1.tgz#803415b62ddfb76661216ace690e0861f73996ca" + integrity sha512-qzp88St5qssOkS6hnWEvsFqE6SGoQtamMc6ghNo2s2idGn3rvHl/mdmLKQr5egZeVcqHfVCXtPoY+DP0flzPTg== form-data@^4.0.0: version "4.0.6" @@ -2246,9 +2246,9 @@ ignore@^5.2.0: integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== ignore@^7.0.5: - version "7.0.16" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.16.tgz#8c593ab7a7193e663f810203690c9cba851b6d3a" - integrity sha512-52N+Y4HRMOJmbLmr+DqO4iSRyyB7N52gm7PWCT6h0p978+oKbqHCB7gIJIwZvBUsjlSdWbrBFqUSmIFNZMpn0A== + version "7.0.17" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.17.tgz#53766c7486ac0b5a1449076bcf081bae0341436a" + integrity sha512-0c3zcBRlWmcKhcIQWckzkYncJRv5HHB8O32wO/FcWL8DDXWDJgiEF6SX9ThbTv5h/eZ+xJK+VvDjjQ+cQJhp3Q== import-fresh@^3.2.1: version "3.3.1" @@ -3083,9 +3083,9 @@ minimatch@^10.2.5: brace-expansion "^5.0.8" minimatch@^11.0.1: - version "11.0.9" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-11.0.9.tgz#00d0088671fa0d872ba1e2578f5abf3be0fe878e" - integrity sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q== + version "11.0.10" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-11.0.10.tgz#082ab490cc2f93849ecd04eed8175060fdd7c5c8" + integrity sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw== dependencies: "@isaacs/nonrecursive-glob-match" "^1.1.0" brace-expansion "^5.0.12" @@ -3103,12 +3103,12 @@ minimist@^1.2.8: integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== minimizer-webpack-plugin@^5.14.0: - version "5.14.0" - resolved "https://registry.yarnpkg.com/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.14.0.tgz#5ab341c84ce3a57daf533e84d52d96a42e707298" - integrity sha512-PnvQXCJxhgH2ZVVO7Lj0sM6q8L1XGxnUvd8wVQIRwi8khMCLq5wg0Ngxe44bcuZL2FSN81RdVE7YHEVzTKsQDQ== + version "5.14.1" + resolved "https://registry.yarnpkg.com/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.14.1.tgz#0e2b21c143a64c8b89916761dbfc18ec1b8bb730" + integrity sha512-qsfTb5Ao4nre9krFweqj8k5bVU7KxgsP4WkLO/ITTuiJkbitCzYBY+Aum5KTKRhY0wDr8VJ1RILsTCSUtPd1kQ== dependencies: jest-worker "^27.4.5" - schema-utils "^4.6.0" + schema-utils "^4.8.5" terser "^5.51.0" mri@^1.1.0: @@ -3176,9 +3176,9 @@ node-int64@^0.4.0: integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.64: - version "2.0.65" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.65.tgz#8937f0f215e572b35c1dc83f8c6ec61cafccb9f8" - integrity sha512-PfvofsGQ+MiOQIPkX9fU8ELUWmy5zL74CdQaph/ismKszfFkfwXaw0cGiwbwym2hT9k5+mdyl8O5WQ1MD8EHmA== + version "2.0.67" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.67.tgz#4bbbc6e43763cc180da7c4ad76437dc8222f639c" + integrity sha512-qgSZT38oj+YV4qyFmdPQEGRFQRP1l8a0wccOECrcrdGl9KldZlCXrEz7uOviThiOWR1KyqiQYeLrf7M9xRi1bg== normalize-path@^3.0.0: version "3.0.0" @@ -3269,9 +3269,9 @@ p-try@^2.0.0: integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== package-manager-detector@^1.8.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/package-manager-detector/-/package-manager-detector-1.9.0.tgz#217ed03645bfeb563e9efce4c5bbbfbb652754ab" - integrity sha512-zAMfbta9nPA8AKkA4WdmNAT8R8s6Dk0/xwPsqNnRidMFcLo1YkLuPDTgs2f64XdzS8vbLNnoJ+uUIkgbz7oRHA== + version "1.10.0" + resolved "https://registry.yarnpkg.com/package-manager-detector/-/package-manager-detector-1.10.0.tgz#815bb3367702384c6f48d044ccc1c4f99bcc7048" + integrity sha512-FlC7wr4YYRfVyk1E3u3qwi7Vh6qVvPowYkHQSDEoSKCN0o0F7w0TzNfJSBb/1rwEQbU3c96Exx/2vMYiCIx+wQ== parent-module@^1.0.0: version "1.0.1" @@ -3514,7 +3514,7 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -schema-utils@^4.6.0, schema-utils@^4.8.2: +schema-utils@^4.8.2, schema-utils@^4.8.5: version "4.8.5" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.8.5.tgz#aa5abf4653e45af6a4c7c0ab7ef11d6f18ffcf22" integrity sha512-K1RRP7aTUAY2lGXNzPwjMK6AMMzbETdpF3pTPMEnH/RrpmPx6K1X47/gSebrV+1I9pRcgpwZwqpYBlyZAsliiw== @@ -3736,9 +3736,9 @@ tapable@^2.3.3, tapable@^2.3.4: integrity sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg== terser@^5.51.0: - version "5.51.3" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.51.3.tgz#3f57396f0ffb8aff0966adffe2d119c58101789b" - integrity sha512-j5jPZZ6Sz0Eg2unusKhdRzUhUlHXJ3Bw2AkIXyJ6AqajWwihUlZOdJS+KSnZzmtVk6mFGdm3hHg0+M2sgyEz5Q== + version "5.51.4" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.51.4.tgz#b3874fdb414054ec2cb54522fef78c6773a0fc85" + integrity sha512-VPi1CkDvCWLGUVIToctNBG+NdHbSXwOPjHJnQ3pdB0XknaldnI76wSkAFOGxV2ZdkzOP5d6gpQ5c58XvDghRvw== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.15.0" @@ -3755,9 +3755,9 @@ test-exclude@^6.0.0: minimatch "^3.0.4" tinyexec@^1.0.4, tinyexec@^1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-1.3.1.tgz#16a2e3c6e23fafce72640e678e651db36145b9c6" - integrity sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA== + version "1.4.0" + resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-1.4.0.tgz#00ebfefb08f1d608ccbf433743830dffe56c7dee" + integrity sha512-PV6lIcJQh57aFeJDwx16JNHmgFRh5xguzallrDW1qe8nAghYgr5MKz2K5k7wEyV/ygZhdnIAP8+HZSarHPBCsg== tinyglobby@^0.2.15: version "0.2.17" @@ -3767,17 +3767,17 @@ tinyglobby@^0.2.15: fdir "^6.5.0" picomatch "^4.0.4" -tldts-core@^7.5.5: - version "7.5.5" - resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.5.5.tgz#9d4645d34b58699744122012c252abcff3645dc6" - integrity sha512-rEJz/8cJFY/bdF354gl14yxavbrIbvM+FcbkYVQ6CSCMQTJdUFUIm39TTWSiGPvcpQh7/F6qHrD3SkwwdgtDCw== +tldts-core@^7.6.4: + version "7.6.4" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.6.4.tgz#ea3d475cf0f09564d54fb5dcd73289d1a74828c5" + integrity sha512-QywQ9lgQyZMuc3NVlqmuxHOhlwirSdvgD/vDLvX8dZYcYgy1cdri5rY/TXDHcF4J3VBSdJLcJNIJI6zGJ7jE+w== tldts@^7.0.5: - version "7.5.5" - resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.5.5.tgz#12c63610ca3ee6d7a60b72667c1b7c570aef367c" - integrity sha512-Hy6IImaWALzJOgCIss4gIFi4G0M9lqk95pFKCUVxQPZw+biZ1Pv6f28JpYgahpJB+BufA0HYsIU/aP/WIx3KRg== + version "7.6.4" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.6.4.tgz#4cf4a818a4309916a634b6de46fa6130375f96e3" + integrity sha512-wp+ZdvQyov404xynNcjbXoJyeGM28W/aCwMmry/rJ+Y0SsObukJYkWwuxWGbNpIjeqMaEbNUtXPNtPPfI5cTFA== dependencies: - tldts-core "^7.5.5" + tldts-core "^7.6.4" tmpl@1.0.5: version "1.0.5" @@ -3913,9 +3913,9 @@ undici-types@~8.9.0: integrity sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg== undici@^7.12.0: - version "7.30.2" - resolved "https://registry.yarnpkg.com/undici/-/undici-7.30.2.tgz#26c6acb0ffe838f823511f8cb79a8d530652135e" - integrity sha512-mLyPQnHwUxaM/rideoK/+KL8DaAJLRl4aBCfmX444aCSLnIaomqPLtNRe2jdCYcsk5wZzXrDIQC8ZeYNRAYyIA== + version "7.30.3" + resolved "https://registry.yarnpkg.com/undici/-/undici-7.30.3.tgz#5871f5c7332cc3c42f577c0420f4378ffa2c4588" + integrity sha512-Zlb+QdzEW3+j3Yt5GyAycC7nFHhrGQaZhK0C65WWslTvEh11sN3G5EkBkboFt+dcNZEGSFuK3XoDSq6YqmXo5Q== universalify@^0.2.0: version "0.2.0" @@ -4090,9 +4090,9 @@ write-file-atomic@^4.0.2: signal-exit "^3.0.7" ws@^8.11.0: - version "8.23.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.23.0.tgz#e1af4314ad9d4cfde4684d08a9f09b322830e84e" - integrity sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ== + version "8.23.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.23.1.tgz#7e32c1948f0a77872fa2fd0580970683986b5fdc" + integrity sha512-1rzWDSN0NOi3tpwgHsQExjWRoKUGtjCkJ2gZRaaRtzhYLboMytOI9pj9PU7yCgY37auqdd4OyLofZDbkeuZmPA== xml-name-validator@^4.0.0: version "4.0.0" From dbf1616816a5ba2add28581ce171b5fc5beea1f7 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:05:26 +0000 Subject: [PATCH 2/2] [fern-replay] Applied customizations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patches applied (6): - patch-066ff9e0: docs: add v6 migration guide for breaking changes in v6.0.0 (#1368) - patch-d8faf7a2: docs: update v6 migration guide with federatedConnectionsTokensets and federated_connections_access_tokens breaking changes (#1370) - patch-0f7baa6f: fix: auto-stamp SDK_VERSION from package.json during build (#1382) - patch-b942f5d6: docs: add Authentication API migration guide (auth0-auth-js / auth0-server-js) (#1395) - patch-842d2f51: docs: add v7 migration guide (v6 → v7) (#1396) - patch-456afefc: feat: enhance domain validation for ManagementClient and related components Patches with unresolved conflicts (15): - patch-490e5634: feat(management): add sub-package exports and management auth helper (#1373) - patch-74170bb0: Release v6.1.0 (#1381) - patch-4fcb39a4: Release v6.2.0 (#1389) - patch-f9d64134: Release v6.3.0 (#1393) - patch-4d450aa4: Release v6.4.0 (#1401) - patch-d4614ec0: Release v7.0.0 (#1402) - patch-e1e90b89: Release v7.1.0 (#1405) - patch-567042f4: Release v7.2.0 (#1409) - patch-de9f20d2: Release v7.3.0 (#1415) - patch-7750e996: Release v7.4.0 (#1424) - patch-f9566e21: Release v7.5.0 (#1427) - patch-185ac064: Release v7.6.0 (#1430) - patch-945e9d93: Release v7.7.0 (#1438) - patch-a4eb7afb: Release v7.8.0 (#1442) - patch-c90ce4ac: Release v7.9.0 (#1448) Run `fern-replay resolve` to apply these customizations. --- .fern/replay.lock | 2670 ++++++++++++++++++++---- .shiprc | 6 + AUTH_MIGRATION_GUIDE.md | 14 + auth-migration/authentication-flows.md | 234 +++ auth-migration/index.md | 732 +++++++ auth-migration/server-side-sessions.md | 163 ++ auth-migration/troubleshooting.md | 32 + v6_MIGRATION_GUIDE.md | 158 ++ v7_MIGRATION_GUIDE.md | 146 ++ 9 files changed, 3773 insertions(+), 382 deletions(-) create mode 100644 .shiprc create mode 100644 AUTH_MIGRATION_GUIDE.md create mode 100644 auth-migration/authentication-flows.md create mode 100644 auth-migration/index.md create mode 100644 auth-migration/server-side-sessions.md create mode 100644 auth-migration/troubleshooting.md create mode 100644 v6_MIGRATION_GUIDE.md create mode 100644 v7_MIGRATION_GUIDE.md diff --git a/.fern/replay.lock b/.fern/replay.lock index d7fe613981..723e63fe02 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -96,14 +96,20 @@ generations: cli_version: unknown generator_versions: fernapi/fern-typescript-sdk: 3.108.17 -current_generation: 33e21ba09b5b8a9ccf35c58834f5aa8ac6d23bec + - commit_sha: 76a8c62150a47e0a4feb6dbda0bc3796152983ae + tree_hash: ccc39639068453326396b6e0b8da79c861bd1a98 + timestamp: 2026-12-02T12:05:07.485Z + cli_version: unknown + generator_versions: + fernapi/fern-typescript-sdk: 3.108.17 +current_generation: 76a8c62150a47e0a4feb6dbda0bc3796152983ae patches: - id: patch-066ff9e0 content_hash: sha256:5b87ec9a63fc57aba4840d0d335d472c621e838fc1d61515b30660df39d0dbc2 original_commit: 066ff9e02c45f4abf46791a3f070c762f7ecd924 original_message: "docs: add v6 migration guide for breaking changes in v6.0.0 (#1368)" original_author: Ankita Tripathi <51994119+ankita10119@users.noreply.github.com> - base_generation: 33e21ba09b5b8a9ccf35c58834f5aa8ac6d23bec + base_generation: 76a8c62150a47e0a4feb6dbda0bc3796152983ae files: - v6_MIGRATION_GUIDE.md patch_content: | @@ -437,7 +443,7 @@ patches: original_commit: d8faf7a21efbed3bd75a0f36ff0d190bb9dd986b original_message: "docs: update v6 migration guide with federatedConnectionsTokensets and federated_connections_access_tokens breaking changes (#1370)" original_author: Ankita Tripathi <51994119+ankita10119@users.noreply.github.com> - base_generation: 33e21ba09b5b8a9ccf35c58834f5aa8ac6d23bec + base_generation: 76a8c62150a47e0a4feb6dbda0bc3796152983ae files: - v6_MIGRATION_GUIDE.md patch_content: | @@ -8279,7 +8285,7 @@ patches: original_commit: 0f7baa6fa58a2944cd9e39abbfd8caf7be8d7e8c original_message: "fix: auto-stamp SDK_VERSION from package.json during build (#1382)" original_author: Ankita Tripathi <51994119+ankita10119@users.noreply.github.com> - base_generation: 33e21ba09b5b8a9ccf35c58834f5aa8ac6d23bec + base_generation: 76a8c62150a47e0a4feb6dbda0bc3796152983ae files: - .shiprc patch_content: | @@ -13756,7 +13762,7 @@ patches: original_commit: b942f5d6b1b5f3e565f3315f12421c58ae005bec original_message: "docs: add Authentication API migration guide (auth0-auth-js / auth0-server-js) (#1395)" original_author: tusharpandey13 - base_generation: 33e21ba09b5b8a9ccf35c58834f5aa8ac6d23bec + base_generation: 76a8c62150a47e0a4feb6dbda0bc3796152983ae files: - AUTH_MIGRATION_GUIDE.md - auth-migration/authentication-flows.md @@ -16156,7 +16162,7 @@ patches: original_commit: 842d2f5189493b78e420c17c968c80bc239e143a original_message: "docs: add v7 migration guide (v6 → v7) (#1396)" original_author: tusharpandey13 - base_generation: 33e21ba09b5b8a9ccf35c58834f5aa8ac6d23bec + base_generation: 76a8c62150a47e0a4feb6dbda0bc3796152983ae files: - v7_MIGRATION_GUIDE.md patch_content: | @@ -25760,42 +25766,2252 @@ patches: } } src/management/version.ts: | - export const SDK_VERSION = "7.4.0"; + export const SDK_VERSION = "7.4.0"; + status: unresolved + - id: patch-f9566e21 + content_hash: sha256:3359546288f8178f80696587c90c4064dbf9a318de4ed55374d77fbdd645a82d + original_commit: f9566e218363f1a46bdfd62fdd947f08272e7537 + original_message: Release v7.5.0 (#1427) + original_author: Ankita Tripathi <51994119+ankita10119@users.noreply.github.com> + base_generation: 0b3c8a4f22d3c758112a0aca732d20beba54c601 + files: + - package.json + - src/management/version.ts + patch_content: | + diff --git a/package.json b/package.json + index acea6f27f2..c456e8ca17 100644 + --- a/package.json + +++ b/package.json + @@ -1,6 +1,6 @@ + { + "name": "auth0", + - "version": "7.4.0", + + "version": "7.5.0", + "private": false, + "repository": { + "type": "git", + diff --git a/src/management/version.ts b/src/management/version.ts + index ccd206f972..6a5cc9fe4a 100644 + --- a/src/management/version.ts + +++ b/src/management/version.ts + @@ -1 +1 @@ + -export const SDK_VERSION = "7.4.0"; + +export const SDK_VERSION = "7.5.0"; + theirs_snapshot: + package.json: | + { + "name": "auth0", + "version": "7.5.0", + "private": false, + "repository": { + "type": "git", + "url": "git+https://github.com/auth0/node-auth0.git" + }, + "license": "MIT", + "type": "commonjs", + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.mjs", + "types": "./dist/cjs/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.js" + }, + "default": "./dist/cjs/index.js" + }, + "./actions": { + "import": { + "types": "./dist/esm/management/api/resources/actions/exports.d.mts", + "default": "./dist/esm/management/api/resources/actions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/actions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/actions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/actions/exports.js" + }, + "./agents": { + "import": { + "types": "./dist/esm/management/api/resources/agents/exports.d.mts", + "default": "./dist/esm/management/api/resources/agents/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/agents/exports.d.ts", + "default": "./dist/cjs/management/api/resources/agents/exports.js" + }, + "default": "./dist/cjs/management/api/resources/agents/exports.js" + }, + "./branding": { + "import": { + "types": "./dist/esm/management/api/resources/branding/exports.d.mts", + "default": "./dist/esm/management/api/resources/branding/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/branding/exports.d.ts", + "default": "./dist/cjs/management/api/resources/branding/exports.js" + }, + "default": "./dist/cjs/management/api/resources/branding/exports.js" + }, + "./clientGrants": { + "import": { + "types": "./dist/esm/management/api/resources/clientGrants/exports.d.mts", + "default": "./dist/esm/management/api/resources/clientGrants/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/clientGrants/exports.d.ts", + "default": "./dist/cjs/management/api/resources/clientGrants/exports.js" + }, + "default": "./dist/cjs/management/api/resources/clientGrants/exports.js" + }, + "./clientProfiles": { + "import": { + "types": "./dist/esm/management/api/resources/clientProfiles/exports.d.mts", + "default": "./dist/esm/management/api/resources/clientProfiles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/clientProfiles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/clientProfiles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/clientProfiles/exports.js" + }, + "./clients": { + "import": { + "types": "./dist/esm/management/api/resources/clients/exports.d.mts", + "default": "./dist/esm/management/api/resources/clients/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/clients/exports.d.ts", + "default": "./dist/cjs/management/api/resources/clients/exports.js" + }, + "default": "./dist/cjs/management/api/resources/clients/exports.js" + }, + "./connectionProfiles": { + "import": { + "types": "./dist/esm/management/api/resources/connectionProfiles/exports.d.mts", + "default": "./dist/esm/management/api/resources/connectionProfiles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/connectionProfiles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/connectionProfiles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/connectionProfiles/exports.js" + }, + "./connections": { + "import": { + "types": "./dist/esm/management/api/resources/connections/exports.d.mts", + "default": "./dist/esm/management/api/resources/connections/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/connections/exports.d.ts", + "default": "./dist/cjs/management/api/resources/connections/exports.js" + }, + "default": "./dist/cjs/management/api/resources/connections/exports.js" + }, + "./customDomains": { + "import": { + "types": "./dist/esm/management/api/resources/customDomains/exports.d.mts", + "default": "./dist/esm/management/api/resources/customDomains/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/customDomains/exports.d.ts", + "default": "./dist/cjs/management/api/resources/customDomains/exports.js" + }, + "default": "./dist/cjs/management/api/resources/customDomains/exports.js" + }, + "./deviceCredentials": { + "import": { + "types": "./dist/esm/management/api/resources/deviceCredentials/exports.d.mts", + "default": "./dist/esm/management/api/resources/deviceCredentials/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/deviceCredentials/exports.d.ts", + "default": "./dist/cjs/management/api/resources/deviceCredentials/exports.js" + }, + "default": "./dist/cjs/management/api/resources/deviceCredentials/exports.js" + }, + "./emailTemplates": { + "import": { + "types": "./dist/esm/management/api/resources/emailTemplates/exports.d.mts", + "default": "./dist/esm/management/api/resources/emailTemplates/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/emailTemplates/exports.d.ts", + "default": "./dist/cjs/management/api/resources/emailTemplates/exports.js" + }, + "default": "./dist/cjs/management/api/resources/emailTemplates/exports.js" + }, + "./eventStreams": { + "import": { + "types": "./dist/esm/management/api/resources/eventStreams/exports.d.mts", + "default": "./dist/esm/management/api/resources/eventStreams/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/eventStreams/exports.d.ts", + "default": "./dist/cjs/management/api/resources/eventStreams/exports.js" + }, + "default": "./dist/cjs/management/api/resources/eventStreams/exports.js" + }, + "./events": { + "import": { + "types": "./dist/esm/management/api/resources/events/exports.d.mts", + "default": "./dist/esm/management/api/resources/events/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/events/exports.d.ts", + "default": "./dist/cjs/management/api/resources/events/exports.js" + }, + "default": "./dist/cjs/management/api/resources/events/exports.js" + }, + "./flows": { + "import": { + "types": "./dist/esm/management/api/resources/flows/exports.d.mts", + "default": "./dist/esm/management/api/resources/flows/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/flows/exports.d.ts", + "default": "./dist/cjs/management/api/resources/flows/exports.js" + }, + "default": "./dist/cjs/management/api/resources/flows/exports.js" + }, + "./forms": { + "import": { + "types": "./dist/esm/management/api/resources/forms/exports.d.mts", + "default": "./dist/esm/management/api/resources/forms/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/forms/exports.d.ts", + "default": "./dist/cjs/management/api/resources/forms/exports.js" + }, + "default": "./dist/cjs/management/api/resources/forms/exports.js" + }, + "./userGrants": { + "import": { + "types": "./dist/esm/management/api/resources/userGrants/exports.d.mts", + "default": "./dist/esm/management/api/resources/userGrants/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/userGrants/exports.d.ts", + "default": "./dist/cjs/management/api/resources/userGrants/exports.js" + }, + "default": "./dist/cjs/management/api/resources/userGrants/exports.js" + }, + "./groups": { + "import": { + "types": "./dist/esm/management/api/resources/groups/exports.d.mts", + "default": "./dist/esm/management/api/resources/groups/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/groups/exports.d.ts", + "default": "./dist/cjs/management/api/resources/groups/exports.js" + }, + "default": "./dist/cjs/management/api/resources/groups/exports.js" + }, + "./guardian": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/exports.js" + }, + "./hooks": { + "import": { + "types": "./dist/esm/management/api/resources/hooks/exports.d.mts", + "default": "./dist/esm/management/api/resources/hooks/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/hooks/exports.d.ts", + "default": "./dist/cjs/management/api/resources/hooks/exports.js" + }, + "default": "./dist/cjs/management/api/resources/hooks/exports.js" + }, + "./jobs": { + "import": { + "types": "./dist/esm/management/api/resources/jobs/exports.d.mts", + "default": "./dist/esm/management/api/resources/jobs/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/jobs/exports.d.ts", + "default": "./dist/cjs/management/api/resources/jobs/exports.js" + }, + "default": "./dist/cjs/management/api/resources/jobs/exports.js" + }, + "./logStreams": { + "import": { + "types": "./dist/esm/management/api/resources/logStreams/exports.d.mts", + "default": "./dist/esm/management/api/resources/logStreams/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/logStreams/exports.d.ts", + "default": "./dist/cjs/management/api/resources/logStreams/exports.js" + }, + "default": "./dist/cjs/management/api/resources/logStreams/exports.js" + }, + "./logs": { + "import": { + "types": "./dist/esm/management/api/resources/logs/exports.d.mts", + "default": "./dist/esm/management/api/resources/logs/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/logs/exports.d.ts", + "default": "./dist/cjs/management/api/resources/logs/exports.js" + }, + "default": "./dist/cjs/management/api/resources/logs/exports.js" + }, + "./networkAcls": { + "import": { + "types": "./dist/esm/management/api/resources/networkAcls/exports.d.mts", + "default": "./dist/esm/management/api/resources/networkAcls/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/networkAcls/exports.d.ts", + "default": "./dist/cjs/management/api/resources/networkAcls/exports.js" + }, + "default": "./dist/cjs/management/api/resources/networkAcls/exports.js" + }, + "./organizations": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/exports.js" + }, + "./prompts": { + "import": { + "types": "./dist/esm/management/api/resources/prompts/exports.d.mts", + "default": "./dist/esm/management/api/resources/prompts/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/prompts/exports.d.ts", + "default": "./dist/cjs/management/api/resources/prompts/exports.js" + }, + "default": "./dist/cjs/management/api/resources/prompts/exports.js" + }, + "./rateLimitPolicies": { + "import": { + "types": "./dist/esm/management/api/resources/rateLimitPolicies/exports.d.mts", + "default": "./dist/esm/management/api/resources/rateLimitPolicies/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/rateLimitPolicies/exports.d.ts", + "default": "./dist/cjs/management/api/resources/rateLimitPolicies/exports.js" + }, + "default": "./dist/cjs/management/api/resources/rateLimitPolicies/exports.js" + }, + "./refreshTokens": { + "import": { + "types": "./dist/esm/management/api/resources/refreshTokens/exports.d.mts", + "default": "./dist/esm/management/api/resources/refreshTokens/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/refreshTokens/exports.d.ts", + "default": "./dist/cjs/management/api/resources/refreshTokens/exports.js" + }, + "default": "./dist/cjs/management/api/resources/refreshTokens/exports.js" + }, + "./resourceServers": { + "import": { + "types": "./dist/esm/management/api/resources/resourceServers/exports.d.mts", + "default": "./dist/esm/management/api/resources/resourceServers/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/resourceServers/exports.d.ts", + "default": "./dist/cjs/management/api/resources/resourceServers/exports.js" + }, + "default": "./dist/cjs/management/api/resources/resourceServers/exports.js" + }, + "./roles": { + "import": { + "types": "./dist/esm/management/api/resources/roles/exports.d.mts", + "default": "./dist/esm/management/api/resources/roles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/roles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/roles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/roles/exports.js" + }, + "./rules": { + "import": { + "types": "./dist/esm/management/api/resources/rules/exports.d.mts", + "default": "./dist/esm/management/api/resources/rules/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/rules/exports.d.ts", + "default": "./dist/cjs/management/api/resources/rules/exports.js" + }, + "default": "./dist/cjs/management/api/resources/rules/exports.js" + }, + "./rulesConfigs": { + "import": { + "types": "./dist/esm/management/api/resources/rulesConfigs/exports.d.mts", + "default": "./dist/esm/management/api/resources/rulesConfigs/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/rulesConfigs/exports.d.ts", + "default": "./dist/cjs/management/api/resources/rulesConfigs/exports.js" + }, + "default": "./dist/cjs/management/api/resources/rulesConfigs/exports.js" + }, + "./selfServiceProfiles": { + "import": { + "types": "./dist/esm/management/api/resources/selfServiceProfiles/exports.d.mts", + "default": "./dist/esm/management/api/resources/selfServiceProfiles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/selfServiceProfiles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/selfServiceProfiles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/selfServiceProfiles/exports.js" + }, + "./sessions": { + "import": { + "types": "./dist/esm/management/api/resources/sessions/exports.d.mts", + "default": "./dist/esm/management/api/resources/sessions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/sessions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/sessions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/sessions/exports.js" + }, + "./stats": { + "import": { + "types": "./dist/esm/management/api/resources/stats/exports.d.mts", + "default": "./dist/esm/management/api/resources/stats/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/stats/exports.d.ts", + "default": "./dist/cjs/management/api/resources/stats/exports.js" + }, + "default": "./dist/cjs/management/api/resources/stats/exports.js" + }, + "./supplementalSignals": { + "import": { + "types": "./dist/esm/management/api/resources/supplementalSignals/exports.d.mts", + "default": "./dist/esm/management/api/resources/supplementalSignals/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/supplementalSignals/exports.d.ts", + "default": "./dist/cjs/management/api/resources/supplementalSignals/exports.js" + }, + "default": "./dist/cjs/management/api/resources/supplementalSignals/exports.js" + }, + "./tickets": { + "import": { + "types": "./dist/esm/management/api/resources/tickets/exports.d.mts", + "default": "./dist/esm/management/api/resources/tickets/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/tickets/exports.d.ts", + "default": "./dist/cjs/management/api/resources/tickets/exports.js" + }, + "default": "./dist/cjs/management/api/resources/tickets/exports.js" + }, + "./tokenExchangeProfiles": { + "import": { + "types": "./dist/esm/management/api/resources/tokenExchangeProfiles/exports.d.mts", + "default": "./dist/esm/management/api/resources/tokenExchangeProfiles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/tokenExchangeProfiles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/tokenExchangeProfiles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/tokenExchangeProfiles/exports.js" + }, + "./userAttributeProfiles": { + "import": { + "types": "./dist/esm/management/api/resources/userAttributeProfiles/exports.d.mts", + "default": "./dist/esm/management/api/resources/userAttributeProfiles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/userAttributeProfiles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/userAttributeProfiles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/userAttributeProfiles/exports.js" + }, + "./userBlocks": { + "import": { + "types": "./dist/esm/management/api/resources/userBlocks/exports.d.mts", + "default": "./dist/esm/management/api/resources/userBlocks/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/userBlocks/exports.d.ts", + "default": "./dist/cjs/management/api/resources/userBlocks/exports.js" + }, + "default": "./dist/cjs/management/api/resources/userBlocks/exports.js" + }, + "./users": { + "import": { + "types": "./dist/esm/management/api/resources/users/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/exports.js" + }, + "./actions/versions": { + "import": { + "types": "./dist/esm/management/api/resources/actions/resources/versions/exports.d.mts", + "default": "./dist/esm/management/api/resources/actions/resources/versions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/actions/resources/versions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/actions/resources/versions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/actions/resources/versions/exports.js" + }, + "./actions/executions": { + "import": { + "types": "./dist/esm/management/api/resources/actions/resources/executions/exports.d.mts", + "default": "./dist/esm/management/api/resources/actions/resources/executions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/actions/resources/executions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/actions/resources/executions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/actions/resources/executions/exports.js" + }, + "./actions/modules": { + "import": { + "types": "./dist/esm/management/api/resources/actions/resources/modules/exports.d.mts", + "default": "./dist/esm/management/api/resources/actions/resources/modules/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/actions/resources/modules/exports.d.ts", + "default": "./dist/cjs/management/api/resources/actions/resources/modules/exports.js" + }, + "default": "./dist/cjs/management/api/resources/actions/resources/modules/exports.js" + }, + "./actions/triggers": { + "import": { + "types": "./dist/esm/management/api/resources/actions/resources/triggers/exports.d.mts", + "default": "./dist/esm/management/api/resources/actions/resources/triggers/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/actions/resources/triggers/exports.d.ts", + "default": "./dist/cjs/management/api/resources/actions/resources/triggers/exports.js" + }, + "default": "./dist/cjs/management/api/resources/actions/resources/triggers/exports.js" + }, + "./actions/modules/versions": { + "import": { + "types": "./dist/esm/management/api/resources/actions/resources/modules/resources/versions/exports.d.mts", + "default": "./dist/esm/management/api/resources/actions/resources/modules/resources/versions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/actions/resources/modules/resources/versions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/actions/resources/modules/resources/versions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/actions/resources/modules/resources/versions/exports.js" + }, + "./actions/triggers/bindings": { + "import": { + "types": "./dist/esm/management/api/resources/actions/resources/triggers/resources/bindings/exports.d.mts", + "default": "./dist/esm/management/api/resources/actions/resources/triggers/resources/bindings/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/actions/resources/triggers/resources/bindings/exports.d.ts", + "default": "./dist/cjs/management/api/resources/actions/resources/triggers/resources/bindings/exports.js" + }, + "default": "./dist/cjs/management/api/resources/actions/resources/triggers/resources/bindings/exports.js" + }, + "./anomaly": { + "import": { + "types": "./dist/esm/management/api/resources/anomaly/exports.d.mts", + "default": "./dist/esm/management/api/resources/anomaly/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/anomaly/exports.d.ts", + "default": "./dist/cjs/management/api/resources/anomaly/exports.js" + }, + "default": "./dist/cjs/management/api/resources/anomaly/exports.js" + }, + "./anomaly/blocks": { + "import": { + "types": "./dist/esm/management/api/resources/anomaly/resources/blocks/exports.d.mts", + "default": "./dist/esm/management/api/resources/anomaly/resources/blocks/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/anomaly/resources/blocks/exports.d.ts", + "default": "./dist/cjs/management/api/resources/anomaly/resources/blocks/exports.js" + }, + "default": "./dist/cjs/management/api/resources/anomaly/resources/blocks/exports.js" + }, + "./attackProtection": { + "import": { + "types": "./dist/esm/management/api/resources/attackProtection/exports.d.mts", + "default": "./dist/esm/management/api/resources/attackProtection/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/attackProtection/exports.d.ts", + "default": "./dist/cjs/management/api/resources/attackProtection/exports.js" + }, + "default": "./dist/cjs/management/api/resources/attackProtection/exports.js" + }, + "./attackProtection/botDetection": { + "import": { + "types": "./dist/esm/management/api/resources/attackProtection/resources/botDetection/exports.d.mts", + "default": "./dist/esm/management/api/resources/attackProtection/resources/botDetection/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/attackProtection/resources/botDetection/exports.d.ts", + "default": "./dist/cjs/management/api/resources/attackProtection/resources/botDetection/exports.js" + }, + "default": "./dist/cjs/management/api/resources/attackProtection/resources/botDetection/exports.js" + }, + "./attackProtection/breachedPasswordDetection": { + "import": { + "types": "./dist/esm/management/api/resources/attackProtection/resources/breachedPasswordDetection/exports.d.mts", + "default": "./dist/esm/management/api/resources/attackProtection/resources/breachedPasswordDetection/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/attackProtection/resources/breachedPasswordDetection/exports.d.ts", + "default": "./dist/cjs/management/api/resources/attackProtection/resources/breachedPasswordDetection/exports.js" + }, + "default": "./dist/cjs/management/api/resources/attackProtection/resources/breachedPasswordDetection/exports.js" + }, + "./attackProtection/bruteForceProtection": { + "import": { + "types": "./dist/esm/management/api/resources/attackProtection/resources/bruteForceProtection/exports.d.mts", + "default": "./dist/esm/management/api/resources/attackProtection/resources/bruteForceProtection/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/attackProtection/resources/bruteForceProtection/exports.d.ts", + "default": "./dist/cjs/management/api/resources/attackProtection/resources/bruteForceProtection/exports.js" + }, + "default": "./dist/cjs/management/api/resources/attackProtection/resources/bruteForceProtection/exports.js" + }, + "./attackProtection/captcha": { + "import": { + "types": "./dist/esm/management/api/resources/attackProtection/resources/captcha/exports.d.mts", + "default": "./dist/esm/management/api/resources/attackProtection/resources/captcha/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/attackProtection/resources/captcha/exports.d.ts", + "default": "./dist/cjs/management/api/resources/attackProtection/resources/captcha/exports.js" + }, + "default": "./dist/cjs/management/api/resources/attackProtection/resources/captcha/exports.js" + }, + "./attackProtection/captchaPolicies": { + "import": { + "types": "./dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.mts", + "default": "./dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.ts", + "default": "./dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.js" + }, + "default": "./dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.js" + }, + "./attackProtection/phoneProviderProtection": { + "import": { + "types": "./dist/esm/management/api/resources/attackProtection/resources/phoneProviderProtection/exports.d.mts", + "default": "./dist/esm/management/api/resources/attackProtection/resources/phoneProviderProtection/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/attackProtection/resources/phoneProviderProtection/exports.d.ts", + "default": "./dist/cjs/management/api/resources/attackProtection/resources/phoneProviderProtection/exports.js" + }, + "default": "./dist/cjs/management/api/resources/attackProtection/resources/phoneProviderProtection/exports.js" + }, + "./attackProtection/suspiciousIpThrottling": { + "import": { + "types": "./dist/esm/management/api/resources/attackProtection/resources/suspiciousIpThrottling/exports.d.mts", + "default": "./dist/esm/management/api/resources/attackProtection/resources/suspiciousIpThrottling/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/attackProtection/resources/suspiciousIpThrottling/exports.d.ts", + "default": "./dist/cjs/management/api/resources/attackProtection/resources/suspiciousIpThrottling/exports.js" + }, + "default": "./dist/cjs/management/api/resources/attackProtection/resources/suspiciousIpThrottling/exports.js" + }, + "./branding/templates": { + "import": { + "types": "./dist/esm/management/api/resources/branding/resources/templates/exports.d.mts", + "default": "./dist/esm/management/api/resources/branding/resources/templates/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/branding/resources/templates/exports.d.ts", + "default": "./dist/cjs/management/api/resources/branding/resources/templates/exports.js" + }, + "default": "./dist/cjs/management/api/resources/branding/resources/templates/exports.js" + }, + "./branding/themes": { + "import": { + "types": "./dist/esm/management/api/resources/branding/resources/themes/exports.d.mts", + "default": "./dist/esm/management/api/resources/branding/resources/themes/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/branding/resources/themes/exports.d.ts", + "default": "./dist/cjs/management/api/resources/branding/resources/themes/exports.js" + }, + "default": "./dist/cjs/management/api/resources/branding/resources/themes/exports.js" + }, + "./branding/phone": { + "import": { + "types": "./dist/esm/management/api/resources/branding/resources/phone/exports.d.mts", + "default": "./dist/esm/management/api/resources/branding/resources/phone/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/branding/resources/phone/exports.d.ts", + "default": "./dist/cjs/management/api/resources/branding/resources/phone/exports.js" + }, + "default": "./dist/cjs/management/api/resources/branding/resources/phone/exports.js" + }, + "./branding/phone/providers": { + "import": { + "types": "./dist/esm/management/api/resources/branding/resources/phone/resources/providers/exports.d.mts", + "default": "./dist/esm/management/api/resources/branding/resources/phone/resources/providers/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/branding/resources/phone/resources/providers/exports.d.ts", + "default": "./dist/cjs/management/api/resources/branding/resources/phone/resources/providers/exports.js" + }, + "default": "./dist/cjs/management/api/resources/branding/resources/phone/resources/providers/exports.js" + }, + "./branding/phone/templates": { + "import": { + "types": "./dist/esm/management/api/resources/branding/resources/phone/resources/templates/exports.d.mts", + "default": "./dist/esm/management/api/resources/branding/resources/phone/resources/templates/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/branding/resources/phone/resources/templates/exports.d.ts", + "default": "./dist/cjs/management/api/resources/branding/resources/phone/resources/templates/exports.js" + }, + "default": "./dist/cjs/management/api/resources/branding/resources/phone/resources/templates/exports.js" + }, + "./clientGrants/organizations": { + "import": { + "types": "./dist/esm/management/api/resources/clientGrants/resources/organizations/exports.d.mts", + "default": "./dist/esm/management/api/resources/clientGrants/resources/organizations/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/clientGrants/resources/organizations/exports.d.ts", + "default": "./dist/cjs/management/api/resources/clientGrants/resources/organizations/exports.js" + }, + "default": "./dist/cjs/management/api/resources/clientGrants/resources/organizations/exports.js" + }, + "./clients/credentials": { + "import": { + "types": "./dist/esm/management/api/resources/clients/resources/credentials/exports.d.mts", + "default": "./dist/esm/management/api/resources/clients/resources/credentials/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/clients/resources/credentials/exports.d.ts", + "default": "./dist/cjs/management/api/resources/clients/resources/credentials/exports.js" + }, + "default": "./dist/cjs/management/api/resources/clients/resources/credentials/exports.js" + }, + "./clients/connections": { + "import": { + "types": "./dist/esm/management/api/resources/clients/resources/connections/exports.d.mts", + "default": "./dist/esm/management/api/resources/clients/resources/connections/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/clients/resources/connections/exports.d.ts", + "default": "./dist/cjs/management/api/resources/clients/resources/connections/exports.js" + }, + "default": "./dist/cjs/management/api/resources/clients/resources/connections/exports.js" + }, + "./connections/directoryProvisioning": { + "import": { + "types": "./dist/esm/management/api/resources/connections/resources/directoryProvisioning/exports.d.mts", + "default": "./dist/esm/management/api/resources/connections/resources/directoryProvisioning/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/connections/resources/directoryProvisioning/exports.d.ts", + "default": "./dist/cjs/management/api/resources/connections/resources/directoryProvisioning/exports.js" + }, + "default": "./dist/cjs/management/api/resources/connections/resources/directoryProvisioning/exports.js" + }, + "./connections/scimConfiguration": { + "import": { + "types": "./dist/esm/management/api/resources/connections/resources/scimConfiguration/exports.d.mts", + "default": "./dist/esm/management/api/resources/connections/resources/scimConfiguration/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/connections/resources/scimConfiguration/exports.d.ts", + "default": "./dist/cjs/management/api/resources/connections/resources/scimConfiguration/exports.js" + }, + "default": "./dist/cjs/management/api/resources/connections/resources/scimConfiguration/exports.js" + }, + "./connections/clients": { + "import": { + "types": "./dist/esm/management/api/resources/connections/resources/clients/exports.d.mts", + "default": "./dist/esm/management/api/resources/connections/resources/clients/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/connections/resources/clients/exports.d.ts", + "default": "./dist/cjs/management/api/resources/connections/resources/clients/exports.js" + }, + "default": "./dist/cjs/management/api/resources/connections/resources/clients/exports.js" + }, + "./connections/keys": { + "import": { + "types": "./dist/esm/management/api/resources/connections/resources/keys/exports.d.mts", + "default": "./dist/esm/management/api/resources/connections/resources/keys/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/connections/resources/keys/exports.d.ts", + "default": "./dist/cjs/management/api/resources/connections/resources/keys/exports.js" + }, + "default": "./dist/cjs/management/api/resources/connections/resources/keys/exports.js" + }, + "./connections/users": { + "import": { + "types": "./dist/esm/management/api/resources/connections/resources/users/exports.d.mts", + "default": "./dist/esm/management/api/resources/connections/resources/users/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/connections/resources/users/exports.d.ts", + "default": "./dist/cjs/management/api/resources/connections/resources/users/exports.js" + }, + "default": "./dist/cjs/management/api/resources/connections/resources/users/exports.js" + }, + "./connections/directoryProvisioning/synchronizations": { + "import": { + "types": "./dist/esm/management/api/resources/connections/resources/directoryProvisioning/resources/synchronizations/exports.d.mts", + "default": "./dist/esm/management/api/resources/connections/resources/directoryProvisioning/resources/synchronizations/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/connections/resources/directoryProvisioning/resources/synchronizations/exports.d.ts", + "default": "./dist/cjs/management/api/resources/connections/resources/directoryProvisioning/resources/synchronizations/exports.js" + }, + "default": "./dist/cjs/management/api/resources/connections/resources/directoryProvisioning/resources/synchronizations/exports.js" + }, + "./connections/scimConfiguration/tokens": { + "import": { + "types": "./dist/esm/management/api/resources/connections/resources/scimConfiguration/resources/tokens/exports.d.mts", + "default": "./dist/esm/management/api/resources/connections/resources/scimConfiguration/resources/tokens/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/connections/resources/scimConfiguration/resources/tokens/exports.d.ts", + "default": "./dist/cjs/management/api/resources/connections/resources/scimConfiguration/resources/tokens/exports.js" + }, + "default": "./dist/cjs/management/api/resources/connections/resources/scimConfiguration/resources/tokens/exports.js" + }, + "./emails": { + "import": { + "types": "./dist/esm/management/api/resources/emails/exports.d.mts", + "default": "./dist/esm/management/api/resources/emails/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/emails/exports.d.ts", + "default": "./dist/cjs/management/api/resources/emails/exports.js" + }, + "default": "./dist/cjs/management/api/resources/emails/exports.js" + }, + "./emails/provider": { + "import": { + "types": "./dist/esm/management/api/resources/emails/resources/provider/exports.d.mts", + "default": "./dist/esm/management/api/resources/emails/resources/provider/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/emails/resources/provider/exports.d.ts", + "default": "./dist/cjs/management/api/resources/emails/resources/provider/exports.js" + }, + "default": "./dist/cjs/management/api/resources/emails/resources/provider/exports.js" + }, + "./eventStreams/deliveries": { + "import": { + "types": "./dist/esm/management/api/resources/eventStreams/resources/deliveries/exports.d.mts", + "default": "./dist/esm/management/api/resources/eventStreams/resources/deliveries/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/eventStreams/resources/deliveries/exports.d.ts", + "default": "./dist/cjs/management/api/resources/eventStreams/resources/deliveries/exports.js" + }, + "default": "./dist/cjs/management/api/resources/eventStreams/resources/deliveries/exports.js" + }, + "./eventStreams/redeliveries": { + "import": { + "types": "./dist/esm/management/api/resources/eventStreams/resources/redeliveries/exports.d.mts", + "default": "./dist/esm/management/api/resources/eventStreams/resources/redeliveries/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/eventStreams/resources/redeliveries/exports.d.ts", + "default": "./dist/cjs/management/api/resources/eventStreams/resources/redeliveries/exports.js" + }, + "default": "./dist/cjs/management/api/resources/eventStreams/resources/redeliveries/exports.js" + }, + "./experimentation": { + "import": { + "types": "./dist/esm/management/api/resources/experimentation/exports.d.mts", + "default": "./dist/esm/management/api/resources/experimentation/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/experimentation/exports.d.ts", + "default": "./dist/cjs/management/api/resources/experimentation/exports.js" + }, + "default": "./dist/cjs/management/api/resources/experimentation/exports.js" + }, + "./experimentation/experiments": { + "import": { + "types": "./dist/esm/management/api/resources/experimentation/resources/experiments/exports.d.mts", + "default": "./dist/esm/management/api/resources/experimentation/resources/experiments/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/experimentation/resources/experiments/exports.d.ts", + "default": "./dist/cjs/management/api/resources/experimentation/resources/experiments/exports.js" + }, + "default": "./dist/cjs/management/api/resources/experimentation/resources/experiments/exports.js" + }, + "./experimentation/featureFlags": { + "import": { + "types": "./dist/esm/management/api/resources/experimentation/resources/featureFlags/exports.d.mts", + "default": "./dist/esm/management/api/resources/experimentation/resources/featureFlags/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/experimentation/resources/featureFlags/exports.d.ts", + "default": "./dist/cjs/management/api/resources/experimentation/resources/featureFlags/exports.js" + }, + "default": "./dist/cjs/management/api/resources/experimentation/resources/featureFlags/exports.js" + }, + "./experimentation/segments": { + "import": { + "types": "./dist/esm/management/api/resources/experimentation/resources/segments/exports.d.mts", + "default": "./dist/esm/management/api/resources/experimentation/resources/segments/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/experimentation/resources/segments/exports.d.ts", + "default": "./dist/cjs/management/api/resources/experimentation/resources/segments/exports.js" + }, + "default": "./dist/cjs/management/api/resources/experimentation/resources/segments/exports.js" + }, + "./experimentation/featureFlags/variations": { + "import": { + "types": "./dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/exports.d.mts", + "default": "./dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/exports.d.ts", + "default": "./dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/exports.js" + }, + "default": "./dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/exports.js" + }, + "./flows/executions": { + "import": { + "types": "./dist/esm/management/api/resources/flows/resources/executions/exports.d.mts", + "default": "./dist/esm/management/api/resources/flows/resources/executions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/flows/resources/executions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/flows/resources/executions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/flows/resources/executions/exports.js" + }, + "./flows/vault": { + "import": { + "types": "./dist/esm/management/api/resources/flows/resources/vault/exports.d.mts", + "default": "./dist/esm/management/api/resources/flows/resources/vault/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/flows/resources/vault/exports.d.ts", + "default": "./dist/cjs/management/api/resources/flows/resources/vault/exports.js" + }, + "default": "./dist/cjs/management/api/resources/flows/resources/vault/exports.js" + }, + "./flows/vault/connections": { + "import": { + "types": "./dist/esm/management/api/resources/flows/resources/vault/resources/connections/exports.d.mts", + "default": "./dist/esm/management/api/resources/flows/resources/vault/resources/connections/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/flows/resources/vault/resources/connections/exports.d.ts", + "default": "./dist/cjs/management/api/resources/flows/resources/vault/resources/connections/exports.js" + }, + "default": "./dist/cjs/management/api/resources/flows/resources/vault/resources/connections/exports.js" + }, + "./groups/members": { + "import": { + "types": "./dist/esm/management/api/resources/groups/resources/members/exports.d.mts", + "default": "./dist/esm/management/api/resources/groups/resources/members/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/groups/resources/members/exports.d.ts", + "default": "./dist/cjs/management/api/resources/groups/resources/members/exports.js" + }, + "default": "./dist/cjs/management/api/resources/groups/resources/members/exports.js" + }, + "./groups/roles": { + "import": { + "types": "./dist/esm/management/api/resources/groups/resources/roles/exports.d.mts", + "default": "./dist/esm/management/api/resources/groups/resources/roles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/groups/resources/roles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/groups/resources/roles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/groups/resources/roles/exports.js" + }, + "./guardian/enrollments": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/resources/enrollments/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/resources/enrollments/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/resources/enrollments/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/resources/enrollments/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/resources/enrollments/exports.js" + }, + "./guardian/factors": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/resources/factors/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/resources/factors/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/resources/factors/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/exports.js" + }, + "./guardian/policies": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/resources/policies/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/resources/policies/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/resources/policies/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/resources/policies/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/resources/policies/exports.js" + }, + "./guardian/factors/email": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/resources/factors/resources/email/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/resources/factors/resources/email/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/email/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/email/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/email/exports.js" + }, + "./guardian/factors/phone": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/resources/factors/resources/phone/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/resources/factors/resources/phone/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/phone/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/phone/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/phone/exports.js" + }, + "./guardian/factors/pushNotification": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/resources/factors/resources/pushNotification/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/resources/factors/resources/pushNotification/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/pushNotification/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/pushNotification/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/pushNotification/exports.js" + }, + "./guardian/factors/sms": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/resources/factors/resources/sms/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/resources/factors/resources/sms/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/sms/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/sms/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/sms/exports.js" + }, + "./guardian/factors/duo": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/resources/factors/resources/duo/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/resources/factors/resources/duo/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/duo/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/duo/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/duo/exports.js" + }, + "./guardian/factors/duo/settings": { + "import": { + "types": "./dist/esm/management/api/resources/guardian/resources/factors/resources/duo/resources/settings/exports.d.mts", + "default": "./dist/esm/management/api/resources/guardian/resources/factors/resources/duo/resources/settings/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/duo/resources/settings/exports.d.ts", + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/duo/resources/settings/exports.js" + }, + "default": "./dist/cjs/management/api/resources/guardian/resources/factors/resources/duo/resources/settings/exports.js" + }, + "./hooks/secrets": { + "import": { + "types": "./dist/esm/management/api/resources/hooks/resources/secrets/exports.d.mts", + "default": "./dist/esm/management/api/resources/hooks/resources/secrets/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/hooks/resources/secrets/exports.d.ts", + "default": "./dist/cjs/management/api/resources/hooks/resources/secrets/exports.js" + }, + "default": "./dist/cjs/management/api/resources/hooks/resources/secrets/exports.js" + }, + "./jobs/usersExports": { + "import": { + "types": "./dist/esm/management/api/resources/jobs/resources/usersExports/exports.d.mts", + "default": "./dist/esm/management/api/resources/jobs/resources/usersExports/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/jobs/resources/usersExports/exports.d.ts", + "default": "./dist/cjs/management/api/resources/jobs/resources/usersExports/exports.js" + }, + "default": "./dist/cjs/management/api/resources/jobs/resources/usersExports/exports.js" + }, + "./jobs/usersImports": { + "import": { + "types": "./dist/esm/management/api/resources/jobs/resources/usersImports/exports.d.mts", + "default": "./dist/esm/management/api/resources/jobs/resources/usersImports/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/jobs/resources/usersImports/exports.d.ts", + "default": "./dist/cjs/management/api/resources/jobs/resources/usersImports/exports.js" + }, + "default": "./dist/cjs/management/api/resources/jobs/resources/usersImports/exports.js" + }, + "./jobs/verificationEmail": { + "import": { + "types": "./dist/esm/management/api/resources/jobs/resources/verificationEmail/exports.d.mts", + "default": "./dist/esm/management/api/resources/jobs/resources/verificationEmail/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/jobs/resources/verificationEmail/exports.d.ts", + "default": "./dist/cjs/management/api/resources/jobs/resources/verificationEmail/exports.js" + }, + "default": "./dist/cjs/management/api/resources/jobs/resources/verificationEmail/exports.js" + }, + "./jobs/errors": { + "import": { + "types": "./dist/esm/management/api/resources/jobs/resources/errors/exports.d.mts", + "default": "./dist/esm/management/api/resources/jobs/resources/errors/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/jobs/resources/errors/exports.d.ts", + "default": "./dist/cjs/management/api/resources/jobs/resources/errors/exports.js" + }, + "default": "./dist/cjs/management/api/resources/jobs/resources/errors/exports.js" + }, + "./keys": { + "import": { + "types": "./dist/esm/management/api/resources/keys/exports.d.mts", + "default": "./dist/esm/management/api/resources/keys/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/keys/exports.d.ts", + "default": "./dist/cjs/management/api/resources/keys/exports.js" + }, + "default": "./dist/cjs/management/api/resources/keys/exports.js" + }, + "./keys/customSigning": { + "import": { + "types": "./dist/esm/management/api/resources/keys/resources/customSigning/exports.d.mts", + "default": "./dist/esm/management/api/resources/keys/resources/customSigning/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/keys/resources/customSigning/exports.d.ts", + "default": "./dist/cjs/management/api/resources/keys/resources/customSigning/exports.js" + }, + "default": "./dist/cjs/management/api/resources/keys/resources/customSigning/exports.js" + }, + "./keys/encryption": { + "import": { + "types": "./dist/esm/management/api/resources/keys/resources/encryption/exports.d.mts", + "default": "./dist/esm/management/api/resources/keys/resources/encryption/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/keys/resources/encryption/exports.d.ts", + "default": "./dist/cjs/management/api/resources/keys/resources/encryption/exports.js" + }, + "default": "./dist/cjs/management/api/resources/keys/resources/encryption/exports.js" + }, + "./keys/networkAcls": { + "import": { + "types": "./dist/esm/management/api/resources/keys/resources/networkAcls/exports.d.mts", + "default": "./dist/esm/management/api/resources/keys/resources/networkAcls/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/keys/resources/networkAcls/exports.d.ts", + "default": "./dist/cjs/management/api/resources/keys/resources/networkAcls/exports.js" + }, + "default": "./dist/cjs/management/api/resources/keys/resources/networkAcls/exports.js" + }, + "./keys/signing": { + "import": { + "types": "./dist/esm/management/api/resources/keys/resources/signing/exports.d.mts", + "default": "./dist/esm/management/api/resources/keys/resources/signing/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/keys/resources/signing/exports.d.ts", + "default": "./dist/cjs/management/api/resources/keys/resources/signing/exports.js" + }, + "default": "./dist/cjs/management/api/resources/keys/resources/signing/exports.js" + }, + "./organizations/clientGrants": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/clientGrants/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/clientGrants/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/clientGrants/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/clientGrants/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/clientGrants/exports.js" + }, + "./organizations/clients": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/clients/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/clients/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/clients/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/clients/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/clients/exports.js" + }, + "./organizations/connections": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/connections/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/connections/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/connections/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/connections/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/connections/exports.js" + }, + "./organizations/discoveryDomains": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/discoveryDomains/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/discoveryDomains/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/discoveryDomains/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/discoveryDomains/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/discoveryDomains/exports.js" + }, + "./organizations/enabledConnections": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/enabledConnections/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/enabledConnections/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/enabledConnections/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/enabledConnections/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/enabledConnections/exports.js" + }, + "./organizations/invitations": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/invitations/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/invitations/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/invitations/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/invitations/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/invitations/exports.js" + }, + "./organizations/members": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/members/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/members/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/members/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/members/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/members/exports.js" + }, + "./organizations/groups": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/groups/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/groups/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/groups/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/groups/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/groups/exports.js" + }, + "./organizations/groups/roles": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/groups/resources/roles/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/groups/resources/roles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/groups/resources/roles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/groups/resources/roles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/groups/resources/roles/exports.js" + }, + "./organizations/members/effectiveRoles": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/members/resources/effectiveRoles/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/members/resources/effectiveRoles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/members/resources/effectiveRoles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/members/resources/effectiveRoles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/members/resources/effectiveRoles/exports.js" + }, + "./organizations/members/roles": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/members/resources/roles/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/members/resources/roles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/members/resources/roles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/members/resources/roles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/members/resources/roles/exports.js" + }, + "./organizations/members/effectiveRoles/sources": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/exports.js" + }, + "./organizations/members/effectiveRoles/sources/groups": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/resources/groups/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/resources/groups/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/resources/groups/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/resources/groups/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/members/resources/effectiveRoles/resources/sources/resources/groups/exports.js" + }, + "./organizations/roles": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/roles/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/roles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/roles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/roles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/roles/exports.js" + }, + "./organizations/roles/members": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/roles/resources/members/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/roles/resources/members/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/roles/resources/members/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/roles/resources/members/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/roles/resources/members/exports.js" + }, + "./organizations/roles/groups": { + "import": { + "types": "./dist/esm/management/api/resources/organizations/resources/roles/resources/groups/exports.d.mts", + "default": "./dist/esm/management/api/resources/organizations/resources/roles/resources/groups/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/organizations/resources/roles/resources/groups/exports.d.ts", + "default": "./dist/cjs/management/api/resources/organizations/resources/roles/resources/groups/exports.js" + }, + "default": "./dist/cjs/management/api/resources/organizations/resources/roles/resources/groups/exports.js" + }, + "./prompts/rendering": { + "import": { + "types": "./dist/esm/management/api/resources/prompts/resources/rendering/exports.d.mts", + "default": "./dist/esm/management/api/resources/prompts/resources/rendering/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/prompts/resources/rendering/exports.d.ts", + "default": "./dist/cjs/management/api/resources/prompts/resources/rendering/exports.js" + }, + "default": "./dist/cjs/management/api/resources/prompts/resources/rendering/exports.js" + }, + "./prompts/customText": { + "import": { + "types": "./dist/esm/management/api/resources/prompts/resources/customText/exports.d.mts", + "default": "./dist/esm/management/api/resources/prompts/resources/customText/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/prompts/resources/customText/exports.d.ts", + "default": "./dist/cjs/management/api/resources/prompts/resources/customText/exports.js" + }, + "default": "./dist/cjs/management/api/resources/prompts/resources/customText/exports.js" + }, + "./prompts/partials": { + "import": { + "types": "./dist/esm/management/api/resources/prompts/resources/partials/exports.d.mts", + "default": "./dist/esm/management/api/resources/prompts/resources/partials/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/prompts/resources/partials/exports.d.ts", + "default": "./dist/cjs/management/api/resources/prompts/resources/partials/exports.js" + }, + "default": "./dist/cjs/management/api/resources/prompts/resources/partials/exports.js" + }, + "./riskAssessments": { + "import": { + "types": "./dist/esm/management/api/resources/riskAssessments/exports.d.mts", + "default": "./dist/esm/management/api/resources/riskAssessments/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/riskAssessments/exports.d.ts", + "default": "./dist/cjs/management/api/resources/riskAssessments/exports.js" + }, + "default": "./dist/cjs/management/api/resources/riskAssessments/exports.js" + }, + "./riskAssessments/settings": { + "import": { + "types": "./dist/esm/management/api/resources/riskAssessments/resources/settings/exports.d.mts", + "default": "./dist/esm/management/api/resources/riskAssessments/resources/settings/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/riskAssessments/resources/settings/exports.d.ts", + "default": "./dist/cjs/management/api/resources/riskAssessments/resources/settings/exports.js" + }, + "default": "./dist/cjs/management/api/resources/riskAssessments/resources/settings/exports.js" + }, + "./riskAssessments/settings/newDevice": { + "import": { + "types": "./dist/esm/management/api/resources/riskAssessments/resources/settings/resources/newDevice/exports.d.mts", + "default": "./dist/esm/management/api/resources/riskAssessments/resources/settings/resources/newDevice/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/riskAssessments/resources/settings/resources/newDevice/exports.d.ts", + "default": "./dist/cjs/management/api/resources/riskAssessments/resources/settings/resources/newDevice/exports.js" + }, + "default": "./dist/cjs/management/api/resources/riskAssessments/resources/settings/resources/newDevice/exports.js" + }, + "./roles/groups": { + "import": { + "types": "./dist/esm/management/api/resources/roles/resources/groups/exports.d.mts", + "default": "./dist/esm/management/api/resources/roles/resources/groups/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/roles/resources/groups/exports.d.ts", + "default": "./dist/cjs/management/api/resources/roles/resources/groups/exports.js" + }, + "default": "./dist/cjs/management/api/resources/roles/resources/groups/exports.js" + }, + "./roles/permissions": { + "import": { + "types": "./dist/esm/management/api/resources/roles/resources/permissions/exports.d.mts", + "default": "./dist/esm/management/api/resources/roles/resources/permissions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/roles/resources/permissions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/roles/resources/permissions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/roles/resources/permissions/exports.js" + }, + "./roles/users": { + "import": { + "types": "./dist/esm/management/api/resources/roles/resources/users/exports.d.mts", + "default": "./dist/esm/management/api/resources/roles/resources/users/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/roles/resources/users/exports.d.ts", + "default": "./dist/cjs/management/api/resources/roles/resources/users/exports.js" + }, + "default": "./dist/cjs/management/api/resources/roles/resources/users/exports.js" + }, + "./selfServiceProfiles/customText": { + "import": { + "types": "./dist/esm/management/api/resources/selfServiceProfiles/resources/customText/exports.d.mts", + "default": "./dist/esm/management/api/resources/selfServiceProfiles/resources/customText/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/selfServiceProfiles/resources/customText/exports.d.ts", + "default": "./dist/cjs/management/api/resources/selfServiceProfiles/resources/customText/exports.js" + }, + "default": "./dist/cjs/management/api/resources/selfServiceProfiles/resources/customText/exports.js" + }, + "./selfServiceProfiles/ssoTicket": { + "import": { + "types": "./dist/esm/management/api/resources/selfServiceProfiles/resources/ssoTicket/exports.d.mts", + "default": "./dist/esm/management/api/resources/selfServiceProfiles/resources/ssoTicket/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/selfServiceProfiles/resources/ssoTicket/exports.d.ts", + "default": "./dist/cjs/management/api/resources/selfServiceProfiles/resources/ssoTicket/exports.js" + }, + "default": "./dist/cjs/management/api/resources/selfServiceProfiles/resources/ssoTicket/exports.js" + }, + "./tenants": { + "import": { + "types": "./dist/esm/management/api/resources/tenants/exports.d.mts", + "default": "./dist/esm/management/api/resources/tenants/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/tenants/exports.d.ts", + "default": "./dist/cjs/management/api/resources/tenants/exports.js" + }, + "default": "./dist/cjs/management/api/resources/tenants/exports.js" + }, + "./tenants/settings": { + "import": { + "types": "./dist/esm/management/api/resources/tenants/resources/settings/exports.d.mts", + "default": "./dist/esm/management/api/resources/tenants/resources/settings/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/tenants/resources/settings/exports.d.ts", + "default": "./dist/cjs/management/api/resources/tenants/resources/settings/exports.js" + }, + "default": "./dist/cjs/management/api/resources/tenants/resources/settings/exports.js" + }, + "./users/authenticationMethods": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/authenticationMethods/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/authenticationMethods/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/authenticationMethods/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/authenticationMethods/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/authenticationMethods/exports.js" + }, + "./users/authenticators": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/authenticators/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/authenticators/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/authenticators/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/authenticators/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/authenticators/exports.js" + }, + "./users/connectedAccounts": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/connectedAccounts/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/connectedAccounts/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/connectedAccounts/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/connectedAccounts/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/connectedAccounts/exports.js" + }, + "./users/effectivePermissions": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/effectivePermissions/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/effectivePermissions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/effectivePermissions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/effectivePermissions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/effectivePermissions/exports.js" + }, + "./users/effectiveRoles": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/effectiveRoles/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/effectiveRoles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/effectiveRoles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/effectiveRoles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/effectiveRoles/exports.js" + }, + "./users/enrollments": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/enrollments/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/enrollments/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/enrollments/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/enrollments/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/enrollments/exports.js" + }, + "./users/groups": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/groups/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/groups/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/groups/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/groups/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/groups/exports.js" + }, + "./users/identities": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/identities/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/identities/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/identities/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/identities/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/identities/exports.js" + }, + "./users/logs": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/logs/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/logs/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/logs/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/logs/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/logs/exports.js" + }, + "./users/multifactor": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/multifactor/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/multifactor/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/multifactor/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/multifactor/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/multifactor/exports.js" + }, + "./users/organizations": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/organizations/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/organizations/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/organizations/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/organizations/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/organizations/exports.js" + }, + "./users/permissions": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/permissions/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/permissions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/permissions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/permissions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/permissions/exports.js" + }, + "./users/riskAssessments": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/riskAssessments/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/riskAssessments/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/riskAssessments/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/riskAssessments/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/riskAssessments/exports.js" + }, + "./users/roles": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/roles/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/roles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/roles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/roles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/roles/exports.js" + }, + "./users/refreshToken": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/refreshToken/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/refreshToken/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/refreshToken/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/refreshToken/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/refreshToken/exports.js" + }, + "./users/sessions": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/sessions/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/sessions/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/sessions/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/sessions/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/sessions/exports.js" + }, + "./users/effectivePermissions/sources": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/effectivePermissions/resources/sources/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/effectivePermissions/resources/sources/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/effectivePermissions/resources/sources/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/effectivePermissions/resources/sources/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/effectivePermissions/resources/sources/exports.js" + }, + "./users/effectivePermissions/sources/roles": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/effectivePermissions/resources/sources/resources/roles/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/effectivePermissions/resources/sources/resources/roles/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/effectivePermissions/resources/sources/resources/roles/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/effectivePermissions/resources/sources/resources/roles/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/effectivePermissions/resources/sources/resources/roles/exports.js" + }, + "./users/effectiveRoles/sources": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/effectiveRoles/resources/sources/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/effectiveRoles/resources/sources/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/effectiveRoles/resources/sources/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/effectiveRoles/resources/sources/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/effectiveRoles/resources/sources/exports.js" + }, + "./users/effectiveRoles/sources/groups": { + "import": { + "types": "./dist/esm/management/api/resources/users/resources/effectiveRoles/resources/sources/resources/groups/exports.d.mts", + "default": "./dist/esm/management/api/resources/users/resources/effectiveRoles/resources/sources/resources/groups/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/users/resources/effectiveRoles/resources/sources/resources/groups/exports.d.ts", + "default": "./dist/cjs/management/api/resources/users/resources/effectiveRoles/resources/sources/resources/groups/exports.js" + }, + "default": "./dist/cjs/management/api/resources/users/resources/effectiveRoles/resources/sources/resources/groups/exports.js" + }, + "./verifiableCredentials": { + "import": { + "types": "./dist/esm/management/api/resources/verifiableCredentials/exports.d.mts", + "default": "./dist/esm/management/api/resources/verifiableCredentials/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/verifiableCredentials/exports.d.ts", + "default": "./dist/cjs/management/api/resources/verifiableCredentials/exports.js" + }, + "default": "./dist/cjs/management/api/resources/verifiableCredentials/exports.js" + }, + "./verifiableCredentials/verification": { + "import": { + "types": "./dist/esm/management/api/resources/verifiableCredentials/resources/verification/exports.d.mts", + "default": "./dist/esm/management/api/resources/verifiableCredentials/resources/verification/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/verifiableCredentials/resources/verification/exports.d.ts", + "default": "./dist/cjs/management/api/resources/verifiableCredentials/resources/verification/exports.js" + }, + "default": "./dist/cjs/management/api/resources/verifiableCredentials/resources/verification/exports.js" + }, + "./verifiableCredentials/verification/templates": { + "import": { + "types": "./dist/esm/management/api/resources/verifiableCredentials/resources/verification/resources/templates/exports.d.mts", + "default": "./dist/esm/management/api/resources/verifiableCredentials/resources/verification/resources/templates/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/verifiableCredentials/resources/verification/resources/templates/exports.d.ts", + "default": "./dist/cjs/management/api/resources/verifiableCredentials/resources/verification/resources/templates/exports.js" + }, + "default": "./dist/cjs/management/api/resources/verifiableCredentials/resources/verification/resources/templates/exports.js" + }, + "./package.json": "./package.json", + "./legacy": { + "types": "./legacy/exports/index.d.ts", + "import": { + "types": "./legacy/exports/index.d.mts", + "default": "./legacy/exports/index.mjs" + }, + "require": { + "types": "./legacy/exports/index.d.ts", + "default": "./legacy/exports/index.js" + } + }, + "./management": { + "import": { + "types": "./dist/esm/management/index.d.mts", + "default": "./dist/esm/management/index.mjs" + }, + "require": { + "types": "./dist/cjs/management/index.d.ts", + "default": "./dist/cjs/management/index.js" + }, + "default": "./dist/cjs/management/index.js" + } + }, + "files": [ + "legacy", + "package.json", + "dist", + "reference.md", + "README.md", + "LICENSE" + ], + "scripts": { + "format": "prettier . --write --ignore-unknown", + "format:check": "prettier . --check --ignore-unknown", + "lint": "eslint . --ext .js,.ts,.tsx", + "lint:fix": "eslint . --ext .js,.ts,.tsx --fix", + "check": "yarn format:check", + "check:fix": "yarn format", + "build": "yarn build:cjs && yarn build:esm", + "build:cjs": "tsc --project ./tsconfig.cjs.json", + "build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm", + "test": "jest --config jest.config.mjs", + "test:unit": "jest --selectProjects unit", + "test:wire": "jest --selectProjects wire", + "prepare": "husky", + "lint:check": "eslint . --ext .js,.ts,.tsx", + "lint:package": "publint --pack npm", + "test:coverage": "jest --config jest.config.mjs --coverage", + "test:coverage:unit": "jest --selectProjects unit --coverage", + "test:coverage:browser": "jest --selectProjects browser --coverage", + "test:coverage:wire": "jest --selectProjects wire --coverage", + "docs": "typedoc", + "docs:clean": "rm -rf docs", + "docs:build": "yarn docs:clean && yarn docs", + "precommit": "lint-staged", + "validate": "yarn lint:check && yarn format --check && yarn build && yarn test && yarn lint:package" + }, + "dependencies": { + "uuid": "^11.1.1", + "jose": "^5.0.0", + "auth0-legacy": "npm:auth0@^4.37.1" + }, + "devDependencies": { + "webpack": "^5.105.4", + "ts-loader": "^9.5.4", + "jest": "^29.7.0", + "@jest/globals": "^29.7.0", + "@types/jest": "^29.5.14", + "ts-jest": "^29.3.4", + "jest-environment-jsdom": "^29.7.0", + "msw": "2.11.2", + "@types/node": "^20.0.0", + "typescript": "~5.9.3", + "prettier": "3.8.1", + "typedoc": "^0.28.7", + "typedoc-plugin-missing-exports": "^4.0.0", + "nock": "^14.0.6", + "undici": "^7.12.0", + "@eslint/js": "^9.32.0", + "@typescript-eslint/eslint-plugin": "^8.38.0", + "@typescript-eslint/parser": "^8.38.0", + "eslint": "^9.32.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-prettier": "^5.5.3", + "husky": "^9.1.7", + "lint-staged": "^16.1.4", + "publint": "^0.3.12" + }, + "browser": { + "fs": false, + "os": false, + "path": false, + "stream": false, + "crypto": false + }, + "packageManager": "yarn@1.22.22", + "engines": { + "node": "^20.19.0 || ^22.12.0 || ^24.0.0 || ^26.0.0" + }, + "sideEffects": false, + "bugs": { + "url": "https://github.com/auth0/node-auth0/issues" + }, + "homepage": "https://github.com/auth0/node-auth0", + "keywords": [ + "auth0", + "authentication", + "login", + "auth", + "jwt", + "management api", + "json web token" + ], + "description": "Auth0 Node.js SDK for the Management API v2.", + "lint-staged": { + "*.{js,ts,tsx}": [ + "eslint --fix", + "prettier --write" + ], + "*.{json,md,yml,yaml}": [ + "prettier --write" + ] + } + } + src/management/version.ts: | + export const SDK_VERSION = "7.5.0"; status: unresolved - - id: patch-f9566e21 - content_hash: sha256:3359546288f8178f80696587c90c4064dbf9a318de4ed55374d77fbdd645a82d - original_commit: f9566e218363f1a46bdfd62fdd947f08272e7537 - original_message: Release v7.5.0 (#1427) + - id: patch-456afefc + content_hash: sha256:33d7dca791ca40e3343d9b1046b1c20a04e0add593e3d5ee2941220a39f42f88 + original_commit: 456afefce9a6ae6305f65307b3a19e7b2a801199 + original_message: "feat: enhance domain validation for ManagementClient and related components" + original_author: Amit Singh + base_generation: 76a8c62150a47e0a4feb6dbda0bc3796152983ae + files: + - v7_MIGRATION_GUIDE.md + patch_content: | + diff --git a/v7_MIGRATION_GUIDE.md b/v7_MIGRATION_GUIDE.md + new file mode 100644 + index 0000000000..d1dba04a5c + --- /dev/null + +++ b/v7_MIGRATION_GUIDE.md + @@ -0,0 +1,146 @@ + +# V7 Migration Guide + + + +A guide to migrating the Auth0 Node.js SDK from `6.x` to `7.x`. + + + +> **Migrating with an AI agent?** Point it at the Auth0 migration skill first. The skill lives in [`auth0/agent-skills`](https://github.com/auth0/agent-skills) as the `auth0` skill (migration intent: `migrate-node-auth0`). It encodes the authentication-layer rewrite rules and a verify loop. + + + +- [Overall changes](#overall-changes) + +- [Breaking changes](#breaking-changes) + + - [Authentication API removed from the main entrypoint](#authentication-api-removed-from-the-main-entrypoint) + + - [Removed exports](#removed-exports) + + - [ManagementClient mTLS requires an explicit `fetch`](#managementclient-mtls-requires-an-explicit-fetch) + + - [mTLS works with both client secret and client assertion](#mtls-works-with-both-client-secret-and-client-assertion) + + - [`domain` must be a bare hostname](#domain-must-be-a-bare-hostname) + + - [Token acquisition failures throw `ManagementError`](#token-acquisition-failures-throw-managementerror) + + - [`uuid` dependency removed](#uuid-dependency-removed) + +- [Migrating authentication code](#migrating-authentication-code) + +- [Staying on the legacy entrypoint](#staying-on-the-legacy-entrypoint) + + + +## Overall changes + + + +V7 makes `node-auth0` a **Management-API-only SDK**. The Authentication API layer (`AuthenticationClient`, its sub-clients, and `UserInfoClient`) has been removed from the main entrypoint. `ManagementClient` continues to work exactly as before; it now acquires its internal token directly via the client credentials grant rather than through the removed authentication layer. + + + +If your code only uses `ManagementClient`, the upgrade is small: address the Management-side breaking changes below (mTLS, domain validation, error type) and you are done. If your code uses `AuthenticationClient` or `UserInfoClient`, that code must move to a dedicated package; see [Migrating authentication code](#migrating-authentication-code). + + + +## Breaking changes + + + +### Authentication API removed from the main entrypoint + + + +`AuthenticationClient` and `UserInfoClient` are no longer exported from the `auth0` main entrypoint. The stateless authentication layer now lives in [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js), and the server-managed session layer lives in [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js). + + + +**Before (v6):** + + + +```ts + +import { AuthenticationClient, UserInfoClient } from "auth0"; + + + +const auth = new AuthenticationClient({ domain, clientId, clientSecret }); + +const tokens = await auth.oauth.clientCredentialsGrant({ audience }); + +``` + + + +**After (v7):** + + + +```ts + +import { AuthClient } from "@auth0/auth0-auth-js"; + + + +const auth = new AuthClient({ domain, clientId, clientSecret }); + +const tokens = await auth.getTokenByClientCredentials({ audience }); + +``` + + + +The complete method-by-method mapping, the four cross-cutting behavior changes (return shape, casing, token expiry, error model), and the session-app wiring are documented in the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). This guide does not repeat that detail. + + + +If you need the old clients unchanged as a stopgap, they still ship from the [legacy entrypoint](#staying-on-the-legacy-entrypoint). + + + +### Removed exports + + + +The following symbols were exported from the main entrypoint in v6 and are removed in v7. Each moves to `@auth0/auth0-auth-js`, or remains available from the `auth0/legacy` entrypoint at its v4.x shape. + + + +| Removed export (v6) | Replacement in v7 | + +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | + +| `AuthenticationClient` | `AuthClient` from `@auth0/auth0-auth-js` | + +| `UserInfoClient` | `AuthClient.getUserInfo()` from `@auth0/auth0-auth-js`, or read `TokenResponse.claims` | + +| `AuthApiError` | Per-operation typed errors from `@auth0/auth0-auth-js` (`TokenByCodeError`, `TokenByRefreshTokenError`, …); use their `.cause` | + +| `AuthenticationClientOptions` | `AuthClientOptions` from `@auth0/auth0-auth-js` | + +| `IDTokenValidateOptions` | Validation is internal to the grant call; pass `organization` / `nonce` / `maxAge` to the grant and read `TokenResponse.claims` | + +| `IdTokenValidatorError` | Thrown internally by the grant as a typed error on claim mismatch | + +| `TokenSet` | `TokenResponse` from `@auth0/auth0-auth-js` (camelCase fields; `expiresAt` is absolute) | + +| `SUBJECT_TOKEN_TYPES` | Pass the token-type URN string directly to `exchangeToken` in `@auth0/auth0-auth-js` | + +| `UserInfoResponse` | Return type of `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | + +| `UserInfoError` | Typed error from `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | + +| `ResponseError` | Management API calls throw `ManagementError` | + +| `FetchError` | Management API calls throw `ManagementError` | + +| `JSONApiResponse` | Responses return the data directly (no wrapper) | + + + +`ManagementClient`, the `Management` namespace, and `ManagementError` are unchanged and still exported. + + + +### ManagementClient mTLS requires an explicit `fetch` + + + +A `ManagementClient` constructed with `useMTLS: true` must now supply an explicit `fetch` option carrying the client certificate. The client throws at construction if `useMTLS` is set without a `fetch`. Previously a missing fetch surfaced as silent `401`s at request time; failing at construction makes the misconfiguration obvious. + + + +The token endpoint automatically uses the `mtls.{domain}` host when `useMTLS` is enabled. + + + +```ts + +// v7: throws at construction if `fetch` is omitted + +const mgmt = new ManagementClient({ + + domain, + + clientId, + + clientSecret, + + useMTLS: true, + + fetch: mtlsCapableFetch, // now required + +}); + +``` + + + +### mTLS works with both client secret and client assertion + + + +`useMTLS` works with both `clientSecret` and `clientAssertionSigningKey`. mTLS (RFC 8705) is a transport-layer concern: the TLS client certificate yields a certificate-bound token regardless of which client authentication method is used. An explicit `fetch` option is always required when `useMTLS` is set. + + + +### `domain` must be a bare hostname + + + +`domain` must be a bare host such as `tenant.us.auth0.com`. A value that is empty, or that contains a scheme, a path, a query string, a fragment, credentials (`@`), or whitespace, now throws at construction instead of producing malformed request URLs later. The check applies to every authentication mode (`token`, `clientSecret`, and `clientAssertionSigningKey`), and to `createManagementAuth` and `TokenProvider` as well as `ManagementClient`. + + + +```ts + +// throws in v7 + +new ManagementClient({ domain: "https://tenant.us.auth0.com/", ... }); + +// correct + +new ManagementClient({ domain: "tenant.us.auth0.com", ... }); + +``` + + + +### Token acquisition failures throw `ManagementError` + + + +When the internal client-credentials token request fails, the client now throws a `ManagementError` (previously a plain `Error`). The error carries `statusCode` and a parsed `body` with the OAuth error details. A request that exceeds the 10-second timeout throws `ManagementError` with status `408`. + + + +```ts + +import { ManagementError } from "auth0"; + + + +try { + + await mgmt.users.getAll(); + +} catch (e) { + + if (e instanceof ManagementError) { + + console.error(e.statusCode, e.body); + + } + +} + +``` + + + +### `uuid` dependency removed + + + +The `uuid` package is no longer a dependency. If your project imported `uuid` transitively through `auth0`, add it to your own `dependencies`. + + + +## Migrating authentication code + + + +If your app calls `AuthenticationClient` or `UserInfoClient`, follow the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). Start with [`auth-migration/index.md`](https://github.com/auth0/node-auth0/blob/master/auth-migration/index.md) for the OIDC token grants section; the incremental flow, session, and troubleshooting pages live in the same [`auth-migration/`](https://github.com/auth0/node-auth0/tree/master/auth-migration) directory. It covers: + + + +- Choosing between `@auth0/auth0-auth-js` (stateless token grants) and `@auth0/auth0-server-js` (server-managed sessions). + +- The complete method-by-method API mapping for `.oauth`, `.database`, `.passwordless`, `.backchannel`, `.tokenExchange`, and `UserInfoClient`. + +- The four cross-cutting behavior changes: return shape (envelope dropped), casing (snake_case → camelCase), token expiry (`expires_in` relative → `expiresAt` absolute, a silent high-risk change), and the typed error model with `isMfaRequiredError()`. + +- Wiring the `auth0-server-js` session lifecycle when you want the SDK to own login, cookies, refresh, and logout. + + + +The Management API is explicitly out of scope in that guide: a file that keeps using `ManagementClient` from `auth0` while importing `@auth0/auth0-auth-js` for authentication is correct and expected. + + + +## Staying on the legacy entrypoint + + + +If you cannot migrate the authentication code immediately, the `auth0/legacy` entrypoint still ships `AuthenticationClient` and `UserInfoClient` at their v4.x configuration format and method signatures. This is a stopgap, not a destination; the legacy shapes differ from the current API and will not receive new features. + + + +```ts + +import { AuthenticationClient } from "auth0/legacy"; + +``` + + + +Plan the move to `@auth0/auth0-auth-js` / `@auth0/auth0-server-js` rather than treating the legacy entrypoint as permanent. + theirs_snapshot: + v7_MIGRATION_GUIDE.md: | + # V7 Migration Guide + + A guide to migrating the Auth0 Node.js SDK from `6.x` to `7.x`. + + > **Migrating with an AI agent?** Point it at the Auth0 migration skill first. The skill lives in [`auth0/agent-skills`](https://github.com/auth0/agent-skills) as the `auth0` skill (migration intent: `migrate-node-auth0`). It encodes the authentication-layer rewrite rules and a verify loop. + + - [Overall changes](#overall-changes) + - [Breaking changes](#breaking-changes) + - [Authentication API removed from the main entrypoint](#authentication-api-removed-from-the-main-entrypoint) + - [Removed exports](#removed-exports) + - [ManagementClient mTLS requires an explicit `fetch`](#managementclient-mtls-requires-an-explicit-fetch) + - [mTLS works with both client secret and client assertion](#mtls-works-with-both-client-secret-and-client-assertion) + - [`domain` must be a bare hostname](#domain-must-be-a-bare-hostname) + - [Token acquisition failures throw `ManagementError`](#token-acquisition-failures-throw-managementerror) + - [`uuid` dependency removed](#uuid-dependency-removed) + - [Migrating authentication code](#migrating-authentication-code) + - [Staying on the legacy entrypoint](#staying-on-the-legacy-entrypoint) + + ## Overall changes + + V7 makes `node-auth0` a **Management-API-only SDK**. The Authentication API layer (`AuthenticationClient`, its sub-clients, and `UserInfoClient`) has been removed from the main entrypoint. `ManagementClient` continues to work exactly as before; it now acquires its internal token directly via the client credentials grant rather than through the removed authentication layer. + + If your code only uses `ManagementClient`, the upgrade is small: address the Management-side breaking changes below (mTLS, domain validation, error type) and you are done. If your code uses `AuthenticationClient` or `UserInfoClient`, that code must move to a dedicated package; see [Migrating authentication code](#migrating-authentication-code). + + ## Breaking changes + + ### Authentication API removed from the main entrypoint + + `AuthenticationClient` and `UserInfoClient` are no longer exported from the `auth0` main entrypoint. The stateless authentication layer now lives in [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js), and the server-managed session layer lives in [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js). + + **Before (v6):** + + ```ts + import { AuthenticationClient, UserInfoClient } from "auth0"; + + const auth = new AuthenticationClient({ domain, clientId, clientSecret }); + const tokens = await auth.oauth.clientCredentialsGrant({ audience }); + ``` + + **After (v7):** + + ```ts + import { AuthClient } from "@auth0/auth0-auth-js"; + + const auth = new AuthClient({ domain, clientId, clientSecret }); + const tokens = await auth.getTokenByClientCredentials({ audience }); + ``` + + The complete method-by-method mapping, the four cross-cutting behavior changes (return shape, casing, token expiry, error model), and the session-app wiring are documented in the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). This guide does not repeat that detail. + + If you need the old clients unchanged as a stopgap, they still ship from the [legacy entrypoint](#staying-on-the-legacy-entrypoint). + + ### Removed exports + + The following symbols were exported from the main entrypoint in v6 and are removed in v7. Each moves to `@auth0/auth0-auth-js`, or remains available from the `auth0/legacy` entrypoint at its v4.x shape. + + | Removed export (v6) | Replacement in v7 | + | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | + | `AuthenticationClient` | `AuthClient` from `@auth0/auth0-auth-js` | + | `UserInfoClient` | `AuthClient.getUserInfo()` from `@auth0/auth0-auth-js`, or read `TokenResponse.claims` | + | `AuthApiError` | Per-operation typed errors from `@auth0/auth0-auth-js` (`TokenByCodeError`, `TokenByRefreshTokenError`, …); use their `.cause` | + | `AuthenticationClientOptions` | `AuthClientOptions` from `@auth0/auth0-auth-js` | + | `IDTokenValidateOptions` | Validation is internal to the grant call; pass `organization` / `nonce` / `maxAge` to the grant and read `TokenResponse.claims` | + | `IdTokenValidatorError` | Thrown internally by the grant as a typed error on claim mismatch | + | `TokenSet` | `TokenResponse` from `@auth0/auth0-auth-js` (camelCase fields; `expiresAt` is absolute) | + | `SUBJECT_TOKEN_TYPES` | Pass the token-type URN string directly to `exchangeToken` in `@auth0/auth0-auth-js` | + | `UserInfoResponse` | Return type of `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | + | `UserInfoError` | Typed error from `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | + | `ResponseError` | Management API calls throw `ManagementError` | + | `FetchError` | Management API calls throw `ManagementError` | + | `JSONApiResponse` | Responses return the data directly (no wrapper) | + + `ManagementClient`, the `Management` namespace, and `ManagementError` are unchanged and still exported. + + ### ManagementClient mTLS requires an explicit `fetch` + + A `ManagementClient` constructed with `useMTLS: true` must now supply an explicit `fetch` option carrying the client certificate. The client throws at construction if `useMTLS` is set without a `fetch`. Previously a missing fetch surfaced as silent `401`s at request time; failing at construction makes the misconfiguration obvious. + + The token endpoint automatically uses the `mtls.{domain}` host when `useMTLS` is enabled. + + ```ts + // v7: throws at construction if `fetch` is omitted + const mgmt = new ManagementClient({ + domain, + clientId, + clientSecret, + useMTLS: true, + fetch: mtlsCapableFetch, // now required + }); + ``` + + ### mTLS works with both client secret and client assertion + + `useMTLS` works with both `clientSecret` and `clientAssertionSigningKey`. mTLS (RFC 8705) is a transport-layer concern: the TLS client certificate yields a certificate-bound token regardless of which client authentication method is used. An explicit `fetch` option is always required when `useMTLS` is set. + + ### `domain` must be a bare hostname + + `domain` must be a bare host such as `tenant.us.auth0.com`. A value that is empty, or that contains a scheme, a path, a query string, a fragment, credentials (`@`), or whitespace, now throws at construction instead of producing malformed request URLs later. The check applies to every authentication mode (`token`, `clientSecret`, and `clientAssertionSigningKey`), and to `createManagementAuth` and `TokenProvider` as well as `ManagementClient`. + + ```ts + // throws in v7 + new ManagementClient({ domain: "https://tenant.us.auth0.com/", ... }); + // correct + new ManagementClient({ domain: "tenant.us.auth0.com", ... }); + ``` + + ### Token acquisition failures throw `ManagementError` + + When the internal client-credentials token request fails, the client now throws a `ManagementError` (previously a plain `Error`). The error carries `statusCode` and a parsed `body` with the OAuth error details. A request that exceeds the 10-second timeout throws `ManagementError` with status `408`. + + ```ts + import { ManagementError } from "auth0"; + + try { + await mgmt.users.getAll(); + } catch (e) { + if (e instanceof ManagementError) { + console.error(e.statusCode, e.body); + } + } + ``` + + ### `uuid` dependency removed + + The `uuid` package is no longer a dependency. If your project imported `uuid` transitively through `auth0`, add it to your own `dependencies`. + + ## Migrating authentication code + + If your app calls `AuthenticationClient` or `UserInfoClient`, follow the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). Start with [`auth-migration/index.md`](https://github.com/auth0/node-auth0/blob/master/auth-migration/index.md) for the OIDC token grants section; the incremental flow, session, and troubleshooting pages live in the same [`auth-migration/`](https://github.com/auth0/node-auth0/tree/master/auth-migration) directory. It covers: + + - Choosing between `@auth0/auth0-auth-js` (stateless token grants) and `@auth0/auth0-server-js` (server-managed sessions). + - The complete method-by-method API mapping for `.oauth`, `.database`, `.passwordless`, `.backchannel`, `.tokenExchange`, and `UserInfoClient`. + - The four cross-cutting behavior changes: return shape (envelope dropped), casing (snake_case → camelCase), token expiry (`expires_in` relative → `expiresAt` absolute, a silent high-risk change), and the typed error model with `isMfaRequiredError()`. + - Wiring the `auth0-server-js` session lifecycle when you want the SDK to own login, cookies, refresh, and logout. + + The Management API is explicitly out of scope in that guide: a file that keeps using `ManagementClient` from `auth0` while importing `@auth0/auth0-auth-js` for authentication is correct and expected. + + ## Staying on the legacy entrypoint + + If you cannot migrate the authentication code immediately, the `auth0/legacy` entrypoint still ships `AuthenticationClient` and `UserInfoClient` at their v4.x configuration format and method signatures. This is a stopgap, not a destination; the legacy shapes differ from the current API and will not receive new features. + + ```ts + import { AuthenticationClient } from "auth0/legacy"; + ``` + + Plan the move to `@auth0/auth0-auth-js` / `@auth0/auth0-server-js` rather than treating the legacy entrypoint as permanent. + user_owned: true + - id: patch-185ac064 + content_hash: sha256:eae25ca4d648887ccd0dbf85d55f52be8e3112bf613809c6b74c1e61499f424f + original_commit: 185ac0645e47f85eba6a6369f820b304bce27d4c + original_message: Release v7.6.0 (#1430) original_author: Ankita Tripathi <51994119+ankita10119@users.noreply.github.com> - base_generation: 0b3c8a4f22d3c758112a0aca732d20beba54c601 + base_generation: ffcd9e2df9f9842b185ec5d5df53c84a898eaf49 files: - package.json - src/management/version.ts patch_content: | diff --git a/package.json b/package.json - index acea6f27f2..c456e8ca17 100644 + index e9d0ebdf6a..498d343959 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "auth0", - - "version": "7.4.0", - + "version": "7.5.0", + - "version": "7.5.0", + + "version": "7.6.0", "private": false, "repository": { "type": "git", diff --git a/src/management/version.ts b/src/management/version.ts - index ccd206f972..6a5cc9fe4a 100644 + index 6a5cc9fe4a..c012080661 100644 --- a/src/management/version.ts +++ b/src/management/version.ts @@ -1 +1 @@ - -export const SDK_VERSION = "7.4.0"; - +export const SDK_VERSION = "7.5.0"; + -export const SDK_VERSION = "7.5.0"; + +export const SDK_VERSION = "7.6.0"; theirs_snapshot: package.json: | { "name": "auth0", - "version": "7.5.0", + "version": "7.6.0", "private": false, "repository": { "type": "git", @@ -26401,17 +28617,6 @@ patches: }, "default": "./dist/cjs/management/api/resources/attackProtection/resources/captcha/exports.js" }, - "./attackProtection/captchaPolicies": { - "import": { - "types": "./dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.mts", - "default": "./dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.mjs" - }, - "require": { - "types": "./dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.ts", - "default": "./dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.js" - }, - "default": "./dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.js" - }, "./attackProtection/phoneProviderProtection": { "import": { "types": "./dist/esm/management/api/resources/attackProtection/resources/phoneProviderProtection/exports.d.mts", @@ -27660,352 +29865,42 @@ patches: } } src/management/version.ts: | - export const SDK_VERSION = "7.5.0"; + export const SDK_VERSION = "7.6.0"; status: unresolved - - id: patch-456afefc - content_hash: sha256:33d7dca791ca40e3343d9b1046b1c20a04e0add593e3d5ee2941220a39f42f88 - original_commit: 456afefce9a6ae6305f65307b3a19e7b2a801199 - original_message: "feat: enhance domain validation for ManagementClient and related components" - original_author: Amit Singh - base_generation: 33e21ba09b5b8a9ccf35c58834f5aa8ac6d23bec - files: - - v7_MIGRATION_GUIDE.md - patch_content: | - diff --git a/v7_MIGRATION_GUIDE.md b/v7_MIGRATION_GUIDE.md - new file mode 100644 - index 0000000000..d1dba04a5c - --- /dev/null - +++ b/v7_MIGRATION_GUIDE.md - @@ -0,0 +1,146 @@ - +# V7 Migration Guide - + - +A guide to migrating the Auth0 Node.js SDK from `6.x` to `7.x`. - + - +> **Migrating with an AI agent?** Point it at the Auth0 migration skill first. The skill lives in [`auth0/agent-skills`](https://github.com/auth0/agent-skills) as the `auth0` skill (migration intent: `migrate-node-auth0`). It encodes the authentication-layer rewrite rules and a verify loop. - + - +- [Overall changes](#overall-changes) - +- [Breaking changes](#breaking-changes) - + - [Authentication API removed from the main entrypoint](#authentication-api-removed-from-the-main-entrypoint) - + - [Removed exports](#removed-exports) - + - [ManagementClient mTLS requires an explicit `fetch`](#managementclient-mtls-requires-an-explicit-fetch) - + - [mTLS works with both client secret and client assertion](#mtls-works-with-both-client-secret-and-client-assertion) - + - [`domain` must be a bare hostname](#domain-must-be-a-bare-hostname) - + - [Token acquisition failures throw `ManagementError`](#token-acquisition-failures-throw-managementerror) - + - [`uuid` dependency removed](#uuid-dependency-removed) - +- [Migrating authentication code](#migrating-authentication-code) - +- [Staying on the legacy entrypoint](#staying-on-the-legacy-entrypoint) - + - +## Overall changes - + - +V7 makes `node-auth0` a **Management-API-only SDK**. The Authentication API layer (`AuthenticationClient`, its sub-clients, and `UserInfoClient`) has been removed from the main entrypoint. `ManagementClient` continues to work exactly as before; it now acquires its internal token directly via the client credentials grant rather than through the removed authentication layer. - + - +If your code only uses `ManagementClient`, the upgrade is small: address the Management-side breaking changes below (mTLS, domain validation, error type) and you are done. If your code uses `AuthenticationClient` or `UserInfoClient`, that code must move to a dedicated package; see [Migrating authentication code](#migrating-authentication-code). - + - +## Breaking changes - + - +### Authentication API removed from the main entrypoint - + - +`AuthenticationClient` and `UserInfoClient` are no longer exported from the `auth0` main entrypoint. The stateless authentication layer now lives in [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js), and the server-managed session layer lives in [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js). - + - +**Before (v6):** - + - +```ts - +import { AuthenticationClient, UserInfoClient } from "auth0"; - + - +const auth = new AuthenticationClient({ domain, clientId, clientSecret }); - +const tokens = await auth.oauth.clientCredentialsGrant({ audience }); - +``` - + - +**After (v7):** - + - +```ts - +import { AuthClient } from "@auth0/auth0-auth-js"; - + - +const auth = new AuthClient({ domain, clientId, clientSecret }); - +const tokens = await auth.getTokenByClientCredentials({ audience }); - +``` - + - +The complete method-by-method mapping, the four cross-cutting behavior changes (return shape, casing, token expiry, error model), and the session-app wiring are documented in the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). This guide does not repeat that detail. - + - +If you need the old clients unchanged as a stopgap, they still ship from the [legacy entrypoint](#staying-on-the-legacy-entrypoint). - + - +### Removed exports - + - +The following symbols were exported from the main entrypoint in v6 and are removed in v7. Each moves to `@auth0/auth0-auth-js`, or remains available from the `auth0/legacy` entrypoint at its v4.x shape. - + - +| Removed export (v6) | Replacement in v7 | - +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | - +| `AuthenticationClient` | `AuthClient` from `@auth0/auth0-auth-js` | - +| `UserInfoClient` | `AuthClient.getUserInfo()` from `@auth0/auth0-auth-js`, or read `TokenResponse.claims` | - +| `AuthApiError` | Per-operation typed errors from `@auth0/auth0-auth-js` (`TokenByCodeError`, `TokenByRefreshTokenError`, …); use their `.cause` | - +| `AuthenticationClientOptions` | `AuthClientOptions` from `@auth0/auth0-auth-js` | - +| `IDTokenValidateOptions` | Validation is internal to the grant call; pass `organization` / `nonce` / `maxAge` to the grant and read `TokenResponse.claims` | - +| `IdTokenValidatorError` | Thrown internally by the grant as a typed error on claim mismatch | - +| `TokenSet` | `TokenResponse` from `@auth0/auth0-auth-js` (camelCase fields; `expiresAt` is absolute) | - +| `SUBJECT_TOKEN_TYPES` | Pass the token-type URN string directly to `exchangeToken` in `@auth0/auth0-auth-js` | - +| `UserInfoResponse` | Return type of `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | - +| `UserInfoError` | Typed error from `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | - +| `ResponseError` | Management API calls throw `ManagementError` | - +| `FetchError` | Management API calls throw `ManagementError` | - +| `JSONApiResponse` | Responses return the data directly (no wrapper) | - + - +`ManagementClient`, the `Management` namespace, and `ManagementError` are unchanged and still exported. - + - +### ManagementClient mTLS requires an explicit `fetch` - + - +A `ManagementClient` constructed with `useMTLS: true` must now supply an explicit `fetch` option carrying the client certificate. The client throws at construction if `useMTLS` is set without a `fetch`. Previously a missing fetch surfaced as silent `401`s at request time; failing at construction makes the misconfiguration obvious. - + - +The token endpoint automatically uses the `mtls.{domain}` host when `useMTLS` is enabled. - + - +```ts - +// v7: throws at construction if `fetch` is omitted - +const mgmt = new ManagementClient({ - + domain, - + clientId, - + clientSecret, - + useMTLS: true, - + fetch: mtlsCapableFetch, // now required - +}); - +``` - + - +### mTLS works with both client secret and client assertion - + - +`useMTLS` works with both `clientSecret` and `clientAssertionSigningKey`. mTLS (RFC 8705) is a transport-layer concern: the TLS client certificate yields a certificate-bound token regardless of which client authentication method is used. An explicit `fetch` option is always required when `useMTLS` is set. - + - +### `domain` must be a bare hostname - + - +`domain` must be a bare host such as `tenant.us.auth0.com`. A value that is empty, or that contains a scheme, a path, a query string, a fragment, credentials (`@`), or whitespace, now throws at construction instead of producing malformed request URLs later. The check applies to every authentication mode (`token`, `clientSecret`, and `clientAssertionSigningKey`), and to `createManagementAuth` and `TokenProvider` as well as `ManagementClient`. - + - +```ts - +// throws in v7 - +new ManagementClient({ domain: "https://tenant.us.auth0.com/", ... }); - +// correct - +new ManagementClient({ domain: "tenant.us.auth0.com", ... }); - +``` - + - +### Token acquisition failures throw `ManagementError` - + - +When the internal client-credentials token request fails, the client now throws a `ManagementError` (previously a plain `Error`). The error carries `statusCode` and a parsed `body` with the OAuth error details. A request that exceeds the 10-second timeout throws `ManagementError` with status `408`. - + - +```ts - +import { ManagementError } from "auth0"; - + - +try { - + await mgmt.users.getAll(); - +} catch (e) { - + if (e instanceof ManagementError) { - + console.error(e.statusCode, e.body); - + } - +} - +``` - + - +### `uuid` dependency removed - + - +The `uuid` package is no longer a dependency. If your project imported `uuid` transitively through `auth0`, add it to your own `dependencies`. - + - +## Migrating authentication code - + - +If your app calls `AuthenticationClient` or `UserInfoClient`, follow the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). Start with [`auth-migration/index.md`](https://github.com/auth0/node-auth0/blob/master/auth-migration/index.md) for the OIDC token grants section; the incremental flow, session, and troubleshooting pages live in the same [`auth-migration/`](https://github.com/auth0/node-auth0/tree/master/auth-migration) directory. It covers: - + - +- Choosing between `@auth0/auth0-auth-js` (stateless token grants) and `@auth0/auth0-server-js` (server-managed sessions). - +- The complete method-by-method API mapping for `.oauth`, `.database`, `.passwordless`, `.backchannel`, `.tokenExchange`, and `UserInfoClient`. - +- The four cross-cutting behavior changes: return shape (envelope dropped), casing (snake_case → camelCase), token expiry (`expires_in` relative → `expiresAt` absolute, a silent high-risk change), and the typed error model with `isMfaRequiredError()`. - +- Wiring the `auth0-server-js` session lifecycle when you want the SDK to own login, cookies, refresh, and logout. - + - +The Management API is explicitly out of scope in that guide: a file that keeps using `ManagementClient` from `auth0` while importing `@auth0/auth0-auth-js` for authentication is correct and expected. - + - +## Staying on the legacy entrypoint - + - +If you cannot migrate the authentication code immediately, the `auth0/legacy` entrypoint still ships `AuthenticationClient` and `UserInfoClient` at their v4.x configuration format and method signatures. This is a stopgap, not a destination; the legacy shapes differ from the current API and will not receive new features. - + - +```ts - +import { AuthenticationClient } from "auth0/legacy"; - +``` - + - +Plan the move to `@auth0/auth0-auth-js` / `@auth0/auth0-server-js` rather than treating the legacy entrypoint as permanent. - theirs_snapshot: - v7_MIGRATION_GUIDE.md: | - # V7 Migration Guide - - A guide to migrating the Auth0 Node.js SDK from `6.x` to `7.x`. - - > **Migrating with an AI agent?** Point it at the Auth0 migration skill first. The skill lives in [`auth0/agent-skills`](https://github.com/auth0/agent-skills) as the `auth0` skill (migration intent: `migrate-node-auth0`). It encodes the authentication-layer rewrite rules and a verify loop. - - - [Overall changes](#overall-changes) - - [Breaking changes](#breaking-changes) - - [Authentication API removed from the main entrypoint](#authentication-api-removed-from-the-main-entrypoint) - - [Removed exports](#removed-exports) - - [ManagementClient mTLS requires an explicit `fetch`](#managementclient-mtls-requires-an-explicit-fetch) - - [mTLS works with both client secret and client assertion](#mtls-works-with-both-client-secret-and-client-assertion) - - [`domain` must be a bare hostname](#domain-must-be-a-bare-hostname) - - [Token acquisition failures throw `ManagementError`](#token-acquisition-failures-throw-managementerror) - - [`uuid` dependency removed](#uuid-dependency-removed) - - [Migrating authentication code](#migrating-authentication-code) - - [Staying on the legacy entrypoint](#staying-on-the-legacy-entrypoint) - - ## Overall changes - - V7 makes `node-auth0` a **Management-API-only SDK**. The Authentication API layer (`AuthenticationClient`, its sub-clients, and `UserInfoClient`) has been removed from the main entrypoint. `ManagementClient` continues to work exactly as before; it now acquires its internal token directly via the client credentials grant rather than through the removed authentication layer. - - If your code only uses `ManagementClient`, the upgrade is small: address the Management-side breaking changes below (mTLS, domain validation, error type) and you are done. If your code uses `AuthenticationClient` or `UserInfoClient`, that code must move to a dedicated package; see [Migrating authentication code](#migrating-authentication-code). - - ## Breaking changes - - ### Authentication API removed from the main entrypoint - - `AuthenticationClient` and `UserInfoClient` are no longer exported from the `auth0` main entrypoint. The stateless authentication layer now lives in [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js), and the server-managed session layer lives in [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js). - - **Before (v6):** - - ```ts - import { AuthenticationClient, UserInfoClient } from "auth0"; - - const auth = new AuthenticationClient({ domain, clientId, clientSecret }); - const tokens = await auth.oauth.clientCredentialsGrant({ audience }); - ``` - - **After (v7):** - - ```ts - import { AuthClient } from "@auth0/auth0-auth-js"; - - const auth = new AuthClient({ domain, clientId, clientSecret }); - const tokens = await auth.getTokenByClientCredentials({ audience }); - ``` - - The complete method-by-method mapping, the four cross-cutting behavior changes (return shape, casing, token expiry, error model), and the session-app wiring are documented in the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). This guide does not repeat that detail. - - If you need the old clients unchanged as a stopgap, they still ship from the [legacy entrypoint](#staying-on-the-legacy-entrypoint). - - ### Removed exports - - The following symbols were exported from the main entrypoint in v6 and are removed in v7. Each moves to `@auth0/auth0-auth-js`, or remains available from the `auth0/legacy` entrypoint at its v4.x shape. - - | Removed export (v6) | Replacement in v7 | - | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | - | `AuthenticationClient` | `AuthClient` from `@auth0/auth0-auth-js` | - | `UserInfoClient` | `AuthClient.getUserInfo()` from `@auth0/auth0-auth-js`, or read `TokenResponse.claims` | - | `AuthApiError` | Per-operation typed errors from `@auth0/auth0-auth-js` (`TokenByCodeError`, `TokenByRefreshTokenError`, …); use their `.cause` | - | `AuthenticationClientOptions` | `AuthClientOptions` from `@auth0/auth0-auth-js` | - | `IDTokenValidateOptions` | Validation is internal to the grant call; pass `organization` / `nonce` / `maxAge` to the grant and read `TokenResponse.claims` | - | `IdTokenValidatorError` | Thrown internally by the grant as a typed error on claim mismatch | - | `TokenSet` | `TokenResponse` from `@auth0/auth0-auth-js` (camelCase fields; `expiresAt` is absolute) | - | `SUBJECT_TOKEN_TYPES` | Pass the token-type URN string directly to `exchangeToken` in `@auth0/auth0-auth-js` | - | `UserInfoResponse` | Return type of `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | - | `UserInfoError` | Typed error from `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | - | `ResponseError` | Management API calls throw `ManagementError` | - | `FetchError` | Management API calls throw `ManagementError` | - | `JSONApiResponse` | Responses return the data directly (no wrapper) | - - `ManagementClient`, the `Management` namespace, and `ManagementError` are unchanged and still exported. - - ### ManagementClient mTLS requires an explicit `fetch` - - A `ManagementClient` constructed with `useMTLS: true` must now supply an explicit `fetch` option carrying the client certificate. The client throws at construction if `useMTLS` is set without a `fetch`. Previously a missing fetch surfaced as silent `401`s at request time; failing at construction makes the misconfiguration obvious. - - The token endpoint automatically uses the `mtls.{domain}` host when `useMTLS` is enabled. - - ```ts - // v7: throws at construction if `fetch` is omitted - const mgmt = new ManagementClient({ - domain, - clientId, - clientSecret, - useMTLS: true, - fetch: mtlsCapableFetch, // now required - }); - ``` - - ### mTLS works with both client secret and client assertion - - `useMTLS` works with both `clientSecret` and `clientAssertionSigningKey`. mTLS (RFC 8705) is a transport-layer concern: the TLS client certificate yields a certificate-bound token regardless of which client authentication method is used. An explicit `fetch` option is always required when `useMTLS` is set. - - ### `domain` must be a bare hostname - - `domain` must be a bare host such as `tenant.us.auth0.com`. A value that is empty, or that contains a scheme, a path, a query string, a fragment, credentials (`@`), or whitespace, now throws at construction instead of producing malformed request URLs later. The check applies to every authentication mode (`token`, `clientSecret`, and `clientAssertionSigningKey`), and to `createManagementAuth` and `TokenProvider` as well as `ManagementClient`. - - ```ts - // throws in v7 - new ManagementClient({ domain: "https://tenant.us.auth0.com/", ... }); - // correct - new ManagementClient({ domain: "tenant.us.auth0.com", ... }); - ``` - - ### Token acquisition failures throw `ManagementError` - - When the internal client-credentials token request fails, the client now throws a `ManagementError` (previously a plain `Error`). The error carries `statusCode` and a parsed `body` with the OAuth error details. A request that exceeds the 10-second timeout throws `ManagementError` with status `408`. - - ```ts - import { ManagementError } from "auth0"; - - try { - await mgmt.users.getAll(); - } catch (e) { - if (e instanceof ManagementError) { - console.error(e.statusCode, e.body); - } - } - ``` - - ### `uuid` dependency removed - - The `uuid` package is no longer a dependency. If your project imported `uuid` transitively through `auth0`, add it to your own `dependencies`. - - ## Migrating authentication code - - If your app calls `AuthenticationClient` or `UserInfoClient`, follow the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). Start with [`auth-migration/index.md`](https://github.com/auth0/node-auth0/blob/master/auth-migration/index.md) for the OIDC token grants section; the incremental flow, session, and troubleshooting pages live in the same [`auth-migration/`](https://github.com/auth0/node-auth0/tree/master/auth-migration) directory. It covers: - - - Choosing between `@auth0/auth0-auth-js` (stateless token grants) and `@auth0/auth0-server-js` (server-managed sessions). - - The complete method-by-method API mapping for `.oauth`, `.database`, `.passwordless`, `.backchannel`, `.tokenExchange`, and `UserInfoClient`. - - The four cross-cutting behavior changes: return shape (envelope dropped), casing (snake_case → camelCase), token expiry (`expires_in` relative → `expiresAt` absolute, a silent high-risk change), and the typed error model with `isMfaRequiredError()`. - - Wiring the `auth0-server-js` session lifecycle when you want the SDK to own login, cookies, refresh, and logout. - - The Management API is explicitly out of scope in that guide: a file that keeps using `ManagementClient` from `auth0` while importing `@auth0/auth0-auth-js` for authentication is correct and expected. - - ## Staying on the legacy entrypoint - - If you cannot migrate the authentication code immediately, the `auth0/legacy` entrypoint still ships `AuthenticationClient` and `UserInfoClient` at their v4.x configuration format and method signatures. This is a stopgap, not a destination; the legacy shapes differ from the current API and will not receive new features. - - ```ts - import { AuthenticationClient } from "auth0/legacy"; - ``` - - Plan the move to `@auth0/auth0-auth-js` / `@auth0/auth0-server-js` rather than treating the legacy entrypoint as permanent. - user_owned: true - - id: patch-185ac064 - content_hash: sha256:eae25ca4d648887ccd0dbf85d55f52be8e3112bf613809c6b74c1e61499f424f - original_commit: 185ac0645e47f85eba6a6369f820b304bce27d4c - original_message: Release v7.6.0 (#1430) + - id: patch-945e9d93 + content_hash: sha256:866298a9eabd534c366513c7a9b7e43c5d0f14389f5a98593901708c081e8b14 + original_commit: 945e9d9383912ea95ccdd32027f6e567fc722f78 + original_message: Release v7.7.0 (#1438) original_author: Ankita Tripathi <51994119+ankita10119@users.noreply.github.com> - base_generation: ffcd9e2df9f9842b185ec5d5df53c84a898eaf49 + base_generation: 33b1cb1a2930f8b86de76fd874cc695bbce614fd files: - package.json - src/management/version.ts patch_content: | diff --git a/package.json b/package.json - index e9d0ebdf6a..498d343959 100644 + index 10f7fd0073..5e0696e281 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "auth0", - - "version": "7.5.0", - + "version": "7.6.0", + - "version": "7.6.0", + + "version": "7.7.0", "private": false, "repository": { "type": "git", diff --git a/src/management/version.ts b/src/management/version.ts - index 6a5cc9fe4a..c012080661 100644 + index c012080661..9d3e1f833d 100644 --- a/src/management/version.ts +++ b/src/management/version.ts @@ -1 +1 @@ - -export const SDK_VERSION = "7.5.0"; - +export const SDK_VERSION = "7.6.0"; + -export const SDK_VERSION = "7.6.0"; + +export const SDK_VERSION = "7.7.0"; theirs_snapshot: package.json: | { "name": "auth0", - "version": "7.6.0", + "version": "7.7.0", "private": false, "repository": { "type": "git", @@ -28292,6 +30187,17 @@ patches: }, "default": "./dist/cjs/management/api/resources/organizations/exports.js" }, + "./portals": { + "import": { + "types": "./dist/esm/management/api/resources/portals/exports.d.mts", + "default": "./dist/esm/management/api/resources/portals/exports.mjs" + }, + "require": { + "types": "./dist/cjs/management/api/resources/portals/exports.d.ts", + "default": "./dist/cjs/management/api/resources/portals/exports.js" + }, + "default": "./dist/cjs/management/api/resources/portals/exports.js" + }, "./prompts": { "import": { "types": "./dist/esm/management/api/resources/prompts/exports.d.mts", @@ -29859,42 +31765,42 @@ patches: } } src/management/version.ts: | - export const SDK_VERSION = "7.6.0"; + export const SDK_VERSION = "7.7.0"; status: unresolved - - id: patch-945e9d93 - content_hash: sha256:866298a9eabd534c366513c7a9b7e43c5d0f14389f5a98593901708c081e8b14 - original_commit: 945e9d9383912ea95ccdd32027f6e567fc722f78 - original_message: Release v7.7.0 (#1438) - original_author: Ankita Tripathi <51994119+ankita10119@users.noreply.github.com> - base_generation: 33b1cb1a2930f8b86de76fd874cc695bbce614fd + - id: patch-a4eb7afb + content_hash: sha256:ebb058330f3f18629dd3c530efa382e5dbfd750781306fc53d76549477feb45c + original_commit: a4eb7afb69a627f0aab8fc1b3124168d4dcf7e25 + original_message: Release v7.8.0 (#1442) + original_author: Harshith Rai <59109406+harshithRai@users.noreply.github.com> + base_generation: bbc59683be5e8c7593ac658e03f9f4c381dc8309 files: - package.json - src/management/version.ts patch_content: | diff --git a/package.json b/package.json - index 10f7fd0073..5e0696e281 100644 + index 5e0696e281..cdd7df0651 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "auth0", - - "version": "7.6.0", - + "version": "7.7.0", + - "version": "7.7.0", + + "version": "7.8.0", "private": false, "repository": { "type": "git", diff --git a/src/management/version.ts b/src/management/version.ts - index c012080661..9d3e1f833d 100644 + index 9d3e1f833d..d3759794ee 100644 --- a/src/management/version.ts +++ b/src/management/version.ts @@ -1 +1 @@ - -export const SDK_VERSION = "7.6.0"; - +export const SDK_VERSION = "7.7.0"; + -export const SDK_VERSION = "7.7.0"; + +export const SDK_VERSION = "7.8.0"; theirs_snapshot: package.json: | { "name": "auth0", - "version": "7.7.0", + "version": "7.8.0", "private": false, "repository": { "type": "git", @@ -31759,42 +33665,42 @@ patches: } } src/management/version.ts: | - export const SDK_VERSION = "7.7.0"; + export const SDK_VERSION = "7.8.0"; status: unresolved - - id: patch-a4eb7afb - content_hash: sha256:ebb058330f3f18629dd3c530efa382e5dbfd750781306fc53d76549477feb45c - original_commit: a4eb7afb69a627f0aab8fc1b3124168d4dcf7e25 - original_message: Release v7.8.0 (#1442) - original_author: Harshith Rai <59109406+harshithRai@users.noreply.github.com> - base_generation: bbc59683be5e8c7593ac658e03f9f4c381dc8309 + - id: patch-c90ce4ac + content_hash: sha256:4475f4f82c158abb89134b598101c46f99d1fe1e1c4f2f86bd0e61ee2d5cfa75 + original_commit: c90ce4ac3665b285d53796dfeaa4815b95c0053d + original_message: Release v7.9.0 (#1448) + original_author: Ankita Tripathi <51994119+ankita10119@users.noreply.github.com> + base_generation: b6a645b09d96f5b34c7d873a8eec88159c2512c1 files: - package.json - src/management/version.ts patch_content: | diff --git a/package.json b/package.json - index 5e0696e281..cdd7df0651 100644 + index cdd7df0651..5b319ee7c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "auth0", - - "version": "7.7.0", - + "version": "7.8.0", + - "version": "7.8.0", + + "version": "7.9.0", "private": false, "repository": { "type": "git", diff --git a/src/management/version.ts b/src/management/version.ts - index 9d3e1f833d..d3759794ee 100644 + index d3759794ee..faecf7baec 100644 --- a/src/management/version.ts +++ b/src/management/version.ts @@ -1 +1 @@ - -export const SDK_VERSION = "7.7.0"; - +export const SDK_VERSION = "7.8.0"; + -export const SDK_VERSION = "7.8.0"; + +export const SDK_VERSION = "7.9.0"; theirs_snapshot: package.json: | { "name": "auth0", - "version": "7.8.0", + "version": "7.9.0", "private": false, "repository": { "type": "git", @@ -33659,5 +35565,5 @@ patches: } } src/management/version.ts: | - export const SDK_VERSION = "7.8.0"; + export const SDK_VERSION = "7.9.0"; status: unresolved diff --git a/.shiprc b/.shiprc new file mode 100644 index 0000000000..d1791e98e5 --- /dev/null +++ b/.shiprc @@ -0,0 +1,6 @@ +{ + "files": { + ".version": [], + "src/management/version.ts": [] + } +} diff --git a/AUTH_MIGRATION_GUIDE.md b/AUTH_MIGRATION_GUIDE.md new file mode 100644 index 0000000000..64626f8067 --- /dev/null +++ b/AUTH_MIGRATION_GUIDE.md @@ -0,0 +1,14 @@ +# Authentication Migration Guide + +This guide lives in the [`auth-migration/`](./auth-migration/) directory. + +**→ Start here: [`auth-migration/index.md`](./auth-migration/index.md)**: migrate your authentication code off the `auth0` package to [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js) (stateless token grants) or [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js) (server-managed sessions). + +The directory contains: + +- [`auth-migration/index.md`](./auth-migration/index.md): the main guide covering OIDC token grants and the four cross-cutting breaking changes. +- [`auth-migration/authentication-flows.md`](./auth-migration/authentication-flows.md): database, passwordless, backchannel (CIBA), token exchange, and `UserInfoClient`. +- [`auth-migration/server-side-sessions.md`](./auth-migration/server-side-sessions.md): the `@auth0/auth0-server-js` session layer. +- [`auth-migration/troubleshooting.md`](./auth-migration/troubleshooting.md): FAQ and gotchas. + +> **Migrating with an AI agent?** Point it at the Auth0 migration skill: the `auth0` skill in [`auth0/agent-skills`](https://github.com/auth0/agent-skills), migration intent `migrate-node-auth0`. diff --git a/auth-migration/authentication-flows.md b/auth-migration/authentication-flows.md new file mode 100644 index 0000000000..6f7bace2a1 --- /dev/null +++ b/auth-migration/authentication-flows.md @@ -0,0 +1,234 @@ +# Migrating the other authentication flows + +This is the incremental part of the [Authentication Migration Guide](./index.md). Start with the guide's [OIDC token grants](./index.md#oidc-token-grants) and cross-cutting breaking changes before you touch anything here. Everything below builds on those changes, so apply them to every rewrite on this page too. + +> **Migrating with an AI agent?** Point it at the Auth0 migration skill (the `auth0` skill in [`auth0/agent-skills`](https://github.com/auth0/agent-skills), migration intent `migrate-node-auth0`). + +Migrate one flow at a time. Only the flows your app actually uses need attention; skip the rest. + +- [Database connections](#database-connections) +- [Passwordless](#passwordless) +- [Backchannel authentication (CIBA)](#backchannel-authentication-ciba) +- [Token exchange (RFC 8693)](#token-exchange-rfc-8693) +- [UserInfoClient](#userinfoclient) +- [Quick lookup table](#quick-lookup-table) + +Unless a row routes explicitly to `@auth0/auth0-server-js`, the replacement lives on the `@auth0/auth0-auth-js` `AuthClient` (or a sub-client: `authClient.database`, `authClient.passwordless`, `authClient.mfa`, `authClient.passkey`). + +## Database connections + +Database connection operations move to the `authClient.database` sub-client. Names and required parameters stay the same; only casing and return shape change. + +### `database.signUp` → `authClient.database.signUp` + +```ts +// before +const resp = await auth0.database.signUp({ + email, + password, + connection: "Username-Password-Authentication", + given_name: "Ada", + family_name: "Lovelace", + user_metadata: { plan: "free" }, +}); +const userId = resp.data.id; +// after +const result = await authClient.database.signUp({ + email, + password, + connection: "Username-Password-Authentication", + givenName: "Ada", + familyName: "Lovelace", + userMetadata: { plan: "free" }, +}); +const userId = result.id; +``` + +> ID normalization is preserved: node-auth0 mapped the server's `_id | user_id | id` onto a single `id`. The new SDK does the same, so `result.id` is always present. Do not add your own `_id` fallback. + +### `database.changePassword` → `authClient.database.changePassword` + +node-auth0 returned a `TextApiResponse` (read via `.data`); the new SDK returns the plain `string` directly. + +```ts +// before +const resp = await auth0.database.changePassword({ email, connection: "Username-Password-Authentication" }); +const message = resp.data; // plain-text confirmation +// after +const message = await authClient.database.changePassword({ email, connection: "Username-Password-Authentication" }); +``` + +> `changePassword` requires `connection` plus at least one of `email` or `username`: either identifier is accepted, not `email` alone. + +## Passwordless + +node-auth0 lumped "start" (send the code or link) and "login" (redeem the code) onto one sub-client. The new SDK splits them: starting stays on `authClient.passwordless`; redeeming a code becomes a top-level grant method on `AuthClient`. + +### `passwordless.sendEmail` → `authClient.passwordless.sendEmail` + +```ts +// before +await auth0.passwordless.sendEmail({ email, send: "code" }); +// after +await authClient.passwordless.sendEmail({ email, send: "code" }); +``` + +> Default changed: node-auth0 defaulted `send` to `'link'` (magic link). The new SDK defaults `send` to `'code'` (one-time password). If you relied on the implicit default to send magic links, set `send: 'link'` explicitly. + +### `passwordless.sendSMS` → `authClient.passwordless.sendSms` + +Note the casing change: `sendSMS` → `sendSms`, and `phone_number` → `phoneNumber`. + +```ts +// before +await auth0.passwordless.sendSMS({ phone_number: "+15551234567" }); +// after +await authClient.passwordless.sendSms({ phoneNumber: "+15551234567" }); +``` + +### `passwordless.loginWithEmail` → `getTokenByPasswordlessEmail` + +Redeeming the one-time password is now a grant method on `AuthClient`, not on the passwordless sub-client. + +```ts +// before +const resp = await auth0.passwordless.loginWithEmail({ email, code, audience, scope }); +const token = resp.data.access_token; +// after +const tokens = await authClient.getTokenByPasswordlessEmail({ email, code, audience, scope }); +const token = tokens.accessToken; +``` + +### `passwordless.loginWithSMS` → `getTokenByPasswordlessSms` + +```ts +// before +const resp = await auth0.passwordless.loginWithSMS({ phone_number, code }); +// after +const tokens = await authClient.getTokenByPasswordlessSms({ phoneNumber, code }); +``` + +> Session apps: `@auth0/auth0-server-js` exposes `startPasswordless` / `completePasswordless` / `completePasswordlessMagicLink`, which both send the code and establish a session. Use those instead of the two-step auth-js flow when the SDK owns the session. See [Migrating session apps](./server-side-sessions.md). + +## Backchannel authentication (CIBA) + +CIBA is Client-Initiated Backchannel Authentication. + +### `backchannel.authorize` → `initiateBackchannelAuthentication` + +```ts +// before +const resp = await auth0.backchannel.authorize({ + binding_message: "ABC123", + scope: "openid", + userId: "auth0|123", +}); +const authReqId = resp.auth_req_id; +// after +const { authReqId, expiresIn, interval } = await authClient.initiateBackchannelAuthentication({ + bindingMessage: "ABC123", + loginHint: { sub: "auth0|123" }, // login_hint is an object with `sub`, not a bare string + authorizationParams: { scope: "openid" }, // scope goes here, NOT as a top-level key +}); +``` + +### `backchannel.backchannelGrant` → `backchannelAuthenticationGrant` + +```ts +// before +const resp = await auth0.backchannel.backchannelGrant({ auth_req_id: authReqId }); +// after +const tokens = await authClient.backchannelAuthenticationGrant({ authReqId }); +``` + +> One-shot convenience: `authClient.backchannelAuthentication({ ... })` initiates and polls to completion, returning a `TokenResponse`. Use it if your code did the initiate-then-poll loop by hand. +> +> Session apps: for CIBA that also establishes a session, see [Migrating session apps](./server-side-sessions.md). + +## Token exchange (RFC 8693) + +```ts +// before +const resp = await auth0.tokenExchange.exchangeToken({ + subject_token_type: "urn:example:custom", + subject_token: token, + audience: "https://api.example.com", + scope: "read", +}); +// after +const tokens = await authClient.exchangeToken({ + subjectTokenType: "urn:example:custom", + subjectToken: token, + audience: "https://api.example.com", + scope: "read", +}); +``` + +> `exchangeToken` is overloaded: a custom-exchange profile shape (`subjectTokenType` + `subjectToken` + `audience`) and a Token Vault shape (`connection` present). Presence of `connection` routes to the vault path. The custom-exchange profile is the RFC 8693 replacement for `tokenExchange.exchangeToken`. +> +> Session apps: `@auth0/auth0-server-js` exposes `loginWithCustomTokenExchange` (exchange, then establish a session) and `customTokenExchange` (exchange, then return tokens with no session). + +## UserInfoClient + +The standalone `UserInfoClient` from node-auth0 does not exist in the new SDK. Choose the replacement based on what the app needs: + +| Your intent | Replacement | +| --- | --- | +| Wanted user profile claims right after login | Read `TokenResponse.claims` from the grant result; the SDK already decodes the ID token. No extra `/userinfo` round-trip needed. **Preferred.** | +| Wanted a live `/userinfo` response for an arbitrary access token | `await authClient.getUserInfo({ accessToken })`, a direct method on `AuthClient`. | +| Wanted the profile in a server-rendered app with a session | `await serverClient.getUser()` returns the stored user claims from the session. | + +**Before (node-auth0):** + +```ts +import { UserInfoClient } from "auth0"; +const userInfo = new UserInfoClient({ domain }); +const resp = await userInfo.getUserInfo(accessToken); +const profile = resp.data; // { sub, name, email, ... } +``` + +**After (preferred): use the claims you already have:** + +```ts +const tokens = await authClient.getTokenByCode(callbackUrl, {}); +const profile = tokens.claims; // { sub, name, email, ... } decoded from the id_token +``` + +**After (direct method):** for when you only have an access token: + +```ts +// Takes an options object: { accessToken, expectedSubject? } +const profile = await authClient.getUserInfo({ accessToken }); +``` + +> Prefer reading `claims` over any `/userinfo` call: it avoids a network round-trip and the claims are already validated by the SDK. + +## Quick lookup table + +The complete node-auth0 → new SDK map, including the OIDC methods covered in the main guide. + +| node-auth0 | new SDK equivalent | Layer | +| --- | --- | --- | +| `oauth.authorizationCodeGrant` | `authClient.getTokenByCode(url, opts)` | auth-js | +| `oauth.authorizationCodeGrantWithPKCE` | `authClient.getTokenByCode(url, { codeVerifier })` | auth-js | +| `oauth.refreshTokenGrant` | `authClient.getTokenByRefreshToken({ refreshToken })` | auth-js | +| `oauth.passwordGrant` | `authClient.getTokenByPassword({ ... })` | auth-js | +| `oauth.clientCredentialsGrant` | `authClient.getTokenByClientCredentials({ audience })` | auth-js | +| `oauth.revokeRefreshToken` | `authClient.revokeToken({ token })` / `serverClient.revokeRefreshToken()` | auth-js / server-js | +| `oauth.tokenForConnection` | `authClient.exchangeToken({ connection, ... })` | auth-js | +| `oauth.pushedAuthorization` | `authClient.buildAuthorizationUrl({ pushedAuthorizationRequests: true })` | auth-js | +| `database.signUp` | `authClient.database.signUp({ ... })` | auth-js | +| `database.changePassword` | `authClient.database.changePassword({ ... })` | auth-js | +| `passwordless.sendEmail` | `authClient.passwordless.sendEmail({ ... })` | auth-js | +| `passwordless.sendSMS` | `authClient.passwordless.sendSms({ phoneNumber })` | auth-js | +| `passwordless.loginWithEmail` | `authClient.getTokenByPasswordlessEmail({ ... })` | auth-js | +| `passwordless.loginWithSMS` | `authClient.getTokenByPasswordlessSms({ ... })` | auth-js | +| `backchannel.authorize` | `authClient.initiateBackchannelAuthentication({ ... })` | auth-js | +| `backchannel.backchannelGrant` | `authClient.backchannelAuthenticationGrant({ authReqId })` | auth-js | +| `tokenExchange.exchangeToken` | `authClient.exchangeToken({ subjectTokenType, subjectToken, audience })` | auth-js | +| `UserInfoClient.getUserInfo` | `TokenResponse.claims` (preferred) / `authClient.getUserInfo({ accessToken })` / `serverClient.getUser()` | auth-js / server-js | +| (no equivalent): build `/authorize` URL | `authClient.buildAuthorizationUrl({ ... })` | auth-js | +| (no equivalent): build `/v2/logout` URL | `authClient.buildLogoutUrl({ returnTo })` | auth-js | +| `ManagementClient.*` | **not migrated, stays on `auth0`** | n/a | + +When you finish a flow, return to the [verification checklist](./index.md#verification-checklist) and confirm the four cross-cutting changes for every call site you touched. diff --git a/auth-migration/index.md b/auth-migration/index.md new file mode 100644 index 0000000000..85a11c45c7 --- /dev/null +++ b/auth-migration/index.md @@ -0,0 +1,732 @@ +# Authentication Migration Guide + +A guide to migrating your authentication code off the `auth0` package (node-auth0) to the modern Auth0 server SDKs: [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js) for stateless token grants, and [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js) for server-managed sessions. + +> **Migrating with an AI agent?** Point it at the Auth0 migration skill first. The skill lives in [`auth0/agent-skills`](https://github.com/auth0/agent-skills) as the `auth0` skill (migration intent: `migrate-node-auth0`). It encodes the target-SDK routing, the four cross-cutting breaking changes, the method-by-method mapping, and a build-until-green verify loop. + +## Contents + +- [How to use this guide](#how-to-use-this-guide) +- [Overview](#overview) + - [Who this is for](#who-this-is-for) + - [Scope](#scope) +- [Choosing your target SDK](#choosing-your-target-sdk) +- [Prerequisites](#prerequisites) +- [Installation and constructor mapping](#installation-and-constructor-mapping) +- [OIDC token grants](#oidc-token-grants) + - [Optional: migrate only OIDC while staying on v6](#optional-migrate-only-oidc-while-staying-on-v6) +- [Cross-cutting breaking changes](#cross-cutting-breaking-changes) + - [1. Return shape](#1-return-shape) + - [2. Casing](#2-casing) + - [3. Token expiry](#3-token-expiry) + - [4. Error model](#4-error-model) +- [Verification checklist](#verification-checklist) +- [Continue the migration](#continue-the-migration) + - [Other authentication flows](#other-authentication-flows) + - [Server-side sessions](#server-side-sessions) + - [Troubleshooting](#troubleshooting) + +## How to use this guide + +This is a reference, not a linear read. You do not have to work through it top to bottom; migrate only the flows your app actually uses, in whatever order suits you. Most apps finish after the [OIDC token grants](#oidc-token-grants) section. + +The work falls into three phases: + +| Phase | What you do | Where | +| --- | --- | --- | +| **Before**: orient and set up | Pick your target SDK, check prerequisites, install the package, map constructor options. | [Choosing your target SDK](#choosing-your-target-sdk), [Prerequisites](#prerequisites), [Installation and constructor mapping](#installation-and-constructor-mapping) | +| **During**: rewrite call sites | Rewrite the OIDC token grants (in this file), then the other flows and the session layer as needed. Apply the four cross-cutting breaking changes to every call site. | [OIDC token grants](#oidc-token-grants), [Cross-cutting breaking changes](#cross-cutting-breaking-changes), [`authentication-flows.md`](./authentication-flows.md), [`server-side-sessions.md`](./server-side-sessions.md) | +| **After**: verify | Run the build-until-green checklist; confirm no residue and that `ManagementClient` code is untouched. | [Verification checklist](#verification-checklist) | + +Suggested order: start with the OIDC grants and cross-cutting changes (the whole job for most apps), then the [other flows](./authentication-flows.md) you actually use, then [session apps](./server-side-sessions.md) if you want the SDK to own sessions. Stuck? See [`troubleshooting.md`](./troubleshooting.md). + +## Overview + +node-auth0's `AuthenticationClient` is a stateless HTTP client. Every method is a single call to an Auth0 Authentication API endpoint that returns a response object. It has no notion of a logged-in user, no session, no cookie, no token store, and no automatic refresh. Anything stateful in a node-auth0 app (persisting tokens, deciding when to refresh, tracking the login across requests) was written by you *around* node-auth0. + +The modern stack splits those two concerns into two packages: + +- `@auth0/auth0-auth-js` is the stateless token layer. It is the direct successor to `AuthenticationClient`: the same "one method equals one API call equals one result" model, with modern ergonomics (camelCase, typed errors, direct return values, per-request options). +- `@auth0/auth0-server-js` is a stateful session layer built on top of auth0-auth-js. It owns the login redirect flow, a pluggable state/transaction store, cookie handling, automatic token refresh, and logout. It is the successor to the *session code you hand-rolled*, not to `AuthenticationClient` itself. + +### Who this is for + +You are running a Node.js backend that imports the `auth0` package and calls `AuthenticationClient` (or `UserInfoClient`) to perform token grants, database signup, passwordless, CIBA, token exchange, or userinfo lookups. You want to move that code to the current first-party server SDKs. This is a surgical rewrite of the authentication layer: routes, controllers, business logic, data access, and framework wiring stay as they are. You touch the smallest possible surface: the files that import and call node-auth0's Authentication API. + +### Scope + +In scope: + +- `AuthenticationClient` and its sub-clients: `.oauth`, `.database`, `.passwordless`, `.backchannel`, `.tokenExchange` +- `UserInfoClient` +- The auth error types (`AuthApiError`) and token-validation types (`IDTokenValidateOptions`, `IdTokenValidatorError`) + +Out of scope, do not touch: + +- `ManagementClient` (Management API v2). It is not being migrated and stays on the `auth0` package. +- Application routes, view/controller logic, database code, and any non-auth use of the `auth0` package. + +> If a file uses `ManagementClient`, leave that code alone. Only rewrite the `AuthenticationClient` / `UserInfoClient` parts. + +## Choosing your target SDK + +The routing question is: do you want to keep owning your session, or hand that responsibility to the SDK? + +### Decision table + +| If your code… | Migrate to | Why | +| --- | --- | --- | +| Only performs token grants / DB signup / passwordless / userinfo and manages its own session (or is a machine-to-machine service backend) | `@auth0/auth0-auth-js` | Direct, near 1:1 replacement for `AuthenticationClient`. Same stateless model. | +| Wants the SDK to own the login redirect flow, session storage, cookies, token refresh, and logout (a server-rendered web app) | `@auth0/auth0-server-js` | Adds a session layer node-auth0 never had. This is a rewrite of the session handling, not a method-for-method port. | + +**Default recommendation:** start with `@auth0/auth0-auth-js` for a faithful parity migration. Choose `@auth0/auth0-server-js` only when you currently hand-roll session/cookie/refresh logic around node-auth0 and would benefit from the SDK owning it. + +### Signals + +Signals that point to auth0-auth-js: + +- Predominant use is `clientCredentialsGrant` (machine-to-machine). There is no user, so there is no session to own. +- The app already has a session framework it is happy with and only calls node-auth0 for token grants. +- The app is an API, worker, or CLI, not a browser-facing web server. +- You want the smallest, most mechanical, lowest-risk migration. + +Signals that point to auth0-server-js: + +- The app performs a browser redirect login and reads `req.session.user` (or equivalent) on later requests. +- You wrote refresh-on-expiry logic, a token cache, or logout-with-revocation by hand. +- You use `express-openid-connect` today and want a first-party, framework-agnostic replacement. +- You are on a server framework (Express, Fastify, Hono, Next.js) and want the SDK to manage cookies. + +### Mixing both + +A single app can use both: auth0-server-js for the user-facing login/session, and auth0-auth-js directly for a separate machine-to-machine `clientCredentialsGrant` to call another API. `ServerClient` even exposes the underlying `AuthClient` via `serverClient.authClient` for occasional low-level needs. Do not force everything onto one package. + +## Prerequisites + +### Node.js version + +Both target SDKs need Node.js 20 LTS or newer. Verify the project's runtime before installing. + +### SDK versions + +- `@auth0/auth0-auth-js` >= `1.13.0` +- `@auth0/auth0-server-js` >= `1.13.0` + +Both are published on npm; install the current `latest`. `1.13.0` is the floor for the full API surface used in this guide (`getUserInfo`, per-request `RequestOptions`, and `fullResponse`). + +## Installation and constructor mapping + +Add the target package: + +```bash +# auth-js target (stateless token grants) +npm install @auth0/auth0-auth-js + +# server-js target (server-managed sessions), pulls in auth0-auth-js transitively +npm install @auth0/auth0-server-js +``` + +Keep the `auth0` package installed if the app still uses `ManagementClient`. + +### Imports + +```ts +// before +import { AuthenticationClient, UserInfoClient, AuthApiError } from "auth0"; + +// after: auth-js target +import { AuthClient, TokenByCodeError, isMfaRequiredError } from "@auth0/auth0-auth-js"; + +// after: server-js target +import { ServerClient } from "@auth0/auth0-server-js"; +``` + +> Keep the `auth0` import if the file also uses `ManagementClient`. It is correct for a file to import both `auth0` (for `ManagementClient`) and `@auth0/auth0-auth-js` (for authentication). Only remove the `auth0` import from files where it was used *solely* for `AuthenticationClient` / `UserInfoClient`. + +### AuthClient options + +The constructor options mostly carry over with camelCase names. A few are renamed or dropped. + +**Before (node-auth0):** + +```ts +new AuthenticationClient({ + domain: "tenant.us.auth0.com", + clientId: "...", + clientSecret: "...", // OR clientAssertionSigningKey + clientAssertionSigningKey: "...", + clientAssertionSigningAlg: "RS256", + idTokenSigningAlg: "RS256", // for manual id_token validation + clockTolerance: 60, // seconds, for validation + useMTLS: false, + telemetry: true, + headers: { "X-Custom": "..." }, // sent on every request + timeoutDuration: 10000, // ms + retry: { + /* ... */ + }, + agent: undiciDispatcher, + fetch: customFetch, + middleware: [ + /* ... */ + ], +}); +``` + +**After (auth0-auth-js):** + +```ts +import { AuthClient } from "@auth0/auth0-auth-js"; + +new AuthClient({ + domain: "tenant.us.auth0.com", // same (no scheme) + clientId: "...", // same + clientSecret: "...", // same + clientAssertionSigningKey: "...", // same (string | CryptoKey) + clientAssertionSigningAlg: "RS256", // same + authorizationParams: { + // NEW: default scope/audience/redirect_uri for URL builders + scope: "openid profile email", + audience: "https://api.example.com", + redirect_uri: "https://app.example.com/callback", + }, + useMtls: false, // RENAMED from useMTLS (lowercase tls) + customFetch: fetch, // RENAMED from fetch + telemetry: { + /* ... */ + }, // structured TelemetryConfig + discoveryCache: { ttl, maxEntries }, // NEW: OIDC discovery / JWKS cache +}); +``` + +Option-by-option: + +| node-auth0 | auth0-auth-js | Notes | +| --- | --- | --- | +| `domain` | `domain` | Unchanged. No `https://` scheme. | +| `clientId` | `clientId` | Unchanged. | +| `clientSecret` | `clientSecret` | Unchanged. | +| `clientAssertionSigningKey` | `clientAssertionSigningKey` | Unchanged. Now also accepts a `CryptoKey`. | +| `clientAssertionSigningAlg` | `clientAssertionSigningAlg` | Unchanged. | +| `useMTLS` | `useMtls` | Renamed (casing). | +| `fetch` | `customFetch` | Renamed. | +| `telemetry: boolean` | `telemetry: TelemetryConfig` | Now a structured object. | +| `headers` (global) | per-request `RequestOptions.headers` | Moved to per-request options; set per call site rather than globally. | +| `timeoutDuration` | per-request `RequestOptions.signal` | Use an `AbortSignal.timeout(ms)` on the call. | +| `retry` | configure via `customFetch` | Wrap your fetch with retry if needed. | +| `agent` | configure via `customFetch` | Set the dispatcher inside your custom fetch. | +| `middleware` | `customFetch` | Compose behavior in the fetch wrapper. | +| `idTokenSigningAlg` | (internal) | ID-token validation is internal; read `TokenResponse.claims`. | +| `clockTolerance` | (internal) | Handled internally during validation. | + +### ServerClient options + +`ServerClient` wraps an `AuthClient` and adds the session machinery. It shares the auth options and adds required stores. This constructor and the stores it needs are covered in [`server-side-sessions.md`](./server-side-sessions.md); reach for it only when you route to server-js. + +### Global config to per-request options + +node-auth0's global constructor options for `headers`, `timeoutDuration`, `agent`, `retry`, and `middleware` have no direct constructor equivalents in auth0-auth-js. Instead, the new SDK's methods accept a trailing `RequestOptions` parameter: + +```ts +import type { RequestOptions } from "@auth0/auth0-server-js"; // or '@auth0/auth0-auth-js' + +const tokens = await authClient.getTokenByClientCredentials( + { audience: "https://api.example.com" }, + { + headers: { "X-Custom": "value" }, + signal: AbortSignal.timeout(5000), // timeout in ms + } satisfies RequestOptions, +); +``` + +`@auth0/auth0-server-js` re-exports `RequestOptions`, `ApiResponse`, and `FullResponseOption` from `@auth0/auth0-auth-js`, so you can import any of them from either package. + +Arity rule: MFA methods (`authClient.mfa.*`) take `requestOptions` as the 2nd argument; store-first methods (session-owning methods on `serverClient`) take it as the 3rd argument after the store context; cache hits ignore it entirely. + +Common patterns: + +- Global headers: apply via `RequestOptions.headers` on each call that needs it, or wrap `customFetch` once to inject it everywhere. +- Timeout: replace `timeoutDuration: 10000` with `signal: AbortSignal.timeout(10000)` on the call. +- Agent (Node.js dispatcher): wrap `customFetch` to inject the agent into the underlying HTTP transport. +- Retry / middleware: compose behavior in a `customFetch` wrapper passed either at construction or per request. + +## OIDC token grants + +This is the core of the migration and, for most apps, the whole of it. These are the `AuthenticationClient.oauth.*` grants that drive OpenID Connect login and machine-to-machine token acquisition. All of them move onto the `AuthClient` instance directly (not a sub-client). + +Before you touch any method, internalize the four [cross-cutting breaking changes](#cross-cutting-breaking-changes); they apply to *every* rewrite here and on the incremental pages. + +Naming conventions used throughout: + +| node-auth0 | new SDKs | +| --- | --- | +| Params and response fields use the snake_case wire shape: `client_id`, `refresh_token`, `access_token`, `expires_in`, `phone_number` | camelCase: `clientId`, `refreshToken`, `accessToken`, `expiresAt`, `phoneNumber` | +| Methods take a `bodyParameters` object (+ optional `initOverrides`) | Methods take a single `options` object (+ optional trailing `RequestOptions` for per-request `signal`, `headers`, `customFetch`) | +| Every method returns a `JSONApiResponse` / `VoidApiResponse` / `TextApiResponse` wrapper | Methods return the domain object directly (`TokenResponse`, `SignUpResult`, `string`, `void`) | + +### `oauth.authorizationCodeGrant` → `getTokenByCode` + +The single most important semantic change in the whole migration. In node-auth0 you pass the raw authorization `code` (and `redirect_uri`) that you extracted from the callback query string yourself. In auth0-auth-js you pass the entire callback `URL`; the SDK extracts `code` and enforces PKCE, and `redirect_uri` comes from the `AuthClient` config / `authorizationParams`. The stateless `AuthClient` does **not** validate OAuth `state` — that is your responsibility (or use `@auth0/auth0-server-js` `completeInteractiveLogin`, which owns a transaction store and validates `state` for you). + +**Before (node-auth0):** + +```ts +import { AuthenticationClient } from "auth0"; + +const auth0 = new AuthenticationClient({ domain, clientId, clientSecret }); + +// You parsed `code` out of the callback URL yourself. +const resp = await auth0.oauth.authorizationCodeGrant({ + code, + redirect_uri: "https://app.example.com/callback", +}); +const accessToken = resp.data.access_token; +const expiresIn = resp.data.expires_in; // relative seconds +const reqId = resp.headers.get("x-request-id"); // metadata on success +``` + +**After (auth0-auth-js):** + +```ts +import { AuthClient } from "@auth0/auth0-auth-js"; + +const authClient = new AuthClient({ domain, clientId, clientSecret }); + +// `url` is a URL object for the full incoming request URL, +// e.g. new URL(req.url, `https://${req.headers.host}`) +const tokens = await authClient.getTokenByCode(url, { + // options; e.g. codeVerifier (PKCE) or organization +}); +const accessToken = tokens.accessToken; +const expiresAt = tokens.expiresAt; // absolute Unix seconds +``` + +> If your code manually parses `req.query.code`, that parsing is now the SDK's job. Delete it and hand the SDK the full URL. The SDK reads `code` from the URL and validates the PKCE verifier; it does **not** validate OAuth `state`. **Keep your existing `state` check** (compare the `state` query parameter against what you stored before the redirect) — or migrate to `@auth0/auth0-server-js` `completeInteractiveLogin`, which handles `state` validation automatically. (`getTokenByCode` options are `codeVerifier` and `organization`.) If the node-auth0 code read `resp.headers.get(...)` on success, see [Reading HTTP response metadata](#reading-http-response-metadata-fullresponse). Error-path metadata remains accessible on the typed error. + +> **Warning:** Do not delete your `state`/CSRF check when migrating to `AuthClient.getTokenByCode`. The stateless client does not validate `state`. Removing the check silently disables CSRF protection on the authorization-code flow. + +### `oauth.authorizationCodeGrantWithPKCE` → `getTokenByCode` (with verifier) + +PKCE (Proof Key for Code Exchange) is folded into the same method; supply the code verifier via options. Typically the verifier was produced earlier by `buildAuthorizationUrl` (below), which returns a `codeVerifier` for you to persist. + +```ts +// before +const resp = await auth0.oauth.authorizationCodeGrantWithPKCE({ + code, + code_verifier: verifier, + redirect_uri: "https://app.example.com/callback", +}); + +// after +const tokens = await authClient.getTokenByCode(url, { + codeVerifier: verifier, +}); +``` + +> If you build the authorization URL yourself today, prefer switching to `authClient.buildAuthorizationUrl()` (below) so the SDK generates and returns the `codeVerifier`, then persist it and pass it back to `getTokenByCode`. + +### `oauth.refreshTokenGrant` → `getTokenByRefreshToken` + +```ts +// before +const resp = await auth0.oauth.refreshTokenGrant({ refresh_token: rt }); +// after +const tokens = await authClient.getTokenByRefreshToken({ refreshToken: rt }); +``` + +### `oauth.passwordGrant` → `getTokenByPassword` + +```ts +// before +const resp = await auth0.oauth.passwordGrant({ + username, + password, + realm: "Username-Password-Authentication", + audience, + scope, +}); +// after +const tokens = await authClient.getTokenByPassword({ + username, + password, + realm: "Username-Password-Authentication", + audience, + scope, +}); +``` + +### `oauth.clientCredentialsGrant` → `getTokenByClientCredentials` + +The canonical machine-to-machine grant. This is the most common reason to stay on auth0-auth-js rather than adopt server-js: there is no user session involved. + +```ts +// before +const resp = await auth0.oauth.clientCredentialsGrant({ audience: "https://api.example.com" }); +const token = resp.data.access_token; +// after +const tokens = await authClient.getTokenByClientCredentials({ audience: "https://api.example.com" }); +const token = tokens.accessToken; +``` + +### `oauth.revokeRefreshToken` → `revokeToken` + +Renamed, and simplified return (was `VoidApiResponse`, now `void`). + +```ts +// before +await auth0.oauth.revokeRefreshToken({ token: rt }); +// after +await authClient.revokeToken({ token: rt }); +``` + +> **Session apps:** if you are migrating to server-js and this revoke was part of logout, use `serverClient.revokeRefreshToken()` instead of the low-level `revokeToken`. By default it reads the refresh token from the session; you can also pass an explicit `{ token }` in its options. + +### Build the authorization and logout URLs + +node-auth0 left `/authorize` URL construction to the caller (or to `express-openid-connect`). The new SDK gives you `buildAuthorizationUrl()` and `buildLogoutUrl()`. When migrating a redirect login, replace hand-built `/authorize` and `/v2/logout` URLs with these: + +```ts +const { authorizationUrl, codeVerifier } = await authClient.buildAuthorizationUrl({ + authorizationParams: { redirect_uri, scope: "openid profile email", audience }, +}); +// ... later, on logout: +const logoutUrl = await authClient.buildLogoutUrl({ returnTo: "https://app.example.com" }); +``` + +> Pushed Authorization Requests (PAR): there is no standalone PAR method. Pass `pushedAuthorizationRequests: true` to `buildAuthorizationUrl`: the SDK performs the PAR POST and returns an authorization URL that references the resulting `request_uri`. Requires the tenant to expose a `pushed_authorization_request_endpoint`; the SDK throws if PAR is requested but unsupported. This replaces node-auth0's `oauth.pushedAuthorization`. + +Once the OIDC grants are rewritten and the [cross-cutting breaking changes](#cross-cutting-breaking-changes) are applied, run the [verification checklist](#verification-checklist). If your app also uses database, passwordless, CIBA, token exchange, or `UserInfoClient`, continue with [`authentication-flows.md`](./authentication-flows.md). If you want the SDK to own sessions, see [`server-side-sessions.md`](./server-side-sessions.md). + +### Optional: migrate only OIDC while staying on v6 + +You do not have to migrate everything at once, and you do not have to wait for v7. node-auth0 v6 still ships `AuthenticationClient` alongside `ManagementClient`, so you can move your OIDC login and token grant code off `AuthenticationClient` to `@auth0/auth0-auth-js` now, incrementally, while the rest of the app keeps using `auth0` v6 unchanged. + +A common and fully supported end state: + +- OIDC / token grant code: migrated to `@auth0/auth0-auth-js` (the grants covered in this section). +- Other auth flows you have not gotten to yet: still on `AuthenticationClient` from `auth0` v6. +- Management API: still on `ManagementClient` from `auth0` (never migrates). + +The OIDC grants above are a complete, shippable step on their own; finishing them is a valid stopping point even if you migrate nothing else. Move on to [`authentication-flows.md`](./authentication-flows.md) and [`server-side-sessions.md`](./server-side-sessions.md) later, at your own pace. When you eventually upgrade to v7 (which removes the Authentication API from the main entrypoint; see the [v7 Migration Guide](../v7_MIGRATION_GUIDE.md)), the OIDC work is already done. + +## Cross-cutting breaking changes + +Every call-site rewrite in this guide and on the incremental pages is subject to four changes that cut across all methods. They cause the overwhelming majority of migration defects, and three of the four are *silent*: the code compiles and often runs, but produces wrong behavior at runtime. Apply each one deliberately. + +1. [Return shape: `JSONApiResponse` → domain object](#1-return-shape) +2. [Casing: snake_case wire shape → camelCase](#2-casing) +3. [Token expiry: `expires_in` (relative) → `expiresAt` (absolute)](#3-token-expiry), most dangerous +4. [Error model: `AuthApiError` → typed per-operation errors](#4-error-model) + +### 1. Return shape + +node-auth0 wraps most Authentication API results in a response envelope: + +- `JSONApiResponse`: has `.data` (the payload), `.status` (number), `.statusText`, `.headers` (a `Headers` object). +- `VoidApiResponse`: same envelope, `.data` is `undefined` (used by `sendEmail`, `revokeRefreshToken`, …). +- `TextApiResponse`: `.data` is a `string` (used by `database.changePassword`). + +Exception: `backchannel.authorize`, `backchannel.backchannelGrant`, and `tokenExchange.exchangeToken` return domain objects directly (no `.data` wrapper) in node-auth0. + +The new SDKs drop the envelope and return the domain object directly: + +- Token grants return a `TokenResponse` instance. +- `database.signUp` returns a `SignUpResult` object. +- `database.changePassword` returns a `string`. +- `sendEmail` / `sendSms` / `revokeToken` return `void`. + +HTTP metadata (status code, response headers such as `x-request-id`, `retry-after`, rate-limit headers) is available through the typed error objects on failure paths. On success paths, metadata is available via the opt-in `fullResponse` envelope (see [Reading HTTP response metadata](#reading-http-response-metadata-fullresponse)). It is no longer on the bare success value by default. + +The rewrite: delete `.data` indirection on every success path: + +```ts +// before +const resp = await auth0.oauth.clientCredentialsGrant({ audience }); +const token = resp.data.access_token; +const status = resp.status; + +// after +const tokens = await authClient.getTokenByClientCredentials({ audience }); +const token = tokens.accessToken; +``` + +```ts +// before: changePassword returned TextApiResponse +const resp = await auth0.database.changePassword({ email, connection }); +console.log(resp.data); + +// after: returns the string directly +const message = await authClient.database.changePassword({ email, connection }); +console.log(message); +``` + +> `changePassword` requires `connection` plus at least one of `email` or `username`: either identifier is accepted, not `email` alone. + +#### Reading HTTP response metadata (fullResponse) + +When your node-auth0 code reads HTTP response metadata (status, headers) on a success path, migrate to the opt-in envelope rather than dropping the read. This is most common when you track rate limits, log request IDs, or check retry-after headers for dashboard telemetry. + +```ts +// before (node-auth0): metadata on the success envelope +const resp = await auth0.oauth.clientCredentialsGrant({ audience }); +const remaining = resp.headers.get("x-ratelimit-remaining"); +const token = resp.data.access_token; + +// after: opt in to the envelope, read the native Response +const { data, response } = await authClient.getTokenByClientCredentials({ audience, fullResponse: true }); +const remaining = response.headers.get("x-ratelimit-remaining"); +const token = data.accessToken; +``` + +The same opt-in covers the non-token Authentication API methods that node-auth0 wrapped in a `JSONApiResponse` / `TextApiResponse` / `VoidApiResponse`: + +| Method | Bare return | `fullResponse: true` return | +| --- | --- | --- | +| `database.signUp` | `SignUpResult` | `ApiResponse` | +| `database.changePassword` | `string` | `ApiResponse` | +| `passwordless.sendEmail` | `void` | `ApiResponse` (`data` is `undefined`) | +| `passwordless.sendSms` | `void` | `ApiResponse` (`data` is `undefined`) | + +```ts +// before (node-auth0): read the request id off the signup envelope +const resp = await auth0.database.signUp({ email, password, connection }); +const reqId = resp.headers.get("x-request-id"); + +// after: opt in to the envelope +const { data, response } = await authClient.database.signUp({ email, password, connection, fullResponse: true }); +const reqId = response.headers.get("x-request-id"); + +// void-returning methods expose the Response with an undefined `data` +const { response: sendResp } = await authClient.passwordless.sendEmail({ email, fullResponse: true }); +const rateLimit = sendResp.headers.get("x-ratelimit-remaining"); +``` + +Caveats: + +- Pass `fullResponse: true` as a literal, not a variable. Using spread (`{ ...opts, fullResponse: true }`) widens `true` to `boolean`, causing TypeScript overload resolution to fall back to the bare return type. Fix: pass `{ ...opts, fullResponse: true as const }` or include `fullResponse` as an inline literal in the options object. +- Performance: `@auth0/auth0-auth-js` does not cache tokens: every `AuthClient` grant method performs a live token-endpoint round-trip regardless of `fullResponse`, so the flag adds no extra network cost at this layer. (Token caching and reuse live in `@auth0/auth0-server-js`'s session store, not in the auth-js `AuthClient`.) The only in-memory cache in auth-js is for OIDC discovery / JWKS metadata, which is unrelated to `fullResponse`. +- Reserved headers: a caller `Authorization` header is ignored and the telemetry `Auth0-Client` header always wins; `RequestOptions.headers` cannot override them. +- Per-request `customFetch` replaces the base transport for that call but does not inherit mutual TLS (mTLS). If you rely on mTLS, the supplied fetch must itself be mTLS-capable. + +Default to the bare return type. Reach for `fullResponse` only where you actually consumed response metadata on success: rate-limit dashboards, request-id logging for support investigations, or retry-after handling. `MissingCapturedResponseError` is an internal-bug sentinel; you do not normally catch it. + +Gotchas: + +- **Void methods.** Code that did `const r = await auth0.passwordless.sendEmail(...)` and then checked `r.status === 200` must drop that check: by default the method returns `void` and throws on failure. Rely on the thrown error instead (see [Error model](#4-error-model)). +- **Header reads.** Any code reading `resp.headers.get('x-ratelimit-remaining')` on a success path needs the opt-in `fullResponse` envelope. Error paths still surface metadata on the typed error. Search your code for `.headers` on response values. +- **Do not hand-roll a compatibility shim.** Resist reintroducing a custom `{ data, status }` shape to minimize downstream diff. Let the domain object flow through; the SDK's opt-in `fullResponse` envelope is the sanctioned channel when you genuinely need the HTTP Response. + +### 2. Casing + +node-auth0's public API exposes the snake_case wire shape verbatim, on both inputs and outputs. The new SDKs use camelCase for the public API and only translate to snake_case at the HTTP boundary internally. + +Input parameters, field map: + +| node-auth0 (snake_case) | new SDK (camelCase) | +| --- | --- | +| `client_id` | `clientId` | +| `client_secret` | `clientSecret` | +| `refresh_token` | `refreshToken` | +| `redirect_uri` | (via `authorizationParams.redirect_uri` on config / builder) | +| `code_verifier` | `codeVerifier` | +| `phone_number` | `phoneNumber` | +| `auth_req_id` | `authReqId` | +| `binding_message` | `bindingMessage` | +| `subject_token` / `subject_token_type` | `subjectToken` / `subjectTokenType` | +| `given_name` / `family_name` | `givenName` / `familyName` | +| `user_metadata` | `userMetadata` | +| `login_hint` | `loginHint` | + +Output fields, `TokenResponse` field map: + +| node-auth0 `TokenSet` (snake_case) | new SDK `TokenResponse` (camelCase) | +| --- | --- | +| `access_token` | `accessToken` | +| `refresh_token` | `refreshToken` | +| `id_token` | `idToken` | +| `token_type` | `tokenType` | +| `expires_in` (relative) | `expiresAt` (absolute, see [Token expiry](#3-token-expiry)) | +| `scope` | `scope` | +| (none): had to decode id_token yourself | `claims` (already-decoded ID token claims) | +| `authorization_details` | `authorizationDetails` | + +Rename fields on both the arguments you pass in and the fields you read out: + +```ts +// before +const resp = await auth0.oauth.refreshTokenGrant({ refresh_token: rt }); +const newRt = resp.data.refresh_token; +const idToken = resp.data.id_token; + +// after +const tokens = await authClient.getTokenByRefreshToken({ refreshToken: rt }); +const newRt = tokens.refreshToken; +const idToken = tokens.idToken; +``` + +> **Gotcha: keys that look renamed but are your data.** `user_metadata` → `userMetadata` is a rename of the *SDK's* parameter. The object *inside* it (e.g. `{ plan: 'free' }`) is passed through untouched. Do not rename your own metadata keys. The same applies to `authorization_details`. + +### 3. Token expiry + +**This is the highest-risk change in the migration. It is silent, it compiles, and it corrupts session lifetimes.** + +- node-auth0 `TokenSet.expires_in` = the token's lifetime in seconds relative to now (e.g. `86400` for a 24-hour token). This is the raw OAuth `expires_in` from the wire. +- new SDK `TokenResponse.expiresAt` = an absolute Unix timestamp in seconds (e.g. `1786000000`) computed by the SDK as roughly `now + expires_in`. + +Existing node-auth0 code almost always converts the relative value to an absolute deadline itself: + +```ts +// before: very common node-auth0 pattern +const resp = await auth0.oauth.refreshTokenGrant({ refresh_token: rt }); +const expiresAtMs = Date.now() + resp.data.expires_in * 1000; // stored deadline +``` + +If you mechanically rename `expires_in` → `expiresAt` and leave the arithmetic, you get: + +```ts +// WRONG: double-counts "now" +const tokens = await authClient.getTokenByRefreshToken({ refreshToken: rt }); +const expiresAtMs = Date.now() + tokens.expiresAt * 1000; // ~ now + (now + lifetime) → far future +``` + +The stored deadline lands decades in the future, so the token is treated as valid long after it has actually expired. The app does not refresh it, so production 401s follow. + +The rewrite: `expiresAt` is *already* the deadline. Do not add `Date.now()`: + +```ts +// after: correct +const tokens = await authClient.getTokenByRefreshToken({ refreshToken: rt }); +const expiresAtMs = tokens.expiresAt * 1000; // absolute; convert s → ms only if you store ms +``` + +If downstream code genuinely needs the *relative* remaining lifetime (e.g. to set a cookie `Max-Age`), compute it from the absolute value: + +```ts +const secondsRemaining = tokens.expiresAt - Math.floor(Date.now() / 1000); +``` + +To find every instance, grep your code for these patterns and inspect each by hand: + +- `expires_in` +- `Date.now() +` near a token result +- `+ expires` / `* 1000` near a token result +- any stored field named `expiresAt`, `expires_at`, `expiry`, `tokenExpiry` fed from a grant + +Every one of these is a candidate for the double-count bug. + +> **Session apps get this for free.** If you migrate to server-js, the SDK owns expiry math inside `getAccessToken`. Delete your `Date.now() + expires_in * 1000` bookkeeping entirely. + +### 4. Error model + +node-auth0 throws a single error type for Authentication API failures: + +```ts +class AuthApiError extends Error { + name: "AuthApiError"; + error: string; // OAuth error code, e.g. 'invalid_grant' + error_description: string; + statusCode: number; + body: string; + headers: Headers; +} +``` + +The new SDKs throw typed, operation-specific error classes: `TokenByCodeError`, `TokenByRefreshTokenError`, `TokenByClientCredentialsError`, `TokenByPasswordError`, `TokenExchangeError`, `TokenRevocationError`, `PasswordlessStartError`, `PasswordlessChallengeError`, `PasswordlessDbGetTokenError`, `MfaEnrollmentError`, and so on. Each carries a structured `.cause` (the underlying OAuth2 error) rather than flat `error` / `error_description` strings. + +The rewrite: generic catch: + +```ts +// before +try { + await auth0.oauth.refreshTokenGrant({ refresh_token: rt }); +} catch (e) { + if (e instanceof AuthApiError && e.error === "invalid_grant") { + // refresh token revoked/expired + } +} + +// after +import { TokenByRefreshTokenError } from "@auth0/auth0-auth-js"; +try { + await authClient.getTokenByRefreshToken({ refreshToken: rt }); +} catch (e) { + if (e instanceof TokenByRefreshTokenError && e.cause?.error === "invalid_grant") { + // refresh token revoked/expired + } +} +``` + +Import the specific error class for the operation you are calling. If you had one broad `catch (e instanceof AuthApiError)` around several different operations, either widen to catch each operation's error type or check the shared base behavior. Prefer the specific type per call site, since it documents which operation can fail. + +#### MFA detection: use the type guard, not the string + +Multi-factor authentication (MFA). A very common node-auth0 pattern is detecting `mfa_required` by string comparison to route the user into an MFA challenge: + +```ts +// before +try { + await auth0.oauth.passwordGrant({ username, password }); +} catch (e) { + if (e instanceof AuthApiError && e.error === "mfa_required") { + // start MFA flow using e (mfa_token is in the body) + } +} +``` + +The new SDK provides `isMfaRequiredError()`, a type guard that narrows the error and gives typed access to the MFA context (including the `mfa_token`). Use it instead of matching the string: + +```ts +// after +import { isMfaRequiredError } from "@auth0/auth0-auth-js"; +try { + await authClient.getTokenByPassword({ username, password }); +} catch (e) { + if (isMfaRequiredError(e)) { + // e is narrowed; drive the MFA challenge via authClient.mfa.* + } +} +``` + +> After detecting `mfa_required`, the MFA enroll/challenge/verify flow that node-auth0 handled ad hoc now lives on `authClient.mfa.*` (`listAuthenticators`, `enrollAuthenticator`, `challengeAuthenticator`, `verify`, and `deleteAuthenticator`). In server-js, `serverClient.mfa.verify()` also persists the resulting tokens to the session. + +#### ID-token validation types + +node-auth0 exposed `IDTokenValidateOptions` and `IdTokenValidatorError` for callers doing manual ID-token validation. The new SDK validates ID tokens internally during grants and exposes the decoded, validated result as `TokenResponse.claims`. Replace manual validation: + +- Options like `organization`, `nonce`, `maxAge` are passed to the grant call (e.g. `getTokenByCode`), and the SDK validates them and throws a typed error on mismatch, so you no longer construct a validator or catch `IdTokenValidatorError` yourself. +- Read the validated claims from `TokenResponse.claims` instead of decoding the `id_token` string. + +## Verification checklist + +The migration is not complete until every check passes in a single pass. For every node-auth0 auth call you rewrote (here or on the incremental pages), confirm all four cross-cutting changes: + +- [ ] **Return shape**: removed `.data` / `.status` / `.headers` access on the success path. +- [ ] **Casing**: renamed every snake_case field on input args and output reads to camelCase. +- [ ] **Expiry**: any code using the old `expires_in` now uses `expiresAt` as an *absolute* timestamp; no `Date.now() +` was left in front of it. +- [ ] **Errors**: `AuthApiError` catches replaced with the specific typed error (`.cause.error`); `mfa_required` string checks replaced with `isMfaRequiredError()`. + +Then run the project gates and repeat the whole loop if any step fails: + +- [ ] Grep for residue: unmigrated `from 'auth0'` auth imports, `.data.` reads on auth responses, and relative `expires_in` arithmetic. +- [ ] `tsc --noEmit`: catches structural mismatches and type errors. +- [ ] `npm test` (or the project's test command): confirms behavior is preserved. +- [ ] Run the linter if the project has one configured. +- [ ] Confirm files that use `ManagementClient` still import and call it from `auth0`; that code must be untouched. + +Do not declare the migration complete until the loop converges: all steps pass in a single iteration. + +## Continue the migration + +Once the OIDC grants and the four cross-cutting changes are in, migrate the rest at your own pace. Each area lives in its own page. + +### Other authentication flows + +Database signup, passwordless, backchannel (CIBA), token exchange, and `UserInfoClient` lookups: see [`authentication-flows.md`](./authentication-flows.md). + +### Server-side sessions + +Routing to `@auth0/auth0-server-js`, where the SDK owns the login redirect flow, session storage, cookies, token refresh, and logout: see [`server-side-sessions.md`](./server-side-sessions.md). + +### Troubleshooting + +Common questions and failure modes (tokens valid for decades, missing `resp.data`, magic-link default flip, `getUserInfo`, `mfa_required` detection, global config): see [`troubleshooting.md`](./troubleshooting.md). diff --git a/auth-migration/server-side-sessions.md b/auth-migration/server-side-sessions.md new file mode 100644 index 0000000000..d040e2986b --- /dev/null +++ b/auth-migration/server-side-sessions.md @@ -0,0 +1,163 @@ +# Migrating session apps to `@auth0/auth0-server-js` + +This page is part of the [Authentication Migration Guide](./index.md). Read it only when you are routing to **`@auth0/auth0-server-js`**: when you want the SDK to own the login redirect flow, session storage, cookies, token refresh, and logout, instead of hand-rolling that around node-auth0. If you only need stateless token grants, stay on the main guide and [`authentication-flows.md`](./authentication-flows.md); you do not need this page. + +> **Migrating with an AI agent?** Point it at the Auth0 migration skill (the `auth0` skill in [`auth0/agent-skills`](https://github.com/auth0/agent-skills), migration intent `migrate-node-auth0`). It walks the session lifecycle step by step. + +**This is a rewrite of the session handling, not a method-for-method port.** node-auth0 had no session concept, so there is nothing to translate line-for-line. Instead you *replace* your existing session code (your `express-session` wiring, your token cache, your refresh-on-expiry logic, your logout handler) with the ServerClient lifecycle. You still touch only the auth/session code; routes, views, and business logic stay put. + +- [Mental model](#mental-model) +- [Store setup](#store-setup) +- [The redirect-login lifecycle](#the-redirect-login-lifecycle) +- [Logins without a browser redirect](#logins-without-a-browser-redirect) +- [Backchannel logout](#backchannel-logout) + +## Mental model + +A ServerClient login has three durable pieces: + +1. **Transaction store**: short-lived. Holds the in-flight login: the OAuth `state` and the PKCE (Proof Key for Code Exchange) `code_verifier` between the moment you redirect the user to Auth0 and the moment they come back to your callback. Created at `startInteractiveLogin`, consumed at `completeInteractiveLogin`. +2. **State store**: long-lived. Holds the established session: the user claims plus the access / refresh / ID tokens and their absolute expiry. Read on every subsequent request via `getUser`, `getSession`, `getAccessToken`. +3. **Cookies**: how the two stores key themselves to the browser. With a *stateless* store the session data lives encrypted in the cookie itself; with a *stateful* store the cookie holds only an identifier and the data lives in your backend (Redis, database, and so on). + +node-auth0 exposed none of this; you built equivalents by hand. You are swapping your implementation for the SDK's. + +## Store setup + +`@auth0/auth0-server-js` ships store base classes and cookie-backed implementations: + +- `CookieTransactionStore`: transaction store backed entirely by a cookie. Good default. +- `StatelessStateStore`: session lives encrypted in the cookie. No server-side storage; good for serverless or horizontally-scaled deployments with small sessions. +- `StatefulStateStore`: session lives server-side; the cookie holds an id. Use for large sessions or when you need server-side revocation. +- `AbstractTransactionStore` / `AbstractStateStore`: extend these to back a store with your own storage (Redis, Postgres, and so on). These are the exported base-class names. + +All stores accept a `CookieHandler` so they can integrate with any framework's cookie API. The `storeOptions` generic (`TStoreOptions`) is how you thread per-request context (like the framework `req` / `res`) into store reads and writes; every ServerClient method takes an optional trailing `storeOptions` argument for exactly this. + +```ts +import { ServerClient, CookieTransactionStore, StatelessStateStore } from "@auth0/auth0-server-js"; + +const serverClient = new ServerClient({ + domain: process.env.AUTH0_DOMAIN!, + clientId: process.env.AUTH0_CLIENT_ID!, + clientSecret: process.env.AUTH0_CLIENT_SECRET!, + authorizationParams: { + redirect_uri: "https://app.example.com/callback", + scope: "openid profile email offline_access", // offline_access ⇒ refresh token + audience: "https://api.example.com", + }, + transactionStore: new CookieTransactionStore( + { secret: process.env.SESSION_SECRET! }, + cookieHandler, // CookieHandler implementation + ), + stateStore: new StatelessStateStore( + { secret: process.env.SESSION_SECRET! }, + cookieHandler, // CookieHandler implementation + ), +}); +``` + +## The redirect-login lifecycle + +### 1. Start login: replace the hand-built `/authorize` redirect + +Whatever you did to send the user to Auth0 (a hand-constructed `/authorize` URL, or `express-openid-connect`'s `/login`) becomes: + +```ts +// GET /login +app.get("/login", async (req, res) => { + const authorizationUrl = await serverClient.startInteractiveLogin( + { + authorizationParams: { + /* optional per-login overrides */ + }, + appState: { returnTo: req.query.returnTo || "/" }, // seed appState for round-trip + }, + { req, res }, // storeOptions: lets the transaction store write its cookie + ); + res.redirect(authorizationUrl.href); +}); +``` + +`startInteractiveLogin` generates `state` and PKCE, writes them to the transaction store, and returns the fully-formed authorization URL. + +### 2. Complete login: replace the manual code exchange + +The callback handler that used to call `oauth.authorizationCodeGrant` (or `authorizationCodeGrantWithPKCE`) and then stuff tokens into the session becomes a single call: + +```ts +// GET /callback +app.get("/callback", async (req, res) => { + const callbackUrl = new URL(req.url, `https://${req.headers.host}`); + const { appState } = await serverClient.completeInteractiveLogin(callbackUrl, { req, res }); + // Session is now established in the state store. Tokens are NOT your concern anymore. + res.redirect(appState?.returnTo ?? "/"); +}); +``` + +`completeInteractiveLogin` validates `state`, exchanges the code, validates the ID token, writes the session (user + tokens + absolute expiry) to the state store, and clears the transaction. + +### 3. Read the user or session on later requests + +Replace `req.session.user` reads: + +```ts +const user = await serverClient.getUser({ req, res }); // user claims, or undefined +const session = await serverClient.getSession({ req, res }); // full session data, or undefined +``` + +`getUser` / `getSession` return `undefined` when there is no session or it has expired (the store deletes expired sessions on read), so use that as your "not logged in" signal. + +### 4. Get an access token to call an API: refresh is automatic + +Replace your manual "is the token expired? if so refresh" block: + +```ts +const { accessToken } = await serverClient.getAccessToken({ req, res }); +// If the stored access token is expired and a refresh token exists, +// the SDK refreshes and persists the new tokens transparently. +``` + +This is where the `expires_in` → `expiresAt` hazard disappears entirely: the SDK owns expiry math. For a downstream federated connection token (Token Vault), use `serverClient.getAccessTokenForConnection({ connection }, { req, res })`. + +### 5. Logout: replace manual revoke, session clear, and `/v2/logout` redirect + +```ts +// GET /logout +app.get("/logout", async (req, res) => { + const logoutUrl = await serverClient.logout({ returnTo: "https://app.example.com" }, { req, res }); + res.redirect(logoutUrl.href); +}); +``` + +`logout` clears the session from the state store and returns the Auth0 `/v2/logout` URL. If you also revoked the refresh token on logout (via `oauth.revokeRefreshToken`), call `serverClient.revokeRefreshToken({ req, res })` before redirecting; by default it reads the refresh token from the session, so you do not handle the raw token yourself (it also accepts an explicit `{ token }` if you need to revoke a specific one). + +## Logins without a browser redirect + +Some logins do not use a browser redirect: the password grant, passwordless, CIBA, and custom token exchange. If you used node-auth0 for one of these *and* want a server-js session out of it, use the ServerClient methods that both authenticate and write the session, rather than the low-level auth-js grants: + +| Flow | ServerClient method | +| --- | --- | +| Backchannel / CIBA | `loginBackchannel({ ... }, storeOptions)` | +| Passwordless (send) | `startPasswordless({ connection, email \| phoneNumber, ... }, storeOptions)` | +| Passwordless (verify code → session) | `completePasswordless({ connection, email \| phoneNumber, verificationCode }, storeOptions)` | +| Passwordless magic link (callback → session) | `completePasswordlessMagicLink(url, storeOptions)` | +| Custom token exchange → session | `loginWithCustomTokenExchange({ ... }, storeOptions)` | +| MFA verify → session | `serverClient.mfa.verify({ ... }, storeOptions)` | + +Each of these performs the underlying grant *and* persists the resulting tokens to the state store, so the user is logged in afterward, exactly the behavior you previously wrote by hand after a node-auth0 grant. + +## Backchannel logout + +If you implemented an Auth0 back-channel logout endpoint by hand (validating the logout token, then clearing your session store), replace it with: + +```ts +// POST /backchannel-logout +app.post("/backchannel-logout", async (req, res) => { + await serverClient.handleBackchannelLogout(req.body.logout_token, { req, res }); + res.sendStatus(204); +}); +``` + +It validates the logout token and clears the corresponding session. + +When the session layer is wired, return to the [verification checklist](./index.md#verification-checklist) in the main guide. diff --git a/auth-migration/troubleshooting.md b/auth-migration/troubleshooting.md new file mode 100644 index 0000000000..334a37a698 --- /dev/null +++ b/auth-migration/troubleshooting.md @@ -0,0 +1,32 @@ +# Troubleshooting: FAQ and gotchas + +Common questions and failure modes when migrating off the `auth0` package's Authentication API. This page is part of the [Authentication Migration Guide](./index.md); it assumes the terms defined there. + +> **Migrating with an AI agent?** Point it at the Auth0 migration skill (the `auth0` skill in [`auth0/agent-skills`](https://github.com/auth0/agent-skills), migration intent `migrate-node-auth0`). + +### Do I have to migrate everything at once? +No. The OIDC / token-grant work is a complete, shippable step on its own. You can stay on `auth0` v6 and migrate only OIDC, leaving other auth flows on `AuthenticationClient` for now. See [Optional: migrate only OIDC while staying on v6](./index.md#optional-migrate-only-oidc-while-staying-on-v6). + +### Do I have to migrate the Management API too? +No. `ManagementClient` is out of scope and stays on the `auth0` package. A file importing both `auth0` (for management) and `@auth0/auth0-auth-js` (for authentication) is correct. + +### auth0-auth-js or auth0-server-js: which do I pick? +Default to auth0-auth-js for a low-risk parity migration. Pick auth0-server-js only when you want the SDK to own the login redirect flow, session storage, cookies, refresh, and logout. See [Choosing your target SDK](./index.md#choosing-your-target-sdk). + +### My tokens suddenly look valid for decades. What happened? +You almost certainly left `Date.now() +` in front of `expiresAt`. `expiresAt` is already an absolute Unix timestamp, not a relative lifetime. See [Token expiry](./index.md#3-token-expiry). + +### Where did `resp.data` go? +The new SDKs return the domain object directly. Read `tokens.accessToken`, not `resp.data.access_token`. If you truly need HTTP response metadata on a success path, opt into `fullResponse`. + +### My magic-link passwordless flow stopped sending links. +The `send` default changed from `'link'` (node-auth0) to `'code'` (new SDK). Set `send: 'link'` explicitly if you want magic links. See [Passwordless](./authentication-flows.md#passwordless). + +### Where is `getUserInfo`? +Prefer `TokenResponse.claims`; they are already decoded and validated, with no extra round-trip. For an arbitrary access token, use `authClient.getUserInfo({ accessToken })`. In a session app, use `serverClient.getUser()`. See [UserInfoClient](./authentication-flows.md#userinfoclient). + +### Can I still set a global `headers` / `timeout` / `agent` on the client? +Not on the constructor. Move them to the per-call `RequestOptions` argument (`headers`, `signal: AbortSignal.timeout(ms)`) or wrap `customFetch`. + +### How do I detect `mfa_required` now? +Use the `isMfaRequiredError()` type guard, not a string comparison. It narrows the error and exposes the `mfa_token`. Drive the challenge via `authClient.mfa.*`. See [Error model](./index.md#4-error-model). diff --git a/v6_MIGRATION_GUIDE.md b/v6_MIGRATION_GUIDE.md new file mode 100644 index 0000000000..d1eb6bd699 --- /dev/null +++ b/v6_MIGRATION_GUIDE.md @@ -0,0 +1,158 @@ +# V6 Migration Guide + +A guide to migrating the Auth0 Node.js SDK from `5.x` to `6.x`. + +- [Overall changes](#overall-changes) +- [Breaking changes](#breaking-changes) + - [ConnectionAttributeIdentifier replaced with identifier-specific types](#connectionattributeidentifier-replaced-with-identifier-specific-types) + - [PhoneProviderProtectionBackoffStrategyEnum value change](#phoneproviderprotectionbackoffstrategyenum-value-change) + - [users.federatedConnectionsTokensets removed](#usersfederatedconnectionstokensets-removed) + - [federated_connections_access_tokens removed from connection options](#federated_connections_access_tokens-removed-from-connection-options) + +## Overall changes + +V6 addresses type correctness for database connection attribute identifiers, aligns the phone provider backoff strategy enum with the updated API, and removes the federated connections tokensets user sub-client. There are no changes to the Authentication API — any code written for the Authentication API in `5.x` will continue to work in `6.x`. + +## Breaking changes + +### ConnectionAttributeIdentifier replaced with identifier-specific types + +In v5, all three attribute identifiers (email, phone number, and username) shared a single `ConnectionAttributeIdentifier` type for their `identifier` field. This was incorrect — each identifier type supports different values for `default_method`. + +In v6, `ConnectionAttributeIdentifier` has been removed and replaced with three separate types: + +| Attribute | Old type | New type | `default_method` values | +| -------------- | ------------------------------- | ----------------------------- | ----------------------------- | +| `email` | `ConnectionAttributeIdentifier` | `EmailAttributeIdentifier` | `"password"` \| `"email_otp"` | +| `phone_number` | `ConnectionAttributeIdentifier` | `PhoneAttributeIdentifier` | `"password"` \| `"phone_otp"` | +| `username` | `ConnectionAttributeIdentifier` | `UsernameAttributeIdentifier` | _(no `default_method`)_ | + +**Before (v5):** + +```ts +import { Management } from "auth0"; + +const identifier: Management.ConnectionAttributeIdentifier = { + active: true, + default_method: "email_otp", +}; +``` + +**After (v6):** + +```ts +import { Management } from "auth0"; + +// For email attribute +const emailIdentifier: Management.EmailAttributeIdentifier = { + active: true, + default_method: "email_otp", +}; + +// For phone_number attribute +const phoneIdentifier: Management.PhoneAttributeIdentifier = { + active: true, + default_method: "phone_otp", +}; + +// For username attribute (no default_method) +const usernameIdentifier: Management.UsernameAttributeIdentifier = { + active: true, +}; +``` + +If you were using `ConnectionAttributeIdentifier` as a type annotation in your own code, update it to the appropriate identifier-specific type based on which attribute it applies to. + +--- + +### PhoneProviderProtectionBackoffStrategyEnum value change + +The `PhoneProviderProtectionBackoffStrategyEnum` enum has been updated to reflect a change in the Auth0 API. The `None` variant has been renamed to `Default`, and its string value has changed from `"none"` to `"default"`. + +**Before (v5):** + +```ts +import { Management } from "auth0"; + +const strategy = Management.PhoneProviderProtectionBackoffStrategyEnum.None; // "none" +``` + +**After (v6):** + +```ts +import { Management } from "auth0"; + +const strategy = Management.PhoneProviderProtectionBackoffStrategyEnum.Default; // "default" +``` + +If you were passing this value directly as a string `"none"`, update it to `"default"` to match the updated API. + +--- + +### users.federatedConnectionsTokensets removed + +The `client.users.federatedConnectionsTokensets` sub-client has been removed. This includes the `list()` and `delete()` methods. + +**Before (v5):** + +```ts +// List active federated connection tokensets for a user +const tokensets = await client.users.federatedConnectionsTokensets.list("user_id"); + +// Delete a tokenset +await client.users.federatedConnectionsTokensets.delete("user_id", "tokenset_id"); +``` + +**After (v6):** + +These methods are no longer available. Remove any calls to `client.users.federatedConnectionsTokensets` from your code. + +--- + +### federated_connections_access_tokens removed from connection options + +The `federated_connections_access_tokens` field has been removed from all connection option types, including create and update. This affects OIDC, Azure AD, Google Apps, and other connection strategies. Remove it from any create or update payloads. + +**Before (v5):** + +```ts +// On create +await client.connections.create({ + strategy: "oidc", + name: "my-connection", + options: { + federated_connections_access_tokens: { ... }, + // other options + }, +}); + +// On update +await client.connections.update("connection_id", { + options: { + federated_connections_access_tokens: { ... }, + // other options + }, +}); +``` + +**After (v6):** + +```ts +// On create +await client.connections.create({ + strategy: "oidc", + name: "my-connection", + options: { + // remove federated_connections_access_tokens + // other options + }, +}); + +// On update +await client.connections.update("connection_id", { + options: { + // remove federated_connections_access_tokens + // other options + }, +}); +``` diff --git a/v7_MIGRATION_GUIDE.md b/v7_MIGRATION_GUIDE.md new file mode 100644 index 0000000000..d1dba04a5c --- /dev/null +++ b/v7_MIGRATION_GUIDE.md @@ -0,0 +1,146 @@ +# V7 Migration Guide + +A guide to migrating the Auth0 Node.js SDK from `6.x` to `7.x`. + +> **Migrating with an AI agent?** Point it at the Auth0 migration skill first. The skill lives in [`auth0/agent-skills`](https://github.com/auth0/agent-skills) as the `auth0` skill (migration intent: `migrate-node-auth0`). It encodes the authentication-layer rewrite rules and a verify loop. + +- [Overall changes](#overall-changes) +- [Breaking changes](#breaking-changes) + - [Authentication API removed from the main entrypoint](#authentication-api-removed-from-the-main-entrypoint) + - [Removed exports](#removed-exports) + - [ManagementClient mTLS requires an explicit `fetch`](#managementclient-mtls-requires-an-explicit-fetch) + - [mTLS works with both client secret and client assertion](#mtls-works-with-both-client-secret-and-client-assertion) + - [`domain` must be a bare hostname](#domain-must-be-a-bare-hostname) + - [Token acquisition failures throw `ManagementError`](#token-acquisition-failures-throw-managementerror) + - [`uuid` dependency removed](#uuid-dependency-removed) +- [Migrating authentication code](#migrating-authentication-code) +- [Staying on the legacy entrypoint](#staying-on-the-legacy-entrypoint) + +## Overall changes + +V7 makes `node-auth0` a **Management-API-only SDK**. The Authentication API layer (`AuthenticationClient`, its sub-clients, and `UserInfoClient`) has been removed from the main entrypoint. `ManagementClient` continues to work exactly as before; it now acquires its internal token directly via the client credentials grant rather than through the removed authentication layer. + +If your code only uses `ManagementClient`, the upgrade is small: address the Management-side breaking changes below (mTLS, domain validation, error type) and you are done. If your code uses `AuthenticationClient` or `UserInfoClient`, that code must move to a dedicated package; see [Migrating authentication code](#migrating-authentication-code). + +## Breaking changes + +### Authentication API removed from the main entrypoint + +`AuthenticationClient` and `UserInfoClient` are no longer exported from the `auth0` main entrypoint. The stateless authentication layer now lives in [`@auth0/auth0-auth-js`](https://github.com/auth0/auth0-auth-js), and the server-managed session layer lives in [`@auth0/auth0-server-js`](https://github.com/auth0/auth0-auth-js/tree/main/packages/auth0-server-js). + +**Before (v6):** + +```ts +import { AuthenticationClient, UserInfoClient } from "auth0"; + +const auth = new AuthenticationClient({ domain, clientId, clientSecret }); +const tokens = await auth.oauth.clientCredentialsGrant({ audience }); +``` + +**After (v7):** + +```ts +import { AuthClient } from "@auth0/auth0-auth-js"; + +const auth = new AuthClient({ domain, clientId, clientSecret }); +const tokens = await auth.getTokenByClientCredentials({ audience }); +``` + +The complete method-by-method mapping, the four cross-cutting behavior changes (return shape, casing, token expiry, error model), and the session-app wiring are documented in the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). This guide does not repeat that detail. + +If you need the old clients unchanged as a stopgap, they still ship from the [legacy entrypoint](#staying-on-the-legacy-entrypoint). + +### Removed exports + +The following symbols were exported from the main entrypoint in v6 and are removed in v7. Each moves to `@auth0/auth0-auth-js`, or remains available from the `auth0/legacy` entrypoint at its v4.x shape. + +| Removed export (v6) | Replacement in v7 | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `AuthenticationClient` | `AuthClient` from `@auth0/auth0-auth-js` | +| `UserInfoClient` | `AuthClient.getUserInfo()` from `@auth0/auth0-auth-js`, or read `TokenResponse.claims` | +| `AuthApiError` | Per-operation typed errors from `@auth0/auth0-auth-js` (`TokenByCodeError`, `TokenByRefreshTokenError`, …); use their `.cause` | +| `AuthenticationClientOptions` | `AuthClientOptions` from `@auth0/auth0-auth-js` | +| `IDTokenValidateOptions` | Validation is internal to the grant call; pass `organization` / `nonce` / `maxAge` to the grant and read `TokenResponse.claims` | +| `IdTokenValidatorError` | Thrown internally by the grant as a typed error on claim mismatch | +| `TokenSet` | `TokenResponse` from `@auth0/auth0-auth-js` (camelCase fields; `expiresAt` is absolute) | +| `SUBJECT_TOKEN_TYPES` | Pass the token-type URN string directly to `exchangeToken` in `@auth0/auth0-auth-js` | +| `UserInfoResponse` | Return type of `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | +| `UserInfoError` | Typed error from `AuthClient.getUserInfo()` in `@auth0/auth0-auth-js` | +| `ResponseError` | Management API calls throw `ManagementError` | +| `FetchError` | Management API calls throw `ManagementError` | +| `JSONApiResponse` | Responses return the data directly (no wrapper) | + +`ManagementClient`, the `Management` namespace, and `ManagementError` are unchanged and still exported. + +### ManagementClient mTLS requires an explicit `fetch` + +A `ManagementClient` constructed with `useMTLS: true` must now supply an explicit `fetch` option carrying the client certificate. The client throws at construction if `useMTLS` is set without a `fetch`. Previously a missing fetch surfaced as silent `401`s at request time; failing at construction makes the misconfiguration obvious. + +The token endpoint automatically uses the `mtls.{domain}` host when `useMTLS` is enabled. + +```ts +// v7: throws at construction if `fetch` is omitted +const mgmt = new ManagementClient({ + domain, + clientId, + clientSecret, + useMTLS: true, + fetch: mtlsCapableFetch, // now required +}); +``` + +### mTLS works with both client secret and client assertion + +`useMTLS` works with both `clientSecret` and `clientAssertionSigningKey`. mTLS (RFC 8705) is a transport-layer concern: the TLS client certificate yields a certificate-bound token regardless of which client authentication method is used. An explicit `fetch` option is always required when `useMTLS` is set. + +### `domain` must be a bare hostname + +`domain` must be a bare host such as `tenant.us.auth0.com`. A value that is empty, or that contains a scheme, a path, a query string, a fragment, credentials (`@`), or whitespace, now throws at construction instead of producing malformed request URLs later. The check applies to every authentication mode (`token`, `clientSecret`, and `clientAssertionSigningKey`), and to `createManagementAuth` and `TokenProvider` as well as `ManagementClient`. + +```ts +// throws in v7 +new ManagementClient({ domain: "https://tenant.us.auth0.com/", ... }); +// correct +new ManagementClient({ domain: "tenant.us.auth0.com", ... }); +``` + +### Token acquisition failures throw `ManagementError` + +When the internal client-credentials token request fails, the client now throws a `ManagementError` (previously a plain `Error`). The error carries `statusCode` and a parsed `body` with the OAuth error details. A request that exceeds the 10-second timeout throws `ManagementError` with status `408`. + +```ts +import { ManagementError } from "auth0"; + +try { + await mgmt.users.getAll(); +} catch (e) { + if (e instanceof ManagementError) { + console.error(e.statusCode, e.body); + } +} +``` + +### `uuid` dependency removed + +The `uuid` package is no longer a dependency. If your project imported `uuid` transitively through `auth0`, add it to your own `dependencies`. + +## Migrating authentication code + +If your app calls `AuthenticationClient` or `UserInfoClient`, follow the dedicated [Authentication Migration Guide](https://github.com/auth0/node-auth0/tree/master/auth-migration). Start with [`auth-migration/index.md`](https://github.com/auth0/node-auth0/blob/master/auth-migration/index.md) for the OIDC token grants section; the incremental flow, session, and troubleshooting pages live in the same [`auth-migration/`](https://github.com/auth0/node-auth0/tree/master/auth-migration) directory. It covers: + +- Choosing between `@auth0/auth0-auth-js` (stateless token grants) and `@auth0/auth0-server-js` (server-managed sessions). +- The complete method-by-method API mapping for `.oauth`, `.database`, `.passwordless`, `.backchannel`, `.tokenExchange`, and `UserInfoClient`. +- The four cross-cutting behavior changes: return shape (envelope dropped), casing (snake_case → camelCase), token expiry (`expires_in` relative → `expiresAt` absolute, a silent high-risk change), and the typed error model with `isMfaRequiredError()`. +- Wiring the `auth0-server-js` session lifecycle when you want the SDK to own login, cookies, refresh, and logout. + +The Management API is explicitly out of scope in that guide: a file that keeps using `ManagementClient` from `auth0` while importing `@auth0/auth0-auth-js` for authentication is correct and expected. + +## Staying on the legacy entrypoint + +If you cannot migrate the authentication code immediately, the `auth0/legacy` entrypoint still ships `AuthenticationClient` and `UserInfoClient` at their v4.x configuration format and method signatures. This is a stopgap, not a destination; the legacy shapes differ from the current API and will not receive new features. + +```ts +import { AuthenticationClient } from "auth0/legacy"; +``` + +Plan the move to `@auth0/auth0-auth-js` / `@auth0/auth0-server-js` rather than treating the legacy entrypoint as permanent.