2024-05-28 16:45:34 +00:00
|
|
|
import * as plugins from '../plugins.js';
|
|
|
|
|
|
|
|
@plugins.smartdata.managed()
|
|
|
|
export class User extends plugins.smartdata.SmartDataDbDoc<User, User> {
|
2024-05-30 20:49:39 +00:00
|
|
|
public static async findUserByUsernameAndPassword(usernameArg: string, passwordArg: string) {
|
|
|
|
return await User.getInstance({
|
|
|
|
data: {
|
|
|
|
username: usernameArg,
|
|
|
|
password: passwordArg,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// INSTANCE
|
|
|
|
@plugins.smartdata.unI()
|
|
|
|
public id: string;
|
|
|
|
|
|
|
|
@plugins.smartdata.svDb()
|
|
|
|
public data: {
|
|
|
|
role: 'admin' | 'user';
|
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
}
|
2024-05-28 16:45:34 +00:00
|
|
|
}
|