Nathan.fooo f9e7b5ffa4
feat: reload UI (#2999)
* chore: reload folder

* chore: reload folder

* chore: init sync

* chore: update tables

* chore: update database

* chore: load row

* chore: update

* chore: reload row

* test: fit test

* chore: retry

* chore: support batch fetch

* chore: enable sync

* chore: sync switch

* chore: sync switch

* chore: migration user data

* chore: migrate data

* chore: migrate folder

* chore: save user email

* chore: refresh user profile

* chore: fix test

* chore: delete translation files

* test: clippy format
2023-07-14 13:37:13 +08:00

66 lines
1.7 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
// Run `dart run build_runner build` to generate the json serialization If the
// file `env_serde.i.dart` is existed, delete it first.
//
// the file `env_serde.g.dart` will be generated in the same directory. Rename
// the file to `env_serde.i.dart` because the file is ignored by default.
part 'env_serde.i.dart';
@JsonSerializable()
class AppFlowyEnv {
final SupabaseConfiguration supabase_config;
AppFlowyEnv({
required this.supabase_config,
});
factory AppFlowyEnv.fromJson(Map<String, dynamic> json) =>
_$AppFlowyEnvFromJson(json);
Map<String, dynamic> toJson() => _$AppFlowyEnvToJson(this);
}
@JsonSerializable()
class SupabaseConfiguration {
/// Indicates whether the sync feature is enabled.
final bool enable_sync;
final String url;
final String key;
final String jwt_secret;
final PostgresConfiguration postgres_config;
SupabaseConfiguration({
this.enable_sync = true,
required this.url,
required this.key,
required this.jwt_secret,
required this.postgres_config,
});
factory SupabaseConfiguration.fromJson(Map<String, dynamic> json) =>
_$SupabaseConfigurationFromJson(json);
Map<String, dynamic> toJson() => _$SupabaseConfigurationToJson(this);
}
@JsonSerializable()
class PostgresConfiguration {
final String url;
final String user_name;
final String password;
final int port;
PostgresConfiguration({
required this.url,
required this.user_name,
required this.password,
required this.port,
});
factory PostgresConfiguration.fromJson(Map<String, dynamic> json) =>
_$PostgresConfigurationFromJson(json);
Map<String, dynamic> toJson() => _$PostgresConfigurationToJson(this);
}