diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart index 1df1e8ac..fdbac331 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart @@ -179,6 +179,7 @@ class _CopyWithImpl$Fragment$genericBackupConfigReturn ? _instance.$__typename : ($__typename as String), )); + CopyWith$Fragment$genericBackupConfigReturn$configuration get configuration { final local$configuration = _instance.configuration; @@ -204,6 +205,7 @@ class _CopyWithStubImpl$Fragment$genericBackupConfigReturn String? $__typename, }) => _res; + CopyWith$Fragment$genericBackupConfigReturn$configuration get configuration => CopyWith$Fragment$genericBackupConfigReturn$configuration.stub(_res); @@ -633,6 +635,7 @@ class _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration ? _instance.$__typename : ($__typename as String), )); + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< TRes> get autobackupQuotas { final local$autobackupQuotas = _instance.autobackupQuotas; @@ -659,6 +662,7 @@ class _CopyWithStubImpl$Fragment$genericBackupConfigReturn$configuration String? $__typename, }) => _res; + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< TRes> get autobackupQuotas => @@ -999,6 +1003,7 @@ class _CopyWithImpl$Query$BackupConfiguration ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$BackupConfiguration$backup get backup { final local$backup = _instance.backup; return CopyWith$Query$BackupConfiguration$backup( @@ -1017,6 +1022,7 @@ class _CopyWithStubImpl$Query$BackupConfiguration String? $__typename, }) => _res; + CopyWith$Query$BackupConfiguration$backup get backup => CopyWith$Query$BackupConfiguration$backup.stub(_res); } @@ -1399,6 +1405,7 @@ class _CopyWithImpl$Query$BackupConfiguration$backup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$BackupConfiguration$backup$configuration get configuration { final local$configuration = _instance.configuration; @@ -1418,6 +1425,7 @@ class _CopyWithStubImpl$Query$BackupConfiguration$backup String? $__typename, }) => _res; + CopyWith$Query$BackupConfiguration$backup$configuration get configuration => CopyWith$Query$BackupConfiguration$backup$configuration.stub(_res); @@ -1658,6 +1666,7 @@ class _CopyWithImpl$Query$BackupConfiguration$backup$configuration ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas get autobackupQuotas { final local$autobackupQuotas = _instance.autobackupQuotas; @@ -1684,6 +1693,7 @@ class _CopyWithStubImpl$Query$BackupConfiguration$backup$configuration String? $__typename, }) => _res; + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas get autobackupQuotas => CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas @@ -2023,6 +2033,7 @@ class _CopyWithImpl$Query$AllBackupSnapshots ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$AllBackupSnapshots$backup get backup { final local$backup = _instance.backup; return CopyWith$Query$AllBackupSnapshots$backup( @@ -2041,6 +2052,7 @@ class _CopyWithStubImpl$Query$AllBackupSnapshots String? $__typename, }) => _res; + CopyWith$Query$AllBackupSnapshots$backup get backup => CopyWith$Query$AllBackupSnapshots$backup.stub(_res); } @@ -2396,6 +2408,7 @@ class _CopyWithImpl$Query$AllBackupSnapshots$backup ? _instance.$__typename : ($__typename as String), )); + TRes allSnapshots( Iterable Function( Iterable< @@ -2421,6 +2434,7 @@ class _CopyWithStubImpl$Query$AllBackupSnapshots$backup String? $__typename, }) => _res; + allSnapshots(_fn) => _res; } @@ -2594,6 +2608,7 @@ class _CopyWithImpl$Query$AllBackupSnapshots$backup$allSnapshots ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service get service { final local$service = _instance.service; @@ -2616,6 +2631,7 @@ class _CopyWithStubImpl$Query$AllBackupSnapshots$backup$allSnapshots String? $__typename, }) => _res; + CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service get service => CopyWith$Query$AllBackupSnapshots$backup$allSnapshots$service.stub( @@ -2887,6 +2903,7 @@ class _CopyWithImpl$Mutation$ForceSnapshotsReload ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$ForceSnapshotsReload$backup get backup { final local$backup = _instance.backup; return CopyWith$Mutation$ForceSnapshotsReload$backup( @@ -2905,6 +2922,7 @@ class _CopyWithStubImpl$Mutation$ForceSnapshotsReload String? $__typename, }) => _res; + CopyWith$Mutation$ForceSnapshotsReload$backup get backup => CopyWith$Mutation$ForceSnapshotsReload$backup.stub(_res); } @@ -3180,6 +3198,7 @@ class _CopyWithImpl$Mutation$ForceSnapshotsReload$backup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload get forceSnapshotsReload { final local$forceSnapshotsReload = _instance.forceSnapshotsReload; @@ -3200,6 +3219,7 @@ class _CopyWithStubImpl$Mutation$ForceSnapshotsReload$backup String? $__typename, }) => _res; + CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload get forceSnapshotsReload => CopyWith$Mutation$ForceSnapshotsReload$backup$forceSnapshotsReload @@ -3403,6 +3423,7 @@ class Variables$Mutation$StartBackup { Map _$data; String get serviceId => (_$data['serviceId'] as String); + Map toJson() { final result$data = {}; final l$serviceId = serviceId; @@ -3415,6 +3436,7 @@ class Variables$Mutation$StartBackup { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -3591,6 +3613,7 @@ class _CopyWithImpl$Mutation$StartBackup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$StartBackup$backup get backup { final local$backup = _instance.backup; return CopyWith$Mutation$StartBackup$backup( @@ -3609,6 +3632,7 @@ class _CopyWithStubImpl$Mutation$StartBackup String? $__typename, }) => _res; + CopyWith$Mutation$StartBackup$backup get backup => CopyWith$Mutation$StartBackup$backup.stub(_res); } @@ -3907,6 +3931,7 @@ class _CopyWithImpl$Mutation$StartBackup$backup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$StartBackup$backup$startBackup get startBackup { final local$startBackup = _instance.startBackup; return CopyWith$Mutation$StartBackup$backup$startBackup( @@ -3925,6 +3950,7 @@ class _CopyWithStubImpl$Mutation$StartBackup$backup String? $__typename, }) => _res; + CopyWith$Mutation$StartBackup$backup$startBackup get startBackup => CopyWith$Mutation$StartBackup$backup$startBackup.stub(_res); } @@ -4102,6 +4128,7 @@ class _CopyWithImpl$Mutation$StartBackup$backup$startBackup ? _instance.job : (job as Fragment$basicApiJobsFields?), )); + CopyWith$Fragment$basicApiJobsFields get job { final local$job = _instance.job; return local$job == null @@ -4124,6 +4151,7 @@ class _CopyWithStubImpl$Mutation$StartBackup$backup$startBackup Fragment$basicApiJobsFields? job, }) => _res; + CopyWith$Fragment$basicApiJobsFields get job => CopyWith$Fragment$basicApiJobsFields.stub(_res); } @@ -4149,6 +4177,7 @@ class Variables$Mutation$SetAutobackupPeriod { Map _$data; int? get period => (_$data['period'] as int?); + Map toJson() { final result$data = {}; if (_$data.containsKey('period')) { @@ -4164,6 +4193,7 @@ class Variables$Mutation$SetAutobackupPeriod { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -4344,6 +4374,7 @@ class _CopyWithImpl$Mutation$SetAutobackupPeriod ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$SetAutobackupPeriod$backup get backup { final local$backup = _instance.backup; return CopyWith$Mutation$SetAutobackupPeriod$backup( @@ -4362,6 +4393,7 @@ class _CopyWithStubImpl$Mutation$SetAutobackupPeriod String? $__typename, }) => _res; + CopyWith$Mutation$SetAutobackupPeriod$backup get backup => CopyWith$Mutation$SetAutobackupPeriod$backup.stub(_res); } @@ -4650,6 +4682,7 @@ class _CopyWithImpl$Mutation$SetAutobackupPeriod$backup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod { final local$setAutobackupPeriod = _instance.setAutobackupPeriod; return CopyWith$Fragment$genericBackupConfigReturn( @@ -4668,6 +4701,7 @@ class _CopyWithStubImpl$Mutation$SetAutobackupPeriod$backup String? $__typename, }) => _res; + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupPeriod => CopyWith$Fragment$genericBackupConfigReturn.stub(_res); } @@ -4694,6 +4728,7 @@ class Variables$Mutation$setAutobackupQuotas { Input$AutobackupQuotasInput get quotas => (_$data['quotas'] as Input$AutobackupQuotasInput); + Map toJson() { final result$data = {}; final l$quotas = quotas; @@ -4707,6 +4742,7 @@ class Variables$Mutation$setAutobackupQuotas { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -4885,6 +4921,7 @@ class _CopyWithImpl$Mutation$setAutobackupQuotas ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$setAutobackupQuotas$backup get backup { final local$backup = _instance.backup; return CopyWith$Mutation$setAutobackupQuotas$backup( @@ -4903,6 +4940,7 @@ class _CopyWithStubImpl$Mutation$setAutobackupQuotas String? $__typename, }) => _res; + CopyWith$Mutation$setAutobackupQuotas$backup get backup => CopyWith$Mutation$setAutobackupQuotas$backup.stub(_res); } @@ -5190,6 +5228,7 @@ class _CopyWithImpl$Mutation$setAutobackupQuotas$backup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupQuotas { final local$setAutobackupQuotas = _instance.setAutobackupQuotas; return CopyWith$Fragment$genericBackupConfigReturn( @@ -5208,6 +5247,7 @@ class _CopyWithStubImpl$Mutation$setAutobackupQuotas$backup String? $__typename, }) => _res; + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupQuotas => CopyWith$Fragment$genericBackupConfigReturn.stub(_res); } @@ -5324,6 +5364,7 @@ class _CopyWithImpl$Mutation$RemoveRepository ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RemoveRepository$backup get backup { final local$backup = _instance.backup; return CopyWith$Mutation$RemoveRepository$backup( @@ -5342,6 +5383,7 @@ class _CopyWithStubImpl$Mutation$RemoveRepository String? $__typename, }) => _res; + CopyWith$Mutation$RemoveRepository$backup get backup => CopyWith$Mutation$RemoveRepository$backup.stub(_res); } @@ -5606,6 +5648,7 @@ class _CopyWithImpl$Mutation$RemoveRepository$backup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Fragment$genericBackupConfigReturn get removeRepository { final local$removeRepository = _instance.removeRepository; return CopyWith$Fragment$genericBackupConfigReturn( @@ -5624,6 +5667,7 @@ class _CopyWithStubImpl$Mutation$RemoveRepository$backup String? $__typename, }) => _res; + CopyWith$Fragment$genericBackupConfigReturn get removeRepository => CopyWith$Fragment$genericBackupConfigReturn.stub(_res); } @@ -5650,6 +5694,7 @@ class Variables$Mutation$InitializeRepository { Input$InitializeRepositoryInput get repository => (_$data['repository'] as Input$InitializeRepositoryInput); + Map toJson() { final result$data = {}; final l$repository = repository; @@ -5663,6 +5708,7 @@ class Variables$Mutation$InitializeRepository { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -5841,6 +5887,7 @@ class _CopyWithImpl$Mutation$InitializeRepository ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$InitializeRepository$backup get backup { final local$backup = _instance.backup; return CopyWith$Mutation$InitializeRepository$backup( @@ -5859,6 +5906,7 @@ class _CopyWithStubImpl$Mutation$InitializeRepository String? $__typename, }) => _res; + CopyWith$Mutation$InitializeRepository$backup get backup => CopyWith$Mutation$InitializeRepository$backup.stub(_res); } @@ -6147,6 +6195,7 @@ class _CopyWithImpl$Mutation$InitializeRepository$backup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Fragment$genericBackupConfigReturn get initializeRepository { final local$initializeRepository = _instance.initializeRepository; return CopyWith$Fragment$genericBackupConfigReturn( @@ -6165,6 +6214,7 @@ class _CopyWithStubImpl$Mutation$InitializeRepository$backup String? $__typename, }) => _res; + CopyWith$Fragment$genericBackupConfigReturn get initializeRepository => CopyWith$Fragment$genericBackupConfigReturn.stub(_res); } @@ -6172,11 +6222,11 @@ class _CopyWithStubImpl$Mutation$InitializeRepository$backup class Variables$Mutation$RestoreBackup { factory Variables$Mutation$RestoreBackup({ required String snapshotId, - required Enum$RestoreStrategy strategy, + Enum$RestoreStrategy? strategy, }) => Variables$Mutation$RestoreBackup._({ r'snapshotId': snapshotId, - r'strategy': strategy, + if (strategy != null) r'strategy': strategy, }); Variables$Mutation$RestoreBackup._(this._$data); @@ -6185,23 +6235,30 @@ class Variables$Mutation$RestoreBackup { final result$data = {}; final l$snapshotId = data['snapshotId']; result$data['snapshotId'] = (l$snapshotId as String); - final l$strategy = data['strategy']; - result$data['strategy'] = - fromJson$Enum$RestoreStrategy((l$strategy as String)); + if (data.containsKey('strategy')) { + final l$strategy = data['strategy']; + result$data['strategy'] = + fromJson$Enum$RestoreStrategy((l$strategy as String)); + } return Variables$Mutation$RestoreBackup._(result$data); } Map _$data; String get snapshotId => (_$data['snapshotId'] as String); - Enum$RestoreStrategy get strategy => - (_$data['strategy'] as Enum$RestoreStrategy); + + Enum$RestoreStrategy? get strategy => + (_$data['strategy'] as Enum$RestoreStrategy?); + Map toJson() { final result$data = {}; final l$snapshotId = snapshotId; result$data['snapshotId'] = l$snapshotId; - final l$strategy = strategy; - result$data['strategy'] = toJson$Enum$RestoreStrategy(l$strategy); + if (_$data.containsKey('strategy')) { + final l$strategy = strategy; + result$data['strategy'] = + toJson$Enum$RestoreStrategy((l$strategy as Enum$RestoreStrategy)); + } return result$data; } @@ -6210,6 +6267,7 @@ class Variables$Mutation$RestoreBackup { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -6226,6 +6284,10 @@ class Variables$Mutation$RestoreBackup { } final l$strategy = strategy; final lOther$strategy = other.strategy; + if (_$data.containsKey('strategy') != + other._$data.containsKey('strategy')) { + return false; + } if (l$strategy != lOther$strategy) { return false; } @@ -6238,7 +6300,7 @@ class Variables$Mutation$RestoreBackup { final l$strategy = strategy; return Object.hashAll([ l$snapshotId, - l$strategy, + _$data.containsKey('strategy') ? l$strategy : const {}, ]); } } @@ -6408,6 +6470,7 @@ class _CopyWithImpl$Mutation$RestoreBackup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RestoreBackup$backup get backup { final local$backup = _instance.backup; return CopyWith$Mutation$RestoreBackup$backup( @@ -6426,6 +6489,7 @@ class _CopyWithStubImpl$Mutation$RestoreBackup String? $__typename, }) => _res; + CopyWith$Mutation$RestoreBackup$backup get backup => CopyWith$Mutation$RestoreBackup$backup.stub(_res); } @@ -6741,6 +6805,7 @@ class _CopyWithImpl$Mutation$RestoreBackup$backup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RestoreBackup$backup$restoreBackup get restoreBackup { final local$restoreBackup = _instance.restoreBackup; return CopyWith$Mutation$RestoreBackup$backup$restoreBackup( @@ -6759,6 +6824,7 @@ class _CopyWithStubImpl$Mutation$RestoreBackup$backup String? $__typename, }) => _res; + CopyWith$Mutation$RestoreBackup$backup$restoreBackup get restoreBackup => CopyWith$Mutation$RestoreBackup$backup$restoreBackup.stub(_res); @@ -6937,6 +7003,7 @@ class _CopyWithImpl$Mutation$RestoreBackup$backup$restoreBackup ? _instance.job : (job as Fragment$basicApiJobsFields?), )); + CopyWith$Fragment$basicApiJobsFields get job { final local$job = _instance.job; return local$job == null @@ -6959,6 +7026,7 @@ class _CopyWithStubImpl$Mutation$RestoreBackup$backup$restoreBackup Fragment$basicApiJobsFields? job, }) => _res; + CopyWith$Fragment$basicApiJobsFields get job => CopyWith$Fragment$basicApiJobsFields.stub(_res); } @@ -6982,6 +7050,7 @@ class Variables$Mutation$ForgetSnapshot { Map _$data; String get snapshotId => (_$data['snapshotId'] as String); + Map toJson() { final result$data = {}; final l$snapshotId = snapshotId; @@ -6994,6 +7063,7 @@ class Variables$Mutation$ForgetSnapshot { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -7171,6 +7241,7 @@ class _CopyWithImpl$Mutation$ForgetSnapshot ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$ForgetSnapshot$backup get backup { final local$backup = _instance.backup; return CopyWith$Mutation$ForgetSnapshot$backup( @@ -7189,6 +7260,7 @@ class _CopyWithStubImpl$Mutation$ForgetSnapshot String? $__typename, }) => _res; + CopyWith$Mutation$ForgetSnapshot$backup get backup => CopyWith$Mutation$ForgetSnapshot$backup.stub(_res); } @@ -7470,6 +7542,7 @@ class _CopyWithImpl$Mutation$ForgetSnapshot$backup ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$ForgetSnapshot$backup$forgetSnapshot get forgetSnapshot { final local$forgetSnapshot = _instance.forgetSnapshot; @@ -7489,6 +7562,7 @@ class _CopyWithStubImpl$Mutation$ForgetSnapshot$backup String? $__typename, }) => _res; + CopyWith$Mutation$ForgetSnapshot$backup$forgetSnapshot get forgetSnapshot => CopyWith$Mutation$ForgetSnapshot$backup$forgetSnapshot.stub(_res); diff --git a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart index d448df1d..6d72df6b 100644 --- a/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/disk_volumes.graphql.dart @@ -116,6 +116,7 @@ class _CopyWithImpl$Query$GetServerDiskVolumes ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$GetServerDiskVolumes$storage get storage { final local$storage = _instance.storage; return CopyWith$Query$GetServerDiskVolumes$storage( @@ -134,6 +135,7 @@ class _CopyWithStubImpl$Query$GetServerDiskVolumes String? $__typename, }) => _res; + CopyWith$Query$GetServerDiskVolumes$storage get storage => CopyWith$Query$GetServerDiskVolumes$storage.stub(_res); } @@ -577,6 +579,7 @@ class _CopyWithImpl$Query$GetServerDiskVolumes$storage ? _instance.$__typename : ($__typename as String), )); + TRes volumes( Iterable Function( Iterable< @@ -602,6 +605,7 @@ class _CopyWithStubImpl$Query$GetServerDiskVolumes$storage String? $__typename, }) => _res; + volumes(_fn) => _res; } @@ -883,6 +887,7 @@ class _CopyWithImpl$Query$GetServerDiskVolumes$storage$volumes ? _instance.$__typename : ($__typename as String), )); + TRes usages( Iterable Function( Iterable< @@ -916,6 +921,7 @@ class _CopyWithStubImpl$Query$GetServerDiskVolumes$storage$volumes String? $__typename, }) => _res; + usages(_fn) => _res; } @@ -1287,6 +1293,7 @@ class _CopyWithImpl$Query$GetServerDiskVolumes$storage$volumes$usages$$ServiceSt ? _instance.usedSpace : (usedSpace as String), )); + CopyWith$Query$GetServerDiskVolumes$storage$volumes$usages$$ServiceStorageUsage$service< TRes> get service { final local$service = _instance.service; @@ -1316,6 +1323,7 @@ class _CopyWithStubImpl$Query$GetServerDiskVolumes$storage$volumes$usages$$Servi String? usedSpace, }) => _res; + CopyWith$Query$GetServerDiskVolumes$storage$volumes$usages$$ServiceStorageUsage$service< TRes> get service => @@ -1524,6 +1532,7 @@ class Variables$Mutation$MountVolume { Map _$data; String get name => (_$data['name'] as String); + Map toJson() { final result$data = {}; final l$name = name; @@ -1536,6 +1545,7 @@ class Variables$Mutation$MountVolume { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -1617,6 +1627,7 @@ class Mutation$MountVolume { ); } + @Deprecated('Use `storage.mount_volume` instead') final Mutation$MountVolume$mountVolume mountVolume; final String $__typename; @@ -1711,6 +1722,7 @@ class _CopyWithImpl$Mutation$MountVolume ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$MountVolume$mountVolume get mountVolume { final local$mountVolume = _instance.mountVolume; return CopyWith$Mutation$MountVolume$mountVolume( @@ -1729,6 +1741,7 @@ class _CopyWithStubImpl$Mutation$MountVolume String? $__typename, }) => _res; + CopyWith$Mutation$MountVolume$mountVolume get mountVolume => CopyWith$Mutation$MountVolume$mountVolume.stub(_res); } @@ -2063,6 +2076,7 @@ class Variables$Mutation$ResizeVolume { Map _$data; String get name => (_$data['name'] as String); + Map toJson() { final result$data = {}; final l$name = name; @@ -2075,6 +2089,7 @@ class Variables$Mutation$ResizeVolume { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -2156,6 +2171,7 @@ class Mutation$ResizeVolume { ); } + @Deprecated('Use `storage.resize_volume` instead') final Mutation$ResizeVolume$resizeVolume resizeVolume; final String $__typename; @@ -2250,6 +2266,7 @@ class _CopyWithImpl$Mutation$ResizeVolume ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$ResizeVolume$resizeVolume get resizeVolume { final local$resizeVolume = _instance.resizeVolume; return CopyWith$Mutation$ResizeVolume$resizeVolume( @@ -2268,6 +2285,7 @@ class _CopyWithStubImpl$Mutation$ResizeVolume String? $__typename, }) => _res; + CopyWith$Mutation$ResizeVolume$resizeVolume get resizeVolume => CopyWith$Mutation$ResizeVolume$resizeVolume.stub(_res); } @@ -2604,6 +2622,7 @@ class Variables$Mutation$UnmountVolume { Map _$data; String get name => (_$data['name'] as String); + Map toJson() { final result$data = {}; final l$name = name; @@ -2616,6 +2635,7 @@ class Variables$Mutation$UnmountVolume { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -2697,6 +2717,7 @@ class Mutation$UnmountVolume { ); } + @Deprecated('Use `storage.unmount_volume` instead') final Mutation$UnmountVolume$unmountVolume unmountVolume; final String $__typename; @@ -2792,6 +2813,7 @@ class _CopyWithImpl$Mutation$UnmountVolume ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$UnmountVolume$unmountVolume get unmountVolume { final local$unmountVolume = _instance.unmountVolume; return CopyWith$Mutation$UnmountVolume$unmountVolume( @@ -2810,6 +2832,7 @@ class _CopyWithStubImpl$Mutation$UnmountVolume String? $__typename, }) => _res; + CopyWith$Mutation$UnmountVolume$unmountVolume get unmountVolume => CopyWith$Mutation$UnmountVolume$unmountVolume.stub(_res); } @@ -3152,6 +3175,7 @@ class Variables$Mutation$MigrateToBinds { Input$MigrateToBindsInput get input => (_$data['input'] as Input$MigrateToBindsInput); + Map toJson() { final result$data = {}; final l$input = input; @@ -3164,6 +3188,7 @@ class Variables$Mutation$MigrateToBinds { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -3246,6 +3271,7 @@ class Mutation$MigrateToBinds { ); } + @Deprecated('Use `storage.migrate_to_binds` instead') final Mutation$MigrateToBinds$migrateToBinds migrateToBinds; final String $__typename; @@ -3341,6 +3367,7 @@ class _CopyWithImpl$Mutation$MigrateToBinds ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$MigrateToBinds$migrateToBinds get migrateToBinds { final local$migrateToBinds = _instance.migrateToBinds; return CopyWith$Mutation$MigrateToBinds$migrateToBinds( @@ -3359,6 +3386,7 @@ class _CopyWithStubImpl$Mutation$MigrateToBinds String? $__typename, }) => _res; + CopyWith$Mutation$MigrateToBinds$migrateToBinds get migrateToBinds => CopyWith$Mutation$MigrateToBinds$migrateToBinds.stub(_res); } @@ -3705,6 +3733,7 @@ class _CopyWithImpl$Mutation$MigrateToBinds$migrateToBinds ? _instance.job : (job as Fragment$basicApiJobsFields?), )); + CopyWith$Fragment$basicApiJobsFields get job { final local$job = _instance.job; return local$job == null @@ -3727,6 +3756,7 @@ class _CopyWithStubImpl$Mutation$MigrateToBinds$migrateToBinds Fragment$basicApiJobsFields? job, }) => _res; + CopyWith$Fragment$basicApiJobsFields get job => CopyWith$Fragment$basicApiJobsFields.stub(_res); } diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql b/lib/logic/api_maps/graphql_maps/schema/schema.graphql index cb154193..d36f6a0f 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql @@ -150,6 +150,7 @@ type DnsRecord { recordType: String! name: String! content: String! + displayName: String! ttl: Int! priority: Int } diff --git a/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart index 538a05ff..c33b740b 100644 --- a/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/schema.graphql.dart @@ -28,7 +28,9 @@ class Input$AutoUpgradeSettingsInput { Map _$data; bool? get enableAutoUpgrade => (_$data['enableAutoUpgrade'] as bool?); + bool? get allowReboot => (_$data['allowReboot'] as bool?); + Map toJson() { final result$data = {}; if (_$data.containsKey('enableAutoUpgrade')) { @@ -47,6 +49,7 @@ class Input$AutoUpgradeSettingsInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -177,10 +180,15 @@ class Input$AutobackupQuotasInput { Map _$data; int get last => (_$data['last'] as int); + int get daily => (_$data['daily'] as int); + int get weekly => (_$data['weekly'] as int); + int get monthly => (_$data['monthly'] as int); + int get yearly => (_$data['yearly'] as int); + Map toJson() { final result$data = {}; final l$last = last; @@ -201,6 +209,7 @@ class Input$AutobackupQuotasInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -358,10 +367,15 @@ class Input$InitializeRepositoryInput { Enum$BackupProvider get provider => (_$data['provider'] as Enum$BackupProvider); + String get locationId => (_$data['locationId'] as String); + String get locationName => (_$data['locationName'] as String); + String get login => (_$data['login'] as String); + String get password => (_$data['password'] as String); + Map toJson() { final result$data = {}; final l$provider = provider; @@ -382,6 +396,7 @@ class Input$InitializeRepositoryInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -540,10 +555,15 @@ class Input$MigrateToBindsInput { Map _$data; String get emailBlockDevice => (_$data['emailBlockDevice'] as String); + String get bitwardenBlockDevice => (_$data['bitwardenBlockDevice'] as String); + String get giteaBlockDevice => (_$data['giteaBlockDevice'] as String); + String get nextcloudBlockDevice => (_$data['nextcloudBlockDevice'] as String); + String get pleromaBlockDevice => (_$data['pleromaBlockDevice'] as String); + Map toJson() { final result$data = {}; final l$emailBlockDevice = emailBlockDevice; @@ -564,6 +584,7 @@ class Input$MigrateToBindsInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -711,7 +732,9 @@ class Input$MoveServiceInput { Map _$data; String get serviceId => (_$data['serviceId'] as String); + String get location => (_$data['location'] as String); + Map toJson() { final result$data = {}; final l$serviceId = serviceId; @@ -726,6 +749,7 @@ class Input$MoveServiceInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -842,7 +866,9 @@ class Input$RecoveryKeyLimitsInput { Map _$data; DateTime? get expirationDate => (_$data['expirationDate'] as DateTime?); + int? get uses => (_$data['uses'] as int?); + Map toJson() { final result$data = {}; if (_$data.containsKey('expirationDate')) { @@ -862,6 +888,7 @@ class Input$RecoveryKeyLimitsInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -979,7 +1006,9 @@ class Input$SshMutationInput { Map _$data; String get username => (_$data['username'] as String); + String get sshKey => (_$data['sshKey'] as String); + Map toJson() { final result$data = {}; final l$username = username; @@ -994,6 +1023,7 @@ class Input$SshMutationInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -1105,7 +1135,9 @@ class Input$UseNewDeviceKeyInput { Map _$data; String get key => (_$data['key'] as String); + String get deviceName => (_$data['deviceName'] as String); + Map toJson() { final result$data = {}; final l$key = key; @@ -1120,6 +1152,7 @@ class Input$UseNewDeviceKeyInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -1230,7 +1263,9 @@ class Input$UseRecoveryKeyInput { Map _$data; String get key => (_$data['key'] as String); + String get deviceName => (_$data['deviceName'] as String); + Map toJson() { final result$data = {}; final l$key = key; @@ -1245,6 +1280,7 @@ class Input$UseRecoveryKeyInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -1355,7 +1391,9 @@ class Input$UserMutationInput { Map _$data; String get username => (_$data['username'] as String); + String get password => (_$data['password'] as String); + Map toJson() { final result$data = {}; final l$username = username; @@ -1370,6 +1408,7 @@ class Input$UserMutationInput { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -1710,6 +1749,177 @@ Enum$UserType fromJson$Enum$UserType(String value) { } } +enum Enum$__TypeKind { + SCALAR, + OBJECT, + INTERFACE, + UNION, + ENUM, + INPUT_OBJECT, + LIST, + NON_NULL, + $unknown +} + +String toJson$Enum$__TypeKind(Enum$__TypeKind e) { + switch (e) { + case Enum$__TypeKind.SCALAR: + return r'SCALAR'; + case Enum$__TypeKind.OBJECT: + return r'OBJECT'; + case Enum$__TypeKind.INTERFACE: + return r'INTERFACE'; + case Enum$__TypeKind.UNION: + return r'UNION'; + case Enum$__TypeKind.ENUM: + return r'ENUM'; + case Enum$__TypeKind.INPUT_OBJECT: + return r'INPUT_OBJECT'; + case Enum$__TypeKind.LIST: + return r'LIST'; + case Enum$__TypeKind.NON_NULL: + return r'NON_NULL'; + case Enum$__TypeKind.$unknown: + return r'$unknown'; + } +} + +Enum$__TypeKind fromJson$Enum$__TypeKind(String value) { + switch (value) { + case r'SCALAR': + return Enum$__TypeKind.SCALAR; + case r'OBJECT': + return Enum$__TypeKind.OBJECT; + case r'INTERFACE': + return Enum$__TypeKind.INTERFACE; + case r'UNION': + return Enum$__TypeKind.UNION; + case r'ENUM': + return Enum$__TypeKind.ENUM; + case r'INPUT_OBJECT': + return Enum$__TypeKind.INPUT_OBJECT; + case r'LIST': + return Enum$__TypeKind.LIST; + case r'NON_NULL': + return Enum$__TypeKind.NON_NULL; + default: + return Enum$__TypeKind.$unknown; + } +} + +enum Enum$__DirectiveLocation { + QUERY, + MUTATION, + SUBSCRIPTION, + FIELD, + FRAGMENT_DEFINITION, + FRAGMENT_SPREAD, + INLINE_FRAGMENT, + VARIABLE_DEFINITION, + SCHEMA, + SCALAR, + OBJECT, + FIELD_DEFINITION, + ARGUMENT_DEFINITION, + INTERFACE, + UNION, + ENUM, + ENUM_VALUE, + INPUT_OBJECT, + INPUT_FIELD_DEFINITION, + $unknown +} + +String toJson$Enum$__DirectiveLocation(Enum$__DirectiveLocation e) { + switch (e) { + case Enum$__DirectiveLocation.QUERY: + return r'QUERY'; + case Enum$__DirectiveLocation.MUTATION: + return r'MUTATION'; + case Enum$__DirectiveLocation.SUBSCRIPTION: + return r'SUBSCRIPTION'; + case Enum$__DirectiveLocation.FIELD: + return r'FIELD'; + case Enum$__DirectiveLocation.FRAGMENT_DEFINITION: + return r'FRAGMENT_DEFINITION'; + case Enum$__DirectiveLocation.FRAGMENT_SPREAD: + return r'FRAGMENT_SPREAD'; + case Enum$__DirectiveLocation.INLINE_FRAGMENT: + return r'INLINE_FRAGMENT'; + case Enum$__DirectiveLocation.VARIABLE_DEFINITION: + return r'VARIABLE_DEFINITION'; + case Enum$__DirectiveLocation.SCHEMA: + return r'SCHEMA'; + case Enum$__DirectiveLocation.SCALAR: + return r'SCALAR'; + case Enum$__DirectiveLocation.OBJECT: + return r'OBJECT'; + case Enum$__DirectiveLocation.FIELD_DEFINITION: + return r'FIELD_DEFINITION'; + case Enum$__DirectiveLocation.ARGUMENT_DEFINITION: + return r'ARGUMENT_DEFINITION'; + case Enum$__DirectiveLocation.INTERFACE: + return r'INTERFACE'; + case Enum$__DirectiveLocation.UNION: + return r'UNION'; + case Enum$__DirectiveLocation.ENUM: + return r'ENUM'; + case Enum$__DirectiveLocation.ENUM_VALUE: + return r'ENUM_VALUE'; + case Enum$__DirectiveLocation.INPUT_OBJECT: + return r'INPUT_OBJECT'; + case Enum$__DirectiveLocation.INPUT_FIELD_DEFINITION: + return r'INPUT_FIELD_DEFINITION'; + case Enum$__DirectiveLocation.$unknown: + return r'$unknown'; + } +} + +Enum$__DirectiveLocation fromJson$Enum$__DirectiveLocation(String value) { + switch (value) { + case r'QUERY': + return Enum$__DirectiveLocation.QUERY; + case r'MUTATION': + return Enum$__DirectiveLocation.MUTATION; + case r'SUBSCRIPTION': + return Enum$__DirectiveLocation.SUBSCRIPTION; + case r'FIELD': + return Enum$__DirectiveLocation.FIELD; + case r'FRAGMENT_DEFINITION': + return Enum$__DirectiveLocation.FRAGMENT_DEFINITION; + case r'FRAGMENT_SPREAD': + return Enum$__DirectiveLocation.FRAGMENT_SPREAD; + case r'INLINE_FRAGMENT': + return Enum$__DirectiveLocation.INLINE_FRAGMENT; + case r'VARIABLE_DEFINITION': + return Enum$__DirectiveLocation.VARIABLE_DEFINITION; + case r'SCHEMA': + return Enum$__DirectiveLocation.SCHEMA; + case r'SCALAR': + return Enum$__DirectiveLocation.SCALAR; + case r'OBJECT': + return Enum$__DirectiveLocation.OBJECT; + case r'FIELD_DEFINITION': + return Enum$__DirectiveLocation.FIELD_DEFINITION; + case r'ARGUMENT_DEFINITION': + return Enum$__DirectiveLocation.ARGUMENT_DEFINITION; + case r'INTERFACE': + return Enum$__DirectiveLocation.INTERFACE; + case r'UNION': + return Enum$__DirectiveLocation.UNION; + case r'ENUM': + return Enum$__DirectiveLocation.ENUM; + case r'ENUM_VALUE': + return Enum$__DirectiveLocation.ENUM_VALUE; + case r'INPUT_OBJECT': + return Enum$__DirectiveLocation.INPUT_OBJECT; + case r'INPUT_FIELD_DEFINITION': + return Enum$__DirectiveLocation.INPUT_FIELD_DEFINITION; + default: + return Enum$__DirectiveLocation.$unknown; + } +} + const possibleTypesMap = >{ 'MutationReturnInterface': { 'ApiKeyMutationReturn', diff --git a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart index 3fed1110..431f8c49 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_api.graphql.dart @@ -2871,6 +2871,7 @@ class _CopyWithImpl$Query$GetApiVersion ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$GetApiVersion$api get api { final local$api = _instance.api; return CopyWith$Query$GetApiVersion$api(local$api, (e) => call(api: e)); @@ -2888,6 +2889,7 @@ class _CopyWithStubImpl$Query$GetApiVersion String? $__typename, }) => _res; + CopyWith$Query$GetApiVersion$api get api => CopyWith$Query$GetApiVersion$api.stub(_res); } @@ -3283,6 +3285,7 @@ class _CopyWithImpl$Query$GetApiJobs ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$GetApiJobs$jobs get jobs { final local$jobs = _instance.jobs; return CopyWith$Query$GetApiJobs$jobs(local$jobs, (e) => call(jobs: e)); @@ -3300,6 +3303,7 @@ class _CopyWithStubImpl$Query$GetApiJobs String? $__typename, }) => _res; + CopyWith$Query$GetApiJobs$jobs get jobs => CopyWith$Query$GetApiJobs$jobs.stub(_res); } @@ -3596,6 +3600,7 @@ class _CopyWithImpl$Query$GetApiJobs$jobs ? _instance.$__typename : ($__typename as String), )); + TRes getJobs( Iterable Function( Iterable< @@ -3621,6 +3626,7 @@ class _CopyWithStubImpl$Query$GetApiJobs$jobs String? $__typename, }) => _res; + getJobs(_fn) => _res; } @@ -3642,6 +3648,7 @@ class Variables$Mutation$RemoveJob { Map _$data; String get jobId => (_$data['jobId'] as String); + Map toJson() { final result$data = {}; final l$jobId = jobId; @@ -3654,6 +3661,7 @@ class Variables$Mutation$RemoveJob { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -3735,6 +3743,7 @@ class Mutation$RemoveJob { ); } + @Deprecated('Use `jobs.remove_job` instead') final Mutation$RemoveJob$removeJob removeJob; final String $__typename; @@ -3829,6 +3838,7 @@ class _CopyWithImpl$Mutation$RemoveJob ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RemoveJob$removeJob get removeJob { final local$removeJob = _instance.removeJob; return CopyWith$Mutation$RemoveJob$removeJob( @@ -3847,6 +3857,7 @@ class _CopyWithStubImpl$Mutation$RemoveJob String? $__typename, }) => _res; + CopyWith$Mutation$RemoveJob$removeJob get removeJob => CopyWith$Mutation$RemoveJob$removeJob.stub(_res); } @@ -4178,6 +4189,7 @@ class Mutation$RunSystemRebuild { ); } + @Deprecated('Use `system.run_system_rebuild` instead') final Mutation$RunSystemRebuild$runSystemRebuild runSystemRebuild; final String $__typename; @@ -4276,6 +4288,7 @@ class _CopyWithImpl$Mutation$RunSystemRebuild ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RunSystemRebuild$runSystemRebuild get runSystemRebuild { final local$runSystemRebuild = _instance.runSystemRebuild; @@ -4295,6 +4308,7 @@ class _CopyWithStubImpl$Mutation$RunSystemRebuild String? $__typename, }) => _res; + CopyWith$Mutation$RunSystemRebuild$runSystemRebuild get runSystemRebuild => CopyWith$Mutation$RunSystemRebuild$runSystemRebuild.stub(_res); @@ -4615,6 +4629,7 @@ class Mutation$RunSystemRollback { ); } + @Deprecated('Use `system.run_system_rollback` instead') final Mutation$RunSystemRollback$runSystemRollback runSystemRollback; final String $__typename; @@ -4714,6 +4729,7 @@ class _CopyWithImpl$Mutation$RunSystemRollback ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RunSystemRollback$runSystemRollback get runSystemRollback { final local$runSystemRollback = _instance.runSystemRollback; @@ -4733,6 +4749,7 @@ class _CopyWithStubImpl$Mutation$RunSystemRollback String? $__typename, }) => _res; + CopyWith$Mutation$RunSystemRollback$runSystemRollback get runSystemRollback => CopyWith$Mutation$RunSystemRollback$runSystemRollback.stub(_res); @@ -5054,6 +5071,7 @@ class Mutation$RunSystemUpgrade { ); } + @Deprecated('Use `system.run_system_upgrade` instead') final Mutation$RunSystemUpgrade$runSystemUpgrade runSystemUpgrade; final String $__typename; @@ -5152,6 +5170,7 @@ class _CopyWithImpl$Mutation$RunSystemUpgrade ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RunSystemUpgrade$runSystemUpgrade get runSystemUpgrade { final local$runSystemUpgrade = _instance.runSystemUpgrade; @@ -5171,6 +5190,7 @@ class _CopyWithStubImpl$Mutation$RunSystemUpgrade String? $__typename, }) => _res; + CopyWith$Mutation$RunSystemUpgrade$runSystemUpgrade get runSystemUpgrade => CopyWith$Mutation$RunSystemUpgrade$runSystemUpgrade.stub(_res); @@ -5492,6 +5512,7 @@ class Mutation$PullRepositoryChanges { ); } + @Deprecated('Use `system.pull_repository_changes` instead') final Mutation$PullRepositoryChanges$pullRepositoryChanges pullRepositoryChanges; @@ -5592,6 +5613,7 @@ class _CopyWithImpl$Mutation$PullRepositoryChanges ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$PullRepositoryChanges$pullRepositoryChanges get pullRepositoryChanges { final local$pullRepositoryChanges = _instance.pullRepositoryChanges; @@ -5611,6 +5633,7 @@ class _CopyWithStubImpl$Mutation$PullRepositoryChanges String? $__typename, }) => _res; + CopyWith$Mutation$PullRepositoryChanges$pullRepositoryChanges get pullRepositoryChanges => CopyWith$Mutation$PullRepositoryChanges$pullRepositoryChanges.stub( @@ -5945,6 +5968,7 @@ class Mutation$RebootSystem { ); } + @Deprecated('Use `system.reboot_system` instead') final Mutation$RebootSystem$rebootSystem rebootSystem; final String $__typename; @@ -6039,6 +6063,7 @@ class _CopyWithImpl$Mutation$RebootSystem ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RebootSystem$rebootSystem get rebootSystem { final local$rebootSystem = _instance.rebootSystem; return CopyWith$Mutation$RebootSystem$rebootSystem( @@ -6057,6 +6082,7 @@ class _CopyWithStubImpl$Mutation$RebootSystem String? $__typename, }) => _res; + CopyWith$Mutation$RebootSystem$rebootSystem get rebootSystem => CopyWith$Mutation$RebootSystem$rebootSystem.stub(_res); } @@ -6468,6 +6494,7 @@ class _CopyWithImpl$Query$SystemServerProvider ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$SystemServerProvider$system get system { final local$system = _instance.system; return CopyWith$Query$SystemServerProvider$system( @@ -6486,6 +6513,7 @@ class _CopyWithStubImpl$Query$SystemServerProvider String? $__typename, }) => _res; + CopyWith$Query$SystemServerProvider$system get system => CopyWith$Query$SystemServerProvider$system.stub(_res); } @@ -6783,6 +6811,7 @@ class _CopyWithImpl$Query$SystemServerProvider$system ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$SystemServerProvider$system$provider get provider { final local$provider = _instance.provider; return CopyWith$Query$SystemServerProvider$system$provider( @@ -6801,6 +6830,7 @@ class _CopyWithStubImpl$Query$SystemServerProvider$system String? $__typename, }) => _res; + CopyWith$Query$SystemServerProvider$system$provider get provider => CopyWith$Query$SystemServerProvider$system$provider.stub(_res); } @@ -7043,6 +7073,7 @@ class _CopyWithImpl$Query$SystemDnsProvider ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$SystemDnsProvider$system get system { final local$system = _instance.system; return CopyWith$Query$SystemDnsProvider$system( @@ -7061,6 +7092,7 @@ class _CopyWithStubImpl$Query$SystemDnsProvider String? $__typename, }) => _res; + CopyWith$Query$SystemDnsProvider$system get system => CopyWith$Query$SystemDnsProvider$system.stub(_res); } @@ -7355,6 +7387,7 @@ class _CopyWithImpl$Query$SystemDnsProvider$system ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$SystemDnsProvider$system$domainInfo get domainInfo { final local$domainInfo = _instance.domainInfo; return CopyWith$Query$SystemDnsProvider$system$domainInfo( @@ -7373,6 +7406,7 @@ class _CopyWithStubImpl$Query$SystemDnsProvider$system String? $__typename, }) => _res; + CopyWith$Query$SystemDnsProvider$system$domainInfo get domainInfo => CopyWith$Query$SystemDnsProvider$system$domainInfo.stub(_res); } @@ -7613,6 +7647,7 @@ class _CopyWithImpl$Query$GetApiTokens ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$GetApiTokens$api get api { final local$api = _instance.api; return CopyWith$Query$GetApiTokens$api(local$api, (e) => call(api: e)); @@ -7630,6 +7665,7 @@ class _CopyWithStubImpl$Query$GetApiTokens String? $__typename, }) => _res; + CopyWith$Query$GetApiTokens$api get api => CopyWith$Query$GetApiTokens$api.stub(_res); } @@ -7946,6 +7982,7 @@ class _CopyWithImpl$Query$GetApiTokens$api ? _instance.$__typename : ($__typename as String), )); + TRes devices( Iterable Function( Iterable< @@ -7971,6 +8008,7 @@ class _CopyWithStubImpl$Query$GetApiTokens$api String? $__typename, }) => _res; + devices(_fn) => _res; } @@ -8248,6 +8286,7 @@ class _CopyWithImpl$Query$RecoveryKey ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$RecoveryKey$api get api { final local$api = _instance.api; return CopyWith$Query$RecoveryKey$api(local$api, (e) => call(api: e)); @@ -8265,6 +8304,7 @@ class _CopyWithStubImpl$Query$RecoveryKey String? $__typename, }) => _res; + CopyWith$Query$RecoveryKey$api get api => CopyWith$Query$RecoveryKey$api.stub(_res); } @@ -8578,6 +8618,7 @@ class _CopyWithImpl$Query$RecoveryKey$api ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$RecoveryKey$api$recoveryKey get recoveryKey { final local$recoveryKey = _instance.recoveryKey; return CopyWith$Query$RecoveryKey$api$recoveryKey( @@ -8596,6 +8637,7 @@ class _CopyWithStubImpl$Query$RecoveryKey$api String? $__typename, }) => _res; + CopyWith$Query$RecoveryKey$api$recoveryKey get recoveryKey => CopyWith$Query$RecoveryKey$api$recoveryKey.stub(_res); } @@ -8835,6 +8877,7 @@ class Variables$Mutation$GetNewRecoveryApiKey { Input$RecoveryKeyLimitsInput? get limits => (_$data['limits'] as Input$RecoveryKeyLimitsInput?); + Map toJson() { final result$data = {}; if (_$data.containsKey('limits')) { @@ -8850,6 +8893,7 @@ class Variables$Mutation$GetNewRecoveryApiKey { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -8936,6 +8980,7 @@ class Mutation$GetNewRecoveryApiKey { ); } + @Deprecated('Use `api.get_new_recovery_api_key` instead') final Mutation$GetNewRecoveryApiKey$getNewRecoveryApiKey getNewRecoveryApiKey; final String $__typename; @@ -9035,6 +9080,7 @@ class _CopyWithImpl$Mutation$GetNewRecoveryApiKey ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$GetNewRecoveryApiKey$getNewRecoveryApiKey get getNewRecoveryApiKey { final local$getNewRecoveryApiKey = _instance.getNewRecoveryApiKey; @@ -9054,6 +9100,7 @@ class _CopyWithStubImpl$Mutation$GetNewRecoveryApiKey String? $__typename, }) => _res; + CopyWith$Mutation$GetNewRecoveryApiKey$getNewRecoveryApiKey get getNewRecoveryApiKey => CopyWith$Mutation$GetNewRecoveryApiKey$getNewRecoveryApiKey.stub( @@ -9435,6 +9482,7 @@ class Variables$Mutation$UseRecoveryApiKey { Input$UseRecoveryKeyInput get input => (_$data['input'] as Input$UseRecoveryKeyInput); + Map toJson() { final result$data = {}; final l$input = input; @@ -9448,6 +9496,7 @@ class Variables$Mutation$UseRecoveryApiKey { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -9530,6 +9579,7 @@ class Mutation$UseRecoveryApiKey { ); } + @Deprecated('Use `api.use_recovery_api_key` instead') final Mutation$UseRecoveryApiKey$useRecoveryApiKey useRecoveryApiKey; final String $__typename; @@ -9629,6 +9679,7 @@ class _CopyWithImpl$Mutation$UseRecoveryApiKey ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$UseRecoveryApiKey$useRecoveryApiKey get useRecoveryApiKey { final local$useRecoveryApiKey = _instance.useRecoveryApiKey; @@ -9648,6 +9699,7 @@ class _CopyWithStubImpl$Mutation$UseRecoveryApiKey String? $__typename, }) => _res; + CopyWith$Mutation$UseRecoveryApiKey$useRecoveryApiKey get useRecoveryApiKey => CopyWith$Mutation$UseRecoveryApiKey$useRecoveryApiKey.stub(_res); @@ -10015,6 +10067,7 @@ class Mutation$RefreshDeviceApiToken { ); } + @Deprecated('Use `api.refresh_device_api_token` instead') final Mutation$RefreshDeviceApiToken$refreshDeviceApiToken refreshDeviceApiToken; @@ -10115,6 +10168,7 @@ class _CopyWithImpl$Mutation$RefreshDeviceApiToken ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RefreshDeviceApiToken$refreshDeviceApiToken get refreshDeviceApiToken { final local$refreshDeviceApiToken = _instance.refreshDeviceApiToken; @@ -10134,6 +10188,7 @@ class _CopyWithStubImpl$Mutation$RefreshDeviceApiToken String? $__typename, }) => _res; + CopyWith$Mutation$RefreshDeviceApiToken$refreshDeviceApiToken get refreshDeviceApiToken => CopyWith$Mutation$RefreshDeviceApiToken$refreshDeviceApiToken.stub( @@ -10497,6 +10552,7 @@ class Variables$Mutation$DeleteDeviceApiToken { Map _$data; String get device => (_$data['device'] as String); + Map toJson() { final result$data = {}; final l$device = device; @@ -10510,6 +10566,7 @@ class Variables$Mutation$DeleteDeviceApiToken { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -10593,6 +10650,7 @@ class Mutation$DeleteDeviceApiToken { ); } + @Deprecated('Use `api.delete_device_api_token` instead') final Mutation$DeleteDeviceApiToken$deleteDeviceApiToken deleteDeviceApiToken; final String $__typename; @@ -10692,6 +10750,7 @@ class _CopyWithImpl$Mutation$DeleteDeviceApiToken ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$DeleteDeviceApiToken$deleteDeviceApiToken get deleteDeviceApiToken { final local$deleteDeviceApiToken = _instance.deleteDeviceApiToken; @@ -10711,6 +10770,7 @@ class _CopyWithStubImpl$Mutation$DeleteDeviceApiToken String? $__typename, }) => _res; + CopyWith$Mutation$DeleteDeviceApiToken$deleteDeviceApiToken get deleteDeviceApiToken => CopyWith$Mutation$DeleteDeviceApiToken$deleteDeviceApiToken.stub( @@ -11061,6 +11121,7 @@ class Mutation$GetNewDeviceApiKey { ); } + @Deprecated('Use `api.get_new_device_api_key` instead') final Mutation$GetNewDeviceApiKey$getNewDeviceApiKey getNewDeviceApiKey; final String $__typename; @@ -11160,6 +11221,7 @@ class _CopyWithImpl$Mutation$GetNewDeviceApiKey ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$GetNewDeviceApiKey$getNewDeviceApiKey get getNewDeviceApiKey { final local$getNewDeviceApiKey = _instance.getNewDeviceApiKey; @@ -11179,6 +11241,7 @@ class _CopyWithStubImpl$Mutation$GetNewDeviceApiKey String? $__typename, }) => _res; + CopyWith$Mutation$GetNewDeviceApiKey$getNewDeviceApiKey get getNewDeviceApiKey => CopyWith$Mutation$GetNewDeviceApiKey$getNewDeviceApiKey.stub(_res); @@ -11528,6 +11591,7 @@ class Mutation$InvalidateNewDeviceApiKey { ); } + @Deprecated('Use `api.invalidate_new_device_api_key` instead') final Mutation$InvalidateNewDeviceApiKey$invalidateNewDeviceApiKey invalidateNewDeviceApiKey; @@ -11631,6 +11695,7 @@ class _CopyWithImpl$Mutation$InvalidateNewDeviceApiKey ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$InvalidateNewDeviceApiKey$invalidateNewDeviceApiKey get invalidateNewDeviceApiKey { final local$invalidateNewDeviceApiKey = _instance.invalidateNewDeviceApiKey; @@ -11652,6 +11717,7 @@ class _CopyWithStubImpl$Mutation$InvalidateNewDeviceApiKey String? $__typename, }) => _res; + CopyWith$Mutation$InvalidateNewDeviceApiKey$invalidateNewDeviceApiKey get invalidateNewDeviceApiKey => CopyWith$Mutation$InvalidateNewDeviceApiKey$invalidateNewDeviceApiKey @@ -11998,6 +12064,7 @@ class Variables$Mutation$AuthorizeWithNewDeviceApiKey { Input$UseNewDeviceKeyInput get input => (_$data['input'] as Input$UseNewDeviceKeyInput); + Map toJson() { final result$data = {}; final l$input = input; @@ -12011,6 +12078,7 @@ class Variables$Mutation$AuthorizeWithNewDeviceApiKey { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -12097,6 +12165,7 @@ class Mutation$AuthorizeWithNewDeviceApiKey { ); } + @Deprecated('Use `api.authorize_with_new_device_api_key` instead') final Mutation$AuthorizeWithNewDeviceApiKey$authorizeWithNewDeviceApiKey authorizeWithNewDeviceApiKey; @@ -12202,6 +12271,7 @@ class _CopyWithImpl$Mutation$AuthorizeWithNewDeviceApiKey ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$AuthorizeWithNewDeviceApiKey$authorizeWithNewDeviceApiKey< TRes> get authorizeWithNewDeviceApiKey { final local$authorizeWithNewDeviceApiKey = @@ -12224,6 +12294,7 @@ class _CopyWithStubImpl$Mutation$AuthorizeWithNewDeviceApiKey String? $__typename, }) => _res; + CopyWith$Mutation$AuthorizeWithNewDeviceApiKey$authorizeWithNewDeviceApiKey< TRes> get authorizeWithNewDeviceApiKey => diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql index f0fbedd6..6de0a67a 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql @@ -25,12 +25,13 @@ query SystemIsUsingBinds { fragment fragmentDnsRecords on DnsRecord { recordType name + displayName content ttl priority } -query DomainInfo { +query GetDnsRecords { system { domainInfo { domain diff --git a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart index bcc677e8..52989adf 100644 --- a/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/server_settings.graphql.dart @@ -8,6 +8,7 @@ class Fragment$fragmentDnsRecords { Fragment$fragmentDnsRecords({ required this.recordType, required this.name, + required this.displayName, required this.content, required this.ttl, this.priority, @@ -17,6 +18,7 @@ class Fragment$fragmentDnsRecords { factory Fragment$fragmentDnsRecords.fromJson(Map json) { final l$recordType = json['recordType']; final l$name = json['name']; + final l$displayName = json['displayName']; final l$content = json['content']; final l$ttl = json['ttl']; final l$priority = json['priority']; @@ -24,6 +26,7 @@ class Fragment$fragmentDnsRecords { return Fragment$fragmentDnsRecords( recordType: (l$recordType as String), name: (l$name as String), + displayName: (l$displayName as String), content: (l$content as String), ttl: (l$ttl as int), priority: (l$priority as int?), @@ -35,6 +38,8 @@ class Fragment$fragmentDnsRecords { final String name; + final String displayName; + final String content; final int ttl; @@ -49,6 +54,8 @@ class Fragment$fragmentDnsRecords { _resultData['recordType'] = l$recordType; final l$name = name; _resultData['name'] = l$name; + final l$displayName = displayName; + _resultData['displayName'] = l$displayName; final l$content = content; _resultData['content'] = l$content; final l$ttl = ttl; @@ -64,6 +71,7 @@ class Fragment$fragmentDnsRecords { int get hashCode { final l$recordType = recordType; final l$name = name; + final l$displayName = displayName; final l$content = content; final l$ttl = ttl; final l$priority = priority; @@ -71,6 +79,7 @@ class Fragment$fragmentDnsRecords { return Object.hashAll([ l$recordType, l$name, + l$displayName, l$content, l$ttl, l$priority, @@ -97,6 +106,11 @@ class Fragment$fragmentDnsRecords { if (l$name != lOther$name) { return false; } + final l$displayName = displayName; + final lOther$displayName = other.displayName; + if (l$displayName != lOther$displayName) { + return false; + } final l$content = content; final lOther$content = other.content; if (l$content != lOther$content) { @@ -142,6 +156,7 @@ abstract class CopyWith$Fragment$fragmentDnsRecords { TRes call({ String? recordType, String? name, + String? displayName, String? content, int? ttl, int? priority, @@ -165,6 +180,7 @@ class _CopyWithImpl$Fragment$fragmentDnsRecords TRes call({ Object? recordType = _undefined, Object? name = _undefined, + Object? displayName = _undefined, Object? content = _undefined, Object? ttl = _undefined, Object? priority = _undefined, @@ -177,6 +193,9 @@ class _CopyWithImpl$Fragment$fragmentDnsRecords name: name == _undefined || name == null ? _instance.name : (name as String), + displayName: displayName == _undefined || displayName == null + ? _instance.displayName + : (displayName as String), content: content == _undefined || content == null ? _instance.content : (content as String), @@ -198,6 +217,7 @@ class _CopyWithStubImpl$Fragment$fragmentDnsRecords call({ String? recordType, String? name, + String? displayName, String? content, int? ttl, int? priority, @@ -229,6 +249,13 @@ const fragmentDefinitionfragmentDnsRecords = FragmentDefinitionNode( directives: [], selectionSet: null, ), + FieldNode( + name: NameNode(value: 'displayName'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), FieldNode( name: NameNode(value: 'content'), alias: null, @@ -408,6 +435,7 @@ class _CopyWithImpl$Query$SystemSettings ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$SystemSettings$system get system { final local$system = _instance.system; return CopyWith$Query$SystemSettings$system( @@ -426,6 +454,7 @@ class _CopyWithStubImpl$Query$SystemSettings String? $__typename, }) => _res; + CopyWith$Query$SystemSettings$system get system => CopyWith$Query$SystemSettings$system.stub(_res); } @@ -774,6 +803,7 @@ class _CopyWithImpl$Query$SystemSettings$system ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$SystemSettings$system$settings get settings { final local$settings = _instance.settings; return CopyWith$Query$SystemSettings$system$settings( @@ -792,6 +822,7 @@ class _CopyWithStubImpl$Query$SystemSettings$system String? $__typename, }) => _res; + CopyWith$Query$SystemSettings$system$settings get settings => CopyWith$Query$SystemSettings$system$settings.stub(_res); } @@ -951,6 +982,7 @@ class _CopyWithImpl$Query$SystemSettings$system$settings ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$SystemSettings$system$settings$autoUpgrade get autoUpgrade { final local$autoUpgrade = _instance.autoUpgrade; @@ -978,9 +1010,11 @@ class _CopyWithStubImpl$Query$SystemSettings$system$settings String? $__typename, }) => _res; + CopyWith$Query$SystemSettings$system$settings$autoUpgrade get autoUpgrade => CopyWith$Query$SystemSettings$system$settings$autoUpgrade.stub(_res); + CopyWith$Query$SystemSettings$system$settings$ssh get ssh => CopyWith$Query$SystemSettings$system$settings$ssh.stub(_res); } @@ -1393,6 +1427,7 @@ class _CopyWithImpl$Query$SystemIsUsingBinds ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$SystemIsUsingBinds$system get system { final local$system = _instance.system; return CopyWith$Query$SystemIsUsingBinds$system( @@ -1411,6 +1446,7 @@ class _CopyWithStubImpl$Query$SystemIsUsingBinds String? $__typename, }) => _res; + CopyWith$Query$SystemIsUsingBinds$system get system => CopyWith$Query$SystemIsUsingBinds$system.stub(_res); } @@ -1707,6 +1743,7 @@ class _CopyWithImpl$Query$SystemIsUsingBinds$system ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$SystemIsUsingBinds$system$info get info { final local$info = _instance.info; return CopyWith$Query$SystemIsUsingBinds$system$info( @@ -1725,6 +1762,7 @@ class _CopyWithStubImpl$Query$SystemIsUsingBinds$system String? $__typename, }) => _res; + CopyWith$Query$SystemIsUsingBinds$system$info get info => CopyWith$Query$SystemIsUsingBinds$system$info.stub(_res); } @@ -1856,23 +1894,23 @@ class _CopyWithStubImpl$Query$SystemIsUsingBinds$system$info _res; } -class Query$DomainInfo { - Query$DomainInfo({ +class Query$GetDnsRecords { + Query$GetDnsRecords({ required this.system, this.$__typename = 'Query', }); - factory Query$DomainInfo.fromJson(Map json) { + factory Query$GetDnsRecords.fromJson(Map json) { final l$system = json['system']; final l$$__typename = json['__typename']; - return Query$DomainInfo( - system: - Query$DomainInfo$system.fromJson((l$system as Map)), + return Query$GetDnsRecords( + system: Query$GetDnsRecords$system.fromJson( + (l$system as Map)), $__typename: (l$$__typename as String), ); } - final Query$DomainInfo$system system; + final Query$GetDnsRecords$system system; final String $__typename; @@ -1900,7 +1938,7 @@ class Query$DomainInfo { if (identical(this, other)) { return true; } - if (!(other is Query$DomainInfo) || runtimeType != other.runtimeType) { + if (!(other is Query$GetDnsRecords) || runtimeType != other.runtimeType) { return false; } final l$system = system; @@ -1917,40 +1955,40 @@ class Query$DomainInfo { } } -extension UtilityExtension$Query$DomainInfo on Query$DomainInfo { - CopyWith$Query$DomainInfo get copyWith => - CopyWith$Query$DomainInfo( +extension UtilityExtension$Query$GetDnsRecords on Query$GetDnsRecords { + CopyWith$Query$GetDnsRecords get copyWith => + CopyWith$Query$GetDnsRecords( this, (i) => i, ); } -abstract class CopyWith$Query$DomainInfo { - factory CopyWith$Query$DomainInfo( - Query$DomainInfo instance, - TRes Function(Query$DomainInfo) then, - ) = _CopyWithImpl$Query$DomainInfo; +abstract class CopyWith$Query$GetDnsRecords { + factory CopyWith$Query$GetDnsRecords( + Query$GetDnsRecords instance, + TRes Function(Query$GetDnsRecords) then, + ) = _CopyWithImpl$Query$GetDnsRecords; - factory CopyWith$Query$DomainInfo.stub(TRes res) = - _CopyWithStubImpl$Query$DomainInfo; + factory CopyWith$Query$GetDnsRecords.stub(TRes res) = + _CopyWithStubImpl$Query$GetDnsRecords; TRes call({ - Query$DomainInfo$system? system, + Query$GetDnsRecords$system? system, String? $__typename, }); - CopyWith$Query$DomainInfo$system get system; + CopyWith$Query$GetDnsRecords$system get system; } -class _CopyWithImpl$Query$DomainInfo - implements CopyWith$Query$DomainInfo { - _CopyWithImpl$Query$DomainInfo( +class _CopyWithImpl$Query$GetDnsRecords + implements CopyWith$Query$GetDnsRecords { + _CopyWithImpl$Query$GetDnsRecords( this._instance, this._then, ); - final Query$DomainInfo _instance; + final Query$GetDnsRecords _instance; - final TRes Function(Query$DomainInfo) _then; + final TRes Function(Query$GetDnsRecords) _then; static const _undefined = {}; @@ -1958,40 +1996,42 @@ class _CopyWithImpl$Query$DomainInfo Object? system = _undefined, Object? $__typename = _undefined, }) => - _then(Query$DomainInfo( + _then(Query$GetDnsRecords( system: system == _undefined || system == null ? _instance.system - : (system as Query$DomainInfo$system), + : (system as Query$GetDnsRecords$system), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); - CopyWith$Query$DomainInfo$system get system { + + CopyWith$Query$GetDnsRecords$system get system { final local$system = _instance.system; - return CopyWith$Query$DomainInfo$system( + return CopyWith$Query$GetDnsRecords$system( local$system, (e) => call(system: e)); } } -class _CopyWithStubImpl$Query$DomainInfo - implements CopyWith$Query$DomainInfo { - _CopyWithStubImpl$Query$DomainInfo(this._res); +class _CopyWithStubImpl$Query$GetDnsRecords + implements CopyWith$Query$GetDnsRecords { + _CopyWithStubImpl$Query$GetDnsRecords(this._res); TRes _res; call({ - Query$DomainInfo$system? system, + Query$GetDnsRecords$system? system, String? $__typename, }) => _res; - CopyWith$Query$DomainInfo$system get system => - CopyWith$Query$DomainInfo$system.stub(_res); + + CopyWith$Query$GetDnsRecords$system get system => + CopyWith$Query$GetDnsRecords$system.stub(_res); } -const documentNodeQueryDomainInfo = DocumentNode(definitions: [ +const documentNodeQueryGetDnsRecords = DocumentNode(definitions: [ OperationDefinitionNode( type: OperationType.query, - name: NameNode(value: 'DomainInfo'), + name: NameNode(value: 'GetDnsRecords'), variableDefinitions: [], directives: [], selectionSet: SelectionSetNode(selections: [ @@ -2076,24 +2116,25 @@ const documentNodeQueryDomainInfo = DocumentNode(definitions: [ ), fragmentDefinitionfragmentDnsRecords, ]); -Query$DomainInfo _parserFn$Query$DomainInfo(Map data) => - Query$DomainInfo.fromJson(data); -typedef OnQueryComplete$Query$DomainInfo = FutureOr Function( +Query$GetDnsRecords _parserFn$Query$GetDnsRecords(Map data) => + Query$GetDnsRecords.fromJson(data); +typedef OnQueryComplete$Query$GetDnsRecords = FutureOr Function( Map?, - Query$DomainInfo?, + Query$GetDnsRecords?, ); -class Options$Query$DomainInfo extends graphql.QueryOptions { - Options$Query$DomainInfo({ +class Options$Query$GetDnsRecords + extends graphql.QueryOptions { + Options$Query$GetDnsRecords({ String? operationName, graphql.FetchPolicy? fetchPolicy, graphql.ErrorPolicy? errorPolicy, graphql.CacheRereadPolicy? cacheRereadPolicy, Object? optimisticResult, - Query$DomainInfo? typedOptimisticResult, + Query$GetDnsRecords? typedOptimisticResult, Duration? pollInterval, graphql.Context? context, - OnQueryComplete$Query$DomainInfo? onComplete, + OnQueryComplete$Query$GetDnsRecords? onComplete, graphql.OnQueryError? onError, }) : onCompleteWithParsed = onComplete, super( @@ -2108,14 +2149,14 @@ class Options$Query$DomainInfo extends graphql.QueryOptions { ? null : (data) => onComplete( data, - data == null ? null : _parserFn$Query$DomainInfo(data), + data == null ? null : _parserFn$Query$GetDnsRecords(data), ), onError: onError, - document: documentNodeQueryDomainInfo, - parserFn: _parserFn$Query$DomainInfo, + document: documentNodeQueryGetDnsRecords, + parserFn: _parserFn$Query$GetDnsRecords, ); - final OnQueryComplete$Query$DomainInfo? onCompleteWithParsed; + final OnQueryComplete$Query$GetDnsRecords? onCompleteWithParsed; @override List get properties => [ @@ -2126,15 +2167,15 @@ class Options$Query$DomainInfo extends graphql.QueryOptions { ]; } -class WatchOptions$Query$DomainInfo - extends graphql.WatchQueryOptions { - WatchOptions$Query$DomainInfo({ +class WatchOptions$Query$GetDnsRecords + extends graphql.WatchQueryOptions { + WatchOptions$Query$GetDnsRecords({ String? operationName, graphql.FetchPolicy? fetchPolicy, graphql.ErrorPolicy? errorPolicy, graphql.CacheRereadPolicy? cacheRereadPolicy, Object? optimisticResult, - Query$DomainInfo? typedOptimisticResult, + Query$GetDnsRecords? typedOptimisticResult, graphql.Context? context, Duration? pollInterval, bool? eagerlyFetchResults, @@ -2147,68 +2188,70 @@ class WatchOptions$Query$DomainInfo cacheRereadPolicy: cacheRereadPolicy, optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), context: context, - document: documentNodeQueryDomainInfo, + document: documentNodeQueryGetDnsRecords, pollInterval: pollInterval, eagerlyFetchResults: eagerlyFetchResults, carryForwardDataOnException: carryForwardDataOnException, fetchResults: fetchResults, - parserFn: _parserFn$Query$DomainInfo, + parserFn: _parserFn$Query$GetDnsRecords, ); } -class FetchMoreOptions$Query$DomainInfo extends graphql.FetchMoreOptions { - FetchMoreOptions$Query$DomainInfo({required graphql.UpdateQuery updateQuery}) +class FetchMoreOptions$Query$GetDnsRecords extends graphql.FetchMoreOptions { + FetchMoreOptions$Query$GetDnsRecords( + {required graphql.UpdateQuery updateQuery}) : super( updateQuery: updateQuery, - document: documentNodeQueryDomainInfo, + document: documentNodeQueryGetDnsRecords, ); } -extension ClientExtension$Query$DomainInfo on graphql.GraphQLClient { - Future> query$DomainInfo( - [Options$Query$DomainInfo? options]) async => - await this.query(options ?? Options$Query$DomainInfo()); - graphql.ObservableQuery watchQuery$DomainInfo( - [WatchOptions$Query$DomainInfo? options]) => - this.watchQuery(options ?? WatchOptions$Query$DomainInfo()); - void writeQuery$DomainInfo({ - required Query$DomainInfo data, +extension ClientExtension$Query$GetDnsRecords on graphql.GraphQLClient { + Future> query$GetDnsRecords( + [Options$Query$GetDnsRecords? options]) async => + await this.query(options ?? Options$Query$GetDnsRecords()); + graphql.ObservableQuery watchQuery$GetDnsRecords( + [WatchOptions$Query$GetDnsRecords? options]) => + this.watchQuery(options ?? WatchOptions$Query$GetDnsRecords()); + void writeQuery$GetDnsRecords({ + required Query$GetDnsRecords data, bool broadcast = true, }) => this.writeQuery( graphql.Request( operation: - graphql.Operation(document: documentNodeQueryDomainInfo)), + graphql.Operation(document: documentNodeQueryGetDnsRecords)), data: data.toJson(), broadcast: broadcast, ); - Query$DomainInfo? readQuery$DomainInfo({bool optimistic = true}) { + Query$GetDnsRecords? readQuery$GetDnsRecords({bool optimistic = true}) { final result = this.readQuery( graphql.Request( - operation: graphql.Operation(document: documentNodeQueryDomainInfo)), + operation: + graphql.Operation(document: documentNodeQueryGetDnsRecords)), optimistic: optimistic, ); - return result == null ? null : Query$DomainInfo.fromJson(result); + return result == null ? null : Query$GetDnsRecords.fromJson(result); } } -class Query$DomainInfo$system { - Query$DomainInfo$system({ +class Query$GetDnsRecords$system { + Query$GetDnsRecords$system({ required this.domainInfo, this.$__typename = 'System', }); - factory Query$DomainInfo$system.fromJson(Map json) { + factory Query$GetDnsRecords$system.fromJson(Map json) { final l$domainInfo = json['domainInfo']; final l$$__typename = json['__typename']; - return Query$DomainInfo$system( - domainInfo: Query$DomainInfo$system$domainInfo.fromJson( + return Query$GetDnsRecords$system( + domainInfo: Query$GetDnsRecords$system$domainInfo.fromJson( (l$domainInfo as Map)), $__typename: (l$$__typename as String), ); } - final Query$DomainInfo$system$domainInfo domainInfo; + final Query$GetDnsRecords$system$domainInfo domainInfo; final String $__typename; @@ -2236,7 +2279,7 @@ class Query$DomainInfo$system { if (identical(this, other)) { return true; } - if (!(other is Query$DomainInfo$system) || + if (!(other is Query$GetDnsRecords$system) || runtimeType != other.runtimeType) { return false; } @@ -2254,40 +2297,41 @@ class Query$DomainInfo$system { } } -extension UtilityExtension$Query$DomainInfo$system on Query$DomainInfo$system { - CopyWith$Query$DomainInfo$system get copyWith => - CopyWith$Query$DomainInfo$system( - this, - (i) => i, - ); +extension UtilityExtension$Query$GetDnsRecords$system + on Query$GetDnsRecords$system { + CopyWith$Query$GetDnsRecords$system + get copyWith => CopyWith$Query$GetDnsRecords$system( + this, + (i) => i, + ); } -abstract class CopyWith$Query$DomainInfo$system { - factory CopyWith$Query$DomainInfo$system( - Query$DomainInfo$system instance, - TRes Function(Query$DomainInfo$system) then, - ) = _CopyWithImpl$Query$DomainInfo$system; +abstract class CopyWith$Query$GetDnsRecords$system { + factory CopyWith$Query$GetDnsRecords$system( + Query$GetDnsRecords$system instance, + TRes Function(Query$GetDnsRecords$system) then, + ) = _CopyWithImpl$Query$GetDnsRecords$system; - factory CopyWith$Query$DomainInfo$system.stub(TRes res) = - _CopyWithStubImpl$Query$DomainInfo$system; + factory CopyWith$Query$GetDnsRecords$system.stub(TRes res) = + _CopyWithStubImpl$Query$GetDnsRecords$system; TRes call({ - Query$DomainInfo$system$domainInfo? domainInfo, + Query$GetDnsRecords$system$domainInfo? domainInfo, String? $__typename, }); - CopyWith$Query$DomainInfo$system$domainInfo get domainInfo; + CopyWith$Query$GetDnsRecords$system$domainInfo get domainInfo; } -class _CopyWithImpl$Query$DomainInfo$system - implements CopyWith$Query$DomainInfo$system { - _CopyWithImpl$Query$DomainInfo$system( +class _CopyWithImpl$Query$GetDnsRecords$system + implements CopyWith$Query$GetDnsRecords$system { + _CopyWithImpl$Query$GetDnsRecords$system( this._instance, this._then, ); - final Query$DomainInfo$system _instance; + final Query$GetDnsRecords$system _instance; - final TRes Function(Query$DomainInfo$system) _then; + final TRes Function(Query$GetDnsRecords$system) _then; static const _undefined = {}; @@ -2295,38 +2339,40 @@ class _CopyWithImpl$Query$DomainInfo$system Object? domainInfo = _undefined, Object? $__typename = _undefined, }) => - _then(Query$DomainInfo$system( + _then(Query$GetDnsRecords$system( domainInfo: domainInfo == _undefined || domainInfo == null ? _instance.domainInfo - : (domainInfo as Query$DomainInfo$system$domainInfo), + : (domainInfo as Query$GetDnsRecords$system$domainInfo), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); - CopyWith$Query$DomainInfo$system$domainInfo get domainInfo { + + CopyWith$Query$GetDnsRecords$system$domainInfo get domainInfo { final local$domainInfo = _instance.domainInfo; - return CopyWith$Query$DomainInfo$system$domainInfo( + return CopyWith$Query$GetDnsRecords$system$domainInfo( local$domainInfo, (e) => call(domainInfo: e)); } } -class _CopyWithStubImpl$Query$DomainInfo$system - implements CopyWith$Query$DomainInfo$system { - _CopyWithStubImpl$Query$DomainInfo$system(this._res); +class _CopyWithStubImpl$Query$GetDnsRecords$system + implements CopyWith$Query$GetDnsRecords$system { + _CopyWithStubImpl$Query$GetDnsRecords$system(this._res); TRes _res; call({ - Query$DomainInfo$system$domainInfo? domainInfo, + Query$GetDnsRecords$system$domainInfo? domainInfo, String? $__typename, }) => _res; - CopyWith$Query$DomainInfo$system$domainInfo get domainInfo => - CopyWith$Query$DomainInfo$system$domainInfo.stub(_res); + + CopyWith$Query$GetDnsRecords$system$domainInfo get domainInfo => + CopyWith$Query$GetDnsRecords$system$domainInfo.stub(_res); } -class Query$DomainInfo$system$domainInfo { - Query$DomainInfo$system$domainInfo({ +class Query$GetDnsRecords$system$domainInfo { + Query$GetDnsRecords$system$domainInfo({ required this.domain, required this.hostname, required this.provider, @@ -2334,14 +2380,14 @@ class Query$DomainInfo$system$domainInfo { this.$__typename = 'SystemDomainInfo', }); - factory Query$DomainInfo$system$domainInfo.fromJson( + factory Query$GetDnsRecords$system$domainInfo.fromJson( Map json) { final l$domain = json['domain']; final l$hostname = json['hostname']; final l$provider = json['provider']; final l$requiredDnsRecords = json['requiredDnsRecords']; final l$$__typename = json['__typename']; - return Query$DomainInfo$system$domainInfo( + return Query$GetDnsRecords$system$domainInfo( domain: (l$domain as String), hostname: (l$hostname as String), provider: fromJson$Enum$DnsProvider((l$provider as String)), @@ -2400,7 +2446,7 @@ class Query$DomainInfo$system$domainInfo { if (identical(this, other)) { return true; } - if (!(other is Query$DomainInfo$system$domainInfo) || + if (!(other is Query$GetDnsRecords$system$domainInfo) || runtimeType != other.runtimeType) { return false; } @@ -2440,24 +2486,24 @@ class Query$DomainInfo$system$domainInfo { } } -extension UtilityExtension$Query$DomainInfo$system$domainInfo - on Query$DomainInfo$system$domainInfo { - CopyWith$Query$DomainInfo$system$domainInfo< - Query$DomainInfo$system$domainInfo> - get copyWith => CopyWith$Query$DomainInfo$system$domainInfo( +extension UtilityExtension$Query$GetDnsRecords$system$domainInfo + on Query$GetDnsRecords$system$domainInfo { + CopyWith$Query$GetDnsRecords$system$domainInfo< + Query$GetDnsRecords$system$domainInfo> + get copyWith => CopyWith$Query$GetDnsRecords$system$domainInfo( this, (i) => i, ); } -abstract class CopyWith$Query$DomainInfo$system$domainInfo { - factory CopyWith$Query$DomainInfo$system$domainInfo( - Query$DomainInfo$system$domainInfo instance, - TRes Function(Query$DomainInfo$system$domainInfo) then, - ) = _CopyWithImpl$Query$DomainInfo$system$domainInfo; +abstract class CopyWith$Query$GetDnsRecords$system$domainInfo { + factory CopyWith$Query$GetDnsRecords$system$domainInfo( + Query$GetDnsRecords$system$domainInfo instance, + TRes Function(Query$GetDnsRecords$system$domainInfo) then, + ) = _CopyWithImpl$Query$GetDnsRecords$system$domainInfo; - factory CopyWith$Query$DomainInfo$system$domainInfo.stub(TRes res) = - _CopyWithStubImpl$Query$DomainInfo$system$domainInfo; + factory CopyWith$Query$GetDnsRecords$system$domainInfo.stub(TRes res) = + _CopyWithStubImpl$Query$GetDnsRecords$system$domainInfo; TRes call({ String? domain, @@ -2474,16 +2520,16 @@ abstract class CopyWith$Query$DomainInfo$system$domainInfo { _fn); } -class _CopyWithImpl$Query$DomainInfo$system$domainInfo - implements CopyWith$Query$DomainInfo$system$domainInfo { - _CopyWithImpl$Query$DomainInfo$system$domainInfo( +class _CopyWithImpl$Query$GetDnsRecords$system$domainInfo + implements CopyWith$Query$GetDnsRecords$system$domainInfo { + _CopyWithImpl$Query$GetDnsRecords$system$domainInfo( this._instance, this._then, ); - final Query$DomainInfo$system$domainInfo _instance; + final Query$GetDnsRecords$system$domainInfo _instance; - final TRes Function(Query$DomainInfo$system$domainInfo) _then; + final TRes Function(Query$GetDnsRecords$system$domainInfo) _then; static const _undefined = {}; @@ -2494,7 +2540,7 @@ class _CopyWithImpl$Query$DomainInfo$system$domainInfo Object? requiredDnsRecords = _undefined, Object? $__typename = _undefined, }) => - _then(Query$DomainInfo$system$domainInfo( + _then(Query$GetDnsRecords$system$domainInfo( domain: domain == _undefined || domain == null ? _instance.domain : (domain as String), @@ -2512,6 +2558,7 @@ class _CopyWithImpl$Query$DomainInfo$system$domainInfo ? _instance.$__typename : ($__typename as String), )); + TRes requiredDnsRecords( Iterable Function( Iterable< @@ -2526,9 +2573,9 @@ class _CopyWithImpl$Query$DomainInfo$system$domainInfo ))).toList()); } -class _CopyWithStubImpl$Query$DomainInfo$system$domainInfo - implements CopyWith$Query$DomainInfo$system$domainInfo { - _CopyWithStubImpl$Query$DomainInfo$system$domainInfo(this._res); +class _CopyWithStubImpl$Query$GetDnsRecords$system$domainInfo + implements CopyWith$Query$GetDnsRecords$system$domainInfo { + _CopyWithStubImpl$Query$GetDnsRecords$system$domainInfo(this._res); TRes _res; @@ -2540,6 +2587,7 @@ class _CopyWithStubImpl$Query$DomainInfo$system$domainInfo String? $__typename, }) => _res; + requiredDnsRecords(_fn) => _res; } @@ -2562,6 +2610,7 @@ class Variables$Mutation$ChangeTimezone { Map _$data; String get timezone => (_$data['timezone'] as String); + Map toJson() { final result$data = {}; final l$timezone = timezone; @@ -2574,6 +2623,7 @@ class Variables$Mutation$ChangeTimezone { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -2656,6 +2706,7 @@ class Mutation$ChangeTimezone { ); } + @Deprecated('Use `system.change_timezone` instead') final Mutation$ChangeTimezone$changeTimezone changeTimezone; final String $__typename; @@ -2751,6 +2802,7 @@ class _CopyWithImpl$Mutation$ChangeTimezone ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$ChangeTimezone$changeTimezone get changeTimezone { final local$changeTimezone = _instance.changeTimezone; return CopyWith$Mutation$ChangeTimezone$changeTimezone( @@ -2769,6 +2821,7 @@ class _CopyWithStubImpl$Mutation$ChangeTimezone String? $__typename, }) => _res; + CopyWith$Mutation$ChangeTimezone$changeTimezone get changeTimezone => CopyWith$Mutation$ChangeTimezone$changeTimezone.stub(_res); } @@ -3137,6 +3190,7 @@ class Variables$Mutation$ChangeAutoUpgradeSettings { Input$AutoUpgradeSettingsInput get settings => (_$data['settings'] as Input$AutoUpgradeSettingsInput); + Map toJson() { final result$data = {}; final l$settings = settings; @@ -3150,6 +3204,7 @@ class Variables$Mutation$ChangeAutoUpgradeSettings { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -3234,6 +3289,7 @@ class Mutation$ChangeAutoUpgradeSettings { ); } + @Deprecated('Use `system.change_auto_upgrade_settings` instead') final Mutation$ChangeAutoUpgradeSettings$changeAutoUpgradeSettings changeAutoUpgradeSettings; @@ -3337,6 +3393,7 @@ class _CopyWithImpl$Mutation$ChangeAutoUpgradeSettings ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$ChangeAutoUpgradeSettings$changeAutoUpgradeSettings get changeAutoUpgradeSettings { final local$changeAutoUpgradeSettings = _instance.changeAutoUpgradeSettings; @@ -3358,6 +3415,7 @@ class _CopyWithStubImpl$Mutation$ChangeAutoUpgradeSettings String? $__typename, }) => _res; + CopyWith$Mutation$ChangeAutoUpgradeSettings$changeAutoUpgradeSettings get changeAutoUpgradeSettings => CopyWith$Mutation$ChangeAutoUpgradeSettings$changeAutoUpgradeSettings diff --git a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart index 798167fd..f5494d9b 100644 --- a/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/services.graphql.dart @@ -115,6 +115,7 @@ class _CopyWithImpl$Query$AllServices ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$AllServices$services get services { final local$services = _instance.services; return CopyWith$Query$AllServices$services( @@ -133,6 +134,7 @@ class _CopyWithStubImpl$Query$AllServices String? $__typename, }) => _res; + CopyWith$Query$AllServices$services get services => CopyWith$Query$AllServices$services.stub(_res); } @@ -575,6 +577,7 @@ class _CopyWithImpl$Query$AllServices$services ? _instance.$__typename : ($__typename as String), )); + TRes allServices( Iterable Function( Iterable< @@ -600,6 +603,7 @@ class _CopyWithStubImpl$Query$AllServices$services String? $__typename, }) => _res; + allServices(_fn) => _res; } @@ -965,6 +969,7 @@ class _CopyWithImpl$Query$AllServices$services$allServices ? _instance.$__typename : ($__typename as String), )); + TRes dnsRecords( Iterable? Function( Iterable< @@ -977,6 +982,7 @@ class _CopyWithImpl$Query$AllServices$services$allServices e, (i) => i, )))?.toList()); + CopyWith$Query$AllServices$services$allServices$storageUsage get storageUsage { final local$storageUsage = _instance.storageUsage; @@ -1008,7 +1014,9 @@ class _CopyWithStubImpl$Query$AllServices$services$allServices String? $__typename, }) => _res; + dnsRecords(_fn) => _res; + CopyWith$Query$AllServices$services$allServices$storageUsage get storageUsage => CopyWith$Query$AllServices$services$allServices$storageUsage.stub( @@ -1176,6 +1184,7 @@ class _CopyWithImpl$Query$AllServices$services$allServices$storageUsage ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$AllServices$services$allServices$storageUsage$volume get volume { final local$volume = _instance.volume; @@ -1203,6 +1212,7 @@ class _CopyWithStubImpl$Query$AllServices$services$allServices$storageUsage< String? $__typename, }) => _res; + CopyWith$Query$AllServices$services$allServices$storageUsage$volume get volume => CopyWith$Query$AllServices$services$allServices$storageUsage$volume @@ -1367,6 +1377,7 @@ class Variables$Mutation$EnableService { Map _$data; String get serviceId => (_$data['serviceId'] as String); + Map toJson() { final result$data = {}; final l$serviceId = serviceId; @@ -1379,6 +1390,7 @@ class Variables$Mutation$EnableService { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -1461,6 +1473,7 @@ class Mutation$EnableService { ); } + @Deprecated('Use `services.enable_service` instead') final Mutation$EnableService$enableService enableService; final String $__typename; @@ -1556,6 +1569,7 @@ class _CopyWithImpl$Mutation$EnableService ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$EnableService$enableService get enableService { final local$enableService = _instance.enableService; return CopyWith$Mutation$EnableService$enableService( @@ -1574,6 +1588,7 @@ class _CopyWithStubImpl$Mutation$EnableService String? $__typename, }) => _res; + CopyWith$Mutation$EnableService$enableService get enableService => CopyWith$Mutation$EnableService$enableService.stub(_res); } @@ -1913,6 +1928,7 @@ class Variables$Mutation$DisableService { Map _$data; String get serviceId => (_$data['serviceId'] as String); + Map toJson() { final result$data = {}; final l$serviceId = serviceId; @@ -1925,6 +1941,7 @@ class Variables$Mutation$DisableService { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -2007,6 +2024,7 @@ class Mutation$DisableService { ); } + @Deprecated('Use `services.disable_service` instead') final Mutation$DisableService$disableService disableService; final String $__typename; @@ -2102,6 +2120,7 @@ class _CopyWithImpl$Mutation$DisableService ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$DisableService$disableService get disableService { final local$disableService = _instance.disableService; return CopyWith$Mutation$DisableService$disableService( @@ -2120,6 +2139,7 @@ class _CopyWithStubImpl$Mutation$DisableService String? $__typename, }) => _res; + CopyWith$Mutation$DisableService$disableService get disableService => CopyWith$Mutation$DisableService$disableService.stub(_res); } @@ -2458,6 +2478,7 @@ class Variables$Mutation$StopService { Map _$data; String get serviceId => (_$data['serviceId'] as String); + Map toJson() { final result$data = {}; final l$serviceId = serviceId; @@ -2470,6 +2491,7 @@ class Variables$Mutation$StopService { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -2552,6 +2574,7 @@ class Mutation$StopService { ); } + @Deprecated('Use `services.stop_service` instead') final Mutation$StopService$stopService stopService; final String $__typename; @@ -2646,6 +2669,7 @@ class _CopyWithImpl$Mutation$StopService ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$StopService$stopService get stopService { final local$stopService = _instance.stopService; return CopyWith$Mutation$StopService$stopService( @@ -2664,6 +2688,7 @@ class _CopyWithStubImpl$Mutation$StopService String? $__typename, }) => _res; + CopyWith$Mutation$StopService$stopService get stopService => CopyWith$Mutation$StopService$stopService.stub(_res); } @@ -2998,6 +3023,7 @@ class Variables$Mutation$StartService { Map _$data; String get serviceId => (_$data['serviceId'] as String); + Map toJson() { final result$data = {}; final l$serviceId = serviceId; @@ -3010,6 +3036,7 @@ class Variables$Mutation$StartService { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -3092,6 +3119,7 @@ class Mutation$StartService { ); } + @Deprecated('Use `services.start_service` instead') final Mutation$StartService$startService startService; final String $__typename; @@ -3186,6 +3214,7 @@ class _CopyWithImpl$Mutation$StartService ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$StartService$startService get startService { final local$startService = _instance.startService; return CopyWith$Mutation$StartService$startService( @@ -3204,6 +3233,7 @@ class _CopyWithStubImpl$Mutation$StartService String? $__typename, }) => _res; + CopyWith$Mutation$StartService$startService get startService => CopyWith$Mutation$StartService$startService.stub(_res); } @@ -3541,6 +3571,7 @@ class Variables$Mutation$RestartService { Map _$data; String get serviceId => (_$data['serviceId'] as String); + Map toJson() { final result$data = {}; final l$serviceId = serviceId; @@ -3553,6 +3584,7 @@ class Variables$Mutation$RestartService { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -3635,6 +3667,7 @@ class Mutation$RestartService { ); } + @Deprecated('Use `services.restart_service` instead') final Mutation$RestartService$restartService restartService; final String $__typename; @@ -3730,6 +3763,7 @@ class _CopyWithImpl$Mutation$RestartService ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RestartService$restartService get restartService { final local$restartService = _instance.restartService; return CopyWith$Mutation$RestartService$restartService( @@ -3748,6 +3782,7 @@ class _CopyWithStubImpl$Mutation$RestartService String? $__typename, }) => _res; + CopyWith$Mutation$RestartService$restartService get restartService => CopyWith$Mutation$RestartService$restartService.stub(_res); } @@ -4089,6 +4124,7 @@ class Variables$Mutation$MoveService { Input$MoveServiceInput get input => (_$data['input'] as Input$MoveServiceInput); + Map toJson() { final result$data = {}; final l$input = input; @@ -4101,6 +4137,7 @@ class Variables$Mutation$MoveService { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -4183,6 +4220,7 @@ class Mutation$MoveService { ); } + @Deprecated('Use `services.move_service` instead') final Mutation$MoveService$moveService moveService; final String $__typename; @@ -4277,6 +4315,7 @@ class _CopyWithImpl$Mutation$MoveService ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$MoveService$moveService get moveService { final local$moveService = _instance.moveService; return CopyWith$Mutation$MoveService$moveService( @@ -4295,6 +4334,7 @@ class _CopyWithStubImpl$Mutation$MoveService String? $__typename, }) => _res; + CopyWith$Mutation$MoveService$moveService get moveService => CopyWith$Mutation$MoveService$moveService.stub(_res); } @@ -4637,6 +4677,7 @@ class _CopyWithImpl$Mutation$MoveService$moveService ? _instance.job : (job as Fragment$basicApiJobsFields?), )); + CopyWith$Fragment$basicApiJobsFields get job { final local$job = _instance.job; return local$job == null @@ -4659,6 +4700,7 @@ class _CopyWithStubImpl$Mutation$MoveService$moveService Fragment$basicApiJobsFields? job, }) => _res; + CopyWith$Fragment$basicApiJobsFields get job => CopyWith$Fragment$basicApiJobsFields.stub(_res); } diff --git a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart index 5d86dc05..4ad681b3 100644 --- a/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/users.graphql.dart @@ -361,6 +361,7 @@ class _CopyWithImpl$Query$AllUsers ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$AllUsers$users get users { final local$users = _instance.users; return CopyWith$Query$AllUsers$users(local$users, (e) => call(users: e)); @@ -378,6 +379,7 @@ class _CopyWithStubImpl$Query$AllUsers String? $__typename, }) => _res; + CopyWith$Query$AllUsers$users get users => CopyWith$Query$AllUsers$users.stub(_res); } @@ -719,6 +721,7 @@ class _CopyWithImpl$Query$AllUsers$users ? _instance.$__typename : ($__typename as String), )); + TRes allUsers( Iterable Function( Iterable>) @@ -729,6 +732,7 @@ class _CopyWithImpl$Query$AllUsers$users e, (i) => i, ))).toList()); + CopyWith$Fragment$userFields get rootUser { final local$rootUser = _instance.rootUser; return local$rootUser == null @@ -750,7 +754,9 @@ class _CopyWithStubImpl$Query$AllUsers$users String? $__typename, }) => _res; + allUsers(_fn) => _res; + CopyWith$Fragment$userFields get rootUser => CopyWith$Fragment$userFields.stub(_res); } @@ -773,6 +779,7 @@ class Variables$Query$GetUser { Map _$data; String get username => (_$data['username'] as String); + Map toJson() { final result$data = {}; final l$username = username; @@ -785,6 +792,7 @@ class Variables$Query$GetUser { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -959,6 +967,7 @@ class _CopyWithImpl$Query$GetUser ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$GetUser$users get users { final local$users = _instance.users; return CopyWith$Query$GetUser$users(local$users, (e) => call(users: e)); @@ -976,6 +985,7 @@ class _CopyWithStubImpl$Query$GetUser String? $__typename, }) => _res; + CopyWith$Query$GetUser$users get users => CopyWith$Query$GetUser$users.stub(_res); } @@ -1288,6 +1298,7 @@ class _CopyWithImpl$Query$GetUser$users ? _instance.$__typename : ($__typename as String), )); + CopyWith$Fragment$userFields get getUser { final local$getUser = _instance.getUser; return local$getUser == null @@ -1307,6 +1318,7 @@ class _CopyWithStubImpl$Query$GetUser$users String? $__typename, }) => _res; + CopyWith$Fragment$userFields get getUser => CopyWith$Fragment$userFields.stub(_res); } @@ -1332,6 +1344,7 @@ class Variables$Mutation$CreateUser { Input$UserMutationInput get user => (_$data['user'] as Input$UserMutationInput); + Map toJson() { final result$data = {}; final l$user = user; @@ -1344,6 +1357,7 @@ class Variables$Mutation$CreateUser { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -1426,6 +1440,7 @@ class Mutation$CreateUser { ); } + @Deprecated('Use `users.create_user` instead') final Mutation$CreateUser$createUser createUser; final String $__typename; @@ -1520,6 +1535,7 @@ class _CopyWithImpl$Mutation$CreateUser ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$CreateUser$createUser get createUser { final local$createUser = _instance.createUser; return CopyWith$Mutation$CreateUser$createUser( @@ -1538,6 +1554,7 @@ class _CopyWithStubImpl$Mutation$CreateUser String? $__typename, }) => _res; + CopyWith$Mutation$CreateUser$createUser get createUser => CopyWith$Mutation$CreateUser$createUser.stub(_res); } @@ -1878,6 +1895,7 @@ class _CopyWithImpl$Mutation$CreateUser$createUser ? _instance.user : (user as Fragment$userFields?), )); + CopyWith$Fragment$userFields get user { final local$user = _instance.user; return local$user == null @@ -1900,6 +1918,7 @@ class _CopyWithStubImpl$Mutation$CreateUser$createUser Fragment$userFields? user, }) => _res; + CopyWith$Fragment$userFields get user => CopyWith$Fragment$userFields.stub(_res); } @@ -1922,6 +1941,7 @@ class Variables$Mutation$DeleteUser { Map _$data; String get username => (_$data['username'] as String); + Map toJson() { final result$data = {}; final l$username = username; @@ -1934,6 +1954,7 @@ class Variables$Mutation$DeleteUser { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -2016,6 +2037,7 @@ class Mutation$DeleteUser { ); } + @Deprecated('Use `users.delete_user` instead') final Mutation$DeleteUser$deleteUser deleteUser; final String $__typename; @@ -2110,6 +2132,7 @@ class _CopyWithImpl$Mutation$DeleteUser ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$DeleteUser$deleteUser get deleteUser { final local$deleteUser = _instance.deleteUser; return CopyWith$Mutation$DeleteUser$deleteUser( @@ -2128,6 +2151,7 @@ class _CopyWithStubImpl$Mutation$DeleteUser String? $__typename, }) => _res; + CopyWith$Mutation$DeleteUser$deleteUser get deleteUser => CopyWith$Mutation$DeleteUser$deleteUser.stub(_res); } @@ -2464,6 +2488,7 @@ class Variables$Mutation$UpdateUser { Input$UserMutationInput get user => (_$data['user'] as Input$UserMutationInput); + Map toJson() { final result$data = {}; final l$user = user; @@ -2476,6 +2501,7 @@ class Variables$Mutation$UpdateUser { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -2558,6 +2584,7 @@ class Mutation$UpdateUser { ); } + @Deprecated('Use `users.update_user` instead') final Mutation$UpdateUser$updateUser updateUser; final String $__typename; @@ -2652,6 +2679,7 @@ class _CopyWithImpl$Mutation$UpdateUser ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$UpdateUser$updateUser get updateUser { final local$updateUser = _instance.updateUser; return CopyWith$Mutation$UpdateUser$updateUser( @@ -2670,6 +2698,7 @@ class _CopyWithStubImpl$Mutation$UpdateUser String? $__typename, }) => _res; + CopyWith$Mutation$UpdateUser$updateUser get updateUser => CopyWith$Mutation$UpdateUser$updateUser.stub(_res); } @@ -3010,6 +3039,7 @@ class _CopyWithImpl$Mutation$UpdateUser$updateUser ? _instance.user : (user as Fragment$userFields?), )); + CopyWith$Fragment$userFields get user { final local$user = _instance.user; return local$user == null @@ -3032,6 +3062,7 @@ class _CopyWithStubImpl$Mutation$UpdateUser$updateUser Fragment$userFields? user, }) => _res; + CopyWith$Fragment$userFields get user => CopyWith$Fragment$userFields.stub(_res); } @@ -3057,6 +3088,7 @@ class Variables$Mutation$AddSshKey { Input$SshMutationInput get sshInput => (_$data['sshInput'] as Input$SshMutationInput); + Map toJson() { final result$data = {}; final l$sshInput = sshInput; @@ -3069,6 +3101,7 @@ class Variables$Mutation$AddSshKey { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -3151,6 +3184,7 @@ class Mutation$AddSshKey { ); } + @Deprecated('Use `users.add_ssh_key` instead') final Mutation$AddSshKey$addSshKey addSshKey; final String $__typename; @@ -3245,6 +3279,7 @@ class _CopyWithImpl$Mutation$AddSshKey ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$AddSshKey$addSshKey get addSshKey { final local$addSshKey = _instance.addSshKey; return CopyWith$Mutation$AddSshKey$addSshKey( @@ -3263,6 +3298,7 @@ class _CopyWithStubImpl$Mutation$AddSshKey String? $__typename, }) => _res; + CopyWith$Mutation$AddSshKey$addSshKey get addSshKey => CopyWith$Mutation$AddSshKey$addSshKey.stub(_res); } @@ -3603,6 +3639,7 @@ class _CopyWithImpl$Mutation$AddSshKey$addSshKey ? _instance.user : (user as Fragment$userFields?), )); + CopyWith$Fragment$userFields get user { final local$user = _instance.user; return local$user == null @@ -3625,6 +3662,7 @@ class _CopyWithStubImpl$Mutation$AddSshKey$addSshKey Fragment$userFields? user, }) => _res; + CopyWith$Fragment$userFields get user => CopyWith$Fragment$userFields.stub(_res); } @@ -3650,6 +3688,7 @@ class Variables$Mutation$RemoveSshKey { Input$SshMutationInput get sshInput => (_$data['sshInput'] as Input$SshMutationInput); + Map toJson() { final result$data = {}; final l$sshInput = sshInput; @@ -3662,6 +3701,7 @@ class Variables$Mutation$RemoveSshKey { this, (i) => i, ); + @override bool operator ==(Object other) { if (identical(this, other)) { @@ -3744,6 +3784,7 @@ class Mutation$RemoveSshKey { ); } + @Deprecated('Use `users.remove_ssh_key` instead') final Mutation$RemoveSshKey$removeSshKey removeSshKey; final String $__typename; @@ -3838,6 +3879,7 @@ class _CopyWithImpl$Mutation$RemoveSshKey ? _instance.$__typename : ($__typename as String), )); + CopyWith$Mutation$RemoveSshKey$removeSshKey get removeSshKey { final local$removeSshKey = _instance.removeSshKey; return CopyWith$Mutation$RemoveSshKey$removeSshKey( @@ -3856,6 +3898,7 @@ class _CopyWithStubImpl$Mutation$RemoveSshKey String? $__typename, }) => _res; + CopyWith$Mutation$RemoveSshKey$removeSshKey get removeSshKey => CopyWith$Mutation$RemoveSshKey$removeSshKey.stub(_res); } @@ -4199,6 +4242,7 @@ class _CopyWithImpl$Mutation$RemoveSshKey$removeSshKey ? _instance.user : (user as Fragment$userFields?), )); + CopyWith$Fragment$userFields get user { final local$user = _instance.user; return local$user == null @@ -4221,6 +4265,7 @@ class _CopyWithStubImpl$Mutation$RemoveSshKey$removeSshKey Fragment$userFields? user, }) => _res; + CopyWith$Fragment$userFields get user => CopyWith$Fragment$userFields.stub(_res); } diff --git a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart index fcf3db05..d59cef10 100644 --- a/lib/logic/api_maps/graphql_maps/server_api/server_api.dart +++ b/lib/logic/api_maps/graphql_maps/server_api/server_api.dart @@ -286,11 +286,11 @@ class ServerApi extends GraphQLApiMap Future> getDnsRecords() async { List records = []; - QueryResult response; + QueryResult response; try { final GraphQLClient client = await getClient(); - response = await client.query$DomainInfo(); + response = await client.query$GetDnsRecords(); if (response.hasException) { print(response.exception.toString()); } diff --git a/lib/logic/api_maps/rest_maps/dns_providers/cloudflare/cloudflare_api.dart b/lib/logic/api_maps/rest_maps/dns_providers/cloudflare/cloudflare_api.dart index bfc1b029..fa325ef5 100644 --- a/lib/logic/api_maps/rest_maps/dns_providers/cloudflare/cloudflare_api.dart +++ b/lib/logic/api_maps/rest_maps/dns_providers/cloudflare/cloudflare_api.dart @@ -4,7 +4,7 @@ import 'package:dio/dio.dart'; import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/logic/api_maps/generic_result.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/rest_api_map.dart'; -import 'package:selfprivacy/logic/models/json/cloudflare_dns_info.dart'; +import 'package:selfprivacy/logic/models/json/dns_providers/cloudflare_dns_info.dart'; class CloudflareApi extends RestApiMap { CloudflareApi({ diff --git a/lib/logic/api_maps/rest_maps/dns_providers/desec/desec_api.dart b/lib/logic/api_maps/rest_maps/dns_providers/desec/desec_api.dart index 9856242d..2bc15c22 100644 --- a/lib/logic/api_maps/rest_maps/dns_providers/desec/desec_api.dart +++ b/lib/logic/api_maps/rest_maps/dns_providers/desec/desec_api.dart @@ -4,7 +4,7 @@ import 'package:dio/dio.dart'; import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/logic/api_maps/generic_result.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/rest_api_map.dart'; -import 'package:selfprivacy/logic/models/json/desec_dns_info.dart'; +import 'package:selfprivacy/logic/models/json/dns_providers/desec_dns_info.dart'; class DesecApi extends RestApiMap { DesecApi({ diff --git a/lib/logic/api_maps/rest_maps/dns_providers/digital_ocean_dns/digital_ocean_dns_api.dart b/lib/logic/api_maps/rest_maps/dns_providers/digital_ocean_dns/digital_ocean_dns_api.dart index 558915ce..10da51e3 100644 --- a/lib/logic/api_maps/rest_maps/dns_providers/digital_ocean_dns/digital_ocean_dns_api.dart +++ b/lib/logic/api_maps/rest_maps/dns_providers/digital_ocean_dns/digital_ocean_dns_api.dart @@ -4,7 +4,7 @@ import 'package:dio/dio.dart'; import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/logic/api_maps/generic_result.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/rest_api_map.dart'; -import 'package:selfprivacy/logic/models/json/digital_ocean_dns_info.dart'; +import 'package:selfprivacy/logic/models/json/dns_providers/digital_ocean_dns_info.dart'; class DigitalOceanDnsApi extends RestApiMap { DigitalOceanDnsApi({ diff --git a/lib/logic/cubit/dns_records/dns_records_cubit.dart b/lib/logic/cubit/dns_records/dns_records_cubit.dart index 6f295274..7dff72f6 100644 --- a/lib/logic/cubit/dns_records/dns_records_cubit.dart +++ b/lib/logic/cubit/dns_records/dns_records_cubit.dart @@ -23,15 +23,9 @@ class DnsRecordsCubit @override Future load() async { emit( - DnsRecordsState( + const DnsRecordsState( dnsState: DnsRecordsStatus.refreshing, - dnsRecords: - ProvidersController.currentDnsProvider?.getDesiredDnsRecords( - serverInstallationCubit.state.serverDomain?.domainName, - '', - '', - ) ?? - [], + dnsRecords: [], ), ); @@ -39,16 +33,18 @@ class DnsRecordsCubit final ServerDomain? domain = serverInstallationCubit.state.serverDomain; final String? ipAddress = serverInstallationCubit.state.serverDetails?.ip4; - if (domain == null && ipAddress == null) { + + if (domain == null || ipAddress == null) { emit(const DnsRecordsState()); return; } - final foundRecords = - await ProvidersController.currentDnsProvider!.validateDnsRecords( - domain!, - ipAddress!, - extractDkimRecord(await api.getDnsRecords())?.content ?? '', + final List allDnsRecords = await api.getDnsRecords(); + allDnsRecords.removeWhere((final record) => record.type == 'AAAA'); + final foundRecords = await validateDnsRecords( + domain, + extractDkimRecord(allDnsRecords)?.content ?? '', + allDnsRecords, ); if (!foundRecords.success || foundRecords.data.isEmpty) { @@ -67,6 +63,93 @@ class DnsRecordsCubit } } + /// Tries to check whether all known DNS records on the domain by ip4 + /// match expectations of SelfPrivacy in order to launch. + /// + /// Will return list of [DesiredDnsRecord] objects, which represent + /// only those records which have successfully passed validation. + Future>> validateDnsRecords( + final ServerDomain domain, + final String dkimPublicKey, + final List pendingDnsRecords, + ) async { + final result = await ProvidersController.currentDnsProvider! + .getDnsRecords(domain: domain); + if (result.data.isEmpty || !result.success) { + return GenericResult( + success: result.success, + data: [], + code: result.code, + message: result.message, + ); + } + + final List providerDnsRecords = result.data; + final List foundRecords = []; + try { + for (final DnsRecord pendingDnsRecord in pendingDnsRecords) { + if (pendingDnsRecord.name == 'selector._domainkey') { + final foundRecord = providerDnsRecords.firstWhere( + (final r) => + (r.name == pendingDnsRecord.name) && + r.type == pendingDnsRecord.type, + orElse: () => DnsRecord( + displayName: pendingDnsRecord.displayName, + name: pendingDnsRecord.name, + type: pendingDnsRecord.type, + content: pendingDnsRecord.content, + ttl: pendingDnsRecord.ttl, + ), + ); + final String foundContent = + foundRecord.content!.replaceAll(RegExp(r'\s+'), '').trim(); + final String desiredContent = + pendingDnsRecord.content!.replaceAll(RegExp(r'\s+'), '').trim(); + final isSatisfied = (desiredContent == foundContent); + foundRecords.add( + DesiredDnsRecord( + name: pendingDnsRecord.name!, + displayName: pendingDnsRecord.displayName, + content: pendingDnsRecord.content!, + isSatisfied: isSatisfied, + type: pendingDnsRecord.type, + category: DnsRecordsCategory.email, + ), + ); + } else { + final foundMatch = providerDnsRecords.any( + (final r) => + r.name == pendingDnsRecord.name && + r.type == pendingDnsRecord.type && + r.content == pendingDnsRecord.content, + ); + foundRecords.add( + DesiredDnsRecord( + name: pendingDnsRecord.name!, + displayName: pendingDnsRecord.displayName, + content: pendingDnsRecord.content!, + isSatisfied: foundMatch, + category: pendingDnsRecord.type == 'A' + ? DnsRecordsCategory.services + : DnsRecordsCategory.email, + ), + ); + } + } + } catch (e) { + print(e); + return GenericResult( + data: [], + success: false, + message: e.toString(), + ); + } + return GenericResult( + data: foundRecords, + success: true, + ); + } + @override void onChange(final Change change) { // print(change); diff --git a/lib/logic/cubit/forms/setup/initializing/domain_setup_cubit.dart b/lib/logic/cubit/forms/setup/initializing/domain_setup_cubit.dart index bccbc551..98324cb8 100644 --- a/lib/logic/cubit/forms/setup/initializing/domain_setup_cubit.dart +++ b/lib/logic/cubit/forms/setup/initializing/domain_setup_cubit.dart @@ -11,14 +11,22 @@ class DomainSetupCubit extends Cubit { Future load() async { emit(Loading(LoadingTypes.loadingDomain)); - final GenericResult> result = + final GenericResult> result = await ProvidersController.currentDnsProvider!.domainList(); if (!result.success || result.data.isEmpty) { emit(Empty()); } else if (result.data.length == 1) { - emit(Loaded(result.data.first)); + emit(Loaded(result.data.first.domainName)); } else { - emit(MoreThenOne(result.data)); + emit( + MoreThenOne( + result.data + .map( + (final d) => d.domainName, + ) + .toList(), + ), + ); } } diff --git a/lib/logic/cubit/server_installation/server_installation_repository.dart b/lib/logic/cubit/server_installation/server_installation_repository.dart index 68534eb8..d69f5b89 100644 --- a/lib/logic/cubit/server_installation/server_installation_repository.dart +++ b/lib/logic/cubit/server_installation/server_installation_repository.dart @@ -210,7 +210,9 @@ class ServerInstallationRepository { return false; } - return domainResult.data.contains(domain); + return domainResult.data.any( + (final serverDomain) => serverDomain.domainName == domain, + ); } Future createDkimRecord(final ServerDomain domain) async { diff --git a/lib/logic/models/json/dns_providers/cloudflare_dns_adapter.dart b/lib/logic/models/json/dns_providers/cloudflare_dns_adapter.dart new file mode 100644 index 00000000..3a22c89e --- /dev/null +++ b/lib/logic/models/json/dns_providers/cloudflare_dns_adapter.dart @@ -0,0 +1,43 @@ +part of 'cloudflare_dns_info.dart'; + +CloudflareDnsRecord _fromDnsRecord( + final DnsRecord dnsRecord, + final String rootDomain, +) { + String name = dnsRecord.name ?? ''; + if (name != rootDomain && name != '@') { + name = '$name.$rootDomain'; + } + return CloudflareDnsRecord( + content: dnsRecord.content, + name: name, + type: dnsRecord.type, + zoneName: rootDomain, + id: null, + ttl: dnsRecord.ttl, + ); +} + +DnsRecord _toDnsRecord( + final CloudflareDnsRecord cloudflareRecord, + final String domainName, +) { + String? name = cloudflareRecord.name; + if (name != null && name.endsWith('.$domainName')) { + // e.g. 'api.example.com -> [api] [example] [com] -> [api]' + name = name.split('.')[0]; + } + + return DnsRecord( + content: cloudflareRecord.content, + type: cloudflareRecord.type, + ttl: cloudflareRecord.ttl, + name: name, + ); +} + +ServerDomain _toServerDomain(final CloudflareZone cloudflareZone) => + ServerDomain( + domainName: cloudflareZone.name, + provider: DnsProviderType.cloudflare, + ); diff --git a/lib/logic/models/json/cloudflare_dns_info.dart b/lib/logic/models/json/dns_providers/cloudflare_dns_info.dart similarity index 81% rename from lib/logic/models/json/cloudflare_dns_info.dart rename to lib/logic/models/json/dns_providers/cloudflare_dns_info.dart index 3cd11bcd..c2ee727b 100644 --- a/lib/logic/models/json/cloudflare_dns_info.dart +++ b/lib/logic/models/json/dns_providers/cloudflare_dns_info.dart @@ -1,6 +1,9 @@ import 'package:json_annotation/json_annotation.dart'; +import 'package:selfprivacy/logic/models/hive/server_domain.dart'; +import 'package:selfprivacy/logic/models/json/dns_records.dart'; part 'cloudflare_dns_info.g.dart'; +part 'cloudflare_dns_adapter.dart'; /// https://developers.cloudflare.com/api/operations/zones-get @JsonSerializable() @@ -26,6 +29,7 @@ class CloudflareZone { static CloudflareZone fromJson(final Map json) => _$CloudflareZoneFromJson(json); + ServerDomain toServerDomain() => _toServerDomain(this); } /// https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-list-dns-records @@ -41,6 +45,12 @@ class CloudflareDnsRecord { this.id, }); + factory CloudflareDnsRecord.fromDnsRecord( + final DnsRecord dnsRecord, + final String rootDomain, + ) => + _fromDnsRecord(dnsRecord, rootDomain); + /// Record identifier /// /// `<= 32 characters` @@ -83,4 +93,6 @@ class CloudflareDnsRecord { static CloudflareDnsRecord fromJson(final Map json) => _$CloudflareDnsRecordFromJson(json); Map toJson() => _$CloudflareDnsRecordToJson(this); + DnsRecord toDnsRecord(final String domainName) => + _toDnsRecord(this, domainName); } diff --git a/lib/logic/models/json/cloudflare_dns_info.g.dart b/lib/logic/models/json/dns_providers/cloudflare_dns_info.g.dart similarity index 100% rename from lib/logic/models/json/cloudflare_dns_info.g.dart rename to lib/logic/models/json/dns_providers/cloudflare_dns_info.g.dart diff --git a/lib/logic/models/json/dns_providers/desec_dns_adapter.dart b/lib/logic/models/json/dns_providers/desec_dns_adapter.dart new file mode 100644 index 00000000..d4dca56e --- /dev/null +++ b/lib/logic/models/json/dns_providers/desec_dns_adapter.dart @@ -0,0 +1,68 @@ +part of 'desec_dns_info.dart'; + +DesecDnsRecord _fromDnsRecord( + final DnsRecord dnsRecord, + final String domainName, +) { + final String type = dnsRecord.type; + String content = dnsRecord.content ?? ''; + String name = dnsRecord.name ?? ''; + if (name == '@' || name == domainName) { + name = ''; + } + if (type == 'MX') { + content = '${dnsRecord.priority} $content.'; + } + if (type == 'TXT' && content.isNotEmpty && !content.startsWith('"')) { + content = '"$content"'; + } + + return DesecDnsRecord( + subname: name, + type: type, + ttl: dnsRecord.ttl, + records: [content], + ); +} + +DnsRecord _toDnsRecord( + final DesecDnsRecord desecRecord, + final String domainName, +) { + final String type = desecRecord.type; + String content = desecRecord.records.isEmpty ? '' : desecRecord.records[0]; + String name = desecRecord.subname; + int? priority; + if (type == 'MX') { + name = name.isEmpty ? domainName : name; + final contentBulk = content.split(' '); + content = contentBulk[1]; + if (content.contains(domainName)) { + content = + content.substring(0, content.length - 1); // cut away trailing dot + } + priority = int.parse(contentBulk[0]); + } + if (type == 'TXT' && content.isNotEmpty && content.startsWith('"')) { + content = content.substring(1, content.length - 1); // cut away quotes + } + if (name.isEmpty) { + name = domainName; + } + + return DnsRecord( + name: name, + type: type, + ttl: desecRecord.ttl, + content: content, + priority: priority ?? 10, + ); +} + +DesecDomain _fromServerDomain(final ServerDomain serverDomain) => + DesecDomain(name: serverDomain.domainName); + +ServerDomain _toServerDomain(final DesecDomain desecDomain) => ServerDomain( + domainName: desecDomain.name, + provider: DnsProviderType.desec, + ); diff --git a/lib/logic/models/json/desec_dns_info.dart b/lib/logic/models/json/dns_providers/desec_dns_info.dart similarity index 74% rename from lib/logic/models/json/desec_dns_info.dart rename to lib/logic/models/json/dns_providers/desec_dns_info.dart index e6023da7..1e6efbd1 100644 --- a/lib/logic/models/json/desec_dns_info.dart +++ b/lib/logic/models/json/dns_providers/desec_dns_info.dart @@ -1,14 +1,19 @@ import 'package:json_annotation/json_annotation.dart'; - +import 'package:selfprivacy/logic/models/hive/server_domain.dart'; +import 'package:selfprivacy/logic/models/json/dns_records.dart'; +part 'desec_dns_adapter.dart'; part 'desec_dns_info.g.dart'; /// https://desec.readthedocs.io/en/latest/dns/domains.html#domain-management @JsonSerializable() class DesecDomain { - DesecDomain( - this.name, + DesecDomain({ + required this.name, this.minimumTtl, - ); + }); + + factory DesecDomain.fromServerDomain(final ServerDomain serverDomain) => + _fromServerDomain(serverDomain); /// Restrictions on what is a valid domain name apply on /// a per-user basis. @@ -19,10 +24,11 @@ class DesecDomain { /// Smallest TTL that can be used in an RRset. /// The value is set automatically by DESEC @JsonKey(name: 'minimum_ttl') - final int minimumTtl; + final int? minimumTtl; static DesecDomain fromJson(final Map json) => _$DesecDomainFromJson(json); + ServerDomain toServerDomain() => _toServerDomain(this); } /// https://desec.readthedocs.io/en/latest/dns/rrsets.html#retrieving-and-creating-dns-records @@ -35,6 +41,12 @@ class DesecDnsRecord { required this.records, }); + factory DesecDnsRecord.fromDnsRecord( + final DnsRecord dnsRecord, + final String domainName, + ) => + _fromDnsRecord(dnsRecord, domainName); + /// Subdomain string which, together with domain, defines the RRset name. /// Typical examples are www or _443._tcp. final String subname; @@ -60,4 +72,6 @@ class DesecDnsRecord { static DesecDnsRecord fromJson(final Map json) => _$DesecDnsRecordFromJson(json); Map toJson() => _$DesecDnsRecordToJson(this); + DnsRecord toDnsRecord(final String domainName) => + _toDnsRecord(this, domainName); } diff --git a/lib/logic/models/json/desec_dns_info.g.dart b/lib/logic/models/json/dns_providers/desec_dns_info.g.dart similarity index 92% rename from lib/logic/models/json/desec_dns_info.g.dart rename to lib/logic/models/json/dns_providers/desec_dns_info.g.dart index b82ed777..bfb9126e 100644 --- a/lib/logic/models/json/desec_dns_info.g.dart +++ b/lib/logic/models/json/dns_providers/desec_dns_info.g.dart @@ -7,8 +7,8 @@ part of 'desec_dns_info.dart'; // ************************************************************************** DesecDomain _$DesecDomainFromJson(Map json) => DesecDomain( - json['name'] as String, - json['minimum_ttl'] as int, + name: json['name'] as String, + minimumTtl: json['minimum_ttl'] as int?, ); Map _$DesecDomainToJson(DesecDomain instance) => diff --git a/lib/logic/models/json/dns_providers/digital_ocean_dns_adapter.dart b/lib/logic/models/json/dns_providers/digital_ocean_dns_adapter.dart new file mode 100644 index 00000000..0fb6cc48 --- /dev/null +++ b/lib/logic/models/json/dns_providers/digital_ocean_dns_adapter.dart @@ -0,0 +1,47 @@ +part of 'digital_ocean_dns_info.dart'; + +DigitalOceanDnsRecord _fromDnsRecord( + final DnsRecord dnsRecord, + final String rootDomain, +) { + String convert(final String entry) => (entry == rootDomain) ? '@' : entry; + String name = dnsRecord.name ?? ''; + String content = dnsRecord.content ?? ''; + name = convert(name); + content = convert(content); + return DigitalOceanDnsRecord( + name: name, + data: content, + ttl: dnsRecord.ttl, + type: dnsRecord.type, + priority: dnsRecord.priority, + id: null, + ); +} + +DnsRecord _toDnsRecord( + final DigitalOceanDnsRecord digitalOceanRecord, + final String rootDomain, +) { + final String type = digitalOceanRecord.type; + String convert(final String entry) => (entry == '@') ? rootDomain : entry; + String name = digitalOceanRecord.name; + final String content = convert(digitalOceanRecord.data); + name = (name == '@') ? rootDomain : name; + return DnsRecord( + name: name, + content: content, + ttl: digitalOceanRecord.ttl, + type: type, + priority: digitalOceanRecord.priority ?? 10, + ); +} + +ServerDomain _toServerDomain(final DigitalOceanDomain digitalOceanDomain) => + ServerDomain( + domainName: digitalOceanDomain.name, + provider: DnsProviderType.digitalOcean, + ); + +DigitalOceanDomain _fromServerDomain(final ServerDomain serverDomain) => + DigitalOceanDomain(name: serverDomain.domainName); diff --git a/lib/logic/models/json/digital_ocean_dns_info.dart b/lib/logic/models/json/dns_providers/digital_ocean_dns_info.dart similarity index 77% rename from lib/logic/models/json/digital_ocean_dns_info.dart rename to lib/logic/models/json/dns_providers/digital_ocean_dns_info.dart index 0881b214..be23f711 100644 --- a/lib/logic/models/json/digital_ocean_dns_info.dart +++ b/lib/logic/models/json/dns_providers/digital_ocean_dns_info.dart @@ -1,6 +1,9 @@ import 'package:json_annotation/json_annotation.dart'; +import 'package:selfprivacy/logic/models/hive/server_domain.dart'; +import 'package:selfprivacy/logic/models/json/dns_records.dart'; part 'digital_ocean_dns_info.g.dart'; +part 'digital_ocean_dns_adapter.dart'; /// https://docs.digitalocean.com/reference/api/api-reference/#tag/Domains @JsonSerializable() @@ -10,6 +13,11 @@ class DigitalOceanDomain { this.ttl, }); + factory DigitalOceanDomain.fromServerDomain( + final ServerDomain serverDomain, + ) => + _fromServerDomain(serverDomain); + /// The name of the domain itself. /// This should follow the standard domain format of domain.TLD. /// @@ -23,6 +31,7 @@ class DigitalOceanDomain { static DigitalOceanDomain fromJson(final Map json) => _$DigitalOceanDomainFromJson(json); + ServerDomain toServerDomain() => _toServerDomain(this); } /// https://docs.digitalocean.com/reference/api/api-reference/#tag/Domain-Records @@ -37,6 +46,15 @@ class DigitalOceanDnsRecord { this.priority, }); + factory DigitalOceanDnsRecord.fromDnsRecord( + final DnsRecord dnsRecord, + final String rootDomain, + ) => + _fromDnsRecord( + dnsRecord, + rootDomain, + ); + /// A unique identifier for each domain record. final int? id; @@ -63,4 +81,6 @@ class DigitalOceanDnsRecord { static DigitalOceanDnsRecord fromJson(final Map json) => _$DigitalOceanDnsRecordFromJson(json); Map toJson() => _$DigitalOceanDnsRecordToJson(this); + DnsRecord toDnsRecord(final String rootDomain) => + _toDnsRecord(this, rootDomain); } diff --git a/lib/logic/models/json/digital_ocean_dns_info.g.dart b/lib/logic/models/json/dns_providers/digital_ocean_dns_info.g.dart similarity index 100% rename from lib/logic/models/json/digital_ocean_dns_info.g.dart rename to lib/logic/models/json/dns_providers/digital_ocean_dns_info.g.dart diff --git a/lib/logic/models/json/dns_records.dart b/lib/logic/models/json/dns_records.dart index 8b0fdf23..28eb71cb 100644 --- a/lib/logic/models/json/dns_records.dart +++ b/lib/logic/models/json/dns_records.dart @@ -9,6 +9,7 @@ class DnsRecord { required this.type, required this.name, required this.content, + this.displayName, this.ttl = 3600, this.priority = 10, this.proxied = false, @@ -19,12 +20,14 @@ class DnsRecord { ) : this( type: record.recordType, name: record.name, + displayName: record.displayName, content: record.content, ttl: record.ttl, priority: record.priority ?? 10, ); final String type; + final String? displayName; final String? name; final String? content; final int ttl; diff --git a/lib/logic/models/json/dns_records.g.dart b/lib/logic/models/json/dns_records.g.dart index c8c12c34..ab4603cb 100644 --- a/lib/logic/models/json/dns_records.g.dart +++ b/lib/logic/models/json/dns_records.g.dart @@ -8,6 +8,7 @@ part of 'dns_records.dart'; Map _$DnsRecordToJson(DnsRecord instance) => { 'type': instance.type, + 'displayName': instance.displayName, 'name': instance.name, 'content': instance.content, 'ttl': instance.ttl, diff --git a/lib/logic/providers/dns_providers/cloudflare.dart b/lib/logic/providers/dns_providers/cloudflare.dart index 18490622..d655cfbb 100644 --- a/lib/logic/providers/dns_providers/cloudflare.dart +++ b/lib/logic/providers/dns_providers/cloudflare.dart @@ -1,9 +1,9 @@ import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/cloudflare/cloudflare_api.dart'; -import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/desired_dns_record.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; -import 'package:selfprivacy/logic/models/json/cloudflare_dns_info.dart'; +import 'package:selfprivacy/logic/models/json/dns_providers/cloudflare_dns_info.dart'; import 'package:selfprivacy/logic/models/json/dns_records.dart'; import 'package:selfprivacy/logic/providers/dns_providers/dns_provider.dart'; +import 'package:selfprivacy/utils/network_utils.dart'; class ApiAdapter { ApiAdapter({ @@ -54,8 +54,8 @@ class CloudflareDnsProvider extends DnsProvider { } @override - Future>> domainList() async { - List domains = []; + Future>> domainList() async { + List domains = []; final result = await _adapter.api().getZones(); if (result.data.isEmpty || !result.success) { return GenericResult( @@ -67,8 +67,8 @@ class CloudflareDnsProvider extends DnsProvider { } domains = result.data - .map( - (final el) => el.name, + .map( + (final el) => el.toServerDomain(), ) .toList(); @@ -93,14 +93,8 @@ class CloudflareDnsProvider extends DnsProvider { zoneId: _adapter.cachedZoneId, records: records .map( - (final rec) => CloudflareDnsRecord( - content: rec.content, - name: rec.name, - type: rec.type, - zoneName: domain.domainName, - id: null, - ttl: rec.ttl, - ), + (final rec) => + CloudflareDnsRecord.fromDnsRecord(rec, domain.domainName), ) .toList(), ); @@ -160,14 +154,7 @@ class CloudflareDnsProvider extends DnsProvider { } for (final rawRecord in result.data) { - records.add( - DnsRecord( - name: rawRecord.name, - type: rawRecord.type, - content: rawRecord.content, - ttl: rawRecord.ttl, - ), - ); + records.add(rawRecord.toDnsRecord(domain.domainName)); } return GenericResult( @@ -188,210 +175,10 @@ class CloudflareDnsProvider extends DnsProvider { return _adapter.api().createMultipleDnsRecords( zoneId: _adapter.cachedZoneId, - records: [ - CloudflareDnsRecord( - content: record.content, - id: null, - name: record.name, - type: record.type, - zoneName: domain.domainName, - ttl: record.ttl, - ), - ], + records: [CloudflareDnsRecord.fromDnsRecord(record, domain.domainName)], ); } - @override - Future>> validateDnsRecords( - final ServerDomain domain, - final String ip4, - final String dkimPublicKey, - ) async { - final GenericResult> records = - await getDnsRecords(domain: domain); - final List foundRecords = []; - try { - final List desiredRecords = - getDesiredDnsRecords(domain.domainName, ip4, dkimPublicKey); - for (final DesiredDnsRecord record in desiredRecords) { - if (record.description == 'record.dkim') { - final DnsRecord foundRecord = records.data.firstWhere( - (final r) => (r.name == record.name) && r.type == record.type, - orElse: () => DnsRecord( - name: record.name, - type: record.type, - content: '', - ttl: 800, - proxied: false, - ), - ); - // remove all spaces and tabulators from - // the foundRecord.content and the record.content - // to compare them - final String? foundContent = - foundRecord.content?.replaceAll(RegExp(r'\s+'), ''); - final String content = record.content.replaceAll(RegExp(r'\s+'), ''); - if (foundContent == content) { - foundRecords.add(record.copyWith(isSatisfied: true)); - } else { - foundRecords.add(record.copyWith(isSatisfied: false)); - } - } else { - if (records.data.any( - (final r) => - (r.name == record.name) && - r.type == record.type && - r.content == record.content, - )) { - foundRecords.add(record.copyWith(isSatisfied: true)); - } else { - foundRecords.add(record.copyWith(isSatisfied: false)); - } - } - } - } catch (e) { - print(e); - return GenericResult( - data: [], - success: false, - message: e.toString(), - ); - } - return GenericResult( - data: foundRecords, - success: true, - ); - } - - @override - List getDesiredDnsRecords( - final String? domainName, - final String? ip4, - final String? dkimPublicKey, - ) { - if (domainName == null || ip4 == null) { - return []; - } - return [ - DesiredDnsRecord( - name: domainName, - content: ip4, - description: 'record.root', - ), - DesiredDnsRecord( - name: 'api.$domainName', - content: ip4, - description: 'record.api', - ), - DesiredDnsRecord( - name: 'cloud.$domainName', - content: ip4, - description: 'record.cloud', - ), - DesiredDnsRecord( - name: 'git.$domainName', - content: ip4, - description: 'record.git', - ), - DesiredDnsRecord( - name: 'meet.$domainName', - content: ip4, - description: 'record.meet', - ), - DesiredDnsRecord( - name: 'social.$domainName', - content: ip4, - description: 'record.social', - ), - DesiredDnsRecord( - name: 'password.$domainName', - content: ip4, - description: 'record.password', - ), - DesiredDnsRecord( - name: 'vpn.$domainName', - content: ip4, - description: 'record.vpn', - ), - DesiredDnsRecord( - name: domainName, - content: domainName, - description: 'record.mx', - type: 'MX', - category: DnsRecordsCategory.email, - ), - DesiredDnsRecord( - name: '_dmarc.$domainName', - content: 'v=DMARC1; p=none', - description: 'record.dmarc', - type: 'TXT', - category: DnsRecordsCategory.email, - ), - DesiredDnsRecord( - name: domainName, - content: 'v=spf1 a mx ip4:$ip4 -all', - description: 'record.spf', - type: 'TXT', - category: DnsRecordsCategory.email, - ), - if (dkimPublicKey != null) - DesiredDnsRecord( - name: 'selector._domainkey.$domainName', - content: dkimPublicKey, - description: 'record.dkim', - type: 'TXT', - category: DnsRecordsCategory.email, - ), - ]; - } - - List getProjectDnsRecords( - final String? domainName, - final String? ip4, - ) { - final DnsRecord domainA = - DnsRecord(type: 'A', name: domainName, content: ip4); - - final DnsRecord mx = DnsRecord(type: 'MX', name: '@', content: domainName); - final DnsRecord apiA = DnsRecord(type: 'A', name: 'api', content: ip4); - final DnsRecord cloudA = DnsRecord(type: 'A', name: 'cloud', content: ip4); - final DnsRecord gitA = DnsRecord(type: 'A', name: 'git', content: ip4); - final DnsRecord meetA = DnsRecord(type: 'A', name: 'meet', content: ip4); - final DnsRecord passwordA = - DnsRecord(type: 'A', name: 'password', content: ip4); - final DnsRecord socialA = - DnsRecord(type: 'A', name: 'social', content: ip4); - final DnsRecord vpn = DnsRecord(type: 'A', name: 'vpn', content: ip4); - - final DnsRecord txt1 = DnsRecord( - type: 'TXT', - name: '_dmarc', - content: 'v=DMARC1; p=none', - ttl: 18000, - ); - - final DnsRecord txt2 = DnsRecord( - type: 'TXT', - name: domainName, - content: 'v=spf1 a mx ip4:$ip4 -all', - ttl: 18000, - ); - - return [ - domainA, - apiA, - cloudA, - gitA, - meetA, - passwordA, - socialA, - mx, - txt1, - txt2, - vpn, - ]; - } - Future> syncZoneId(final String domain) async { if (domain == _adapter.cachedDomain && _adapter.cachedZoneId.isNotEmpty) { return GenericResult( diff --git a/lib/logic/providers/dns_providers/desec.dart b/lib/logic/providers/dns_providers/desec.dart index 8863f05f..ea139039 100644 --- a/lib/logic/providers/dns_providers/desec.dart +++ b/lib/logic/providers/dns_providers/desec.dart @@ -1,9 +1,9 @@ import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/desec/desec_api.dart'; -import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/desired_dns_record.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; -import 'package:selfprivacy/logic/models/json/desec_dns_info.dart'; +import 'package:selfprivacy/logic/models/json/dns_providers/desec_dns_info.dart'; import 'package:selfprivacy/logic/models/json/dns_records.dart'; import 'package:selfprivacy/logic/providers/dns_providers/dns_provider.dart'; +import 'package:selfprivacy/utils/network_utils.dart'; class ApiAdapter { ApiAdapter({final bool isWithToken = true}) @@ -49,8 +49,8 @@ class DesecDnsProvider extends DnsProvider { } @override - Future>> domainList() async { - List domains = []; + Future>> domainList() async { + List domains = []; final result = await _adapter.api().getDomains(); if (result.data.isEmpty || !result.success) { return GenericResult( @@ -62,8 +62,8 @@ class DesecDnsProvider extends DnsProvider { } domains = result.data - .map( - (final el) => el.name, + .map( + (final el) => el.toServerDomain(), ) .toList(); @@ -78,21 +78,14 @@ class DesecDnsProvider extends DnsProvider { required final ServerDomain domain, final String? ip4, }) async { - final List listDnsRecords = projectDnsRecords( + final List listDnsRecords = getProjectDnsRecords( domain.domainName, ip4, ); final List bulkRecords = []; for (final DnsRecord record in listDnsRecords) { - bulkRecords.add( - DesecDnsRecord( - subname: record.name ?? '', - type: record.type, - ttl: record.ttl, - records: [extractContent(record) ?? ''], - ), - ); + bulkRecords.add(DesecDnsRecord.fromDnsRecord(record, domain.domainName)); } return _adapter.api().createMultipleDnsRecords( @@ -106,18 +99,22 @@ class DesecDnsProvider extends DnsProvider { required final ServerDomain domain, final String? ip4, }) async { - final List listDnsRecords = projectDnsRecords( + final List listDnsRecords = getProjectDnsRecords( domain.domainName, ip4, ); final List bulkRecords = []; for (final DnsRecord record in listDnsRecords) { + final desecRecord = DesecDnsRecord.fromDnsRecord( + record, + domain.domainName, + ); bulkRecords.add( DesecDnsRecord( - subname: record.name ?? '', - type: record.type, - ttl: record.ttl, + subname: desecRecord.subname, + type: desecRecord.type, + ttl: desecRecord.ttl, records: [], ), ); @@ -154,16 +151,7 @@ class DesecDnsProvider extends DnsProvider { try { for (final record in result.data) { - final String? content = - record.records.isEmpty ? null : record.records[0]; - records.add( - DnsRecord( - name: record.subname, - type: record.type, - content: content, - ttl: record.ttl, - ), - ); + records.add(record.toDnsRecord(domain.domainName)); } } catch (e) { print(e); @@ -184,14 +172,7 @@ class DesecDnsProvider extends DnsProvider { ) async { final result = await _adapter.api().createMultipleDnsRecords( domainName: domain.domainName, - records: [ - DesecDnsRecord( - subname: record.name ?? '', - type: record.type, - ttl: record.ttl, - records: [extractContent(record) ?? ''], - ), - ], + records: [DesecDnsRecord.fromDnsRecord(record, domain.domainName)], ); return GenericResult( @@ -199,216 +180,4 @@ class DesecDnsProvider extends DnsProvider { data: null, ); } - - String? extractContent(final DnsRecord record) { - String? content = record.content; - if (record.type == 'TXT' && content != null && !content.startsWith('"')) { - content = '"$content"'; - } - - return content; - } - - @override - Future>> validateDnsRecords( - final ServerDomain domain, - final String ip4, - final String dkimPublicKey, - ) async { - final result = await getDnsRecords(domain: domain); - if (result.data.isEmpty || !result.success) { - return GenericResult( - success: result.success, - data: [], - code: result.code, - message: result.message, - ); - } - - final records = result.data; - final List foundRecords = []; - try { - final List desiredRecords = - getDesiredDnsRecords(domain.domainName, ip4, dkimPublicKey); - for (final DesiredDnsRecord record in desiredRecords) { - if (record.description == 'record.dkim') { - final DnsRecord foundRecord = records.firstWhere( - (final r) => - ('${r.name}.${domain.domainName}' == record.name) && - r.type == record.type, - orElse: () => DnsRecord( - name: record.name, - type: record.type, - content: '', - ttl: 800, - proxied: false, - ), - ); - // remove all spaces and tabulators from - // the foundRecord.content and the record.content - // to compare them - final String? foundContent = - foundRecord.content?.replaceAll(RegExp(r'\s+'), ''); - final String content = record.content.replaceAll(RegExp(r'\s+'), ''); - if (foundContent == content) { - foundRecords.add(record.copyWith(isSatisfied: true)); - } else { - foundRecords.add(record.copyWith(isSatisfied: false)); - } - } else { - if (records.any( - (final r) => - ('${r.name}.${domain.domainName}' == record.name || - record.name == '') && - r.type == record.type && - r.content == record.content, - )) { - foundRecords.add(record.copyWith(isSatisfied: true)); - } else { - foundRecords.add(record.copyWith(isSatisfied: false)); - } - } - } - } catch (e) { - print(e); - return GenericResult( - data: [], - success: false, - message: e.toString(), - ); - } - return GenericResult( - data: foundRecords, - success: true, - ); - } - - List projectDnsRecords( - final String? domainName, - final String? ip4, - ) { - final DnsRecord domainA = DnsRecord(type: 'A', name: '', content: ip4); - - final DnsRecord mx = - DnsRecord(type: 'MX', name: '', content: '10 $domainName.'); - final DnsRecord apiA = DnsRecord(type: 'A', name: 'api', content: ip4); - final DnsRecord cloudA = DnsRecord(type: 'A', name: 'cloud', content: ip4); - final DnsRecord gitA = DnsRecord(type: 'A', name: 'git', content: ip4); - final DnsRecord meetA = DnsRecord(type: 'A', name: 'meet', content: ip4); - final DnsRecord passwordA = - DnsRecord(type: 'A', name: 'password', content: ip4); - final DnsRecord socialA = - DnsRecord(type: 'A', name: 'social', content: ip4); - final DnsRecord vpn = DnsRecord(type: 'A', name: 'vpn', content: ip4); - - final DnsRecord txt1 = DnsRecord( - type: 'TXT', - name: '_dmarc', - content: '"v=DMARC1; p=none"', - ttl: 18000, - ); - - final DnsRecord txt2 = DnsRecord( - type: 'TXT', - name: '', - content: '"v=spf1 a mx ip4:$ip4 -all"', - ttl: 18000, - ); - - return [ - domainA, - apiA, - cloudA, - gitA, - meetA, - passwordA, - socialA, - mx, - txt1, - txt2, - vpn, - ]; - } - - @override - List getDesiredDnsRecords( - final String? domainName, - final String? ip4, - final String? dkimPublicKey, - ) { - if (domainName == null || ip4 == null) { - return []; - } - return [ - DesiredDnsRecord( - name: '', - content: ip4, - description: 'record.root', - ), - DesiredDnsRecord( - name: 'api.$domainName', - content: ip4, - description: 'record.api', - ), - DesiredDnsRecord( - name: 'cloud.$domainName', - content: ip4, - description: 'record.cloud', - ), - DesiredDnsRecord( - name: 'git.$domainName', - content: ip4, - description: 'record.git', - ), - DesiredDnsRecord( - name: 'meet.$domainName', - content: ip4, - description: 'record.meet', - ), - DesiredDnsRecord( - name: 'social.$domainName', - content: ip4, - description: 'record.social', - ), - DesiredDnsRecord( - name: 'password.$domainName', - content: ip4, - description: 'record.password', - ), - DesiredDnsRecord( - name: 'vpn.$domainName', - content: ip4, - description: 'record.vpn', - ), - DesiredDnsRecord( - name: '', - content: '10 $domainName.', - description: 'record.mx', - type: 'MX', - category: DnsRecordsCategory.email, - ), - DesiredDnsRecord( - name: '_dmarc.$domainName', - content: '"v=DMARC1; p=none"', - description: 'record.dmarc', - type: 'TXT', - category: DnsRecordsCategory.email, - ), - DesiredDnsRecord( - name: '', - content: '"v=spf1 a mx ip4:$ip4 -all"', - description: 'record.spf', - type: 'TXT', - category: DnsRecordsCategory.email, - ), - if (dkimPublicKey != null) - DesiredDnsRecord( - name: 'selector._domainkey.$domainName', - content: '"$dkimPublicKey"', - description: 'record.dkim', - type: 'TXT', - category: DnsRecordsCategory.email, - ), - ]; - } } diff --git a/lib/logic/providers/dns_providers/digital_ocean_dns.dart b/lib/logic/providers/dns_providers/digital_ocean_dns.dart index d793586b..e07b63b1 100644 --- a/lib/logic/providers/dns_providers/digital_ocean_dns.dart +++ b/lib/logic/providers/dns_providers/digital_ocean_dns.dart @@ -1,9 +1,9 @@ -import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/desired_dns_record.dart'; import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/digital_ocean_dns/digital_ocean_dns_api.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; -import 'package:selfprivacy/logic/models/json/digital_ocean_dns_info.dart'; +import 'package:selfprivacy/logic/models/json/dns_providers/digital_ocean_dns_info.dart'; import 'package:selfprivacy/logic/models/json/dns_records.dart'; import 'package:selfprivacy/logic/providers/dns_providers/dns_provider.dart'; +import 'package:selfprivacy/utils/network_utils.dart'; class ApiAdapter { ApiAdapter({final bool isWithToken = true}) @@ -49,8 +49,8 @@ class DigitalOceanDnsProvider extends DnsProvider { } @override - Future>> domainList() async { - List domains = []; + Future>> domainList() async { + List domains = []; final result = await _adapter.api().getDomains(); if (result.data.isEmpty || !result.success) { return GenericResult( @@ -62,8 +62,8 @@ class DigitalOceanDnsProvider extends DnsProvider { } domains = result.data - .map( - (final el) => el.name, + .map( + (final el) => el.toServerDomain(), ) .toList(); @@ -85,14 +85,8 @@ class DigitalOceanDnsProvider extends DnsProvider { ip4, ) .map( - (final e) => DigitalOceanDnsRecord( - name: e.name ?? '', - id: null, - data: e.content ?? '', - ttl: e.ttl, - type: e.type, - priority: e.priority, - ), + (final e) => + DigitalOceanDnsRecord.fromDnsRecord(e, domain.domainName), ) .toList(), ); @@ -142,15 +136,7 @@ class DigitalOceanDnsProvider extends DnsProvider { } for (final rawRecord in result.data) { - records.add( - DnsRecord( - name: rawRecord.name, - type: rawRecord.type, - content: rawRecord.data, - ttl: rawRecord.ttl, - proxied: false, - ), - ); + records.add(rawRecord.toDnsRecord(domain.domainName)); } return GenericResult(data: records, success: true); @@ -164,212 +150,10 @@ class DigitalOceanDnsProvider extends DnsProvider { _adapter.api().createMultipleDnsRecords( domainName: domain.domainName, records: [ - DigitalOceanDnsRecord( - data: record.content ?? '', - id: null, - name: record.name ?? '', - ttl: record.ttl, - type: record.type, - priority: record.priority, + DigitalOceanDnsRecord.fromDnsRecord( + record, + domain.domainName, ), ], ); - - @override - Future>> validateDnsRecords( - final ServerDomain domain, - final String ip4, - final String dkimPublicKey, - ) async { - final GenericResult> records = - await getDnsRecords(domain: domain); - final List foundRecords = []; - try { - final List desiredRecords = - getDesiredDnsRecords(domain.domainName, ip4, dkimPublicKey); - for (final DesiredDnsRecord record in desiredRecords) { - if (record.description == 'record.dkim') { - final DnsRecord foundRecord = records.data.firstWhere( - (final r) => (r.name == record.name) && r.type == record.type, - orElse: () => DnsRecord( - name: record.name, - type: record.type, - content: '', - ttl: 800, - proxied: false, - ), - ); - // remove all spaces and tabulators from - // the foundRecord.content and the record.content - // to compare them - final String? foundContent = - foundRecord.content?.replaceAll(RegExp(r'\s+'), ''); - final String content = record.content.replaceAll(RegExp(r'\s+'), ''); - if (foundContent == content) { - foundRecords.add(record.copyWith(isSatisfied: true)); - } else { - foundRecords.add(record.copyWith(isSatisfied: false)); - } - } else { - if (records.data.any( - (final r) => - (r.name == record.name) && - r.type == record.type && - r.content == record.content, - )) { - foundRecords.add(record.copyWith(isSatisfied: true)); - } else { - foundRecords.add(record.copyWith(isSatisfied: false)); - } - } - } - } catch (e) { - print(e); - return GenericResult( - data: [], - success: false, - message: e.toString(), - ); - } - return GenericResult( - data: foundRecords, - success: true, - ); - } - - List getProjectDnsRecords( - final String? domainName, - final String? ip4, - ) { - final DnsRecord domainA = DnsRecord(type: 'A', name: '@', content: ip4); - - final DnsRecord mx = DnsRecord(type: 'MX', name: '@', content: '@'); - final DnsRecord apiA = DnsRecord(type: 'A', name: 'api', content: ip4); - final DnsRecord cloudA = DnsRecord(type: 'A', name: 'cloud', content: ip4); - final DnsRecord gitA = DnsRecord(type: 'A', name: 'git', content: ip4); - final DnsRecord meetA = DnsRecord(type: 'A', name: 'meet', content: ip4); - final DnsRecord passwordA = - DnsRecord(type: 'A', name: 'password', content: ip4); - final DnsRecord socialA = - DnsRecord(type: 'A', name: 'social', content: ip4); - final DnsRecord vpn = DnsRecord(type: 'A', name: 'vpn', content: ip4); - - final DnsRecord txt1 = DnsRecord( - type: 'TXT', - name: '_dmarc', - content: 'v=DMARC1; p=none', - ttl: 18000, - ); - - final DnsRecord txt2 = DnsRecord( - type: 'TXT', - name: '@', - content: 'v=spf1 a mx ip4:$ip4 -all', - ttl: 18000, - ); - - return [ - domainA, - apiA, - cloudA, - gitA, - meetA, - passwordA, - socialA, - mx, - txt1, - txt2, - vpn, - ]; - } - - @override - List getDesiredDnsRecords( - final String? domainName, - final String? ip4, - final String? dkimPublicKey, - ) { - if (domainName == null || ip4 == null) { - return []; - } - return [ - DesiredDnsRecord( - name: '@', - content: ip4, - description: 'record.root', - displayName: domainName, - ), - DesiredDnsRecord( - name: 'api', - content: ip4, - description: 'record.api', - displayName: 'api.$domainName', - ), - DesiredDnsRecord( - name: 'cloud', - content: ip4, - description: 'record.cloud', - displayName: 'cloud.$domainName', - ), - DesiredDnsRecord( - name: 'git', - content: ip4, - description: 'record.git', - displayName: 'git.$domainName', - ), - DesiredDnsRecord( - name: 'meet', - content: ip4, - description: 'record.meet', - displayName: 'meet.$domainName', - ), - DesiredDnsRecord( - name: 'social', - content: ip4, - description: 'record.social', - displayName: 'social.$domainName', - ), - DesiredDnsRecord( - name: 'password', - content: ip4, - description: 'record.password', - displayName: 'password.$domainName', - ), - DesiredDnsRecord( - name: 'vpn', - content: ip4, - description: 'record.vpn', - displayName: 'vpn.$domainName', - ), - const DesiredDnsRecord( - name: '@', - content: '@', - description: 'record.mx', - type: 'MX', - category: DnsRecordsCategory.email, - ), - const DesiredDnsRecord( - name: '_dmarc', - content: 'v=DMARC1; p=none', - description: 'record.dmarc', - type: 'TXT', - category: DnsRecordsCategory.email, - ), - DesiredDnsRecord( - name: '@', - content: 'v=spf1 a mx ip4:$ip4 -all', - description: 'record.spf', - type: 'TXT', - category: DnsRecordsCategory.email, - ), - if (dkimPublicKey != null) - DesiredDnsRecord( - name: 'selector._domainkey', - content: dkimPublicKey, - description: 'record.dkim', - type: 'TXT', - category: DnsRecordsCategory.email, - ), - ]; - } } diff --git a/lib/logic/providers/dns_providers/dns_provider.dart b/lib/logic/providers/dns_providers/dns_provider.dart index 95932b0a..98bd2199 100644 --- a/lib/logic/providers/dns_providers/dns_provider.dart +++ b/lib/logic/providers/dns_providers/dns_provider.dart @@ -1,5 +1,4 @@ import 'package:selfprivacy/logic/api_maps/generic_result.dart'; -import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/desired_dns_record.dart'; import 'package:selfprivacy/logic/models/hive/server_domain.dart'; import 'package:selfprivacy/logic/models/json/dns_records.dart'; export 'package:selfprivacy/logic/api_maps/generic_result.dart'; @@ -22,7 +21,7 @@ abstract class DnsProvider { Future> tryInitApiByToken(final String token); /// Returns list of all available domain entries assigned to the account. - Future>> domainList(); + Future>> domainList(); /// Tries to create all main domain records needed /// for SelfPrivacy to launch on requested domain by ip4. @@ -57,24 +56,4 @@ abstract class DnsProvider { final DnsRecord record, final ServerDomain domain, ); - - /// Tries to check whether all known DNS records on the domain by ip4 - /// match expectations of SelfPrivacy in order to launch. - /// - /// Will return list of [DesiredDnsRecord] objects, which represent - /// only those records which have successfully passed validation. - Future>> validateDnsRecords( - final ServerDomain domain, - final String ip4, - final String dkimPublicKey, - ); - - /// Will return list of [DesiredDnsRecord] objects, which represent - /// samples of perfect DNS records we need to know about in order to launch - /// SelfPrivacy application correctly. - List getDesiredDnsRecords( - final String? domainName, - final String? ip4, - final String? dkimPublicKey, - ); } diff --git a/lib/ui/pages/dns_details/dns_details.dart b/lib/ui/pages/dns_details/dns_details.dart index 98e567a9..a6aa02dd 100644 --- a/lib/ui/pages/dns_details/dns_details.dart +++ b/lib/ui/pages/dns_details/dns_details.dart @@ -151,12 +151,8 @@ class _DnsDetailsPageState extends State { ? neutralColor : errorColor, ), - title: Text( - dnsRecord.description.tr(), - ), - subtitle: Text( - dnsRecord.displayName ?? dnsRecord.name, - ), + title: Text(dnsRecord.displayName ?? dnsRecord.name), + subtitle: Text(dnsRecord.content), ), ], ), @@ -195,9 +191,8 @@ class _DnsDetailsPageState extends State { ? neutralColor : errorColor, ), - title: Text( - dnsRecord.description.tr(), - ), + title: Text(dnsRecord.displayName ?? dnsRecord.name), + subtitle: Text(dnsRecord.name), ), ], ), diff --git a/lib/ui/router/router.gr.dart b/lib/ui/router/router.gr.dart index a9d401f3..98f4453a 100644 --- a/lib/ui/router/router.gr.dart +++ b/lib/ui/router/router.gr.dart @@ -15,6 +15,24 @@ abstract class _$RootRouter extends RootStackRouter { @override final Map pagesMap = { + AboutApplicationRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AboutApplicationPage(), + ); + }, + AppSettingsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AppSettingsPage(), + ); + }, + BackupDetailsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const BackupDetailsPage(), + ); + }, BackupsListRoute.name: (routeData) { final args = routeData.argsAs(); return AutoRoutePage( @@ -25,10 +43,16 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, - BackupDetailsRoute.name: (routeData) { + ConsoleRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const BackupDetailsPage(), + child: const ConsolePage(), + ); + }, + DeveloperSettingsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const DeveloperSettingsPage(), ); }, DevicesRoute.name: (routeData) { @@ -43,28 +67,21 @@ abstract class _$RootRouter extends RootStackRouter { child: const DnsDetailsPage(), ); }, - AboutApplicationRoute.name: (routeData) { + ExtendingVolumeRoute.name: (routeData) { + final args = routeData.argsAs(); return AutoRoutePage( routeData: routeData, - child: const AboutApplicationPage(), + child: ExtendingVolumePage( + diskVolumeToResize: args.diskVolumeToResize, + diskStatus: args.diskStatus, + key: args.key, + ), ); }, - AppSettingsRoute.name: (routeData) { + InitializingRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const AppSettingsPage(), - ); - }, - DeveloperSettingsRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const DeveloperSettingsPage(), - ); - }, - ConsoleRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const ConsolePage(), + child: const InitializingPage(), ); }, MoreRoute.name: (routeData) { @@ -73,6 +90,12 @@ abstract class _$RootRouter extends RootStackRouter { child: const MorePage(), ); }, + NewUserRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const NewUserPage(), + ); + }, OnboardingRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, @@ -91,6 +114,12 @@ abstract class _$RootRouter extends RootStackRouter { child: const RecoveryKeyPage(), ); }, + RecoveryRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const RecoveryRouting(), + ); + }, RootRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, @@ -103,18 +132,6 @@ abstract class _$RootRouter extends RootStackRouter { child: const ServerDetailsScreen(), ); }, - ServicesMigrationRoute.name: (routeData) { - final args = routeData.argsAs(); - return AutoRoutePage( - routeData: routeData, - child: ServicesMigrationPage( - services: args.services, - diskStatus: args.diskStatus, - isMigration: args.isMigration, - key: args.key, - ), - ); - }, ServerStorageRoute.name: (routeData) { final args = routeData.argsAs(); return AutoRoutePage( @@ -125,17 +142,6 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, - ExtendingVolumeRoute.name: (routeData) { - final args = routeData.argsAs(); - return AutoRoutePage( - routeData: routeData, - child: ExtendingVolumePage( - diskVolumeToResize: args.diskVolumeToResize, - diskStatus: args.diskStatus, - key: args.key, - ), - ); - }, ServiceRoute.name: (routeData) { final args = routeData.argsAs(); return AutoRoutePage( @@ -146,36 +152,24 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, + ServicesMigrationRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: ServicesMigrationPage( + services: args.services, + diskStatus: args.diskStatus, + isMigration: args.isMigration, + key: args.key, + ), + ); + }, ServicesRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, child: const ServicesPage(), ); }, - InitializingRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const InitializingPage(), - ); - }, - RecoveryRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const RecoveryRouting(), - ); - }, - UsersRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const UsersPage(), - ); - }, - NewUserRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const NewUserPage(), - ); - }, UserDetailsRoute.name: (routeData) { final args = routeData.argsAs(); return AutoRoutePage( @@ -186,9 +180,57 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, + UsersRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const UsersPage(), + ); + }, }; } +/// generated route for +/// [AboutApplicationPage] +class AboutApplicationRoute extends PageRouteInfo { + const AboutApplicationRoute({List? children}) + : super( + AboutApplicationRoute.name, + initialChildren: children, + ); + + static const String name = 'AboutApplicationRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [AppSettingsPage] +class AppSettingsRoute extends PageRouteInfo { + const AppSettingsRoute({List? children}) + : super( + AppSettingsRoute.name, + initialChildren: children, + ); + + static const String name = 'AppSettingsRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [BackupDetailsPage] +class BackupDetailsRoute extends PageRouteInfo { + const BackupDetailsRoute({List? children}) + : super( + BackupDetailsRoute.name, + initialChildren: children, + ); + + static const String name = 'BackupDetailsRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [BackupsListPage] class BackupsListRoute extends PageRouteInfo { @@ -228,15 +270,29 @@ class BackupsListRouteArgs { } /// generated route for -/// [BackupDetailsPage] -class BackupDetailsRoute extends PageRouteInfo { - const BackupDetailsRoute({List? children}) +/// [ConsolePage] +class ConsoleRoute extends PageRouteInfo { + const ConsoleRoute({List? children}) : super( - BackupDetailsRoute.name, + ConsoleRoute.name, initialChildren: children, ); - static const String name = 'BackupDetailsRoute'; + static const String name = 'ConsoleRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [DeveloperSettingsPage] +class DeveloperSettingsRoute extends PageRouteInfo { + const DeveloperSettingsRoute({List? children}) + : super( + DeveloperSettingsRoute.name, + initialChildren: children, + ); + + static const String name = 'DeveloperSettingsRoute'; static const PageInfo page = PageInfo(name); } @@ -270,57 +326,58 @@ class DnsDetailsRoute extends PageRouteInfo { } /// generated route for -/// [AboutApplicationPage] -class AboutApplicationRoute extends PageRouteInfo { - const AboutApplicationRoute({List? children}) - : super( - AboutApplicationRoute.name, +/// [ExtendingVolumePage] +class ExtendingVolumeRoute extends PageRouteInfo { + ExtendingVolumeRoute({ + required DiskVolume diskVolumeToResize, + required DiskStatus diskStatus, + Key? key, + List? children, + }) : super( + ExtendingVolumeRoute.name, + args: ExtendingVolumeRouteArgs( + diskVolumeToResize: diskVolumeToResize, + diskStatus: diskStatus, + key: key, + ), initialChildren: children, ); - static const String name = 'AboutApplicationRoute'; + static const String name = 'ExtendingVolumeRoute'; - static const PageInfo page = PageInfo(name); + static const PageInfo page = + PageInfo(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 -/// [AppSettingsPage] -class AppSettingsRoute extends PageRouteInfo { - const AppSettingsRoute({List? children}) +/// [InitializingPage] +class InitializingRoute extends PageRouteInfo { + const InitializingRoute({List? children}) : super( - AppSettingsRoute.name, + InitializingRoute.name, initialChildren: children, ); - static const String name = 'AppSettingsRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [DeveloperSettingsPage] -class DeveloperSettingsRoute extends PageRouteInfo { - const DeveloperSettingsRoute({List? children}) - : super( - DeveloperSettingsRoute.name, - initialChildren: children, - ); - - static const String name = 'DeveloperSettingsRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [ConsolePage] -class ConsoleRoute extends PageRouteInfo { - const ConsoleRoute({List? children}) - : super( - ConsoleRoute.name, - initialChildren: children, - ); - - static const String name = 'ConsoleRoute'; + static const String name = 'InitializingRoute'; static const PageInfo page = PageInfo(name); } @@ -339,6 +396,20 @@ class MoreRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } +/// generated route for +/// [NewUserPage] +class NewUserRoute extends PageRouteInfo { + const NewUserRoute({List? children}) + : super( + NewUserRoute.name, + initialChildren: children, + ); + + static const String name = 'NewUserRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [OnboardingPage] class OnboardingRoute extends PageRouteInfo { @@ -381,6 +452,20 @@ class RecoveryKeyRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } +/// generated route for +/// [RecoveryRouting] +class RecoveryRoute extends PageRouteInfo { + const RecoveryRoute({List? children}) + : super( + RecoveryRoute.name, + initialChildren: children, + ); + + static const String name = 'RecoveryRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [RootPage] class RootRoute extends PageRouteInfo { @@ -409,6 +494,82 @@ class ServerDetailsRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } +/// generated route for +/// [ServerStoragePage] +class ServerStorageRoute extends PageRouteInfo { + ServerStorageRoute({ + required DiskStatus diskStatus, + Key? key, + List? children, + }) : super( + ServerStorageRoute.name, + args: ServerStorageRouteArgs( + diskStatus: diskStatus, + key: key, + ), + initialChildren: children, + ); + + static const String name = 'ServerStorageRoute'; + + static const PageInfo page = + PageInfo(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 +/// [ServicePage] +class ServiceRoute extends PageRouteInfo { + ServiceRoute({ + required String serviceId, + Key? key, + List? children, + }) : super( + ServiceRoute.name, + args: ServiceRouteArgs( + serviceId: serviceId, + key: key, + ), + initialChildren: children, + ); + + static const String name = 'ServiceRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class ServiceRouteArgs { + const ServiceRouteArgs({ + required this.serviceId, + this.key, + }); + + final String serviceId; + + final Key? key; + + @override + String toString() { + return 'ServiceRouteArgs{serviceId: $serviceId, key: $key}'; + } +} + /// generated route for /// [ServicesMigrationPage] class ServicesMigrationRoute extends PageRouteInfo { @@ -457,125 +618,6 @@ class ServicesMigrationRouteArgs { } } -/// generated route for -/// [ServerStoragePage] -class ServerStorageRoute extends PageRouteInfo { - ServerStorageRoute({ - required DiskStatus diskStatus, - Key? key, - List? children, - }) : super( - ServerStorageRoute.name, - args: ServerStorageRouteArgs( - diskStatus: diskStatus, - key: key, - ), - initialChildren: children, - ); - - static const String name = 'ServerStorageRoute'; - - static const PageInfo page = - PageInfo(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 -/// [ExtendingVolumePage] -class ExtendingVolumeRoute extends PageRouteInfo { - ExtendingVolumeRoute({ - required DiskVolume diskVolumeToResize, - required DiskStatus diskStatus, - Key? key, - List? children, - }) : super( - ExtendingVolumeRoute.name, - args: ExtendingVolumeRouteArgs( - diskVolumeToResize: diskVolumeToResize, - diskStatus: diskStatus, - key: key, - ), - initialChildren: children, - ); - - static const String name = 'ExtendingVolumeRoute'; - - static const PageInfo page = - PageInfo(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 -/// [ServicePage] -class ServiceRoute extends PageRouteInfo { - ServiceRoute({ - required String serviceId, - Key? key, - List? children, - }) : super( - ServiceRoute.name, - args: ServiceRouteArgs( - serviceId: serviceId, - key: key, - ), - initialChildren: children, - ); - - static const String name = 'ServiceRoute'; - - static const PageInfo page = - PageInfo(name); -} - -class ServiceRouteArgs { - const ServiceRouteArgs({ - required this.serviceId, - this.key, - }); - - final String serviceId; - - final Key? key; - - @override - String toString() { - return 'ServiceRouteArgs{serviceId: $serviceId, key: $key}'; - } -} - /// generated route for /// [ServicesPage] class ServicesRoute extends PageRouteInfo { @@ -590,62 +632,6 @@ class ServicesRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } -/// generated route for -/// [InitializingPage] -class InitializingRoute extends PageRouteInfo { - const InitializingRoute({List? children}) - : super( - InitializingRoute.name, - initialChildren: children, - ); - - static const String name = 'InitializingRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [RecoveryRouting] -class RecoveryRoute extends PageRouteInfo { - const RecoveryRoute({List? children}) - : super( - RecoveryRoute.name, - initialChildren: children, - ); - - static const String name = 'RecoveryRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [UsersPage] -class UsersRoute extends PageRouteInfo { - const UsersRoute({List? children}) - : super( - UsersRoute.name, - initialChildren: children, - ); - - static const String name = 'UsersRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [NewUserPage] -class NewUserRoute extends PageRouteInfo { - const NewUserRoute({List? children}) - : super( - NewUserRoute.name, - initialChildren: children, - ); - - static const String name = 'NewUserRoute'; - - static const PageInfo page = PageInfo(name); -} - /// generated route for /// [UserDetailsPage] class UserDetailsRoute extends PageRouteInfo { @@ -683,3 +669,17 @@ class UserDetailsRouteArgs { return 'UserDetailsRouteArgs{login: $login, key: $key}'; } } + +/// generated route for +/// [UsersPage] +class UsersRoute extends PageRouteInfo { + const UsersRoute({List? children}) + : super( + UsersRoute.name, + initialChildren: children, + ); + + static const String name = 'UsersRoute'; + + static const PageInfo page = PageInfo(name); +} diff --git a/lib/utils/network_utils.dart b/lib/utils/network_utils.dart index 95fe79fa..bfd8a82d 100644 --- a/lib/utils/network_utils.dart +++ b/lib/utils/network_utils.dart @@ -89,3 +89,49 @@ void launchURL(final url) async { print(e); } } + +List getProjectDnsRecords( + final String? domainName, + final String? ip4, +) { + final DnsRecord domainA = + DnsRecord(type: 'A', name: domainName, content: ip4); + + final DnsRecord mx = DnsRecord(type: 'MX', name: '@', content: domainName); + final DnsRecord apiA = DnsRecord(type: 'A', name: 'api', content: ip4); + final DnsRecord cloudA = DnsRecord(type: 'A', name: 'cloud', content: ip4); + final DnsRecord gitA = DnsRecord(type: 'A', name: 'git', content: ip4); + final DnsRecord meetA = DnsRecord(type: 'A', name: 'meet', content: ip4); + final DnsRecord passwordA = + DnsRecord(type: 'A', name: 'password', content: ip4); + final DnsRecord socialA = DnsRecord(type: 'A', name: 'social', content: ip4); + final DnsRecord vpn = DnsRecord(type: 'A', name: 'vpn', content: ip4); + + final DnsRecord txt1 = DnsRecord( + type: 'TXT', + name: '_dmarc', + content: 'v=DMARC1; p=none', + ttl: 18000, + ); + + final DnsRecord txt2 = DnsRecord( + type: 'TXT', + name: domainName, + content: 'v=spf1 a mx ip4:$ip4 -all', + ttl: 18000, + ); + + return [ + domainA, + apiA, + cloudA, + gitA, + meetA, + passwordA, + socialA, + mx, + txt1, + txt2, + vpn, + ]; +}