16 lines
541 B
Dart
16 lines
541 B
Dart
import '../../models/user_model.dart';
|
|
|
|
typedef CreateUserResult = ({UserModel user, String secret});
|
|
|
|
abstract class UserService {
|
|
/// Returns all users.
|
|
/// In real-API mode, returns only in-session created users (no list endpoint).
|
|
Future<List<UserModel>> getUsers();
|
|
|
|
/// Creates a new user and returns the user along with the generated secret.
|
|
Future<CreateUserResult> createUser(String username, UserRole role);
|
|
|
|
/// Resets the secret for [userId] and returns the new secret.
|
|
Future<String> resetSecret(String userId);
|
|
}
|