From 719b95b94a5d482e5b428ce14399c1b249d3c51f Mon Sep 17 00:00:00 2001 From: khorshuheng Date: Wed, 11 Dec 2024 12:33:46 +0800 Subject: [PATCH] chore: update validator crate --- Cargo.lock | 671 +++++++++++++++++------ Cargo.toml | 3 +- admin_frontend/Cargo.toml | 6 +- libs/app-error/Cargo.toml | 2 +- libs/appflowy-ai-client/Cargo.toml | 26 +- libs/client-websocket/Cargo.toml | 26 +- libs/database-entity/Cargo.toml | 2 +- libs/database-entity/src/dto.rs | 44 +- libs/database/Cargo.toml | 2 +- libs/infra/Cargo.toml | 5 +- libs/shared-entity/Cargo.toml | 5 +- libs/shared-entity/src/dto/chat_dto.rs | 10 +- script/client_api_deps_check.sh | 2 +- services/appflowy-collaborate/Cargo.toml | 2 +- services/appflowy-worker/Cargo.toml | 17 +- src/domain/user_email.rs | 4 +- 16 files changed, 605 insertions(+), 222 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c9851d7..9cb27007 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,7 +130,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -168,7 +168,7 @@ dependencies = [ "parse-size", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -342,7 +342,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -353,7 +353,7 @@ checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -557,7 +557,7 @@ dependencies = [ "serde_json", "serde_repr", "sqlx", - "thiserror", + "thiserror 1.0.63", "tokio", "tsify", "url", @@ -576,11 +576,11 @@ dependencies = [ "futures", "infra", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.9", "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", "tracing-subscriber", @@ -680,7 +680,7 @@ dependencies = [ "snowflake", "sqlx", "tempfile", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tokio-tungstenite", @@ -751,7 +751,7 @@ dependencies = [ "serde_repr", "shared-entity", "sqlx", - "thiserror", + "thiserror 1.0.63", "tiktoken-rs", "tokio", "tokio-stream", @@ -793,13 +793,13 @@ dependencies = [ "mime_guess", "prometheus-client", "redis 0.25.4", - "reqwest 0.12.5", + "reqwest 0.12.9", "secrecy", "serde", "serde_json", "serde_repr", "sqlx", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tokio-util", @@ -859,7 +859,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -889,7 +889,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -902,7 +902,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -963,7 +963,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -985,7 +985,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -996,7 +996,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -1010,7 +1010,7 @@ dependencies = [ "crc32fast", "futures-lite", "pin-project", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-util", ] @@ -1043,7 +1043,7 @@ dependencies = [ "secrecy", "serde", "sqlx", - "thiserror", + "thiserror 1.0.63", "tracing", ] @@ -1664,7 +1664,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", "syn_derive", ] @@ -1865,7 +1865,7 @@ dependencies = [ "rhai", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", "tokio", ] @@ -2047,7 +2047,7 @@ dependencies = [ "serde_repr", "serde_urlencoded", "shared-entity", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-retry", "tokio-stream", @@ -2123,7 +2123,7 @@ dependencies = [ "httparse", "js-sys", "percent-encoding", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-tungstenite", "wasm-bindgen", @@ -2146,7 +2146,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tracing", @@ -2185,7 +2185,7 @@ dependencies = [ "sha2", "strum", "strum_macros", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tokio-util", @@ -2208,7 +2208,7 @@ dependencies = [ "nanoid", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tracing", @@ -2230,7 +2230,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "uuid", "walkdir", ] @@ -2250,7 +2250,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tracing", @@ -2287,7 +2287,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-util", "tracing", @@ -2317,7 +2317,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tokio-tungstenite", "yrs", ] @@ -2332,7 +2332,7 @@ dependencies = [ "collab", "collab-entity", "serde", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", "yrs", @@ -2353,7 +2353,7 @@ dependencies = [ "redis 0.25.4", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tokio-util", @@ -2551,12 +2551,13 @@ dependencies = [ [[package]] name = "cookie_store" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4934e6b7e8419148b6ef56950d277af8561060b56afd59e2aadf98b59fce6baa" +checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9" dependencies = [ "cookie 0.18.1", - "idna 0.5.0", + "document-features", + "idna 1.0.3", "log", "publicsuffix", "serde", @@ -2762,7 +2763,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -2818,7 +2819,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -2842,7 +2843,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -2853,7 +2854,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -2939,7 +2940,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", "validator", @@ -3015,7 +3016,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -3038,7 +3039,16 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", +] + +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", ] [[package]] @@ -3408,7 +3418,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -3673,7 +3683,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -3951,9 +3961,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", @@ -4051,6 +4061,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -4067,16 +4195,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.5.0" @@ -4088,10 +4206,25 @@ dependencies = [ ] [[package]] -name = "if_chain" -version = "1.0.2" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] [[package]] name = "image" @@ -4323,9 +4456,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libm" @@ -4350,6 +4483,18 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "local-channel" version = "0.1.5" @@ -4792,7 +4937,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -4986,7 +5131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.63", "ucd-trie", ] @@ -5010,7 +5155,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5112,7 +5257,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5150,7 +5295,7 @@ checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5288,7 +5433,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5309,7 +5454,6 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", "version_check", ] @@ -5325,10 +5469,32 @@ dependencies = [ ] [[package]] -name = "proc-macro2" -version = "1.0.86" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -5353,7 +5519,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5393,7 +5559,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.72", + "syn 2.0.90", "tempfile", ] @@ -5414,7 +5580,7 @@ dependencies = [ "prost 0.13.3", "prost-types 0.13.3", "regex", - "syn 2.0.72", + "syn 2.0.90", "tempfile", ] @@ -5428,7 +5594,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5441,7 +5607,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5585,47 +5751,53 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", + "rustc-hash 2.1.0", "rustls 0.23.12", - "thiserror", + "socket2", + "thiserror 2.0.6", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.3" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom 0.2.15", "rand 0.8.5", "ring 0.17.8", - "rustc-hash", + "rustc-hash 2.1.0", "rustls 0.23.12", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.6", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "52cd4b1eff68bf27940dd39811292c49e007f4d0b4c357358dc9b0197be6b527" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", + "tracing", "windows-sys 0.52.0", ] @@ -5933,7 +6105,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", - "system-configuration", + "system-configuration 0.5.1", "tokio", "tokio-native-tls", "tokio-rustls 0.24.1", @@ -5945,19 +6117,19 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots 0.25.4", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", "cookie 0.18.1", - "cookie_store 0.21.0", + "cookie_store 0.21.1", "encoding_rs", "futures-core", "futures-util", @@ -5966,7 +6138,7 @@ dependencies = [ "http-body 1.0.1", "http-body-util", "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper-rustls 0.27.3", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -5985,7 +6157,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", - "system-configuration", + "system-configuration 0.6.1", "tokio", "tokio-native-tls", "tokio-rustls 0.26.0", @@ -5997,7 +6169,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots 0.26.3", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -6037,7 +6209,7 @@ checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -6157,6 +6329,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + [[package]] name = "rustc_version" version = "0.4.0" @@ -6250,6 +6428,9 @@ name = "rustls-pki-types" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -6465,7 +6646,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -6476,7 +6657,7 @@ checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -6518,7 +6699,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -6600,7 +6781,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", "validator", @@ -6649,7 +6830,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -6830,7 +7011,7 @@ dependencies = [ "sha2", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tracing", @@ -6849,7 +7030,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -6872,7 +7053,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.72", + "syn 2.0.90", "tempfile", "tokio", "url", @@ -6917,7 +7098,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", "whoami", @@ -6958,7 +7139,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", "whoami", @@ -7073,7 +7254,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7095,9 +7276,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -7113,7 +7294,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7127,6 +7308,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "synstructure" @@ -7140,6 +7324,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -7148,7 +7343,18 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] @@ -7161,6 +7367,16 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tagptr" version = "0.2.0" @@ -7211,7 +7427,16 @@ version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.63", +] + +[[package]] +name = "thiserror" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" +dependencies = [ + "thiserror-impl 2.0.6", ] [[package]] @@ -7222,7 +7447,18 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] @@ -7259,7 +7495,7 @@ dependencies = [ "lazy_static", "parking_lot 0.12.3", "regex", - "rustc-hash", + "rustc-hash 1.1.0", ] [[package]] @@ -7302,6 +7538,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -7354,7 +7600,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7513,7 +7759,7 @@ dependencies = [ "prost-build 0.13.3", "prost-types 0.13.3", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7604,7 +7850,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7722,7 +7968,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7741,7 +7987,7 @@ dependencies = [ "rand 0.8.5", "rustls 0.21.12", "sha1", - "thiserror", + "thiserror 1.0.63", "url", "utf-8", ] @@ -7869,6 +8115,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "uuid" version = "1.10.0" @@ -7882,12 +8140,12 @@ dependencies = [ [[package]] name = "validator" -version = "0.16.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b92f40481c04ff1f4f61f304d61793c7b56ff76ac1469f1beb199b1445b253bd" +checksum = "d0b4a29d8709210980a09379f27ee31549b73292c87ab9899beee1c0d3be6303" dependencies = [ - "idna 0.4.0", - "lazy_static", + "idna 1.0.3", + "once_cell", "regex", "serde", "serde_derive", @@ -7898,28 +8156,16 @@ dependencies = [ [[package]] name = "validator_derive" -version = "0.16.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc44ca3088bb3ba384d9aecf40c6a23a676ce23e09bdaca2073d99c207f864af" +checksum = "bac855a2ce6f843beb229757e6e570a42e837bcb15e5f449dd48d5747d41bf77" dependencies = [ - "if_chain", - "lazy_static", - "proc-macro-error", + "darling", + "once_cell", + "proc-macro-error2", "proc-macro2", "quote", - "regex", - "syn 1.0.109", - "validator_types", -] - -[[package]] -name = "validator_types" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "111abfe30072511849c5910134e8baf8dc05de4c0e5903d681cbd5c9c4d611e3" -dependencies = [ - "proc-macro2", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] @@ -8004,7 +8250,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -8038,7 +8284,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8071,7 +8317,7 @@ checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -8123,6 +8369,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "webpki-roots" version = "0.25.4" @@ -8204,6 +8460,36 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -8362,16 +8648,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "workspace-template" version = "0.1.0" @@ -8393,6 +8669,18 @@ dependencies = [ "uuid", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -8429,7 +8717,7 @@ dependencies = [ "oid-registry", "ring 0.16.20", "rusticata-macros", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -8465,6 +8753,30 @@ dependencies = [ "time", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure 0.13.1", +] + [[package]] name = "yrs" version = "0.21.3" @@ -8480,7 +8792,7 @@ dependencies = [ "serde_json", "smallstr", "smallvec", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -8510,7 +8822,7 @@ checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -8521,7 +8833,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure 0.13.1", ] [[package]] @@ -8541,7 +8874,29 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index a51288b9..2d8e15db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,7 +58,7 @@ reqwest = { workspace = true, features = [ unicode-segmentation = "1.10" lazy_static.workspace = true fancy-regex = "0.11.0" -validator = "0.16.1" +validator.workspace = true bytes = "1.5.0" rcgen = { version = "0.10.0", features = ["pem", "x509-parser"] } mime = "0.3.17" @@ -283,6 +283,7 @@ sanitize-filename = "0.5.0" base64 = "0.22" md5 = "0.7.0" pin-project = "1.1.5" +validator = "0.19" zstd = { version = "0.13.2", features = [] } # collaboration diff --git a/admin_frontend/Cargo.toml b/admin_frontend/Cargo.toml index 3d1cd407..9c3530d4 100644 --- a/admin_frontend/Cargo.toml +++ b/admin_frontend/Cargo.toml @@ -19,7 +19,11 @@ askama = "0.12" axum-extra = { version = "0.9", features = ["cookie"] } serde.workspace = true serde_json.workspace = true -redis = { version = "0.25.2", features = ["aio", "tokio-comp", "connection-manager"] } +redis = { version = "0.25.2", features = [ + "aio", + "tokio-comp", + "connection-manager", +] } uuid = { workspace = true, features = ["v4"] } dotenvy = "0.15" reqwest = "0.11.27" diff --git a/libs/app-error/Cargo.toml b/libs/app-error/Cargo.toml index b40b2af3..71ca247d 100644 --- a/libs/app-error/Cargo.toml +++ b/libs/app-error/Cargo.toml @@ -17,7 +17,7 @@ sqlx = { workspace = true, default-features = false, features = [ "postgres", "json", ], optional = true } -validator = { version = "0.16", optional = true } +validator = { workspace = true, optional = true } url = { version = "2.5.0" } actix-web = { version = "4.4.1", optional = true } reqwest.workspace = true diff --git a/libs/appflowy-ai-client/Cargo.toml b/libs/appflowy-ai-client/Cargo.toml index 6032dccf..60ad0abf 100644 --- a/libs/appflowy-ai-client/Cargo.toml +++ b/libs/appflowy-ai-client/Cargo.toml @@ -6,7 +6,12 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -reqwest = { version = "0.12", features = ["json", "rustls-tls", "cookies", "stream"], optional = true } +reqwest = { version = "0.12", features = [ + "json", + "rustls-tls", + "cookies", + "stream", +], optional = true } serde = { version = "1.0.199", features = ["derive"], optional = true } serde_json = { version = "1.0", optional = true } thiserror = "1.0.58" @@ -20,11 +25,24 @@ pin-project = "1.1.5" [dev-dependencies] appflowy-ai-client = { path = ".", features = ["dto", "client-api"] } tokio = { version = "1.37.0", features = ["macros", "test-util"] } -tracing-subscriber = { version = "0.3.18", features = ["registry", "env-filter", "ansi", "json"] } +tracing-subscriber = { version = "0.3.18", features = [ + "registry", + "env-filter", + "ansi", + "json", +] } uuid = { workspace = true, features = ["v4"] } infra.workspace = true [features] default = ["client-api"] -client-api = ["dto", "reqwest", "serde", "serde_json", "tracing", "serde_repr", "infra/request_util"] -dto = ["serde", "serde_json", "serde_repr"] \ No newline at end of file +client-api = [ + "dto", + "reqwest", + "serde", + "serde_json", + "tracing", + "serde_repr", + "infra/request_util", +] +dto = ["serde", "serde_json", "serde_repr"] diff --git a/libs/client-websocket/Cargo.toml b/libs/client-websocket/Cargo.toml index cc17bb77..b4b98b75 100644 --- a/libs/client-websocket/Cargo.toml +++ b/libs/client-websocket/Cargo.toml @@ -8,12 +8,12 @@ edition = "2021" native-tls = ["tokio-tungstenite/native-tls"] native-tls-vendored = ["native-tls", "tokio-tungstenite/native-tls-vendored"] rustls-tls-native-roots = [ - "__rustls-tls", - "tokio-tungstenite/rustls-tls-native-roots", + "__rustls-tls", + "tokio-tungstenite/rustls-tls-native-roots", ] rustls-tls-webpki-roots = [ - "__rustls-tls", - "tokio-tungstenite/rustls-tls-webpki-roots", + "__rustls-tls", + "tokio-tungstenite/rustls-tls-webpki-roots", ] __rustls-tls = [] @@ -22,8 +22,8 @@ thiserror = "1" http = "0.2" httparse = "1.8" futures-util = { version = "0.3", default-features = false, features = [ - "sink", - "std", + "sink", + "std", ] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] @@ -39,11 +39,11 @@ percent-encoding = "2.3.1" [target.'cfg(target_arch = "wasm32")'.dependencies.web-sys] version = "0.3" features = [ - "WebSocket", - "MessageEvent", - "CloseEvent", - "Event", - "ErrorEvent", - "BinaryType", - "Blob", + "WebSocket", + "MessageEvent", + "CloseEvent", + "Event", + "ErrorEvent", + "BinaryType", + "Blob", ] diff --git a/libs/database-entity/Cargo.toml b/libs/database-entity/Cargo.toml index e37908c8..f1ecc0da 100644 --- a/libs/database-entity/Cargo.toml +++ b/libs/database-entity/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib", "rlib"] serde.workspace = true serde_json.workspace = true collab-entity = { workspace = true } -validator = { version = "0.16", features = ["validator_derive", "derive"] } +validator = { workspace = true, features = ["validator_derive", "derive"] } chrono = { version = "0.4", features = ["serde"] } uuid = { workspace = true, features = ["serde", "v4"] } thiserror = "1.0.56" diff --git a/libs/database-entity/src/dto.rs b/libs/database-entity/src/dto.rs index 57142337..9e0aae58 100644 --- a/libs/database-entity/src/dto.rs +++ b/libs/database-entity/src/dto.rs @@ -24,13 +24,13 @@ pub const ZSTD_COMPRESSION_LEVEL: i32 = 3; #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct CreateCollabParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_id: String, - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub object_id: String, - #[validate(custom = "validate_not_empty_payload")] + #[validate(custom(function = "validate_not_empty_payload"))] pub encoded_collab_v1: Vec, pub collab_type: CollabType, @@ -88,9 +88,9 @@ impl PendingCollabWrite { #[derive(Debug, Clone, Validate, Serialize, Deserialize, PartialEq)] pub struct CollabParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub object_id: String, - #[validate(custom = "validate_not_empty_payload")] + #[validate(custom(function = "validate_not_empty_payload"))] pub encoded_collab_v1: Bytes, pub collab_type: CollabType, #[serde(default)] @@ -196,7 +196,7 @@ struct CollabParamsV0 { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct BatchCreateCollabParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_id: String, pub params_list: Vec, } @@ -219,19 +219,19 @@ pub struct UpdateCollabWebParams { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct DeleteCollabParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub object_id: String, - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_id: String, } #[derive(Debug, Clone, Validate)] pub struct InsertSnapshotParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub object_id: String, - #[validate(custom = "validate_not_empty_payload")] + #[validate(custom(function = "validate_not_empty_payload"))] pub data: Bytes, - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_id: String, pub collab_type: CollabType, } @@ -250,9 +250,9 @@ pub struct QuerySnapshotParams { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct QueryCollabParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_id: String, - #[validate] + #[validate(nested)] pub inner: QueryCollab, } @@ -295,7 +295,7 @@ impl Deref for QueryCollabParams { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct QueryCollab { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub object_id: String, pub collab_type: CollabType, } @@ -369,9 +369,9 @@ pub struct WorkspaceUsage { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct InsertCollabMemberParams { pub uid: i64, - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_id: String, - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub object_id: String, pub access_level: AFAccessLevel, } @@ -381,9 +381,9 @@ pub type UpdateCollabMemberParams = InsertCollabMemberParams; #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct CollabMemberIdentify { pub uid: i64, - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_id: String, - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub object_id: String, } @@ -406,15 +406,15 @@ pub struct DefaultPublishViewInfoMeta { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct QueryCollabMembers { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_id: String, - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub object_id: String, } #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct QueryWorkspaceMember { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_id: String, pub uid: i64, @@ -1207,7 +1207,7 @@ pub struct ApproveAccessRequestParams { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct CreateImportTask { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub workspace_name: String, pub content_length: u64, } diff --git a/libs/database/Cargo.toml b/libs/database/Cargo.toml index 42dc4d96..c11d04c6 100644 --- a/libs/database/Cargo.toml +++ b/libs/database/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" collab = { workspace = true } collab-entity = { workspace = true } collab-rt-entity = { workspace = true } -validator = { version = "0.16", features = ["validator_derive", "derive"] } +validator = { workspace = true, features = ["validator_derive", "derive"] } database-entity.workspace = true shared-entity.workspace = true app-error = { workspace = true, features = ["sqlx_error", "validation_error"] } diff --git a/libs/infra/Cargo.toml b/libs/infra/Cargo.toml index 8c3a8dab..a194c901 100644 --- a/libs/infra/Cargo.toml +++ b/libs/infra/Cargo.toml @@ -15,10 +15,7 @@ bytes = { workspace = true } tokio = { workspace = true, optional = true } pin-project.workspace = true futures = "0.3.30" -validator = { version = "0.16", features = [ - "validator_derive", - "derive", -] } +validator = { workspace = true, features = ["validator_derive", "derive"] } [features] file_util = ["tokio/fs"] diff --git a/libs/shared-entity/Cargo.toml b/libs/shared-entity/Cargo.toml index cd5acd7d..b0b65d93 100644 --- a/libs/shared-entity/Cargo.toml +++ b/libs/shared-entity/Cargo.toml @@ -29,10 +29,7 @@ pin-project = "1.1.5" actix-web = { version = "4.4.1", default-features = false, features = [ "http2", ], optional = true } -validator = { version = "0.16", features = [ - "validator_derive", - "derive", -] } +validator = { workspace = true, features = ["validator_derive", "derive"] } futures = "0.3.30" bytes = "1.6.0" log = "0.4.21" diff --git a/libs/shared-entity/src/dto/chat_dto.rs b/libs/shared-entity/src/dto/chat_dto.rs index 2f30897e..e0ab8395 100644 --- a/libs/shared-entity/src/dto/chat_dto.rs +++ b/libs/shared-entity/src/dto/chat_dto.rs @@ -10,7 +10,7 @@ use validator::Validate; #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct CreateChatParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub chat_id: String, pub name: String, pub rag_ids: Vec, @@ -18,7 +18,7 @@ pub struct CreateChatParams { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct UpdateChatParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub name: Option, /// Key-value pairs of metadata to be updated. @@ -29,7 +29,7 @@ pub struct UpdateChatParams { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct CreateChatMessageParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub content: String, pub message_type: ChatMessageType, #[serde(deserialize_with = "deserialize_metadata")] @@ -40,7 +40,7 @@ pub struct CreateChatMessageParams { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct CreateChatMessageParamsV2 { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub content: String, pub message_type: ChatMessageType, #[serde(deserialize_with = "deserialize_metadata")] @@ -361,7 +361,7 @@ pub struct UpdateChatMessageResponse { #[derive(Debug, Clone, Validate, Serialize, Deserialize)] pub struct CreateAnswerMessageParams { - #[validate(custom = "validate_not_empty_str")] + #[validate(custom(function = "validate_not_empty_str"))] pub content: String, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/script/client_api_deps_check.sh b/script/client_api_deps_check.sh index 11b33958..41d6401b 100755 --- a/script/client_api_deps_check.sh +++ b/script/client_api_deps_check.sh @@ -3,7 +3,7 @@ # Generate the current dependency list cargo tree > current_deps.txt -BASELINE_COUNT=642 +BASELINE_COUNT=720 CURRENT_COUNT=$(cat current_deps.txt | wc -l) echo "Expected dependency count (baseline): $BASELINE_COUNT" diff --git a/services/appflowy-collaborate/Cargo.toml b/services/appflowy-collaborate/Cargo.toml index 65112801..ac3bf25b 100644 --- a/services/appflowy-collaborate/Cargo.toml +++ b/services/appflowy-collaborate/Cargo.toml @@ -85,7 +85,7 @@ shared-entity = { workspace = true, features = ["cloud"] } parking_lot = "0.12.1" lazy_static = "1.4.0" itertools = "0.12.0" -validator = "0.16.1" +validator.workspace = true rayon.workspace = true tiktoken-rs = "0.6.0" unicode-segmentation = "1.9.0" diff --git a/services/appflowy-worker/Cargo.toml b/services/appflowy-worker/Cargo.toml index c98804ee..09e798b4 100644 --- a/services/appflowy-worker/Cargo.toml +++ b/services/appflowy-worker/Cargo.toml @@ -25,7 +25,12 @@ database.workspace = true database-entity.workspace = true tokio = { workspace = true, features = ["rt-multi-thread", "macros", "net"] } tokio-stream = { version = "0.1", features = ["net"] } -redis = { workspace = true, features = ["aio", "tokio-comp", "connection-manager", "streams"] } +redis = { workspace = true, features = [ + "aio", + "tokio-comp", + "connection-manager", + "streams", +] } dotenvy = "0.15.0" axum = "0.7.4" thiserror = "1.0.58" @@ -33,7 +38,14 @@ tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } serde_repr = "0.1.18" futures = "0.3.30" infra = { workspace = true, features = ["request_util"] } -sqlx = { workspace = true, default-features = false, features = ["runtime-tokio-rustls", "macros", "postgres", "uuid", "chrono", "migrate"] } +sqlx = { workspace = true, default-features = false, features = [ + "runtime-tokio-rustls", + "macros", + "postgres", + "uuid", + "chrono", + "migrate", +] } secrecy = { version = "0.8", features = ["serde"] } aws-sdk-s3 = { version = "1.36.0", features = [ "behavior-version-latest", @@ -51,4 +63,3 @@ base64.workspace = true prometheus-client = "0.22.3" reqwest = "0.12.5" zstd.workspace = true - diff --git a/src/domain/user_email.rs b/src/domain/user_email.rs index 1f45c9db..d3340367 100644 --- a/src/domain/user_email.rs +++ b/src/domain/user_email.rs @@ -1,4 +1,4 @@ -use validator::validate_email; +use validator::ValidateEmail; #[derive(Debug)] pub struct UserEmail(pub String); @@ -9,7 +9,7 @@ impl UserEmail { return Err("Email can not be empty or whitespace".to_string()); } - if validate_email(&s) { + if s.validate_email() { Ok(Self(s)) } else { Err("Invalid email".to_string())