No JSDoc comment in source yet.
API
@Component()
export class UsersRepo implements Users {
@Use() private readonly db!: Db;
insert(row: UserRow): void;
findById(userId: string): UserRow | null;
list(): UserRow[];
count(): number;
updatePassword(userId: string, passwordHash: string, isInitial: boolean): void;
updateProfile(userId: string, patch: { displayName?: string | null; avatar?: string | null }): void;
delete(userId: string): void;
}Dependencies & Wiring
Extracted from class decoratorsMethods (7)
insert
insert(row: UserRow): void@paramrow
UserRow@returns
voidfindById
findById(userId: string): UserRow | null@paramuserId
string@returns
UserRow | nulllist
list(): UserRow[]All users (for the admin user backend), ordered by creation time ascending.
@returns
UserRow[]count
count(): number@returns
numberupdatePassword
updatePassword(userId: string, passwordHash: string, isInitial: boolean): voidUpdate the password hash; isInitial marks whether the password was set by someone else (seed / admin).
@paramuserId
string@parampasswordHash
string@paramisInitial
boolean@returns
voidupdateProfile
updateProfile(userId: string, patch: { displayName?: string | null; avatar?: string | null }): voidWrites the profile fields the patch names, leaving the rest as they are: an absent key
keeps the stored value, null clears it, a string replaces it. A patch naming neither
field writes nothing rather than issuing an UPDATE with an empty SET list.
@paramuserId
string@parampatch
{ displayName?: string | null; avatar?: string | null }@returns
voiddelete
delete(userId: string): voidUsed by admin user deletion and account-creation compensation paths (owned Projects must be cleaned up first).
@paramuserId
string@returns
void