You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm submitting a ...
[X] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
While developing it also comes across as problematic. Using permit.api.roles.create is the one I came across so far, if I Go to Definition in VS Code I get:
/** * Creates a new role. * * @param roleData The data for the new role. * @returns A promise that resolves to the created role. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */asynccreate(roleData){awaitthis.ensureAccessLevel(context_1.ApiKeyLevel.ENVIRONMENT_LEVEL_API_KEY);awaitthis.ensureContext(context_1.ApiContextLevel.ENVIRONMENT);try{return(awaitthis.roles.createRole(Object.assign(Object.assign({},this.config.apiContext.environmentContext),{roleCreate: roleData}))).data;}catch(err){this.handleApiError(err);}}
Unfortunately, that has no type information available for me to inspect roleData or the return type.
If I instead do Go to Type Definition, I get only the return type RoleRead pulled up, which doesn't take me to the type of create nor show RoleCreate. The only way to navigate there is to instead use Go to Implementations, which I've never had to do before
Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
Ideally one could navigate to the type definition as expected.
I'm submitting a ...
[X] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
According to https://arethetypeswrong.github.io/?p=permitio%402.4.1 there appears to be TS issues.
While developing it also comes across as problematic. Using
permit.api.roles.create
is the one I came across so far, if IGo to Definition
in VS Code I get:Unfortunately, that has no type information available for me to inspect
roleData
or the return type.If I instead do
Go to Type Definition
, I get only the return typeRoleRead
pulled up, which doesn't take me to the type ofcreate
nor showRoleCreate
. The only way to navigate there is to instead useGo to Implementations
, which I've never had to do beforeIdeally one could navigate to the type definition as expected.
EDIT: The tsconfig.json is targeting a much lower version than expected, so generally out of date https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping. Ideally this should be targeting ES2022 as node 16 is EOL.
The text was updated successfully, but these errors were encountered: