user role + module alias

This commit is contained in:
2022-10-16 15:28:42 +02:00
parent f6a7415884
commit 0c3a3546e6
14 changed files with 70 additions and 29 deletions

View File

@ -1,28 +1,35 @@
import { EntityInfo } from './entity';
export enum UserRoles {
ADMIN = 'ADMIN',
USER = 'USER',
}
export type UserInfo = {
uuid: string;
username: string;
role: keyof typeof UserRoles;
};
export type User = UserInfo & EntityInfo;
export type UserCtor = Partial<User>;
export type UserInfoWithPassword = {
password: string;
} & UserInfo;
export type User = UserInfo & EntityInfo;
export type UserWithPassword = UserInfoWithPassword & EntityInfo;
export type UserWithPasswordCtor = Partial<UserWithPassword>;
export type CreateUserBody = {
username: string;
password: string;
role: keyof typeof UserRoles;
};
export type LoginUserBody = {
username: string;
password: string;
};
export type UserCtor = Partial<User>;
export type UserWithPasswordCtor = Partial<UserWithPassword>;

View File

@ -8,6 +8,5 @@
"outDir": "dist"
},
"include": ["src/**/*"],
"exclude": ["node_modules/*", "dist/*"],
"references": []
"exclude": ["node_modules/*", "dist/*"]
}