chore(v7): remove dead exports and unreachable telemetry middleware - #1397
Open
tusharpandey13 wants to merge 2 commits into
Open
chore(v7): remove dead exports and unreachable telemetry middleware#1397tusharpandey13 wants to merge 2 commits into
tusharpandey13 wants to merge 2 commits into
Conversation
Cleanup follow-up to the auth-separation work, which orphaned several public exports and a middleware hook. - Remove the dead ResponseError and FetchError classes from src/lib/errors.ts and JSONApiResponse from src/lib/models.ts. These were exported from the package entrypoint but no longer back any live code path after the auth layer was removed. Removing public exports is breaking, so this must land within v7. TimeoutError stays: it is still used by the retry path. - Remove the unreachable pre() middleware hook from Auth0ClientTelemetry and drop the now-unused Middleware/FetchParams/RequestContext imports and the 'implements Middleware' clause. The middleware pipeline was dismantled by the auth-separation; only getAuth0ClientHeader() is still called. The class is internal-only (never re-exported), so this is not a contract change. - Add a test asserting Management API requests route through a user-supplied fetch option, and document the fetch option in the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
These low-level HTTP wrapper types were removed from the public API in this PR but had no migration coverage. Document them in the error-handling section so consumers upgrading from v6 know what replaced them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
Reviewer notes (beyond the description)Points that are not obvious from the diff:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Cleanup follow-up to the v7 auth-separation work (#1390), which orphaned several public exports and a middleware hook. Tracked in the deferred-items comment on #1390.
See #1390 (comment)
Remove dead exports (breaking, must land within v7):
ResponseErrorandFetchError(src/lib/errors.ts) andJSONApiResponse(src/lib/models.ts) were exported from the package entrypoint but no longer back any live code path after the auth layer was removed.TimeoutErroris kept: it is still used by the retry path (src/lib/retry.ts).Remove unreachable telemetry middleware:
pre()hook onAuth0ClientTelemetryis dead after the middleware pipeline was dismantled. Removed it along with the now-unusedMiddleware/FetchParams/RequestContextimports and theimplements Middlewareclause. OnlygetAuth0ClientHeader()is still called (fromauth-helpers.ts). The class is internal-only (never re-exported), so this is not a public-contract change.Document and test the
fetchoption:fetchis already a typed public option onManagementClient(inherited from the base client, not excluded by the optionsOmit). Added a test asserting Management API requests actually route through a user-suppliedfetch, and documented the option in the README.Notes / out of scope
Middleware/FetchParams/RequestContextremain public (they backConfiguration.middleware). Deciding whether to remove that surface too is a separate call.Testing
tsc --noEmitclean.management-client-fetch-optiontest.🤖 Generated with Claude Code