Files
umbrix/lib/domain/profiles/profiles_repository.dart

38 lines
1.0 KiB
Dart
Raw Normal View History

2023-07-06 17:18:41 +03:30
import 'package:fpdart/fpdart.dart';
2023-07-26 16:42:31 +03:30
import 'package:hiddify/domain/enums.dart';
2023-07-06 17:18:41 +03:30
import 'package:hiddify/domain/profiles/profiles.dart';
abstract class ProfilesRepository {
TaskEither<ProfileFailure, Profile?> get(String id);
Stream<Either<ProfileFailure, Profile?>> watchActiveProfile();
Stream<Either<ProfileFailure, bool>> watchHasAnyProfile();
2023-07-26 16:42:31 +03:30
Stream<Either<ProfileFailure, List<Profile>>> watchAll({
ProfilesSort sort = ProfilesSort.lastUpdate,
SortMode mode = SortMode.ascending,
});
2023-07-06 17:18:41 +03:30
2023-07-26 14:17:11 +03:30
TaskEither<ProfileFailure, Unit> addByUrl(
String url, {
bool markAsActive = false,
});
2023-10-02 18:51:14 +03:30
TaskEither<ProfileFailure, Unit> addByContent(
String content, {
required String name,
bool markAsActive = false,
});
TaskEither<ProfileFailure, Unit> add(RemoteProfile baseProfile);
2023-07-06 17:18:41 +03:30
2023-10-02 18:51:14 +03:30
TaskEither<ProfileFailure, Unit> update(RemoteProfile baseProfile);
2023-07-06 17:18:41 +03:30
2023-09-28 14:03:45 +03:30
TaskEither<ProfileFailure, Unit> edit(Profile profile);
2023-07-06 17:18:41 +03:30
TaskEither<ProfileFailure, Unit> setAsActive(String id);
TaskEither<ProfileFailure, Unit> delete(String id);
}