more refactors

This commit is contained in:
shenlong-tanwen
2024-10-19 14:34:42 +05:30
parent e8bb9a3934
commit 3b8951fde6
46 changed files with 598 additions and 435 deletions
@@ -0,0 +1,10 @@
abstract interface class IAuthenticationApiRepository {
/// Returns the access token on successful login
Future<String?> login(String email, String password);
/// Returns the OAuth URL
Future<String?> startOAuth({required String redirectUri});
/// Returns the access token on successful oauth login
Future<String?> finishOAuth(String url);
}
@@ -0,0 +1,13 @@
import 'package:immich_mobile/domain/models/server-info/server_config.model.dart';
import 'package:immich_mobile/domain/models/server-info/server_features.model.dart';
abstract interface class IServerApiRepository {
/// Pings and check if server is reachable
Future<void> pingServer();
/// Fetches the list of enabled features in the server
Future<ServerFeatures?> getServerFeatures();
/// Fetches the server configuration and settings
Future<ServerConfig?> getServerConfig();
}
@@ -0,0 +1,11 @@
import 'package:immich_mobile/domain/models/asset.model.dart';
abstract interface class ISyncApiRepository {
/// Fetches the full assets for the user in batches
Future<List<Asset>?> getFullSyncForUser({
String? lastId,
required int limit,
required DateTime updatedUntil,
String? userId,
});
}
@@ -0,0 +1,6 @@
import 'package:immich_mobile/domain/models/user.model.dart';
abstract interface class IUserApiRepository {
/// Fetches the current users meta data
Future<User?> getMyUser();
}