2023-11-05 06:00:24 +00:00
|
|
|
// ignore_for_file: non_constant_identifier_names
|
2023-05-23 15:55:21 +00:00
|
|
|
|
2023-11-05 06:00:24 +00:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'backend_env.g.dart';
|
2023-05-23 15:55:21 +00:00
|
|
|
|
|
|
|
@JsonSerializable()
|
|
|
|
class AppFlowyEnv {
|
|
|
|
final SupabaseConfiguration supabase_config;
|
2023-10-02 09:22:22 +00:00
|
|
|
final AppFlowyCloudConfiguration appflowy_cloud_config;
|
2023-05-23 15:55:21 +00:00
|
|
|
|
2023-07-14 05:37:13 +00:00
|
|
|
AppFlowyEnv({
|
|
|
|
required this.supabase_config,
|
2023-10-02 09:22:22 +00:00
|
|
|
required this.appflowy_cloud_config,
|
2023-07-14 05:37:13 +00:00
|
|
|
});
|
2023-05-23 15:55:21 +00:00
|
|
|
|
|
|
|
factory AppFlowyEnv.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$AppFlowyEnvFromJson(json);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => _$AppFlowyEnvToJson(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable()
|
|
|
|
class SupabaseConfiguration {
|
2023-07-14 05:37:13 +00:00
|
|
|
/// Indicates whether the sync feature is enabled.
|
|
|
|
final bool enable_sync;
|
2023-05-23 15:55:21 +00:00
|
|
|
final String url;
|
2023-07-29 01:46:24 +00:00
|
|
|
final String anon_key;
|
2023-05-23 15:55:21 +00:00
|
|
|
|
2023-07-05 12:57:09 +00:00
|
|
|
SupabaseConfiguration({
|
2023-07-14 05:37:13 +00:00
|
|
|
this.enable_sync = true,
|
2023-07-05 12:57:09 +00:00
|
|
|
required this.url,
|
2023-07-29 01:46:24 +00:00
|
|
|
required this.anon_key,
|
2023-07-05 12:57:09 +00:00
|
|
|
});
|
2023-05-23 15:55:21 +00:00
|
|
|
|
|
|
|
factory SupabaseConfiguration.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$SupabaseConfigurationFromJson(json);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => _$SupabaseConfigurationToJson(this);
|
|
|
|
}
|
2023-10-02 09:22:22 +00:00
|
|
|
|
|
|
|
@JsonSerializable()
|
|
|
|
class AppFlowyCloudConfiguration {
|
|
|
|
final String base_url;
|
2023-10-07 01:58:44 +00:00
|
|
|
final String ws_base_url;
|
|
|
|
final String gotrue_url;
|
2023-10-02 09:22:22 +00:00
|
|
|
|
|
|
|
AppFlowyCloudConfiguration({
|
|
|
|
required this.base_url,
|
2023-10-07 01:58:44 +00:00
|
|
|
required this.ws_base_url,
|
|
|
|
required this.gotrue_url,
|
2023-10-02 09:22:22 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
factory AppFlowyCloudConfiguration.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$AppFlowyCloudConfigurationFromJson(json);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => _$AppFlowyCloudConfigurationToJson(this);
|
|
|
|
}
|