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