Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
refactor: rename error-code to flowy-error-code in case of ambiguous
appflowy58097585393f
diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pb.dartnew file mode 100644index 0000000000..02ae41c056--- /dev/null+++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pb.dart@@ -0,0 +1,11 @@+///+// Generated code. Do not modify.+// source: code.proto+//+// @dart = 2.12+// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields++import 'dart:core' as $core;++export 'code.pbenum.dart';+diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pbenum.dartnew file mode 100644index 0000000000..dcf1e69936--- /dev/null+++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pbenum.dart@@ -0,0 +1,82 @@+///+// Generated code. Do not modify.+// source: code.proto+//+// @dart = 2.12+// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields++// ignore_for_file: UNDEFINED_SHOWN_NAME+import 'dart:core' as $core;+import 'package:protobuf/protobuf.dart' as $pb;++class ErrorCode extends $pb.ProtobufEnum {+ static const ErrorCode Internal = ErrorCode._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Internal');+ static const ErrorCode UserUnauthorized = ErrorCode._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserUnauthorized');+ static const ErrorCode RecordNotFound = ErrorCode._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'RecordNotFound');+ static const ErrorCode WorkspaceNameInvalid = ErrorCode._(100, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'WorkspaceNameInvalid');+ static const ErrorCode WorkspaceIdInvalid = ErrorCode._(101, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'WorkspaceIdInvalid');+ static const ErrorCode AppColorStyleInvalid = ErrorCode._(102, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'AppColorStyleInvalid');+ static const ErrorCode WorkspaceDescTooLong = ErrorCode._(103, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'WorkspaceDescTooLong');+ static const ErrorCode WorkspaceNameTooLong = ErrorCode._(104, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'WorkspaceNameTooLong');+ static const ErrorCode AppIdInvalid = ErrorCode._(110, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'AppIdInvalid');+ static const ErrorCode AppNameInvalid = ErrorCode._(111, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'AppNameInvalid');+ static const ErrorCode ViewNameInvalid = ErrorCode._(120, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ViewNameInvalid');+ static const ErrorCode ViewThumbnailInvalid = ErrorCode._(121, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ViewThumbnailInvalid');+ static const ErrorCode ViewIdInvalid = ErrorCode._(122, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ViewIdInvalid');+ static const ErrorCode ViewDescTooLong = ErrorCode._(123, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ViewDescTooLong');+ static const ErrorCode ViewDataInvalid = ErrorCode._(124, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ViewDataInvalid');+ static const ErrorCode ViewNameTooLong = ErrorCode._(125, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ViewNameTooLong');+ static const ErrorCode ConnectError = ErrorCode._(200, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ConnectError');+ static const ErrorCode EmailIsEmpty = ErrorCode._(300, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'EmailIsEmpty');+ static const ErrorCode EmailFormatInvalid = ErrorCode._(301, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'EmailFormatInvalid');+ static const ErrorCode EmailAlreadyExists = ErrorCode._(302, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'EmailAlreadyExists');+ static const ErrorCode PasswordIsEmpty = ErrorCode._(303, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PasswordIsEmpty');+ static const ErrorCode PasswordTooLong = ErrorCode._(304, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PasswordTooLong');+ static const ErrorCode PasswordContainsForbidCharacters = ErrorCode._(305, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PasswordContainsForbidCharacters');+ static const ErrorCode PasswordFormatInvalid = ErrorCode._(306, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PasswordFormatInvalid');+ static const ErrorCode PasswordNotMatch = ErrorCode._(307, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PasswordNotMatch');+ static const ErrorCode UserNameTooLong = ErrorCode._(308, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserNameTooLong');+ static const ErrorCode UserNameContainForbiddenCharacters = ErrorCode._(309, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserNameContainForbiddenCharacters');+ static const ErrorCode UserNameIsEmpty = ErrorCode._(310, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserNameIsEmpty');+ static const ErrorCode UserIdInvalid = ErrorCode._(311, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserIdInvalid');+ static const ErrorCode UserNotExist = ErrorCode._(312, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserNotExist');++ static const $core.List<ErrorCode> values = <ErrorCode> [+ Internal,+ UserUnauthorized,+ RecordNotFound,+ WorkspaceNameInvalid,+ WorkspaceIdInvalid,+ AppColorStyleInvalid,+ WorkspaceDescTooLong,+ WorkspaceNameTooLong,+ AppIdInvalid,+ AppNameInvalid,+ ViewNameInvalid,+ ViewThumbnailInvalid,+ ViewIdInvalid,+ ViewDescTooLong,+ ViewDataInvalid,+ ViewNameTooLong,+ ConnectError,+ EmailIsEmpty,+ EmailFormatInvalid,+ EmailAlreadyExists,+ PasswordIsEmpty,+ PasswordTooLong,+ PasswordContainsForbidCharacters,+ PasswordFormatInvalid,+ PasswordNotMatch,+ UserNameTooLong,+ UserNameContainForbiddenCharacters,+ UserNameIsEmpty,+ UserIdInvalid,+ UserNotExist,+ ];++ static final $core.Map<$core.int, ErrorCode> _byValue = $pb.ProtobufEnum.initByValue(values);+ static ErrorCode? valueOf($core.int value) => _byValue[value];++ const ErrorCode._($core.int v, $core.String n) : super(v, n);+}+diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pbjson.dartnew file mode 100644index 0000000000..c8d7191d54--- /dev/null+++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pbjson.dart@@ -0,0 +1,49 @@+///+// Generated code. Do not modify.+// source: code.proto+//+// @dart = 2.12+// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package++import 'dart:core' as $core;+import 'dart:convert' as $convert;+import 'dart:typed_data' as $typed_data;+@$core.Deprecated('Use errorCodeDescriptor instead')+const ErrorCode$json = const {+ '1': 'ErrorCode',+ '2': const [+ const {'1': 'Internal', '2': 0},+ const {'1': 'UserUnauthorized', '2': 2},+ const {'1': 'RecordNotFound', '2': 3},+ const {'1': 'WorkspaceNameInvalid', '2': 100},+ const {'1': 'WorkspaceIdInvalid', '2': 101},+ const {'1': 'AppColorStyleInvalid', '2': 102},+ const {'1': 'WorkspaceDescTooLong', '2': 103},+ const {'1': 'WorkspaceNameTooLong', '2': 104},+ const {'1': 'AppIdInvalid', '2': 110},+ const {'1': 'AppNameInvalid', '2': 111},+ const {'1': 'ViewNameInvalid', '2': 120},+ const {'1': 'ViewThumbnailInvalid', '2': 121},+ const {'1': 'ViewIdInvalid', '2': 122},+ const {'1': 'ViewDescTooLong', '2': 123},+ const {'1': 'ViewDataInvalid', '2': 124},+ const {'1': 'ViewNameTooLong', '2': 125},+ const {'1': 'ConnectError', '2': 200},+ const {'1': 'EmailIsEmpty', '2': 300},+ const {'1': 'EmailFormatInvalid', '2': 301},+ const {'1': 'EmailAlreadyExists', '2': 302},+ const {'1': 'PasswordIsEmpty', '2': 303},+ const {'1': 'PasswordTooLong', '2': 304},+ const {'1': 'PasswordContainsForbidCharacters', '2': 305},+ const {'1': 'PasswordFormatInvalid', '2': 306},+ const {'1': 'PasswordNotMatch', '2': 307},+ const {'1': 'UserNameTooLong', '2': 308},+ const {'1': 'UserNameContainForbiddenCharacters', '2': 309},+ const {'1': 'UserNameIsEmpty', '2': 310},+ const {'1': 'UserIdInvalid', '2': 311},+ const {'1': 'UserNotExist', '2': 312},+ ],+};++/// Descriptor for `ErrorCode`. Decode as a `google.protobuf.EnumDescriptorProto`.+final $typed_data.Uint8List errorCodeDescriptor = $convert.base64Decode('CglFcnJvckNvZGUSDAoISW50ZXJuYWwQABIUChBVc2VyVW5hdXRob3JpemVkEAISEgoOUmVjb3JkTm90Rm91bmQQAxIYChRXb3Jrc3BhY2VOYW1lSW52YWxpZBBkEhYKEldvcmtzcGFjZUlkSW52YWxpZBBlEhgKFEFwcENvbG9yU3R5bGVJbnZhbGlkEGYSGAoUV29ya3NwYWNlRGVzY1Rvb0xvbmcQZxIYChRXb3Jrc3BhY2VOYW1lVG9vTG9uZxBoEhAKDEFwcElkSW52YWxpZBBuEhIKDkFwcE5hbWVJbnZhbGlkEG8SEwoPVmlld05hbWVJbnZhbGlkEHgSGAoUVmlld1RodW1ibmFpbEludmFsaWQQeRIRCg1WaWV3SWRJbnZhbGlkEHoSEwoPVmlld0Rlc2NUb29Mb25nEHsSEwoPVmlld0RhdGFJbnZhbGlkEHwSEwoPVmlld05hbWVUb29Mb25nEH0SEQoMQ29ubmVjdEVycm9yEMgBEhEKDEVtYWlsSXNFbXB0eRCsAhIXChJFbWFpbEZvcm1hdEludmFsaWQQrQISFwoSRW1haWxBbHJlYWR5RXhpc3RzEK4CEhQKD1Bhc3N3b3JkSXNFbXB0eRCvAhIUCg9QYXNzd29yZFRvb0xvbmcQsAISJQogUGFzc3dvcmRDb250YWluc0ZvcmJpZENoYXJhY3RlcnMQsQISGgoVUGFzc3dvcmRGb3JtYXRJbnZhbGlkELICEhUKEFBhc3N3b3JkTm90TWF0Y2gQswISFAoPVXNlck5hbWVUb29Mb25nELQCEicKIlVzZXJOYW1lQ29udGFpbkZvcmJpZGRlbkNoYXJhY3RlcnMQtQISFAoPVXNlck5hbWVJc0VtcHR5ELYCEhIKDVVzZXJJZEludmFsaWQQtwISEQoMVXNlck5vdEV4aXN0ELgC');diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pbserver.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pbserver.dartnew file mode 100644index 0000000000..c42f9c4c50--- /dev/null+++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/code.pbserver.dart@@ -0,0 +1,9 @@+///+// Generated code. Do not modify.+// source: code.proto+//+// @dart = 2.12+// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package++export 'code.pb.dart';+diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/protobuf.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/protobuf.dartnew file mode 100644index 0000000000..de33b9d615--- /dev/null+++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-error-code/protobuf.dart@@ -0,0 +1,2 @@+// Auto-generated, do not edit+export './code.pb.dart';diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lockindex 2886cd7a1b..f0181e0e07 100755--- a/frontend/rust-lib/Cargo.lock+++ b/frontend/rust-lib/Cargo.lock@@ -773,16 +773,6 @@ dependencies = ["backtrace",]-[[package]]-name = "error-code"-version = "0.1.0"-dependencies = [- "derive_more",- "flowy-derive",- "lib-infra",- "protobuf",-]-[[package]]name = "eyre"version = "0.6.5"@@ -961,10 +951,10 @@ name = "flowy-error"version = "0.1.0"dependencies = ["bytes",- "error-code","flowy-collaboration","flowy-database","flowy-derive",+ "flowy-error-code","http-flowy","lib-dispatch","lib-infra",@@ -975,6 +965,16 @@ dependencies = ["serde_json",]+[[package]]+name = "flowy-error-code"+version = "0.1.0"+dependencies = [+ "derive_more",+ "flowy-derive",+ "lib-infra",+ "protobuf",+]+[[package]]name = "flowy-folder"version = "0.1.0"@@ -1024,8 +1024,8 @@ dependencies = ["bytes","chrono","derive_more",- "error-code","flowy-derive",+ "flowy-error-code","lib-infra","log","protobuf",@@ -1203,9 +1203,9 @@ version = "0.1.0"dependencies = ["bytes","derive_more",- "error-code","fancy-regex","flowy-derive",+ "flowy-error-code","lazy_static","lib-infra","log",diff --git a/frontend/rust-lib/flowy-error/Cargo.toml b/frontend/rust-lib/flowy-error/Cargo.tomlindex a93776894b..cf2a48e2e2 100644--- a/frontend/rust-lib/flowy-error/Cargo.toml+++ b/frontend/rust-lib/flowy-error/Cargo.toml@@ -7,7 +7,7 @@ edition = "2018"[dependencies]flowy-derive = { path = "../../../shared-lib/flowy-derive" }-error-code = { path = "../../../shared-lib/error-code"}+flowy-error-code = { path = "../../../shared-lib/flowy-error-code"}lib-dispatch = { path = "../lib-dispatch" }protobuf = {version = "2.20.0"}bytes = "1.0"@@ -27,7 +27,7 @@ ot = ["lib-ot"]serde = ["serde_json"]http_server = ["http-flowy"]db = ["flowy-database", "lib-sqlite", "r2d2"]-dart = ["error-code/dart", "lib-infra/dart"]+dart = ["flowy-error-code/dart", "lib-infra/dart"][build-dependencies]lib-infra = { path = "../../../shared-lib/lib-infra", features = ["pb_gen"] }\ No newline at end of filediff --git a/frontend/rust-lib/flowy-error/src/errors.rs b/frontend/rust-lib/flowy-error/src/errors.rsindex a0c2cc129f..956df16fa5 100644--- a/frontend/rust-lib/flowy-error/src/errors.rs+++ b/frontend/rust-lib/flowy-error/src/errors.rs@@ -1,6 +1,6 @@use bytes::Bytes;-use error_code::ErrorCode;use flowy_derive::ProtoBuf;+use flowy_error_code::ErrorCode;use lib_dispatch::prelude::{EventResponse, ResponseBuilder};use std::{convert::TryInto, fmt, fmt::Debug};diff --git a/frontend/rust-lib/flowy-error/src/ext/http_server.rs b/frontend/rust-lib/flowy-error/src/ext/http_server.rsindex 4515eddf1f..25154d0072 100644--- a/frontend/rust-lib/flowy-error/src/ext/http_server.rs+++ b/frontend/rust-lib/flowy-error/src/ext/http_server.rs@@ -1,5 +1,5 @@use crate::FlowyError;-use error_code::ErrorCode;+use flowy_error_code::ErrorCode;use http_flowy::errors::{ErrorCode as ServerErrorCode, ServerError};impl std::convert::From<ServerError> for FlowyError {diff --git a/frontend/rust-lib/flowy-error/src/lib.rs b/frontend/rust-lib/flowy-error/src/lib.rsindex 756eb4e82c..a72422d1fa 100644--- a/frontend/rust-lib/flowy-error/src/lib.rs+++ b/frontend/rust-lib/flowy-error/src/lib.rs@@ -2,5 +2,5 @@ mod errors;mod ext;pub mod protobuf;-pub use error_code::ErrorCode;pub use errors::*;+pub use flowy_error_code::ErrorCode;diff --git a/shared-lib/Cargo.lock b/shared-lib/Cargo.lockindex d5463b5006..bb3800d4e7 100644--- a/shared-lib/Cargo.lock+++ b/shared-lib/Cargo.lock@@ -348,16 +348,6 @@ dependencies = ["termcolor",]-[[package]]-name = "error-code"-version = "0.1.0"-dependencies = [- "derive_more",- "flowy-derive",- "lib-infra",- "protobuf",-]-[[package]]name = "faccess"version = "0.2.3"@@ -457,6 +447,16 @@ dependencies = ["walkdir",]+[[package]]+name = "flowy-error-code"+version = "0.1.0"+dependencies = [+ "derive_more",+ "flowy-derive",+ "lib-infra",+ "protobuf",+]+[[package]]name = "flowy-folder-data-model"version = "0.1.0"@@ -464,8 +464,8 @@ dependencies = ["bytes","chrono","derive_more",- "error-code","flowy-derive",+ "flowy-error-code","lib-infra","log","protobuf",@@ -484,10 +484,10 @@ dependencies = ["bytes","claim","derive_more",- "error-code","fake","fancy-regex","flowy-derive",+ "flowy-error-code","futures","lazy_static","lib-infra",diff --git a/shared-lib/Cargo.toml b/shared-lib/Cargo.tomlindex ed805600e4..0a4b9c7069 100644--- a/shared-lib/Cargo.toml+++ b/shared-lib/Cargo.toml@@ -8,7 +8,7 @@ members = ["lib-infra","flowy-derive","flowy-ast",- "error-code",+ "flowy-error-code",][profile.dev]diff --git a/shared-lib/error-code/Flowy.toml b/shared-lib/error-code/Flowy.tomldeleted file mode 100644index 1c788f7599..0000000000--- a/shared-lib/error-code/Flowy.toml+++ /dev/null@@ -1,3 +0,0 @@--proto_crates = ["src/error_code.rs"]-event_files = []\ No newline at end of filediff --git a/shared-lib/error-code/src/lib.rs b/shared-lib/error-code/src/lib.rsdeleted file mode 100644index 90a67f9c77..0000000000--- a/shared-lib/error-code/src/lib.rs+++ /dev/null@@ -1,4 +0,0 @@-mod error_code;-mod protobuf;--pub use error_code::*;diff --git a/shared-lib/error-code/src/protobuf/model/mod.rs b/shared-lib/error-code/src/protobuf/model/mod.rsdeleted file mode 100644index e6c7f34086..0000000000--- a/shared-lib/error-code/src/protobuf/model/mod.rs+++ /dev/null@@ -1,5 +0,0 @@-#![cfg_attr(rustfmt, rustfmt::skip)]-// Auto-generated, do not edit--mod error_code;-pub use error_code::*;diff --git a/shared-lib/error-code/Cargo.toml b/shared-lib/flowy-error-code/Cargo.tomlsimilarity index 88%rename from shared-lib/error-code/Cargo.tomlrename to shared-lib/flowy-error-code/Cargo.tomlindex 404da61a41..691230c2eb 100644--- a/shared-lib/error-code/Cargo.toml+++ b/shared-lib/flowy-error-code/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "error-code"+name = "flowy-error-code"version = "0.1.0"edition = "2018"diff --git a/shared-lib/flowy-error-code/Flowy.toml b/shared-lib/flowy-error-code/Flowy.tomlnew file mode 100644index 0000000000..7d6706b430--- /dev/null+++ b/shared-lib/flowy-error-code/Flowy.toml@@ -0,0 +1,3 @@++proto_crates = ["src/code.rs"]+event_files = []\ No newline at end of filediff --git a/shared-lib/error-code/build.rs b/shared-lib/flowy-error-code/build.rssimilarity index 100%rename from shared-lib/error-code/build.rsrename to shared-lib/flowy-error-code/build.rsdiff --git a/shared-lib/error-code/src/error_code.rs b/shared-lib/flowy-error-code/src/code.rssimilarity index 100%rename from shared-lib/error-code/src/error_code.rsrename to shared-lib/flowy-error-code/src/code.rsdiff --git a/shared-lib/flowy-error-code/src/lib.rs b/shared-lib/flowy-error-code/src/lib.rsnew file mode 100644index 0000000000..4970c163f7--- /dev/null+++ b/shared-lib/flowy-error-code/src/lib.rs@@ -0,0 +1,4 @@+mod code;+mod protobuf;++pub use code::*;diff --git a/shared-lib/error-code/src/protobuf/mod.rs b/shared-lib/flowy-error-code/src/protobuf/mod.rssimilarity index 100%rename from shared-lib/error-code/src/protobuf/mod.rsrename to shared-lib/flowy-error-code/src/protobuf/mod.rsdiff --git a/shared-lib/error-code/src/protobuf/model/error_code.rs b/shared-lib/flowy-error-code/src/protobuf/model/code.rssimilarity index 86%rename from shared-lib/error-code/src/protobuf/model/error_code.rsrename to shared-lib/flowy-error-code/src/protobuf/model/code.rsindex 412b935aab..f70c1eb49d 100644--- a/shared-lib/error-code/src/protobuf/model/error_code.rs+++ b/shared-lib/flowy-error-code/src/protobuf/model/code.rs@@ -17,7 +17,7 @@#![allow(trivial_casts)]#![allow(unused_imports)]#![allow(unused_results)]-//! Generated file from `error_code.proto`+//! Generated file from `code.proto`/// Generated files are compatible only with the same version/// of protobuf runtime.@@ -158,20 +158,20 @@ impl ::protobuf::reflect::ProtobufValue for ErrorCode {}static file_descriptor_proto_data: &'static [u8] = b"\- \n\x10error_code.proto*\xc4\x05\n\tErrorCode\x12\x0c\n\x08Internal\x10\0\- \x12\x14\n\x10UserUnauthorized\x10\x02\x12\x12\n\x0eRecordNotFound\x10\- \x03\x12\x18\n\x14WorkspaceNameInvalid\x10d\x12\x16\n\x12WorkspaceIdInva\- lid\x10e\x12\x18\n\x14AppColorStyleInvalid\x10f\x12\x18\n\x14WorkspaceDe\- scTooLong\x10g\x12\x18\n\x14WorkspaceNameTooLong\x10h\x12\x10\n\x0cAppId\- Invalid\x10n\x12\x12\n\x0eAppNameInvalid\x10o\x12\x13\n\x0fViewNameInval\- id\x10x\x12\x18\n\x14ViewThumbnailInvalid\x10y\x12\x11\n\rViewIdInvalid\- \x10z\x12\x13\n\x0fViewDescTooLong\x10{\x12\x13\n\x0fViewDataInvalid\x10\- |\x12\x13\n\x0fViewNameTooLong\x10}\x12\x11\n\x0cConnectError\x10\xc8\- \x01\x12\x11\n\x0cEmailIsEmpty\x10\xac\x02\x12\x17\n\x12EmailFormatInval\- id\x10\xad\x02\x12\x17\n\x12EmailAlreadyExists\x10\xae\x02\x12\x14\n\x0f\- PasswordIsEmpty\x10\xaf\x02\x12\x14\n\x0fPasswordTooLong\x10\xb0\x02\x12\- %\n\x20PasswordContainsForbidCharacters\x10\xb1\x02\x12\x1a\n\x15Passwor\- dFormatInvalid\x10\xb2\x02\x12\x15\n\x10PasswordNotMatch\x10\xb3\x02\x12\+ \n\ncode.proto*\xc4\x05\n\tErrorCode\x12\x0c\n\x08Internal\x10\0\x12\x14\+ \n\x10UserUnauthorized\x10\x02\x12\x12\n\x0eRecordNotFound\x10\x03\x12\+ \x18\n\x14WorkspaceNameInvalid\x10d\x12\x16\n\x12WorkspaceIdInvalid\x10e\+ \x12\x18\n\x14AppColorStyleInvalid\x10f\x12\x18\n\x14WorkspaceDescTooLon\+ g\x10g\x12\x18\n\x14WorkspaceNameTooLong\x10h\x12\x10\n\x0cAppIdInvalid\+ \x10n\x12\x12\n\x0eAppNameInvalid\x10o\x12\x13\n\x0fViewNameInvalid\x10x\+ \x12\x18\n\x14ViewThumbnailInvalid\x10y\x12\x11\n\rViewIdInvalid\x10z\+ \x12\x13\n\x0fViewDescTooLong\x10{\x12\x13\n\x0fViewDataInvalid\x10|\x12\+ \x13\n\x0fViewNameTooLong\x10}\x12\x11\n\x0cConnectError\x10\xc8\x01\x12\+ \x11\n\x0cEmailIsEmpty\x10\xac\x02\x12\x17\n\x12EmailFormatInvalid\x10\+ \xad\x02\x12\x17\n\x12EmailAlreadyExists\x10\xae\x02\x12\x14\n\x0fPasswo\+ rdIsEmpty\x10\xaf\x02\x12\x14\n\x0fPasswordTooLong\x10\xb0\x02\x12%\n\+ \x20PasswordContainsForbidCharacters\x10\xb1\x02\x12\x1a\n\x15PasswordFo\+ rmatInvalid\x10\xb2\x02\x12\x15\n\x10PasswordNotMatch\x10\xb3\x02\x12\\x14\n\x0fUserNameTooLong\x10\xb4\x02\x12'\n\"UserNameContainForbiddenCh\aracters\x10\xb5\x02\x12\x14\n\x0fUserNameIsEmpty\x10\xb6\x02\x12\x12\n\\rUserIdInvalid\x10\xb7\x02\x12\x11\n\x0cUserNotExist\x10\xb8\x02b\x06pr\diff --git a/shared-lib/error-code/src/protobuf/document b/shared-lib/flowy-error-code/src/protobuf/model/mod.rssimilarity index 70%rename from shared-lib/error-code/src/protobuf/documentrename to shared-lib/flowy-error-code/src/protobuf/model/mod.rsindex da97aad28a..191b80e077 100644--- a/shared-lib/error-code/src/protobuf/document+++ b/shared-lib/flowy-error-code/src/protobuf/model/mod.rs@@ -1,4 +1,5 @@#![cfg_attr(rustfmt, rustfmt::skip)]// Auto-generated, do not edit-mod model;-pub use model::*;\ No newline at end of file++mod code;+pub use code::*;diff --git a/shared-lib/error-code/src/protobuf/proto/error_code.proto b/shared-lib/flowy-error-code/src/protobuf/proto/code.protosimilarity index 100%rename from shared-lib/error-code/src/protobuf/proto/error_code.protorename to shared-lib/flowy-error-code/src/protobuf/proto/code.protodiff --git a/shared-lib/flowy-folder-data-model/Cargo.toml b/shared-lib/flowy-folder-data-model/Cargo.tomlindex 23695e9947..44cd3412b3 100644--- a/shared-lib/flowy-folder-data-model/Cargo.toml+++ b/shared-lib/flowy-folder-data-model/Cargo.toml@@ -16,7 +16,7 @@ derive_more = {version = "0.99", features = ["display"]}log = "0.4.14"uuid = { version = "0.8", features = ["serde", "v4"] }chrono = { version = "0.4" }-error-code = { path = "../error-code"}+flowy-error-code = { path = "../flowy-error-code"}serde = { version = "1.0", features = ["derive"] }serde_json = "1.0"@@ -27,4 +27,4 @@ lib-infra = { path = "../lib-infra", features = ["pb_gen"] }default = []backend = []frontend = []-dart = ["lib-infra/dart", "error-code/dart"]\ No newline at end of file+dart = ["lib-infra/dart", "flowy-error-code/dart"]\ No newline at end of filediff --git a/shared-lib/flowy-folder-data-model/src/lib.rs b/shared-lib/flowy-folder-data-model/src/lib.rsindex 841c93b8d7..0621902466 100644--- a/shared-lib/flowy-folder-data-model/src/lib.rs+++ b/shared-lib/flowy-folder-data-model/src/lib.rs@@ -9,5 +9,5 @@ pub mod protobuf;pub mod user_default;pub mod errors {- pub use error_code::ErrorCode;+ pub use flowy_error_code::ErrorCode;}diff --git a/shared-lib/flowy-user-data-model/Cargo.toml b/shared-lib/flowy-user-data-model/Cargo.tomlindex b8bdc9760d..561764adea 100644--- a/shared-lib/flowy-user-data-model/Cargo.toml+++ b/shared-lib/flowy-user-data-model/Cargo.toml@@ -7,7 +7,7 @@ edition = "2018"[dependencies]flowy-derive = { path = "../flowy-derive" }-error-code = { path = "../error-code" }+flowy-error-code = { path = "../flowy-error-code" }protobuf = {version = "2.18.0"}bytes = "1.0"unicode-segmentation = "1.8"@@ -30,4 +30,4 @@ futures = "0.3.15"serial_test = "0.5.1"[features]-dart = ["lib-infra/dart", "error-code/dart"]+dart = ["lib-infra/dart", "flowy-error-code/dart"]diff --git a/shared-lib/flowy-user-data-model/src/lib.rs b/shared-lib/flowy-user-data-model/src/lib.rsindex 706b26a74f..eb967a2520 100644--- a/shared-lib/flowy-user-data-model/src/lib.rs+++ b/shared-lib/flowy-user-data-model/src/lib.rs@@ -3,5 +3,5 @@ pub mod parser;pub mod protobuf;pub mod errors {- pub use error_code::ErrorCode;+ pub use flowy_error_code::ErrorCode;}diff --git a/shared-lib/lib-infra/src/proto_gen/ast.rs b/shared-lib/lib-infra/src/proto_gen/ast.rsindex 8da1f64f62..d61d454240 100644--- a/shared-lib/lib-infra/src/proto_gen/ast.rs+++ b/shared-lib/lib-infra/src/proto_gen/ast.rs@@ -1,3 +1,7 @@+#![allow(unused_attributes)]+#![allow(dead_code)]+#![allow(unused_imports)]+#![allow(unused_results)]use crate::proto_gen::template::{EnumTemplate, StructTemplate};use crate::proto_gen::util::*;use crate::proto_gen::{parse_crate_info_from_path, ProtoFile, ProtobufCrateContext};diff --git a/shared-lib/lib-infra/src/proto_gen/proto_gen.rs b/shared-lib/lib-infra/src/proto_gen/proto_gen.rsindex 584d4395b1..bbeea67299 100644--- a/shared-lib/lib-infra/src/proto_gen/proto_gen.rs+++ b/shared-lib/lib-infra/src/proto_gen/proto_gen.rs@@ -1,6 +1,9 @@+#![allow(unused_attributes)]+#![allow(dead_code)]+#![allow(unused_imports)]+#![allow(unused_results)]use crate::proto_gen::ast::parse_crate_protobuf;use crate::proto_gen::proto_info::ProtobufCrateContext;-use crate::proto_gen::util::*;use crate::proto_gen::ProtoFile;use std::fs::File;