mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 00:51:20 +00:00
chore: Rename ApiMaps to RestApiMap and GraphQLApiMap
This commit is contained in:
parent
f9da202093
commit
215ad3579d
|
@ -53,7 +53,7 @@ class ResponseLoggingParser extends ResponseParser {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class ApiMap {
|
||||
abstract class GraphQLApiMap {
|
||||
Future<GraphQLClient> getClient() async {
|
||||
IOClient? ioClient;
|
||||
if (TlsOptions.stagingAcme || !TlsOptions.verifyCertificate) {
|
|
@ -1,6 +1,6 @@
|
|||
part of 'server_api.dart';
|
||||
|
||||
mixin JobsApi on ApiMap {
|
||||
mixin JobsApi on GraphQLApiMap {
|
||||
Future<List<ServerJob>> getServerJobs() async {
|
||||
QueryResult<Query$GetApiJobs> response;
|
||||
List<ServerJob> jobsList = [];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
part of 'server_api.dart';
|
||||
|
||||
mixin ServerActionsApi on ApiMap {
|
||||
mixin ServerActionsApi on GraphQLApiMap {
|
||||
Future<bool> _commonBoolRequest(final Function graphQLMethod) async {
|
||||
QueryResult response;
|
||||
bool result = false;
|
||||
|
|
|
@ -32,7 +32,7 @@ part 'services_api.dart';
|
|||
part 'users_api.dart';
|
||||
part 'volume_api.dart';
|
||||
|
||||
class ServerApi extends ApiMap
|
||||
class ServerApi extends GraphQLApiMap
|
||||
with VolumeApi, JobsApi, ServerActionsApi, ServicesApi, UsersApi {
|
||||
ServerApi({
|
||||
this.hasLogger = false,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
part of 'server_api.dart';
|
||||
|
||||
mixin ServicesApi on ApiMap {
|
||||
mixin ServicesApi on GraphQLApiMap {
|
||||
Future<List<Service>> getAllServices() async {
|
||||
QueryResult<Query$AllServices> response;
|
||||
List<Service> services = [];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
part of 'server_api.dart';
|
||||
|
||||
mixin UsersApi on ApiMap {
|
||||
mixin UsersApi on GraphQLApiMap {
|
||||
Future<List<User>> getAllUsers() async {
|
||||
QueryResult<Query$AllUsers> response;
|
||||
List<User> users = [];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
part of 'server_api.dart';
|
||||
|
||||
mixin VolumeApi on ApiMap {
|
||||
mixin VolumeApi on GraphQLApiMap {
|
||||
Future<List<ServerDiskVolume>> getServerDiskVolumes() async {
|
||||
QueryResult response;
|
||||
List<ServerDiskVolume> volumes = [];
|
||||
|
|
|
@ -25,7 +25,7 @@ class BackblazeApplicationKey {
|
|||
final String applicationKey;
|
||||
}
|
||||
|
||||
class BackblazeApi extends ApiMap {
|
||||
class BackblazeApi extends RestApiMap {
|
||||
BackblazeApi({this.hasLogger = false, this.isWithToken = true});
|
||||
|
||||
@override
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'package:selfprivacy/logic/api_maps/rest_maps/api_map.dart';
|
|||
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
||||
import 'package:selfprivacy/logic/models/json/dns_records.dart';
|
||||
|
||||
class CloudflareApi extends ApiMap {
|
||||
class CloudflareApi extends RestApiMap {
|
||||
CloudflareApi({
|
||||
this.hasLogger = false,
|
||||
this.isWithToken = true,
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:selfprivacy/logic/api_maps/generic_result.dart';
|
|||
import 'package:selfprivacy/logic/api_maps/rest_maps/api_map.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
||||
|
||||
class DesecApi extends ApiMap {
|
||||
class DesecApi extends RestApiMap {
|
||||
DesecApi({
|
||||
this.hasLogger = false,
|
||||
this.isWithToken = true,
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'package:selfprivacy/logic/api_maps/rest_maps/api_map.dart';
|
|||
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
||||
import 'package:selfprivacy/logic/models/json/dns_records.dart';
|
||||
|
||||
class DigitalOceanDnsApi extends ApiMap {
|
||||
class DigitalOceanDnsApi extends RestApiMap {
|
||||
DigitalOceanDnsApi({
|
||||
this.hasLogger = false,
|
||||
this.isWithToken = true,
|
||||
|
|
|
@ -8,7 +8,7 @@ import 'package:pretty_dio_logger/pretty_dio_logger.dart';
|
|||
import 'package:selfprivacy/config/get_it_config.dart';
|
||||
import 'package:selfprivacy/logic/models/message.dart';
|
||||
|
||||
abstract class ApiMap {
|
||||
abstract class RestApiMap {
|
||||
Future<Dio> getClient({final BaseOptions? customOptions}) async {
|
||||
final Dio dio = Dio(customOptions ?? (await options));
|
||||
if (hasLogger) {
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:selfprivacy/logic/api_maps/rest_maps/api_map.dart';
|
||||
export 'package:selfprivacy/logic/api_maps/generic_result.dart';
|
||||
|
||||
abstract class ServerProviderApi extends ApiMap {
|
||||
abstract class ServerProviderApi extends RestApiMap {
|
||||
/// Provider name key which lets infect understand what kind of installation
|
||||
/// it requires, for example 'digitaloceal' for Digital Ocean
|
||||
String get infectProviderName;
|
||||
|
|
Loading…
Reference in a new issue