-
Notifications
You must be signed in to change notification settings - Fork 317
Open
Labels
bugThis points to a verified bug in the codeThis points to a verified bug in the code
Description
Checklist
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
When upgrading existing code to the latest SDK (5.x) version there were multiple occasions where I was referencing incorrect fields, but the typescript compiler did not complain because the return types have very broad type definitions:
/** Accepts any additional properties */
[key: string]: any;One example:
node-auth0/src/management/api/types/types.ts
Lines 20656 to 20657 in 6a0be4b
| /** Accepts any additional properties */ | |
| [key: string]: any; |
The correct definitions should be tight enough that when there are changes to the API, the developer will know from the typescript compiler alone that their code is referencing properties which do not exist.
Reproduction
- Create a query e.g.
// EXAMPLE 1
const { data } = await auth0Client.users.list()
const val = data[0].invalidPropertyThatDoesNotComplain
// EXAMPLE 2
const exportJobInfo = await auth0Client.jobs.usersExports.create({
connection_id: process.env.AUTH_CONNECTION_ID,
format: 'json'
})
const exportJobId = exportJobInfo.invalidPropertyThatDoesNotComplain.id- Observe as the typescript compiler does not indicate that the fields are not valid
Additional context
No response
node-auth0 version
5.3.0
Node.js version
v22.22.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugThis points to a verified bug in the codeThis points to a verified bug in the code