mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 00:51:20 +00:00
fix: Adjust graphql schemas to new dns provider
- fix runtime bugs
This commit is contained in:
parent
01c09aaae4
commit
c67e37a40e
|
@ -3,6 +3,7 @@ import 'package:gql/ast.dart';
|
|||
import 'package:graphql/client.dart' as graphql;
|
||||
import 'package:selfprivacy/utils/scalars.dart';
|
||||
import 'schema.graphql.dart';
|
||||
import 'services.graphql.dart';
|
||||
|
||||
class Fragment$basicMutationReturnFields {
|
||||
Fragment$basicMutationReturnFields({
|
||||
|
|
|
@ -75,7 +75,8 @@ type DeviceApiTokenMutationReturn implements MutationReturnInterface {
|
|||
}
|
||||
|
||||
enum DnsProvider {
|
||||
CLOUDFLARE
|
||||
CLOUDFLARE,
|
||||
DESEC
|
||||
}
|
||||
|
||||
type DnsRecord {
|
||||
|
|
|
@ -1096,12 +1096,14 @@ class _CopyWithStubImpl$Input$UserMutationInput<TRes>
|
|||
_res;
|
||||
}
|
||||
|
||||
enum Enum$DnsProvider { CLOUDFLARE, $unknown }
|
||||
enum Enum$DnsProvider { CLOUDFLARE, DESEC, $unknown }
|
||||
|
||||
String toJson$Enum$DnsProvider(Enum$DnsProvider e) {
|
||||
switch (e) {
|
||||
case Enum$DnsProvider.CLOUDFLARE:
|
||||
return r'CLOUDFLARE';
|
||||
case Enum$DnsProvider.DESEC:
|
||||
return r'DESEC';
|
||||
case Enum$DnsProvider.$unknown:
|
||||
return r'$unknown';
|
||||
}
|
||||
|
@ -1111,6 +1113,8 @@ Enum$DnsProvider fromJson$Enum$DnsProvider(String value) {
|
|||
switch (value) {
|
||||
case r'CLOUDFLARE':
|
||||
return Enum$DnsProvider.CLOUDFLARE;
|
||||
case r'DESEC':
|
||||
return Enum$DnsProvider.DESEC;
|
||||
default:
|
||||
return Enum$DnsProvider.$unknown;
|
||||
}
|
||||
|
|
|
@ -72,6 +72,15 @@ query SystemServerProvider {
|
|||
}
|
||||
}
|
||||
|
||||
query SystemDnsProvider {
|
||||
system {
|
||||
domainInfo {
|
||||
provider
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
query GetApiTokens {
|
||||
api {
|
||||
devices {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import 'dart:async';
|
||||
import 'disk_volumes.graphql.dart';
|
||||
import 'package:gql/ast.dart';
|
||||
import 'package:graphql/client.dart' as graphql;
|
||||
import 'package:selfprivacy/utils/scalars.dart';
|
||||
import 'schema.graphql.dart';
|
||||
import 'services.graphql.dart';
|
||||
|
||||
class Fragment$basicMutationReturnFields {
|
||||
Fragment$basicMutationReturnFields({
|
||||
|
@ -6380,6 +6380,550 @@ class _CopyWithStubImpl$Query$SystemServerProvider$system$provider<TRes>
|
|||
_res;
|
||||
}
|
||||
|
||||
class Query$SystemDnsProvider {
|
||||
Query$SystemDnsProvider({
|
||||
required this.system,
|
||||
required this.$__typename,
|
||||
});
|
||||
|
||||
factory Query$SystemDnsProvider.fromJson(Map<String, dynamic> json) {
|
||||
final l$system = json['system'];
|
||||
final l$$__typename = json['__typename'];
|
||||
return Query$SystemDnsProvider(
|
||||
system: Query$SystemDnsProvider$system.fromJson(
|
||||
(l$system as Map<String, dynamic>)),
|
||||
$__typename: (l$$__typename as String),
|
||||
);
|
||||
}
|
||||
|
||||
final Query$SystemDnsProvider$system system;
|
||||
|
||||
final String $__typename;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _resultData = <String, dynamic>{};
|
||||
final l$system = system;
|
||||
_resultData['system'] = l$system.toJson();
|
||||
final l$$__typename = $__typename;
|
||||
_resultData['__typename'] = l$$__typename;
|
||||
return _resultData;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
final l$system = system;
|
||||
final l$$__typename = $__typename;
|
||||
return Object.hashAll([
|
||||
l$system,
|
||||
l$$__typename,
|
||||
]);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (!(other is Query$SystemDnsProvider) ||
|
||||
runtimeType != other.runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final l$system = system;
|
||||
final lOther$system = other.system;
|
||||
if (l$system != lOther$system) {
|
||||
return false;
|
||||
}
|
||||
final l$$__typename = $__typename;
|
||||
final lOther$$__typename = other.$__typename;
|
||||
if (l$$__typename != lOther$$__typename) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
extension UtilityExtension$Query$SystemDnsProvider on Query$SystemDnsProvider {
|
||||
CopyWith$Query$SystemDnsProvider<Query$SystemDnsProvider> get copyWith =>
|
||||
CopyWith$Query$SystemDnsProvider(
|
||||
this,
|
||||
(i) => i,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class CopyWith$Query$SystemDnsProvider<TRes> {
|
||||
factory CopyWith$Query$SystemDnsProvider(
|
||||
Query$SystemDnsProvider instance,
|
||||
TRes Function(Query$SystemDnsProvider) then,
|
||||
) = _CopyWithImpl$Query$SystemDnsProvider;
|
||||
|
||||
factory CopyWith$Query$SystemDnsProvider.stub(TRes res) =
|
||||
_CopyWithStubImpl$Query$SystemDnsProvider;
|
||||
|
||||
TRes call({
|
||||
Query$SystemDnsProvider$system? system,
|
||||
String? $__typename,
|
||||
});
|
||||
CopyWith$Query$SystemDnsProvider$system<TRes> get system;
|
||||
}
|
||||
|
||||
class _CopyWithImpl$Query$SystemDnsProvider<TRes>
|
||||
implements CopyWith$Query$SystemDnsProvider<TRes> {
|
||||
_CopyWithImpl$Query$SystemDnsProvider(
|
||||
this._instance,
|
||||
this._then,
|
||||
);
|
||||
|
||||
final Query$SystemDnsProvider _instance;
|
||||
|
||||
final TRes Function(Query$SystemDnsProvider) _then;
|
||||
|
||||
static const _undefined = {};
|
||||
|
||||
TRes call({
|
||||
Object? system = _undefined,
|
||||
Object? $__typename = _undefined,
|
||||
}) =>
|
||||
_then(Query$SystemDnsProvider(
|
||||
system: system == _undefined || system == null
|
||||
? _instance.system
|
||||
: (system as Query$SystemDnsProvider$system),
|
||||
$__typename: $__typename == _undefined || $__typename == null
|
||||
? _instance.$__typename
|
||||
: ($__typename as String),
|
||||
));
|
||||
CopyWith$Query$SystemDnsProvider$system<TRes> get system {
|
||||
final local$system = _instance.system;
|
||||
return CopyWith$Query$SystemDnsProvider$system(
|
||||
local$system, (e) => call(system: e));
|
||||
}
|
||||
}
|
||||
|
||||
class _CopyWithStubImpl$Query$SystemDnsProvider<TRes>
|
||||
implements CopyWith$Query$SystemDnsProvider<TRes> {
|
||||
_CopyWithStubImpl$Query$SystemDnsProvider(this._res);
|
||||
|
||||
TRes _res;
|
||||
|
||||
call({
|
||||
Query$SystemDnsProvider$system? system,
|
||||
String? $__typename,
|
||||
}) =>
|
||||
_res;
|
||||
CopyWith$Query$SystemDnsProvider$system<TRes> get system =>
|
||||
CopyWith$Query$SystemDnsProvider$system.stub(_res);
|
||||
}
|
||||
|
||||
const documentNodeQuerySystemDnsProvider = DocumentNode(definitions: [
|
||||
OperationDefinitionNode(
|
||||
type: OperationType.query,
|
||||
name: NameNode(value: 'SystemDnsProvider'),
|
||||
variableDefinitions: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'system'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'domainInfo'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'provider'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
FieldNode(
|
||||
name: NameNode(value: '__typename'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
]),
|
||||
),
|
||||
FieldNode(
|
||||
name: NameNode(value: '__typename'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
]),
|
||||
),
|
||||
FieldNode(
|
||||
name: NameNode(value: '__typename'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
]),
|
||||
),
|
||||
]);
|
||||
Query$SystemDnsProvider _parserFn$Query$SystemDnsProvider(
|
||||
Map<String, dynamic> data) =>
|
||||
Query$SystemDnsProvider.fromJson(data);
|
||||
|
||||
class Options$Query$SystemDnsProvider
|
||||
extends graphql.QueryOptions<Query$SystemDnsProvider> {
|
||||
Options$Query$SystemDnsProvider({
|
||||
String? operationName,
|
||||
graphql.FetchPolicy? fetchPolicy,
|
||||
graphql.ErrorPolicy? errorPolicy,
|
||||
graphql.CacheRereadPolicy? cacheRereadPolicy,
|
||||
Object? optimisticResult,
|
||||
Duration? pollInterval,
|
||||
graphql.Context? context,
|
||||
}) : super(
|
||||
operationName: operationName,
|
||||
fetchPolicy: fetchPolicy,
|
||||
errorPolicy: errorPolicy,
|
||||
cacheRereadPolicy: cacheRereadPolicy,
|
||||
optimisticResult: optimisticResult,
|
||||
pollInterval: pollInterval,
|
||||
context: context,
|
||||
document: documentNodeQuerySystemDnsProvider,
|
||||
parserFn: _parserFn$Query$SystemDnsProvider,
|
||||
);
|
||||
}
|
||||
|
||||
class WatchOptions$Query$SystemDnsProvider
|
||||
extends graphql.WatchQueryOptions<Query$SystemDnsProvider> {
|
||||
WatchOptions$Query$SystemDnsProvider({
|
||||
String? operationName,
|
||||
graphql.FetchPolicy? fetchPolicy,
|
||||
graphql.ErrorPolicy? errorPolicy,
|
||||
graphql.CacheRereadPolicy? cacheRereadPolicy,
|
||||
Object? optimisticResult,
|
||||
graphql.Context? context,
|
||||
Duration? pollInterval,
|
||||
bool? eagerlyFetchResults,
|
||||
bool carryForwardDataOnException = true,
|
||||
bool fetchResults = false,
|
||||
}) : super(
|
||||
operationName: operationName,
|
||||
fetchPolicy: fetchPolicy,
|
||||
errorPolicy: errorPolicy,
|
||||
cacheRereadPolicy: cacheRereadPolicy,
|
||||
optimisticResult: optimisticResult,
|
||||
context: context,
|
||||
document: documentNodeQuerySystemDnsProvider,
|
||||
pollInterval: pollInterval,
|
||||
eagerlyFetchResults: eagerlyFetchResults,
|
||||
carryForwardDataOnException: carryForwardDataOnException,
|
||||
fetchResults: fetchResults,
|
||||
parserFn: _parserFn$Query$SystemDnsProvider,
|
||||
);
|
||||
}
|
||||
|
||||
class FetchMoreOptions$Query$SystemDnsProvider
|
||||
extends graphql.FetchMoreOptions {
|
||||
FetchMoreOptions$Query$SystemDnsProvider(
|
||||
{required graphql.UpdateQuery updateQuery})
|
||||
: super(
|
||||
updateQuery: updateQuery,
|
||||
document: documentNodeQuerySystemDnsProvider,
|
||||
);
|
||||
}
|
||||
|
||||
extension ClientExtension$Query$SystemDnsProvider on graphql.GraphQLClient {
|
||||
Future<graphql.QueryResult<Query$SystemDnsProvider>> query$SystemDnsProvider(
|
||||
[Options$Query$SystemDnsProvider? options]) async =>
|
||||
await this.query(options ?? Options$Query$SystemDnsProvider());
|
||||
graphql.ObservableQuery<Query$SystemDnsProvider> watchQuery$SystemDnsProvider(
|
||||
[WatchOptions$Query$SystemDnsProvider? options]) =>
|
||||
this.watchQuery(options ?? WatchOptions$Query$SystemDnsProvider());
|
||||
void writeQuery$SystemDnsProvider({
|
||||
required Query$SystemDnsProvider data,
|
||||
bool broadcast = true,
|
||||
}) =>
|
||||
this.writeQuery(
|
||||
graphql.Request(
|
||||
operation: graphql.Operation(
|
||||
document: documentNodeQuerySystemDnsProvider)),
|
||||
data: data.toJson(),
|
||||
broadcast: broadcast,
|
||||
);
|
||||
Query$SystemDnsProvider? readQuery$SystemDnsProvider(
|
||||
{bool optimistic = true}) {
|
||||
final result = this.readQuery(
|
||||
graphql.Request(
|
||||
operation:
|
||||
graphql.Operation(document: documentNodeQuerySystemDnsProvider)),
|
||||
optimistic: optimistic,
|
||||
);
|
||||
return result == null ? null : Query$SystemDnsProvider.fromJson(result);
|
||||
}
|
||||
}
|
||||
|
||||
class Query$SystemDnsProvider$system {
|
||||
Query$SystemDnsProvider$system({
|
||||
required this.domainInfo,
|
||||
required this.$__typename,
|
||||
});
|
||||
|
||||
factory Query$SystemDnsProvider$system.fromJson(Map<String, dynamic> json) {
|
||||
final l$domainInfo = json['domainInfo'];
|
||||
final l$$__typename = json['__typename'];
|
||||
return Query$SystemDnsProvider$system(
|
||||
domainInfo: Query$SystemDnsProvider$system$domainInfo.fromJson(
|
||||
(l$domainInfo as Map<String, dynamic>)),
|
||||
$__typename: (l$$__typename as String),
|
||||
);
|
||||
}
|
||||
|
||||
final Query$SystemDnsProvider$system$domainInfo domainInfo;
|
||||
|
||||
final String $__typename;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _resultData = <String, dynamic>{};
|
||||
final l$domainInfo = domainInfo;
|
||||
_resultData['domainInfo'] = l$domainInfo.toJson();
|
||||
final l$$__typename = $__typename;
|
||||
_resultData['__typename'] = l$$__typename;
|
||||
return _resultData;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
final l$domainInfo = domainInfo;
|
||||
final l$$__typename = $__typename;
|
||||
return Object.hashAll([
|
||||
l$domainInfo,
|
||||
l$$__typename,
|
||||
]);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (!(other is Query$SystemDnsProvider$system) ||
|
||||
runtimeType != other.runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final l$domainInfo = domainInfo;
|
||||
final lOther$domainInfo = other.domainInfo;
|
||||
if (l$domainInfo != lOther$domainInfo) {
|
||||
return false;
|
||||
}
|
||||
final l$$__typename = $__typename;
|
||||
final lOther$$__typename = other.$__typename;
|
||||
if (l$$__typename != lOther$$__typename) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
extension UtilityExtension$Query$SystemDnsProvider$system
|
||||
on Query$SystemDnsProvider$system {
|
||||
CopyWith$Query$SystemDnsProvider$system<Query$SystemDnsProvider$system>
|
||||
get copyWith => CopyWith$Query$SystemDnsProvider$system(
|
||||
this,
|
||||
(i) => i,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class CopyWith$Query$SystemDnsProvider$system<TRes> {
|
||||
factory CopyWith$Query$SystemDnsProvider$system(
|
||||
Query$SystemDnsProvider$system instance,
|
||||
TRes Function(Query$SystemDnsProvider$system) then,
|
||||
) = _CopyWithImpl$Query$SystemDnsProvider$system;
|
||||
|
||||
factory CopyWith$Query$SystemDnsProvider$system.stub(TRes res) =
|
||||
_CopyWithStubImpl$Query$SystemDnsProvider$system;
|
||||
|
||||
TRes call({
|
||||
Query$SystemDnsProvider$system$domainInfo? domainInfo,
|
||||
String? $__typename,
|
||||
});
|
||||
CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> get domainInfo;
|
||||
}
|
||||
|
||||
class _CopyWithImpl$Query$SystemDnsProvider$system<TRes>
|
||||
implements CopyWith$Query$SystemDnsProvider$system<TRes> {
|
||||
_CopyWithImpl$Query$SystemDnsProvider$system(
|
||||
this._instance,
|
||||
this._then,
|
||||
);
|
||||
|
||||
final Query$SystemDnsProvider$system _instance;
|
||||
|
||||
final TRes Function(Query$SystemDnsProvider$system) _then;
|
||||
|
||||
static const _undefined = {};
|
||||
|
||||
TRes call({
|
||||
Object? domainInfo = _undefined,
|
||||
Object? $__typename = _undefined,
|
||||
}) =>
|
||||
_then(Query$SystemDnsProvider$system(
|
||||
domainInfo: domainInfo == _undefined || domainInfo == null
|
||||
? _instance.domainInfo
|
||||
: (domainInfo as Query$SystemDnsProvider$system$domainInfo),
|
||||
$__typename: $__typename == _undefined || $__typename == null
|
||||
? _instance.$__typename
|
||||
: ($__typename as String),
|
||||
));
|
||||
CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> get domainInfo {
|
||||
final local$domainInfo = _instance.domainInfo;
|
||||
return CopyWith$Query$SystemDnsProvider$system$domainInfo(
|
||||
local$domainInfo, (e) => call(domainInfo: e));
|
||||
}
|
||||
}
|
||||
|
||||
class _CopyWithStubImpl$Query$SystemDnsProvider$system<TRes>
|
||||
implements CopyWith$Query$SystemDnsProvider$system<TRes> {
|
||||
_CopyWithStubImpl$Query$SystemDnsProvider$system(this._res);
|
||||
|
||||
TRes _res;
|
||||
|
||||
call({
|
||||
Query$SystemDnsProvider$system$domainInfo? domainInfo,
|
||||
String? $__typename,
|
||||
}) =>
|
||||
_res;
|
||||
CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> get domainInfo =>
|
||||
CopyWith$Query$SystemDnsProvider$system$domainInfo.stub(_res);
|
||||
}
|
||||
|
||||
class Query$SystemDnsProvider$system$domainInfo {
|
||||
Query$SystemDnsProvider$system$domainInfo({
|
||||
required this.provider,
|
||||
required this.$__typename,
|
||||
});
|
||||
|
||||
factory Query$SystemDnsProvider$system$domainInfo.fromJson(
|
||||
Map<String, dynamic> json) {
|
||||
final l$provider = json['provider'];
|
||||
final l$$__typename = json['__typename'];
|
||||
return Query$SystemDnsProvider$system$domainInfo(
|
||||
provider: fromJson$Enum$DnsProvider((l$provider as String)),
|
||||
$__typename: (l$$__typename as String),
|
||||
);
|
||||
}
|
||||
|
||||
final Enum$DnsProvider provider;
|
||||
|
||||
final String $__typename;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _resultData = <String, dynamic>{};
|
||||
final l$provider = provider;
|
||||
_resultData['provider'] = toJson$Enum$DnsProvider(l$provider);
|
||||
final l$$__typename = $__typename;
|
||||
_resultData['__typename'] = l$$__typename;
|
||||
return _resultData;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
final l$provider = provider;
|
||||
final l$$__typename = $__typename;
|
||||
return Object.hashAll([
|
||||
l$provider,
|
||||
l$$__typename,
|
||||
]);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (!(other is Query$SystemDnsProvider$system$domainInfo) ||
|
||||
runtimeType != other.runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final l$provider = provider;
|
||||
final lOther$provider = other.provider;
|
||||
if (l$provider != lOther$provider) {
|
||||
return false;
|
||||
}
|
||||
final l$$__typename = $__typename;
|
||||
final lOther$$__typename = other.$__typename;
|
||||
if (l$$__typename != lOther$$__typename) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
extension UtilityExtension$Query$SystemDnsProvider$system$domainInfo
|
||||
on Query$SystemDnsProvider$system$domainInfo {
|
||||
CopyWith$Query$SystemDnsProvider$system$domainInfo<
|
||||
Query$SystemDnsProvider$system$domainInfo>
|
||||
get copyWith => CopyWith$Query$SystemDnsProvider$system$domainInfo(
|
||||
this,
|
||||
(i) => i,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> {
|
||||
factory CopyWith$Query$SystemDnsProvider$system$domainInfo(
|
||||
Query$SystemDnsProvider$system$domainInfo instance,
|
||||
TRes Function(Query$SystemDnsProvider$system$domainInfo) then,
|
||||
) = _CopyWithImpl$Query$SystemDnsProvider$system$domainInfo;
|
||||
|
||||
factory CopyWith$Query$SystemDnsProvider$system$domainInfo.stub(TRes res) =
|
||||
_CopyWithStubImpl$Query$SystemDnsProvider$system$domainInfo;
|
||||
|
||||
TRes call({
|
||||
Enum$DnsProvider? provider,
|
||||
String? $__typename,
|
||||
});
|
||||
}
|
||||
|
||||
class _CopyWithImpl$Query$SystemDnsProvider$system$domainInfo<TRes>
|
||||
implements CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> {
|
||||
_CopyWithImpl$Query$SystemDnsProvider$system$domainInfo(
|
||||
this._instance,
|
||||
this._then,
|
||||
);
|
||||
|
||||
final Query$SystemDnsProvider$system$domainInfo _instance;
|
||||
|
||||
final TRes Function(Query$SystemDnsProvider$system$domainInfo) _then;
|
||||
|
||||
static const _undefined = {};
|
||||
|
||||
TRes call({
|
||||
Object? provider = _undefined,
|
||||
Object? $__typename = _undefined,
|
||||
}) =>
|
||||
_then(Query$SystemDnsProvider$system$domainInfo(
|
||||
provider: provider == _undefined || provider == null
|
||||
? _instance.provider
|
||||
: (provider as Enum$DnsProvider),
|
||||
$__typename: $__typename == _undefined || $__typename == null
|
||||
? _instance.$__typename
|
||||
: ($__typename as String),
|
||||
));
|
||||
}
|
||||
|
||||
class _CopyWithStubImpl$Query$SystemDnsProvider$system$domainInfo<TRes>
|
||||
implements CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> {
|
||||
_CopyWithStubImpl$Query$SystemDnsProvider$system$domainInfo(this._res);
|
||||
|
||||
TRes _res;
|
||||
|
||||
call({
|
||||
Enum$DnsProvider? provider,
|
||||
String? $__typename,
|
||||
}) =>
|
||||
_res;
|
||||
}
|
||||
|
||||
class Query$GetApiTokens {
|
||||
Query$GetApiTokens({
|
||||
required this.api,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'dart:async';
|
||||
import 'disk_volumes.graphql.dart';
|
||||
import 'package:gql/ast.dart';
|
||||
import 'package:graphql/client.dart' as graphql;
|
||||
import 'schema.graphql.dart';
|
||||
import 'services.graphql.dart';
|
||||
|
||||
class Fragment$basicMutationReturnFields {
|
||||
Fragment$basicMutationReturnFields({
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:async';
|
||||
import 'disk_volumes.graphql.dart';
|
||||
import 'package:gql/ast.dart';
|
||||
import 'package:graphql/client.dart' as graphql;
|
||||
import 'package:selfprivacy/utils/scalars.dart';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'dart:async';
|
||||
import 'disk_volumes.graphql.dart';
|
||||
import 'package:gql/ast.dart';
|
||||
import 'package:graphql/client.dart' as graphql;
|
||||
import 'schema.graphql.dart';
|
||||
import 'services.graphql.dart';
|
||||
|
||||
class Fragment$basicMutationReturnFields {
|
||||
Fragment$basicMutationReturnFields({
|
||||
|
|
|
@ -11,6 +11,7 @@ import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/users.graphql.dar
|
|||
import 'package:selfprivacy/logic/models/auto_upgrade_settings.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/server_details.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/user.dart';
|
||||
import 'package:selfprivacy/logic/models/json/api_token.dart';
|
||||
import 'package:selfprivacy/logic/models/json/backup.dart';
|
||||
|
@ -87,6 +88,25 @@ class ServerApi extends ApiMap
|
|||
return providerType;
|
||||
}
|
||||
|
||||
Future<DnsProvider> getDnsProviderType() async {
|
||||
QueryResult<Query$SystemDnsProvider> response;
|
||||
DnsProvider providerType = DnsProvider.unknown;
|
||||
|
||||
try {
|
||||
final GraphQLClient client = await getClient();
|
||||
response = await client.query$SystemDnsProvider();
|
||||
if (response.hasException) {
|
||||
print(response.exception.toString());
|
||||
}
|
||||
providerType = DnsProvider.fromGraphQL(
|
||||
response.parsedData!.system.domainInfo.provider,
|
||||
);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
return providerType;
|
||||
}
|
||||
|
||||
Future<bool> isUsingBinds() async {
|
||||
QueryResult response;
|
||||
bool usesBinds = false;
|
||||
|
|
|
@ -27,7 +27,7 @@ class CloudflareApi extends DnsProviderApi {
|
|||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().cloudFlareKey;
|
||||
final String? token = getIt<ApiConfigModel>().dnsProviderKey;
|
||||
assert(token != null);
|
||||
options.headers = {'Authorization': 'Bearer $token'};
|
||||
}
|
||||
|
|
|
@ -27,13 +27,13 @@ class DesecApi extends DnsProviderApi {
|
|||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().cloudFlareKey;
|
||||
final String? token = getIt<ApiConfigModel>().dnsProviderKey;
|
||||
assert(token != null);
|
||||
options.headers = {'Authorization': 'Bearer $token'};
|
||||
options.headers = {'Authorization': 'Token $token'};
|
||||
}
|
||||
|
||||
if (customToken != null) {
|
||||
options.headers = {'Authorization': 'Bearer $customToken'};
|
||||
options.headers = {'Authorization': 'Token $customToken'};
|
||||
}
|
||||
|
||||
if (validateStatus != null) {
|
||||
|
@ -107,7 +107,7 @@ class DesecApi extends DnsProviderApi {
|
|||
try {
|
||||
final Response response = await client.get(url);
|
||||
|
||||
final List records = response.data['result'] ?? [];
|
||||
final List records = response.data;
|
||||
await client.put(url, data: records);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
|
@ -136,7 +136,7 @@ class DesecApi extends DnsProviderApi {
|
|||
final Dio client = await getClient();
|
||||
try {
|
||||
response = await client.get(url);
|
||||
final List records = response.data['result'] ?? [];
|
||||
final List records = response.data;
|
||||
|
||||
for (final record in records) {
|
||||
allRecords.add(
|
||||
|
@ -291,7 +291,7 @@ class DesecApi extends DnsProviderApi {
|
|||
final Response response = await client.get(
|
||||
'',
|
||||
);
|
||||
domains = response.data['result']
|
||||
domains = response.data
|
||||
.map<String>((final el) => el['name'] as String)
|
||||
.toList();
|
||||
} catch (e) {
|
||||
|
|
|
@ -332,6 +332,7 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
|||
required final User rootUser,
|
||||
required final String domainName,
|
||||
required final String serverType,
|
||||
required final DnsProvider dnsProvider,
|
||||
}) async {
|
||||
ServerHostingDetails? serverDetails;
|
||||
|
||||
|
@ -344,9 +345,10 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
|||
final String formattedHostname = getHostnameFromDomain(domainName);
|
||||
const String infectBranch = 'providers/digital-ocean';
|
||||
final String stagingAcme = StagingOptions.stagingAcme ? 'true' : 'false';
|
||||
final String dnsProviderType = dnsProviderToInfectName(dnsProvider);
|
||||
|
||||
final String userdataString =
|
||||
"#cloud-config\nruncmd:\n- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/$infectBranch/nixos-infect | PROVIDER=$infectProviderName STAGING_ACME='$stagingAcme' DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$dbPassword API_TOKEN=$apiToken HOSTNAME=$formattedHostname bash 2>&1 | tee /tmp/infect.log";
|
||||
"#cloud-config\nruncmd:\n- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/$infectBranch/nixos-infect | DNS_PROVIDER_TYPE=$dnsProviderType PROVIDER=$infectProviderName STAGING_ACME='$stagingAcme' DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$dbPassword API_TOKEN=$apiToken HOSTNAME=$formattedHostname bash 2>&1 | tee /tmp/infect.log";
|
||||
print(userdataString);
|
||||
|
||||
Response? serverCreateResponse;
|
||||
|
|
|
@ -356,6 +356,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
required final User rootUser,
|
||||
required final String domainName,
|
||||
required final String serverType,
|
||||
required final DnsProvider dnsProvider,
|
||||
}) async {
|
||||
final APIGenericResult<ServerVolume?> newVolumeResponse =
|
||||
await createVolume();
|
||||
|
@ -374,6 +375,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
domainName: domainName,
|
||||
volume: newVolumeResponse.data!,
|
||||
serverType: serverType,
|
||||
dnsProvider: dnsProvider,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -383,6 +385,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
required final String domainName,
|
||||
required final ServerVolume volume,
|
||||
required final String serverType,
|
||||
required final DnsProvider dnsProvider,
|
||||
}) async {
|
||||
final Dio client = await getClient();
|
||||
|
||||
|
@ -395,9 +398,10 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
final String stagingAcme = StagingOptions.stagingAcme ? 'true' : 'false';
|
||||
final String base64Password =
|
||||
base64.encode(utf8.encode(rootUser.password ?? 'PASS'));
|
||||
final String dnsProviderType = dnsProviderToInfectName(dnsProvider);
|
||||
|
||||
final String userdataString =
|
||||
"#cloud-config\nruncmd:\n- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/$infectBranch/nixos-infect | STAGING_ACME='$stagingAcme' PROVIDER=$infectProviderName NIX_CHANNEL=nixos-21.05 DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$dbPassword API_TOKEN=$apiToken HOSTNAME=$hostname bash 2>&1 | tee /tmp/infect.log";
|
||||
"#cloud-config\nruncmd:\n- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/$infectBranch/nixos-infect | DNS_PROVIDER_TYPE=$dnsProviderType STAGING_ACME='$stagingAcme' PROVIDER=$infectProviderName NIX_CHANNEL=nixos-21.05 DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$dbPassword API_TOKEN=$apiToken HOSTNAME=$hostname bash 2>&1 | tee /tmp/infect.log";
|
||||
|
||||
Response? serverCreateResponse;
|
||||
ServerHostingDetails? serverDetails;
|
||||
|
|
|
@ -39,6 +39,7 @@ abstract class ServerProviderApi extends ApiMap {
|
|||
required final User rootUser,
|
||||
required final String domainName,
|
||||
required final String serverType,
|
||||
required final DnsProvider dnsProvider,
|
||||
});
|
||||
Future<APIGenericResult<void>> createReverseDns({
|
||||
required final ServerHostingDetails serverDetails,
|
||||
|
@ -54,6 +55,20 @@ abstract class ServerProviderApi extends ApiMap {
|
|||
final DateTime end,
|
||||
);
|
||||
|
||||
String dnsProviderToInfectName(final DnsProvider dnsProvider) {
|
||||
String dnsProviderType;
|
||||
switch (dnsProvider) {
|
||||
case DnsProvider.desec:
|
||||
dnsProviderType = 'DESEC';
|
||||
break;
|
||||
case DnsProvider.cloudflare:
|
||||
default:
|
||||
dnsProviderType = 'CLOUDFLARE';
|
||||
break;
|
||||
}
|
||||
return dnsProviderType;
|
||||
}
|
||||
|
||||
/// Provider name key which lets infect understand what kind of installation
|
||||
/// it requires, for example 'digitaloceal' for Digital Ocean
|
||||
String get infectProviderName;
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'dart:async';
|
|||
import 'package:cubit_form/cubit_form.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/forms/validations/validations.dart';
|
||||
|
||||
class DnsProviderFormCubit extends FormCubit {
|
||||
DnsProviderFormCubit(this.initializingCubit) {
|
||||
|
@ -11,7 +10,6 @@ class DnsProviderFormCubit extends FormCubit {
|
|||
initalValue: '',
|
||||
validations: [
|
||||
RequiredStringValidation('validations.required'.tr()),
|
||||
LengthStringNotEqualValidation(40)
|
||||
],
|
||||
);
|
||||
|
||||
|
@ -20,7 +18,7 @@ class DnsProviderFormCubit extends FormCubit {
|
|||
|
||||
@override
|
||||
FutureOr<void> onSubmit() async {
|
||||
initializingCubit.setCloudflareKey(apiKey.state.value);
|
||||
initializingCubit.setDnsApiToken(apiKey.state.value);
|
||||
}
|
||||
|
||||
final ServerInstallationCubit initializingCubit;
|
||||
|
|
|
@ -110,16 +110,6 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
Future<bool?> isDnsProviderApiTokenValid(
|
||||
final String providerToken,
|
||||
) async {
|
||||
if (ApiController.currentDnsProviderApiFactory == null) {
|
||||
// No other DNS provider is supported for now,
|
||||
// so it's safe to hardcode Cloudflare
|
||||
ApiController.initDnsProviderApiFactory(
|
||||
DnsProviderApiFactorySettings(
|
||||
provider: DnsProvider.cloudflare,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final APIGenericResult<bool> apiResponse =
|
||||
await ApiController.currentDnsProviderApiFactory!
|
||||
.getDnsProvider(
|
||||
|
@ -223,16 +213,16 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
);
|
||||
}
|
||||
|
||||
void setCloudflareKey(final String cloudFlareKey) async {
|
||||
void setDnsApiToken(final String dnsApiToken) async {
|
||||
if (state is ServerInstallationRecovery) {
|
||||
setAndValidateCloudflareToken(cloudFlareKey);
|
||||
setAndValidateDnsApiToken(dnsApiToken);
|
||||
return;
|
||||
}
|
||||
await repository.saveCloudFlareKey(cloudFlareKey);
|
||||
await repository.saveDnsProviderKey(dnsApiToken);
|
||||
|
||||
emit(
|
||||
(state as ServerInstallationNotFinished)
|
||||
.copyWith(cloudFlareKey: cloudFlareKey),
|
||||
.copyWith(dnsApiToken: dnsApiToken),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -293,7 +283,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
await repository.createServer(
|
||||
state.rootUser!,
|
||||
state.serverDomain!.domainName,
|
||||
state.cloudFlareKey!,
|
||||
state.dnsApiToken!,
|
||||
state.backblazeCredential!,
|
||||
onCancel: onCancel,
|
||||
onSuccess: onSuccess,
|
||||
|
@ -595,7 +585,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
),
|
||||
);
|
||||
break;
|
||||
case RecoveryStep.cloudflareToken:
|
||||
case RecoveryStep.dnsProviderToken:
|
||||
repository.deleteServerDetails();
|
||||
emit(
|
||||
dataState.copyWith(
|
||||
|
@ -691,12 +681,12 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
emit(
|
||||
dataState.copyWith(
|
||||
serverDetails: serverDetails,
|
||||
currentStep: RecoveryStep.cloudflareToken,
|
||||
currentStep: RecoveryStep.dnsProviderToken,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> setAndValidateCloudflareToken(final String token) async {
|
||||
Future<void> setAndValidateDnsApiToken(final String token) async {
|
||||
final ServerInstallationRecovery dataState =
|
||||
state as ServerInstallationRecovery;
|
||||
final ServerDomain? serverDomain = dataState.serverDomain;
|
||||
|
@ -714,10 +704,13 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
ServerDomain(
|
||||
domainName: serverDomain.domainName,
|
||||
zoneId: zoneId,
|
||||
provider: DnsProvider.cloudflare,
|
||||
provider: await ServerApi(
|
||||
customToken: token,
|
||||
isWithToken: true,
|
||||
).getDnsProviderType(),
|
||||
),
|
||||
);
|
||||
await repository.saveCloudFlareKey(token);
|
||||
await repository.saveDnsProviderKey(token);
|
||||
emit(
|
||||
dataState.copyWith(
|
||||
serverDomain: ServerDomain(
|
||||
|
@ -725,7 +718,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
zoneId: zoneId,
|
||||
provider: DnsProvider.cloudflare,
|
||||
),
|
||||
cloudFlareKey: token,
|
||||
dnsApiToken: token,
|
||||
currentStep: RecoveryStep.backblazeToken,
|
||||
),
|
||||
);
|
||||
|
@ -776,7 +769,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
ServerInstallationNotFinished(
|
||||
providerApiToken: state.providerApiToken,
|
||||
serverDomain: state.serverDomain,
|
||||
cloudFlareKey: state.cloudFlareKey,
|
||||
dnsApiToken: state.dnsApiToken,
|
||||
backblazeCredential: state.backblazeCredential,
|
||||
rootUser: state.rootUser,
|
||||
serverDetails: null,
|
||||
|
|
|
@ -45,7 +45,7 @@ class ServerInstallationRepository {
|
|||
Future<ServerInstallationState> load() async {
|
||||
final String? providerApiToken = getIt<ApiConfigModel>().serverProviderKey;
|
||||
final String? location = getIt<ApiConfigModel>().serverLocation;
|
||||
final String? cloudflareToken = getIt<ApiConfigModel>().cloudFlareKey;
|
||||
final String? dnsApiToken = getIt<ApiConfigModel>().dnsProviderKey;
|
||||
final String? serverTypeIdentificator = getIt<ApiConfigModel>().serverType;
|
||||
final ServerDomain? serverDomain = getIt<ApiConfigModel>().serverDomain;
|
||||
final ServerProvider? serverProvider =
|
||||
|
@ -54,6 +54,7 @@ class ServerInstallationRepository {
|
|||
getIt<ApiConfigModel>().backblazeCredential;
|
||||
final ServerHostingDetails? serverDetails =
|
||||
getIt<ApiConfigModel>().serverDetails;
|
||||
final DnsProvider? dnsProvider = getIt<ApiConfigModel>().dnsProvider;
|
||||
|
||||
if (serverProvider != null ||
|
||||
(serverDetails != null &&
|
||||
|
@ -75,18 +76,21 @@ class ServerInstallationRepository {
|
|||
);
|
||||
}
|
||||
|
||||
// No other DNS provider is supported for now, so it's fine.
|
||||
ApiController.initDnsProviderApiFactory(
|
||||
DnsProviderApiFactorySettings(
|
||||
provider: DnsProvider.cloudflare,
|
||||
),
|
||||
);
|
||||
if (dnsProvider != null ||
|
||||
(serverDomain != null &&
|
||||
serverDomain.provider != DnsProvider.unknown)) {
|
||||
ApiController.initDnsProviderApiFactory(
|
||||
DnsProviderApiFactorySettings(
|
||||
provider: dnsProvider ?? serverDomain!.provider,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (box.get(BNames.hasFinalChecked, defaultValue: false)) {
|
||||
return ServerInstallationFinished(
|
||||
providerApiToken: providerApiToken!,
|
||||
serverTypeIdentificator: serverTypeIdentificator ?? '',
|
||||
cloudFlareKey: cloudflareToken!,
|
||||
dnsApiToken: dnsApiToken!,
|
||||
serverDomain: serverDomain!,
|
||||
backblazeCredential: backblazeCredential!,
|
||||
serverDetails: serverDetails!,
|
||||
|
@ -103,14 +107,14 @@ class ServerInstallationRepository {
|
|||
serverDomain != null) {
|
||||
return ServerInstallationRecovery(
|
||||
providerApiToken: providerApiToken,
|
||||
cloudFlareKey: cloudflareToken,
|
||||
dnsApiToken: dnsApiToken,
|
||||
serverDomain: serverDomain,
|
||||
backblazeCredential: backblazeCredential,
|
||||
serverDetails: serverDetails,
|
||||
rootUser: box.get(BNames.rootUser),
|
||||
currentStep: _getCurrentRecoveryStep(
|
||||
providerApiToken,
|
||||
cloudflareToken,
|
||||
dnsApiToken,
|
||||
serverDomain,
|
||||
serverDetails,
|
||||
),
|
||||
|
@ -120,7 +124,7 @@ class ServerInstallationRepository {
|
|||
|
||||
return ServerInstallationNotFinished(
|
||||
providerApiToken: providerApiToken,
|
||||
cloudFlareKey: cloudflareToken,
|
||||
dnsApiToken: dnsApiToken,
|
||||
serverDomain: serverDomain,
|
||||
backblazeCredential: backblazeCredential,
|
||||
serverDetails: serverDetails,
|
||||
|
@ -147,7 +151,7 @@ class ServerInstallationRepository {
|
|||
if (serverDomain.provider != DnsProvider.unknown) {
|
||||
return RecoveryStep.backblazeToken;
|
||||
}
|
||||
return RecoveryStep.cloudflareToken;
|
||||
return RecoveryStep.dnsProviderToken;
|
||||
}
|
||||
return RecoveryStep.serverSelection;
|
||||
}
|
||||
|
@ -238,7 +242,7 @@ class ServerInstallationRepository {
|
|||
Future<void> createServer(
|
||||
final User rootUser,
|
||||
final String domainName,
|
||||
final String cloudFlareKey,
|
||||
final String dnsApiToken,
|
||||
final BackblazeCredential backblazeCredential, {
|
||||
required final void Function() onCancel,
|
||||
required final Future<void> Function(ServerHostingDetails serverDetails)
|
||||
|
@ -256,7 +260,8 @@ class ServerInstallationRepository {
|
|||
ServerHostingDetails? serverDetails;
|
||||
try {
|
||||
final APIGenericResult createResult = await api.createServer(
|
||||
dnsApiToken: cloudFlareKey,
|
||||
dnsProvider: getIt<ApiConfigModel>().dnsProvider!,
|
||||
dnsApiToken: dnsApiToken,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
serverType: getIt<ApiConfigModel>().serverType!,
|
||||
|
@ -280,7 +285,8 @@ class ServerInstallationRepository {
|
|||
try {
|
||||
final APIGenericResult<ServerHostingDetails?> createServerResult =
|
||||
await api.createServer(
|
||||
dnsApiToken: cloudFlareKey,
|
||||
dnsProvider: getIt<ApiConfigModel>().dnsProvider!,
|
||||
dnsApiToken: dnsApiToken,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
serverType: getIt<ApiConfigModel>().serverType!,
|
||||
|
@ -304,7 +310,8 @@ class ServerInstallationRepository {
|
|||
ServerHostingDetails? serverDetails;
|
||||
try {
|
||||
final APIGenericResult createResult = await api.createServer(
|
||||
dnsApiToken: cloudFlareKey,
|
||||
dnsProvider: getIt<ApiConfigModel>().dnsProvider!,
|
||||
dnsApiToken: dnsApiToken,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
serverType: getIt<ApiConfigModel>().serverType!,
|
||||
|
@ -721,11 +728,11 @@ class ServerInstallationRepository {
|
|||
getIt<ApiConfigModel>().init();
|
||||
}
|
||||
|
||||
Future<void> saveCloudFlareKey(final String key) async {
|
||||
await getIt<ApiConfigModel>().storeCloudFlareKey(key);
|
||||
Future<void> saveDnsProviderKey(final String key) async {
|
||||
await getIt<ApiConfigModel>().storeDnsProviderKey(key);
|
||||
}
|
||||
|
||||
Future<void> deleteCloudFlareKey() async {
|
||||
Future<void> deleteDnsProviderKey() async {
|
||||
await box.delete(BNames.cloudFlareKey);
|
||||
getIt<ApiConfigModel>().init();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ abstract class ServerInstallationState extends Equatable {
|
|||
const ServerInstallationState({
|
||||
required this.providerApiToken,
|
||||
required this.serverTypeIdentificator,
|
||||
required this.cloudFlareKey,
|
||||
required this.dnsApiToken,
|
||||
required this.backblazeCredential,
|
||||
required this.serverDomain,
|
||||
required this.rootUser,
|
||||
|
@ -18,7 +18,7 @@ abstract class ServerInstallationState extends Equatable {
|
|||
List<Object?> get props => [
|
||||
providerApiToken,
|
||||
serverTypeIdentificator,
|
||||
cloudFlareKey,
|
||||
dnsApiToken,
|
||||
backblazeCredential,
|
||||
serverDomain,
|
||||
rootUser,
|
||||
|
@ -28,7 +28,7 @@ abstract class ServerInstallationState extends Equatable {
|
|||
];
|
||||
|
||||
final String? providerApiToken;
|
||||
final String? cloudFlareKey;
|
||||
final String? dnsApiToken;
|
||||
final String? serverTypeIdentificator;
|
||||
final BackblazeCredential? backblazeCredential;
|
||||
final ServerDomain? serverDomain;
|
||||
|
@ -40,7 +40,7 @@ abstract class ServerInstallationState extends Equatable {
|
|||
|
||||
bool get isServerProviderApiKeyFilled => providerApiToken != null;
|
||||
bool get isServerTypeFilled => serverTypeIdentificator != null;
|
||||
bool get isDnsProviderFilled => cloudFlareKey != null;
|
||||
bool get isDnsProviderFilled => dnsApiToken != null;
|
||||
bool get isBackupsProviderFilled => backblazeCredential != null;
|
||||
bool get isDomainSelected => serverDomain != null;
|
||||
bool get isPrimaryUserFilled => rootUser != null;
|
||||
|
@ -87,7 +87,7 @@ class TimerState extends ServerInstallationNotFinished {
|
|||
}) : super(
|
||||
providerApiToken: dataState.providerApiToken,
|
||||
serverTypeIdentificator: dataState.serverTypeIdentificator,
|
||||
cloudFlareKey: dataState.cloudFlareKey,
|
||||
dnsApiToken: dataState.dnsApiToken,
|
||||
backblazeCredential: dataState.backblazeCredential,
|
||||
serverDomain: dataState.serverDomain,
|
||||
rootUser: dataState.rootUser,
|
||||
|
@ -114,7 +114,7 @@ enum ServerSetupProgress {
|
|||
nothingYet,
|
||||
serverProviderFilled,
|
||||
servertTypeFilled,
|
||||
cloudFlareFilled,
|
||||
dnsProviderFilled,
|
||||
backblazeFilled,
|
||||
domainFilled,
|
||||
userFilled,
|
||||
|
@ -133,7 +133,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
|||
required this.dnsMatches,
|
||||
super.providerApiToken,
|
||||
super.serverTypeIdentificator,
|
||||
super.cloudFlareKey,
|
||||
super.dnsApiToken,
|
||||
super.backblazeCredential,
|
||||
super.serverDomain,
|
||||
super.rootUser,
|
||||
|
@ -146,7 +146,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
|||
List<Object?> get props => [
|
||||
providerApiToken,
|
||||
serverTypeIdentificator,
|
||||
cloudFlareKey,
|
||||
dnsApiToken,
|
||||
backblazeCredential,
|
||||
serverDomain,
|
||||
rootUser,
|
||||
|
@ -160,7 +160,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
|||
ServerInstallationNotFinished copyWith({
|
||||
final String? providerApiToken,
|
||||
final String? serverTypeIdentificator,
|
||||
final String? cloudFlareKey,
|
||||
final String? dnsApiToken,
|
||||
final BackblazeCredential? backblazeCredential,
|
||||
final ServerDomain? serverDomain,
|
||||
final User? rootUser,
|
||||
|
@ -175,7 +175,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
|||
providerApiToken: providerApiToken ?? this.providerApiToken,
|
||||
serverTypeIdentificator:
|
||||
serverTypeIdentificator ?? this.serverTypeIdentificator,
|
||||
cloudFlareKey: cloudFlareKey ?? this.cloudFlareKey,
|
||||
dnsApiToken: dnsApiToken ?? this.dnsApiToken,
|
||||
backblazeCredential: backblazeCredential ?? this.backblazeCredential,
|
||||
serverDomain: serverDomain ?? this.serverDomain,
|
||||
rootUser: rootUser ?? this.rootUser,
|
||||
|
@ -192,7 +192,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
|||
ServerInstallationFinished finish() => ServerInstallationFinished(
|
||||
providerApiToken: providerApiToken!,
|
||||
serverTypeIdentificator: serverTypeIdentificator ?? '',
|
||||
cloudFlareKey: cloudFlareKey!,
|
||||
dnsApiToken: dnsApiToken!,
|
||||
backblazeCredential: backblazeCredential!,
|
||||
serverDomain: serverDomain!,
|
||||
rootUser: rootUser!,
|
||||
|
@ -208,7 +208,7 @@ class ServerInstallationEmpty extends ServerInstallationNotFinished {
|
|||
: super(
|
||||
providerApiToken: null,
|
||||
serverTypeIdentificator: null,
|
||||
cloudFlareKey: null,
|
||||
dnsApiToken: null,
|
||||
backblazeCredential: null,
|
||||
serverDomain: null,
|
||||
rootUser: null,
|
||||
|
@ -225,7 +225,7 @@ class ServerInstallationFinished extends ServerInstallationState {
|
|||
const ServerInstallationFinished({
|
||||
required String super.providerApiToken,
|
||||
required String super.serverTypeIdentificator,
|
||||
required String super.cloudFlareKey,
|
||||
required String super.dnsApiToken,
|
||||
required BackblazeCredential super.backblazeCredential,
|
||||
required ServerDomain super.serverDomain,
|
||||
required User super.rootUser,
|
||||
|
@ -239,7 +239,7 @@ class ServerInstallationFinished extends ServerInstallationState {
|
|||
List<Object?> get props => [
|
||||
providerApiToken,
|
||||
serverTypeIdentificator,
|
||||
cloudFlareKey,
|
||||
dnsApiToken,
|
||||
backblazeCredential,
|
||||
serverDomain,
|
||||
rootUser,
|
||||
|
@ -256,7 +256,7 @@ enum RecoveryStep {
|
|||
oldToken,
|
||||
serverProviderToken,
|
||||
serverSelection,
|
||||
cloudflareToken,
|
||||
dnsProviderToken,
|
||||
backblazeToken,
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
|||
required this.recoveryCapabilities,
|
||||
super.providerApiToken,
|
||||
super.serverTypeIdentificator,
|
||||
super.cloudFlareKey,
|
||||
super.dnsApiToken,
|
||||
super.backblazeCredential,
|
||||
super.serverDomain,
|
||||
super.rootUser,
|
||||
|
@ -295,7 +295,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
|||
List<Object?> get props => [
|
||||
providerApiToken,
|
||||
serverTypeIdentificator,
|
||||
cloudFlareKey,
|
||||
dnsApiToken,
|
||||
backblazeCredential,
|
||||
serverDomain,
|
||||
rootUser,
|
||||
|
@ -308,7 +308,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
|||
ServerInstallationRecovery copyWith({
|
||||
final String? providerApiToken,
|
||||
final String? serverTypeIdentificator,
|
||||
final String? cloudFlareKey,
|
||||
final String? dnsApiToken,
|
||||
final BackblazeCredential? backblazeCredential,
|
||||
final ServerDomain? serverDomain,
|
||||
final User? rootUser,
|
||||
|
@ -320,7 +320,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
|||
providerApiToken: providerApiToken ?? this.providerApiToken,
|
||||
serverTypeIdentificator:
|
||||
serverTypeIdentificator ?? this.serverTypeIdentificator,
|
||||
cloudFlareKey: cloudFlareKey ?? this.cloudFlareKey,
|
||||
dnsApiToken: dnsApiToken ?? this.dnsApiToken,
|
||||
backblazeCredential: backblazeCredential ?? this.backblazeCredential,
|
||||
serverDomain: serverDomain ?? this.serverDomain,
|
||||
rootUser: rootUser ?? this.rootUser,
|
||||
|
@ -332,7 +332,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
|||
ServerInstallationFinished finish() => ServerInstallationFinished(
|
||||
providerApiToken: providerApiToken!,
|
||||
serverTypeIdentificator: serverTypeIdentificator ?? '',
|
||||
cloudFlareKey: cloudFlareKey!,
|
||||
dnsApiToken: dnsApiToken!,
|
||||
backblazeCredential: backblazeCredential!,
|
||||
serverDomain: serverDomain!,
|
||||
rootUser: rootUser!,
|
||||
|
|
|
@ -12,7 +12,7 @@ class ApiConfigModel {
|
|||
String? get serverProviderKey => _serverProviderKey;
|
||||
String? get serverLocation => _serverLocation;
|
||||
String? get serverType => _serverType;
|
||||
String? get cloudFlareKey => _cloudFlareKey;
|
||||
String? get dnsProviderKey => _dnsProviderKey;
|
||||
ServerProvider? get serverProvider => _serverProvider;
|
||||
DnsProvider? get dnsProvider => _dnsProvider;
|
||||
|
||||
|
@ -22,7 +22,7 @@ class ApiConfigModel {
|
|||
|
||||
String? _serverProviderKey;
|
||||
String? _serverLocation;
|
||||
String? _cloudFlareKey;
|
||||
String? _dnsProviderKey;
|
||||
String? _serverType;
|
||||
ServerProvider? _serverProvider;
|
||||
DnsProvider? _dnsProvider;
|
||||
|
@ -46,9 +46,9 @@ class ApiConfigModel {
|
|||
_serverProviderKey = value;
|
||||
}
|
||||
|
||||
Future<void> storeCloudFlareKey(final String value) async {
|
||||
Future<void> storeDnsProviderKey(final String value) async {
|
||||
await _box.put(BNames.cloudFlareKey, value);
|
||||
_cloudFlareKey = value;
|
||||
_dnsProviderKey = value;
|
||||
}
|
||||
|
||||
Future<void> storeServerTypeIdentifier(final String typeIdentifier) async {
|
||||
|
@ -85,7 +85,7 @@ class ApiConfigModel {
|
|||
_serverProviderKey = null;
|
||||
_dnsProvider = null;
|
||||
_serverLocation = null;
|
||||
_cloudFlareKey = null;
|
||||
_dnsProviderKey = null;
|
||||
_backblazeCredential = null;
|
||||
_serverDomain = null;
|
||||
_serverDetails = null;
|
||||
|
@ -97,7 +97,7 @@ class ApiConfigModel {
|
|||
void init() {
|
||||
_serverProviderKey = _box.get(BNames.hetznerKey);
|
||||
_serverLocation = _box.get(BNames.serverLocation);
|
||||
_cloudFlareKey = _box.get(BNames.cloudFlareKey);
|
||||
_dnsProviderKey = _box.get(BNames.cloudFlareKey);
|
||||
_backblazeCredential = _box.get(BNames.backblazeCredential);
|
||||
_serverDomain = _box.get(BNames.serverDomain);
|
||||
_serverDetails = _box.get(BNames.serverDetails);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:hive/hive.dart';
|
||||
import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/schema.graphql.dart';
|
||||
|
||||
part 'server_domain.g.dart';
|
||||
|
||||
|
@ -30,5 +31,16 @@ enum DnsProvider {
|
|||
@HiveField(1)
|
||||
cloudflare,
|
||||
@HiveField(2)
|
||||
desec
|
||||
desec;
|
||||
|
||||
factory DnsProvider.fromGraphQL(final Enum$DnsProvider provider) {
|
||||
switch (provider) {
|
||||
case Enum$DnsProvider.CLOUDFLARE:
|
||||
return cloudflare;
|
||||
case Enum$DnsProvider.DESEC:
|
||||
return desec;
|
||||
default:
|
||||
return unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,8 @@ class DnsProviderAdapter extends TypeAdapter<DnsProvider> {
|
|||
return DnsProvider.unknown;
|
||||
case 1:
|
||||
return DnsProvider.cloudflare;
|
||||
case 2:
|
||||
return DnsProvider.desec;
|
||||
default:
|
||||
return DnsProvider.unknown;
|
||||
}
|
||||
|
@ -72,6 +74,9 @@ class DnsProviderAdapter extends TypeAdapter<DnsProvider> {
|
|||
case DnsProvider.cloudflare:
|
||||
writer.writeByte(1);
|
||||
break;
|
||||
case DnsProvider.desec:
|
||||
writer.writeByte(2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import 'package:selfprivacy/logic/cubit/support_system/support_system_cubit.dart
|
|||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
|
||||
class RecoveryConfirmCloudflare extends StatelessWidget {
|
||||
const RecoveryConfirmCloudflare({super.key});
|
||||
class RecoveryConfirmDns extends StatelessWidget {
|
||||
const RecoveryConfirmDns({super.key});
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) {
|
|
@ -12,7 +12,7 @@ import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_old_token.dart'
|
|||
import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_recovery_key.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_new_device_key.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_backblaze.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_cloudflare.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_dns.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_server.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_server_provider_connected.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_method_select.dart';
|
||||
|
@ -55,8 +55,8 @@ class RecoveryRouting extends StatelessWidget {
|
|||
case RecoveryStep.serverSelection:
|
||||
currentPage = const RecoveryConfirmServer();
|
||||
break;
|
||||
case RecoveryStep.cloudflareToken:
|
||||
currentPage = const RecoveryConfirmCloudflare();
|
||||
case RecoveryStep.dnsProviderToken:
|
||||
currentPage = const RecoveryConfirmDns();
|
||||
break;
|
||||
case RecoveryStep.backblazeToken:
|
||||
currentPage = const RecoveryConfirmBackblaze();
|
||||
|
|
|
@ -14,52 +14,16 @@ abstract class _$RootRouter extends RootStackRouter {
|
|||
|
||||
@override
|
||||
final Map<String, PageFactory> pagesMap = {
|
||||
AboutApplicationRoute.name: (routeData) {
|
||||
BackupDetailsRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const AboutApplicationPage(),
|
||||
child: const BackupDetailsPage(),
|
||||
);
|
||||
},
|
||||
AppSettingsRoute.name: (routeData) {
|
||||
RootRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const AppSettingsPage(),
|
||||
);
|
||||
},
|
||||
DeveloperSettingsRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const DeveloperSettingsPage(),
|
||||
);
|
||||
},
|
||||
ConsoleRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const ConsolePage(),
|
||||
);
|
||||
},
|
||||
MoreRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const MorePage(),
|
||||
);
|
||||
},
|
||||
OnboardingRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const OnboardingPage(),
|
||||
);
|
||||
},
|
||||
ProvidersRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const ProvidersPage(),
|
||||
);
|
||||
},
|
||||
ServerDetailsRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const ServerDetailsScreen(),
|
||||
child: WrappedRoute(child: const RootPage()),
|
||||
);
|
||||
},
|
||||
ServiceRoute.name: (routeData) {
|
||||
|
@ -78,6 +42,12 @@ abstract class _$RootRouter extends RootStackRouter {
|
|||
child: const ServicesPage(),
|
||||
);
|
||||
},
|
||||
ServerDetailsRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const ServerDetailsScreen(),
|
||||
);
|
||||
},
|
||||
UsersRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
|
@ -100,10 +70,46 @@ abstract class _$RootRouter extends RootStackRouter {
|
|||
),
|
||||
);
|
||||
},
|
||||
BackupDetailsRoute.name: (routeData) {
|
||||
AppSettingsRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const BackupDetailsPage(),
|
||||
child: const AppSettingsPage(),
|
||||
);
|
||||
},
|
||||
DeveloperSettingsRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const DeveloperSettingsPage(),
|
||||
);
|
||||
},
|
||||
MoreRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const MorePage(),
|
||||
);
|
||||
},
|
||||
AboutApplicationRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const AboutApplicationPage(),
|
||||
);
|
||||
},
|
||||
ConsoleRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const ConsolePage(),
|
||||
);
|
||||
},
|
||||
ProvidersRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const ProvidersPage(),
|
||||
);
|
||||
},
|
||||
RecoveryKeyRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const RecoveryKeyPage(),
|
||||
);
|
||||
},
|
||||
DnsDetailsRoute.name: (routeData) {
|
||||
|
@ -124,26 +130,12 @@ abstract class _$RootRouter extends RootStackRouter {
|
|||
child: const InitializingPage(),
|
||||
);
|
||||
},
|
||||
RecoveryKeyRoute.name: (routeData) {
|
||||
ServerStorageRoute.name: (routeData) {
|
||||
final args = routeData.argsAs<ServerStorageRouteArgs>();
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const RecoveryKeyPage(),
|
||||
);
|
||||
},
|
||||
DevicesRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const DevicesScreen(),
|
||||
);
|
||||
},
|
||||
ServicesMigrationRoute.name: (routeData) {
|
||||
final args = routeData.argsAs<ServicesMigrationRouteArgs>();
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: ServicesMigrationPage(
|
||||
services: args.services,
|
||||
child: ServerStoragePage(
|
||||
diskStatus: args.diskStatus,
|
||||
isMigration: args.isMigration,
|
||||
key: args.key,
|
||||
),
|
||||
);
|
||||
|
@ -159,133 +151,57 @@ abstract class _$RootRouter extends RootStackRouter {
|
|||
),
|
||||
);
|
||||
},
|
||||
ServerStorageRoute.name: (routeData) {
|
||||
final args = routeData.argsAs<ServerStorageRouteArgs>();
|
||||
ServicesMigrationRoute.name: (routeData) {
|
||||
final args = routeData.argsAs<ServicesMigrationRouteArgs>();
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: ServerStoragePage(
|
||||
child: ServicesMigrationPage(
|
||||
services: args.services,
|
||||
diskStatus: args.diskStatus,
|
||||
isMigration: args.isMigration,
|
||||
key: args.key,
|
||||
),
|
||||
);
|
||||
},
|
||||
RootRoute.name: (routeData) {
|
||||
DevicesRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: WrappedRoute(child: const RootPage()),
|
||||
child: const DevicesScreen(),
|
||||
);
|
||||
},
|
||||
OnboardingRoute.name: (routeData) {
|
||||
return AutoRoutePage<dynamic>(
|
||||
routeData: routeData,
|
||||
child: const OnboardingPage(),
|
||||
);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [AboutApplicationPage]
|
||||
class AboutApplicationRoute extends PageRouteInfo<void> {
|
||||
const AboutApplicationRoute({List<PageRouteInfo>? children})
|
||||
/// [BackupDetailsPage]
|
||||
class BackupDetailsRoute extends PageRouteInfo<void> {
|
||||
const BackupDetailsRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
AboutApplicationRoute.name,
|
||||
BackupDetailsRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'AboutApplicationRoute';
|
||||
static const String name = 'BackupDetailsRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [AppSettingsPage]
|
||||
class AppSettingsRoute extends PageRouteInfo<void> {
|
||||
const AppSettingsRoute({List<PageRouteInfo>? children})
|
||||
/// [RootPage]
|
||||
class RootRoute extends PageRouteInfo<void> {
|
||||
const RootRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
AppSettingsRoute.name,
|
||||
RootRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'AppSettingsRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [DeveloperSettingsPage]
|
||||
class DeveloperSettingsRoute extends PageRouteInfo<void> {
|
||||
const DeveloperSettingsRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
DeveloperSettingsRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'DeveloperSettingsRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [ConsolePage]
|
||||
class ConsoleRoute extends PageRouteInfo<void> {
|
||||
const ConsoleRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
ConsoleRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'ConsoleRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [MorePage]
|
||||
class MoreRoute extends PageRouteInfo<void> {
|
||||
const MoreRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
MoreRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'MoreRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [OnboardingPage]
|
||||
class OnboardingRoute extends PageRouteInfo<void> {
|
||||
const OnboardingRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
OnboardingRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'OnboardingRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [ProvidersPage]
|
||||
class ProvidersRoute extends PageRouteInfo<void> {
|
||||
const ProvidersRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
ProvidersRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'ProvidersRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [ServerDetailsScreen]
|
||||
class ServerDetailsRoute extends PageRouteInfo<void> {
|
||||
const ServerDetailsRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
ServerDetailsRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'ServerDetailsRoute';
|
||||
static const String name = 'RootRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
@ -342,6 +258,20 @@ class ServicesRoute extends PageRouteInfo<void> {
|
|||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [ServerDetailsScreen]
|
||||
class ServerDetailsRoute extends PageRouteInfo<void> {
|
||||
const ServerDetailsRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
ServerDetailsRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'ServerDetailsRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [UsersPage]
|
||||
class UsersRoute extends PageRouteInfo<void> {
|
||||
|
@ -409,15 +339,99 @@ class UserDetailsRouteArgs {
|
|||
}
|
||||
|
||||
/// generated route for
|
||||
/// [BackupDetailsPage]
|
||||
class BackupDetailsRoute extends PageRouteInfo<void> {
|
||||
const BackupDetailsRoute({List<PageRouteInfo>? children})
|
||||
/// [AppSettingsPage]
|
||||
class AppSettingsRoute extends PageRouteInfo<void> {
|
||||
const AppSettingsRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
BackupDetailsRoute.name,
|
||||
AppSettingsRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'BackupDetailsRoute';
|
||||
static const String name = 'AppSettingsRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [DeveloperSettingsPage]
|
||||
class DeveloperSettingsRoute extends PageRouteInfo<void> {
|
||||
const DeveloperSettingsRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
DeveloperSettingsRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'DeveloperSettingsRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [MorePage]
|
||||
class MoreRoute extends PageRouteInfo<void> {
|
||||
const MoreRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
MoreRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'MoreRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [AboutApplicationPage]
|
||||
class AboutApplicationRoute extends PageRouteInfo<void> {
|
||||
const AboutApplicationRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
AboutApplicationRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'AboutApplicationRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [ConsolePage]
|
||||
class ConsoleRoute extends PageRouteInfo<void> {
|
||||
const ConsoleRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
ConsoleRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'ConsoleRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [ProvidersPage]
|
||||
class ProvidersRoute extends PageRouteInfo<void> {
|
||||
const ProvidersRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
ProvidersRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'ProvidersRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [RecoveryKeyPage]
|
||||
class RecoveryKeyRoute extends PageRouteInfo<void> {
|
||||
const RecoveryKeyRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
RecoveryKeyRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'RecoveryKeyRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
@ -465,31 +479,84 @@ class InitializingRoute extends PageRouteInfo<void> {
|
|||
}
|
||||
|
||||
/// generated route for
|
||||
/// [RecoveryKeyPage]
|
||||
class RecoveryKeyRoute extends PageRouteInfo<void> {
|
||||
const RecoveryKeyRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
RecoveryKeyRoute.name,
|
||||
/// [ServerStoragePage]
|
||||
class ServerStorageRoute extends PageRouteInfo<ServerStorageRouteArgs> {
|
||||
ServerStorageRoute({
|
||||
required DiskStatus diskStatus,
|
||||
Key? key,
|
||||
List<PageRouteInfo>? children,
|
||||
}) : super(
|
||||
ServerStorageRoute.name,
|
||||
args: ServerStorageRouteArgs(
|
||||
diskStatus: diskStatus,
|
||||
key: key,
|
||||
),
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'RecoveryKeyRoute';
|
||||
static const String name = 'ServerStorageRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
static const PageInfo<ServerStorageRouteArgs> page =
|
||||
PageInfo<ServerStorageRouteArgs>(name);
|
||||
}
|
||||
|
||||
class ServerStorageRouteArgs {
|
||||
const ServerStorageRouteArgs({
|
||||
required this.diskStatus,
|
||||
this.key,
|
||||
});
|
||||
|
||||
final DiskStatus diskStatus;
|
||||
|
||||
final Key? key;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ServerStorageRouteArgs{diskStatus: $diskStatus, key: $key}';
|
||||
}
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [DevicesScreen]
|
||||
class DevicesRoute extends PageRouteInfo<void> {
|
||||
const DevicesRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
DevicesRoute.name,
|
||||
/// [ExtendingVolumePage]
|
||||
class ExtendingVolumeRoute extends PageRouteInfo<ExtendingVolumeRouteArgs> {
|
||||
ExtendingVolumeRoute({
|
||||
required DiskVolume diskVolumeToResize,
|
||||
required DiskStatus diskStatus,
|
||||
Key? key,
|
||||
List<PageRouteInfo>? children,
|
||||
}) : super(
|
||||
ExtendingVolumeRoute.name,
|
||||
args: ExtendingVolumeRouteArgs(
|
||||
diskVolumeToResize: diskVolumeToResize,
|
||||
diskStatus: diskStatus,
|
||||
key: key,
|
||||
),
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'DevicesRoute';
|
||||
static const String name = 'ExtendingVolumeRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
static const PageInfo<ExtendingVolumeRouteArgs> page =
|
||||
PageInfo<ExtendingVolumeRouteArgs>(name);
|
||||
}
|
||||
|
||||
class ExtendingVolumeRouteArgs {
|
||||
const ExtendingVolumeRouteArgs({
|
||||
required this.diskVolumeToResize,
|
||||
required this.diskStatus,
|
||||
this.key,
|
||||
});
|
||||
|
||||
final DiskVolume diskVolumeToResize;
|
||||
|
||||
final DiskStatus diskStatus;
|
||||
|
||||
final Key? key;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ExtendingVolumeRouteArgs{diskVolumeToResize: $diskVolumeToResize, diskStatus: $diskStatus, key: $key}';
|
||||
}
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
|
@ -541,96 +608,29 @@ class ServicesMigrationRouteArgs {
|
|||
}
|
||||
|
||||
/// generated route for
|
||||
/// [ExtendingVolumePage]
|
||||
class ExtendingVolumeRoute extends PageRouteInfo<ExtendingVolumeRouteArgs> {
|
||||
ExtendingVolumeRoute({
|
||||
required DiskVolume diskVolumeToResize,
|
||||
required DiskStatus diskStatus,
|
||||
Key? key,
|
||||
List<PageRouteInfo>? children,
|
||||
}) : super(
|
||||
ExtendingVolumeRoute.name,
|
||||
args: ExtendingVolumeRouteArgs(
|
||||
diskVolumeToResize: diskVolumeToResize,
|
||||
diskStatus: diskStatus,
|
||||
key: key,
|
||||
),
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'ExtendingVolumeRoute';
|
||||
|
||||
static const PageInfo<ExtendingVolumeRouteArgs> page =
|
||||
PageInfo<ExtendingVolumeRouteArgs>(name);
|
||||
}
|
||||
|
||||
class ExtendingVolumeRouteArgs {
|
||||
const ExtendingVolumeRouteArgs({
|
||||
required this.diskVolumeToResize,
|
||||
required this.diskStatus,
|
||||
this.key,
|
||||
});
|
||||
|
||||
final DiskVolume diskVolumeToResize;
|
||||
|
||||
final DiskStatus diskStatus;
|
||||
|
||||
final Key? key;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ExtendingVolumeRouteArgs{diskVolumeToResize: $diskVolumeToResize, diskStatus: $diskStatus, key: $key}';
|
||||
}
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [ServerStoragePage]
|
||||
class ServerStorageRoute extends PageRouteInfo<ServerStorageRouteArgs> {
|
||||
ServerStorageRoute({
|
||||
required DiskStatus diskStatus,
|
||||
Key? key,
|
||||
List<PageRouteInfo>? children,
|
||||
}) : super(
|
||||
ServerStorageRoute.name,
|
||||
args: ServerStorageRouteArgs(
|
||||
diskStatus: diskStatus,
|
||||
key: key,
|
||||
),
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'ServerStorageRoute';
|
||||
|
||||
static const PageInfo<ServerStorageRouteArgs> page =
|
||||
PageInfo<ServerStorageRouteArgs>(name);
|
||||
}
|
||||
|
||||
class ServerStorageRouteArgs {
|
||||
const ServerStorageRouteArgs({
|
||||
required this.diskStatus,
|
||||
this.key,
|
||||
});
|
||||
|
||||
final DiskStatus diskStatus;
|
||||
|
||||
final Key? key;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ServerStorageRouteArgs{diskStatus: $diskStatus, key: $key}';
|
||||
}
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [RootPage]
|
||||
class RootRoute extends PageRouteInfo<void> {
|
||||
const RootRoute({List<PageRouteInfo>? children})
|
||||
/// [DevicesScreen]
|
||||
class DevicesRoute extends PageRouteInfo<void> {
|
||||
const DevicesRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
RootRoute.name,
|
||||
DevicesRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'RootRoute';
|
||||
static const String name = 'DevicesRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [OnboardingPage]
|
||||
class OnboardingRoute extends PageRouteInfo<void> {
|
||||
const OnboardingRoute({List<PageRouteInfo>? children})
|
||||
: super(
|
||||
OnboardingRoute.name,
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'OnboardingRoute';
|
||||
|
||||
static const PageInfo<void> page = PageInfo<void>(name);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue