-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix @types/auth0 inconsistencies with this library #572
Comments
Thanks @vicary for raising the issue. Let me talk with the team about the possibility of bringing the types into this library. |
I just came across this myself by tracing through the code and noticing the hidden extra param. At the very least, could someone move on updating the docs where they are? Moving them here would be great, but sounds less quick. |
We the community may trace out types (i.e. |
Thanks @vicary and @franklin-ross for raising visibility. We agree that maintaining the types in this library is the correct path. Let me discuss with the team on the best path forward for migration. |
forwardedFor
options
Another mismatch is the |
@danawoodman I think your issue should be tracked separately, yours could be a documentation mismatch, or a genuine implementation mistake. This issue is about TypeScript types matching the current codebase AND documentations, not the other way around. |
I noticed a few others: |
Thanks for continuing to raise these discrepancies @franklin-ross. We've had conversations within the team and we do want to take ownerships of these types. Not sure what that looks like yet and it's a matter of prioritization; as soon as we have an update to share, we'll post it here. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇♂️ |
Pinging @davidpatrick because this should not be stale. |
We miss Organizations types. Please add to ether |
any estimation for adding Organization types? |
In the meantime, you can augment the DefinitelyTyped definitions with a module in your own codebase, i.e. import * as auth0 from "auth0";
declare module "auth0" {
/**
* @see https://auth0.com/docs/api/management/v2/#!/Organizations/get_organizations
* @see https://auth0.github.io/node-auth0/module-management.OrganizationsManager.html
*/
export interface OrganizationsManager {
getEnabledConnections({
id: string,
}): Promise<
Array<{
connection_id: string;
assign_membership_on_login: boolean;
connection: {
name: string;
strategy: string;
};
}>
>;
}
export interface ManagementClient {
organizations: OrganizationsManager;
}
} Realistically, I don't have time to help out with all of these definitions but am happy to help out with what I can. We really just need some clarity from Auth0 on how and when the TypeScript support for this library evolves. From all of us on this thread, thank you in advance for your efforts around prioritization! |
Sorry for asking again, but any news on the organization types? This really slows us down 😞 If at least we had some idea when we can expect the types to be implemented so we could decide if we should do it ourselves or wait for the official types. Or does anyone in this thread maybe have an implementation that we could use as a basis? |
Support for Organizations has been added as part of |
That's very good news @frederikprijck! Thank you very much to you and everyone who was involved in delivering the Organizations API support. |
Support fot UserManager in @types/auth0 for nodejs currently only organizations is available Example
|
Any update here or ETA? Is this still in the backlog or prioritized to have this worked soon? |
+1. Is this prioritized in the backlog? |
+1 for this. Having some typing issues especially on |
Please add the types in this repo. i have to check if a user is in an organisation and it's a pain to do it without this function: https://auth0.github.io/node-auth0/UsersManager.html#getUserOrganizations |
@kkomelin is right:
|
@jonasschultheiss I needed |
@frederikprijck could you please share an update on typings for Seems like this issue has been opened for almost 2 years, and yet there are many typings missing, e.g. management.regenerateRecoveryCode. |
Hi @alejandromcsd - thanks for your feedback. This library still relies on the DefinitelyTyped for it's types, and we currently don't have a timeline on when that may change. We'll update this thread when we have any news. |
I'm looking for types for action functions, specifically the parameters. For example:
Does anyone have proper types for action functions like these? Or even a stab at them? |
Not sure if this helps or if it should be the route to take but it seems since Typescript 3.7 the compiler can generate the types from JS files with jsdoc params. Fortunately this library has some quite good jsdocs, so I tried it and I've to say that I am impressed by the results: Here are the changes https://github.com/auth0/node-auth0/compare/master...jfromaniello:node-auth0:with_types?expand=1 As you can notice I didn't add the types to the repo, just added a You can try it out with |
@jfromaniello This is definitely an interesting approach! But after installing your fork I found that intermediate types are not nearly enough, for example we heavily relies on a generic type I would suggest a hybrid approach, where methods in |
@vicary yes, I think that's a better idea 👍🏽 |
We could also put some of these types from @types/auth0 like /**
* @typedef { import("./types").AppMetadata } AppMetadata
* @typedef { import("./types").UserMetadata } UserMetadata
* @typedef { import("./types").UserData } UserData
*/ and use these types in the jsdocs: /**
....
* @param {object} params The user data object..
* @param {string} params.id The user id.
* @param {AppMetadata} metadata New user metadata.
* @param {Function} [cb] Callback function
* @returns {Promise|undefined}
*/
updateUserMetadata(...args) { |
@jfromaniello This looks promising! |
@vicary I added just |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇♂️ |
@jfromaniello @Widcket FWIW this fork https://github.com/jfromaniello/node-auth0 is 41 commits behind upstream. We're a few years on now from when the original discussion was started on the community site, and we (customers) still lack up to date TypeScript types for the first-class API for auth0. Please advise. |
Thanks for raising this @shellscape - we are actively developing a TypeScript version of this library and we hope to have a Beta out in the next few weeks. You can follow the progress in the |
@adamjmcgrath thanks for the update. would it be possible to have your team publish the beta to a dist-tag as work is done?
A tagged alpha release would be preferable, but we can fall back to forking and publishing to a scope if absolutely necessary. (I thought that perhaps a github dependency might work but the branch isn't setup for that) |
Thanks @shellscape - we'll publish a beta as soon as it's available, we don't publish anything on npm before that - but you can publish your own under a scope or use a tarball in the interim.
You could probably also do this if you setup typescript to transpile |
I'm pleased to report that the Beta of v4 is now available. This has been rewritten in TypeScript and has full type coverage of Auth0's Management and Authentication APIs. Closing this thread in favour of #859 |
thanks for the update |
@adamjmcgrath Thanks the auth0 team for making it happen! |
|
Thanks for reporting this @vicary - this should be resolved in |
Describe the problem
Relocated from community forum (53190).
From earlier technical support enquiries I know that the SDK method
ManagementClient#passwordGrant()
in fact takes an undocumented second argument{ forwardedFor }
to sent theAuth0-Forwarded-For
header. Since server-side authentication requires the option to prevent blocking, I would like to know if there are plans to add the definition in the official SDK documentation?The TypeScript/DefinitelyTyped community is confused about this and I think we need official comments to move on.
What was the expected behavior?
https://auth0.github.io/node-auth0 and
@types/auth0
should reflects the implemented features and actual behaviour of this repo.Reproduction
npm install @types/auth0
Environment
The text was updated successfully, but these errors were encountered: