-
Notifications
You must be signed in to change notification settings - Fork 30
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
Export Generated Types #252
Comments
@peintnermax can you please have a look at this |
@wodka can you describe a little better what you try to achieve? How are you importing the types right now? |
@peintnermax I would like to consume the generated types from the package as part of my implementation. // this is the path where the file resides, but cannot import it
// import { Profile } from '@zitadel/node/dist/commonjs/api/generated/zitadel/user'
// this would be a nice import path that decides itself between commonjs and esm
// import { Profile } from '@zitadel/node/api/generated/zitadel/user'
function somewhere() {
const response = await this.zitadel.getForOrg(user.zitadelResourceOwner).getHumanProfile({ userId: user.zitadel });
return new UserDto(user, response.profile!);
}
class UserDto {
constructor(user: UserEntity, p: Profile) {
// beeing able to use the typed data in here!
}
} currently I am adding a copy of the zitadel profile type in my own code base, but it would be great to be able to use it from the package |
Got it.. Types are exported by the package import { User, UserState } from "@zitadel/proto/zitadel/user/v2/user_pb"; |
Preflight Checklist
Describe your problem
I would like to type function that use part of the api response. when ie importing Profile the compile will crash:
Describe your ideal solution
export the generated types
Version
No response
Environment
Self-hosted
Additional Context
No response
The text was updated successfully, but these errors were encountered: