diff --git a/Cargo.lock b/Cargo.lock index 0e52b12..e8ba6f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -264,7 +264,7 @@ version = "7.0.13" source = "git+https://github.com/aumetra/async-graphql.git?rev=690ece7#690ece7cd408e28bfaf0c434fdd4c46ef1a78ef2" dependencies = [ "async-graphql", - "axum 0.8.1", + "axum", "bytes", "futures-util", "serde_json", @@ -286,7 +286,7 @@ dependencies = [ "proc-macro2", "quote", "strum", - "syn 2.0.95", + "syn 2.0.96", "thiserror 1.0.69", ] @@ -331,7 +331,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -342,7 +342,7 @@ checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -394,47 +394,13 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "axum" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" -dependencies = [ - "async-trait", - "axum-core 0.4.5", - "bytes", - "futures-util", - "http 1.2.0", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "itoa", - "matchit 0.7.3", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tower 0.5.2", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "axum" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" dependencies = [ - "axum-core 0.5.0", + "axum-core", "axum-macros", "base64 0.22.1", "bytes", @@ -446,7 +412,7 @@ dependencies = [ "hyper", "hyper-util", "itoa", - "matchit 0.8.4", + "matchit", "memchr", "mime", "percent-encoding", @@ -466,27 +432,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "axum-core" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.2.0", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "axum-core" version = "0.5.0" @@ -513,8 +458,8 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fc6f625a1f7705c6cf62d0d070794e94668988b1c38111baeec177c715f7b" dependencies = [ - "axum 0.8.1", - "axum-core 0.5.0", + "axum", + "axum-core", "bytes", "cookie", "futures-util", @@ -537,7 +482,7 @@ checksum = "604fde5e028fea851ce1d8570bbdc034bec850d157f7569d10f347d06808c05c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -549,7 +494,7 @@ dependencies = [ "anyhow", "assert-json-diff", "auto-future", - "axum 0.8.1", + "axum", "bytes", "bytesize", "cookie", @@ -684,9 +629,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" dependencies = [ "serde", ] @@ -752,7 +697,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tokio-util", "tower-service", @@ -791,7 +736,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -978,9 +923,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -988,9 +933,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -1000,14 +945,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1155,9 +1100,9 @@ dependencies = [ [[package]] name = "const_panic" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53857514f72ee4a2b583de67401e3ff63a5472ca4acf289d09a9ea7636dfec17" +checksum = "2459fc9262a1aa204eb4b5764ad4f189caec88aea9634389c0a25f8be7f6265e" [[package]] name = "convert_case" @@ -1387,7 +1332,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1411,7 +1356,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1422,7 +1367,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1492,7 +1437,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1502,7 +1447,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1513,7 +1458,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1599,7 +1544,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1726,7 +1671,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1758,9 +1703,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.3.1" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -1986,7 +1931,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2120,7 +2065,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "ignore", "walkdir", ] @@ -2383,7 +2328,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2701,7 +2646,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2802,7 +2747,7 @@ checksum = "0122b7114117e64a63ac49f752a5ca4624d534c7b1c7de796ac196381cd2d947" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2979,10 +2924,9 @@ dependencies = [ [[package]] name = "jwt-authorizer" version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87d72c47f96cdd849689e1a417a2b7206399b238dd8e2b1dfcea16f27185d00e" +source = "git+https://github.com/blablacio/jwt-authorizer.git?rev=e956774#e95677413b622ab107d941855615267868b82c41" dependencies = [ - "axum 0.7.9", + "axum", "chrono", "futures-core", "futures-util", @@ -2994,13 +2938,12 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.10", "tokio", - "tower-http 0.5.2", + "tower-http", "tower-layer", "tower-service", "tracing", - "tracing-subscriber", ] [[package]] @@ -3200,7 +3143,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "libc", "redox_syscall 0.5.8", ] @@ -3287,12 +3230,12 @@ dependencies = [ [[package]] name = "lightningcss" -version = "1.0.0-alpha.61" +version = "1.0.0-alpha.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c9e1f991b3861d25bf872ecca2eb6a73f7a9fe671da047cd1f9b49c65cbc40" +checksum = "8a75fcbcdbcc84fc1ae7c60c31f99337560b620757a9bfc1c9f84df3cff8ac24" dependencies = [ "ahash 0.8.11", - "bitflags 2.6.0", + "bitflags 2.7.0", "const-str", "cssparser 0.33.0", "cssparser-color", @@ -3332,9 +3275,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" @@ -3354,8 +3297,9 @@ dependencies = [ [[package]] name = "loco-gen" -version = "0.13.2" -source = "git+https://github.com/lonelyhentxi/loco.git?rev=beb890e#beb890eef645a024bd49cd8ca54aebdb9768ea85" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef868bd2df99c949018850b36fb700bba01b10001715f94390bcdb81f412f874" dependencies = [ "chrono", "clap", @@ -3373,12 +3317,13 @@ dependencies = [ [[package]] name = "loco-rs" -version = "0.13.2" -source = "git+https://github.com/lonelyhentxi/loco.git?rev=beb890e#beb890eef645a024bd49cd8ca54aebdb9768ea85" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2250c89f0f996c3493ec3d2588a2d63e2861a48df7b9585cb28fbf6faf15a1a0" dependencies = [ "argon2", "async-trait", - "axum 0.8.1", + "axum", "axum-extra", "axum-test", "backtrace_printer", @@ -3426,7 +3371,7 @@ dependencies = [ "tokio-util", "toml", "tower 0.4.13", - "tower-http 0.6.2", + "tower-http", "tracing", "tracing-appender", "tracing-subscriber", @@ -3519,12 +3464,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - [[package]] name = "matchit" version = "0.8.4" @@ -3736,7 +3675,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3855,7 +3794,7 @@ version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "foreign-types", "libc", @@ -3872,7 +3811,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3949,7 +3888,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3972,11 +3911,11 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parcel_selectors" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7645c578d3a5c4cdf667af1ad39765f5f751c4883d251e050d5e1204b5cad0a9" +checksum = "dccbc6fb560df303a44e511618256029410efbc87779018f751ef12c488271fe" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cssparser 0.33.0", "log", "phf", @@ -4076,7 +4015,7 @@ dependencies = [ "regex", "regex-syntax 0.8.5", "structmeta", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4131,7 +4070,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4166,7 +4105,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.9", + "thiserror 2.0.10", "ucd-trie", ] @@ -4190,7 +4129,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4254,7 +4193,7 @@ dependencies = [ "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4292,7 +4231,7 @@ checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4399,7 +4338,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4419,7 +4358,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "version_check", "yansi", ] @@ -4467,7 +4406,7 @@ dependencies = [ "serde_repr", "serde_with", "tap", - "thiserror 2.0.9", + "thiserror 2.0.10", "tracing", "typed-builder", "url", @@ -4512,7 +4451,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tracing", ] @@ -4531,7 +4470,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.9", + "thiserror 2.0.10", "tinyvec", "tracing", "web-time", @@ -4560,7 +4499,7 @@ dependencies = [ "cfg_rust_features", "nom", "percent-encoding", - "thiserror 2.0.9", + "thiserror 2.0.10", "url", ] @@ -4643,7 +4582,8 @@ dependencies = [ "async-graphql", "async-graphql-axum", "async-trait", - "axum 0.8.1", + "axum", + "axum-extra", "base64 0.22.1", "bollard", "bytes", @@ -4684,8 +4624,9 @@ dependencies = [ "serial_test", "testcontainers", "testcontainers-modules", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", + "tower 0.5.2", "tracing", "tracing-subscriber", "url", @@ -4737,7 +4678,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -4905,7 +4846,7 @@ dependencies = [ "async-trait", "getrandom", "http 1.2.0", - "matchit 0.8.4", + "matchit", "reqwest", "reqwest-middleware", "tracing", @@ -5090,11 +5031,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "errno", "libc", "linux-raw-sys", @@ -5103,9 +5044,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "log", "once_cell", @@ -5125,7 +5066,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.1.0", + "security-framework 3.2.0", ] [[package]] @@ -5284,7 +5225,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5342,7 +5283,7 @@ dependencies = [ "proc-macro2", "quote", "sea-bae", - "syn 2.0.95", + "syn 2.0.96", "unicode-ident", ] @@ -5406,7 +5347,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "thiserror 1.0.69", ] @@ -5430,7 +5371,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5459,7 +5400,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -5468,11 +5409,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d3f8c9bfcc3cbb6b0179eb57042d75b1582bdc65c3cb95f3fa999509c03cbc" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -5481,9 +5422,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -5495,7 +5436,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd568a4c9bb598e291a08244a5c1f5a8a6650bee243b5b0f8dbb3d9cc1d87fe8" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cssparser 0.34.0", "derive_more", "fxhash", @@ -5552,7 +5493,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5595,7 +5536,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5655,7 +5596,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5693,7 +5634,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5958,7 +5899,7 @@ dependencies = [ "serde_json", "sha2", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", "time", "tokio", "tokio-stream", @@ -5978,7 +5919,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6001,7 +5942,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.95", + "syn 2.0.96", "tempfile", "tokio", "url", @@ -6016,7 +5957,7 @@ dependencies = [ "atoi", "base64 0.22.1", "bigdecimal", - "bitflags 2.6.0", + "bitflags 2.7.0", "byteorder", "bytes", "chrono", @@ -6047,7 +5988,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.9", + "thiserror 2.0.10", "time", "tracing", "uuid", @@ -6063,7 +6004,7 @@ dependencies = [ "atoi", "base64 0.22.1", "bigdecimal", - "bitflags 2.6.0", + "bitflags 2.7.0", "byteorder", "chrono", "crc", @@ -6090,7 +6031,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.9", + "thiserror 2.0.10", "time", "tracing", "uuid", @@ -6206,7 +6147,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6217,7 +6158,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6239,7 +6180,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6261,9 +6202,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -6287,7 +6228,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6296,7 +6237,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -6405,7 +6346,7 @@ dependencies = [ "serde_json", "serde_with", "signal-hook", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tokio-stream", "tokio-tar", @@ -6434,11 +6375,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +checksum = "a3ac7f54ca534db81081ef1c1e7f6ea8a3ef428d2fc069097c079443d24124d3" dependencies = [ - "thiserror-impl 2.0.9", + "thiserror-impl 2.0.10", ] [[package]] @@ -6449,18 +6390,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] name = "thiserror-impl" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +checksum = "9e9465d30713b56a37ede7185763c3492a91be2f5fa68d958c44e41ab9248beb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6537,9 +6478,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -6570,13 +6511,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6712,25 +6653,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" -dependencies = [ - "base64 0.21.7", - "bitflags 2.6.0", - "bytes", - "http 1.2.0", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tower-http" version = "0.6.2" @@ -6738,7 +6660,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "async-compression", - "bitflags 2.6.0", + "base64 0.22.1", + "bitflags 2.7.0", "bytes", "futures-core", "futures-util", @@ -6802,7 +6725,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6887,7 +6810,7 @@ dependencies = [ "log", "rand", "sha1", - "thiserror 2.0.9", + "thiserror 2.0.10", "utf-8", ] @@ -6908,7 +6831,7 @@ checksum = "560b82d656506509d43abe30e0ba64c56b1953ab3d4fe7ba5902747a7a3cedd5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6925,11 +6848,10 @@ checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "ulid" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f903f293d11f31c0c29e4148f6dc0d033a7f80cebc0282bea147611667d289" +checksum = "f294bff79170ed1c5633812aff1e565c35d993a36e757f9bc0accf5eec4e6045" dependencies = [ - "getrandom", "rand", "web-time", ] @@ -7094,9 +7016,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4" dependencies = [ "getrandom", "rand", @@ -7130,7 +7052,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7209,7 +7131,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-shared", ] @@ -7244,7 +7166,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7409,7 +7331,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7420,7 +7342,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7678,7 +7600,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -7700,7 +7622,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7720,7 +7642,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -7749,7 +7671,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c3fd8c8..7c05fad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,10 +4,11 @@ resolver = "2" [patch.crates-io] testcontainers = { git = "https://github.com/testcontainers/testcontainers-rs.git", rev = "af21727" } -loco-rs = { git = "https://github.com/lonelyhentxi/loco.git", rev = "beb890e" } +# loco-rs = { git = "https://github.com/lonelyhentxi/loco.git", rev = "beb890e" } # loco-rs = { git = "https://github.com/loco-rs/loco.git" } async-graphql = { git = "https://github.com/aumetra/async-graphql.git", rev = "690ece7" } async-graphql-axum = { git = "https://github.com/aumetra/async-graphql.git", rev = "690ece7" } +jwt-authorizer = { git = "https://github.com/blablacio/jwt-authorizer.git", rev = "e956774" } # [patch."https://github.com/lonelyhentxi/qbit.git"] # qbit-rs = { path = "./patches/qbit-rs" } diff --git a/apps/proxy/.whistle/rules/files/0.webui b/apps/proxy/.whistle/rules/files/0.webui index bca1aca..18f51f8 100644 --- a/apps/proxy/.whistle/rules/files/0.webui +++ b/apps/proxy/.whistle/rules/files/0.webui @@ -1,2 +1,2 @@ -^https://konobangu.com/*** http://127.0.0.1:5000/$1 -^wss://konobangu.com/*** ws://127.0.0.1:5000/$1 \ No newline at end of file +^https://konobangu.com/*** http://127.0.0.1:5000/$1 excludeFilter://^https://konobangu.com/api/*** +^wss://konobangu.com/*** ws://127.0.0.1:5000/$1 ^excludeFilter://^wss://konobangu.com/api/*** \ No newline at end of file diff --git a/apps/proxy/.whistle/rules/files/2.recorder b/apps/proxy/.whistle/rules/files/2.recorder index b47b223..f9998e7 100644 --- a/apps/proxy/.whistle/rules/files/2.recorder +++ b/apps/proxy/.whistle/rules/files/2.recorder @@ -1 +1 @@ -^https://recorder.konobangu.com/*** http://127.0.0.1:7600/$1 \ No newline at end of file +^https://konobangu.com/api/*** http://127.0.0.1:5001/api/$1 \ No newline at end of file diff --git a/apps/recorder/Cargo.toml b/apps/recorder/Cargo.toml index cfb1f2c..0909b07 100644 --- a/apps/recorder/Cargo.toml +++ b/apps/recorder/Cargo.toml @@ -22,7 +22,7 @@ testcontainers = [ ] [dependencies] -loco-rs = { version = "0.13" } +loco-rs = { version = "0.14" } serde = { version = "1", features = ["derive"] } serde_json = "1" tokio = { version = "1.42", features = ["macros", "fs", "rt-multi-thread"] } @@ -42,7 +42,13 @@ axum = "0.8" uuid = { version = "1.6.0", features = ["v4"] } tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } sea-orm-migration = { version = "1", features = ["runtime-tokio-rustls"] } -reqwest = { version = "0.12.9" } +reqwest = { version = "0.12", features = [ + "charset", + "http2", + "json", + "macos-system-configuration", + "rustls-tls", +] } thiserror = "2" rss = "2" bytes = "1.9" @@ -91,8 +97,10 @@ fastrand = "2.3.0" seaography = "1.1.2" quirks_path = "0.1.0" base64 = "0.22.1" +tower = "0.5.2" +axum-extra = "0.10.0" [dev-dependencies] serial_test = "3" -loco-rs = { version = "0.13", features = ["testing"] } +loco-rs = { version = "0.14", features = ["testing"] } insta = { version = "1", features = ["redactions", "yaml", "filters"] } diff --git a/apps/recorder/src/app.rs b/apps/recorder/src/app.rs index 61b7be9..9c4261d 100644 --- a/apps/recorder/src/app.rs +++ b/apps/recorder/src/app.rs @@ -13,10 +13,9 @@ use loco_rs::{ task::Tasks, Result, }; -use sea_orm::DatabaseConnection; use crate::{ - auth::service::AppAuthService, + auth::service::{AppAuthService, AppAuthServiceInitializer}, controllers::{self}, dal::{AppDalClient, AppDalInitalizer}, extract::mikan::{client::AppMikanClientInitializer, AppMikanClient}, @@ -75,6 +74,7 @@ impl Hooks for App { Box::new(AppDalInitalizer), Box::new(AppMikanClientInitializer), Box::new(AppGraphQLServiceInitializer), + Box::new(AppAuthServiceInitializer), ]; Ok(initializers) @@ -101,8 +101,8 @@ impl Hooks for App { fn routes(ctx: &AppContext) -> AppRoutes { AppRoutes::with_default_routes() .prefix("/api") - .add_route(controllers::subscribers::routes()) - .add_route(controllers::graphql::routes(ctx.get_graphql_service())) + .add_route(controllers::auth::routes()) + .add_route(controllers::graphql::routes(ctx.clone())) } async fn connect_workers(ctx: &AppContext, queue: &Queue) -> Result<()> { @@ -119,12 +119,12 @@ impl Hooks for App { fn register_tasks(_tasks: &mut Tasks) {} - async fn truncate(db: &DatabaseConnection) -> Result<()> { - truncate_table(db, subscribers::Entity).await?; + async fn truncate(ctx: &AppContext) -> Result<()> { + truncate_table(&ctx.db, subscribers::Entity).await?; Ok(()) } - async fn seed(_db: &DatabaseConnection, _base: &Path) -> Result<()> { + async fn seed(_ctx: &AppContext, _base: &Path) -> Result<()> { Ok(()) } } diff --git a/apps/recorder/src/auth/errors.rs b/apps/recorder/src/auth/errors.rs index 7c15816..358ede6 100644 --- a/apps/recorder/src/auth/errors.rs +++ b/apps/recorder/src/auth/errors.rs @@ -1,6 +1,7 @@ use axum::{ http::StatusCode, response::{IntoResponse, Response}, + Json, }; use thiserror::Error; @@ -30,6 +31,6 @@ pub enum AuthError { impl IntoResponse for AuthError { fn into_response(self) -> Response { - (StatusCode::UNAUTHORIZED, self.to_string()).into_response() + (StatusCode::UNAUTHORIZED, Json(self.to_string())).into_response() } } diff --git a/apps/recorder/src/auth/service.rs b/apps/recorder/src/auth/service.rs index 070c790..ff47446 100644 --- a/apps/recorder/src/auth/service.rs +++ b/apps/recorder/src/auth/service.rs @@ -3,7 +3,6 @@ use axum::{ extract::FromRequestParts, http::request::Parts, response::{IntoResponse as _, Response}, - Extension, }; use jwt_authorizer::{JwtAuthorizer, Validation}; use loco_rs::app::{AppContext, Initializer}; @@ -22,21 +21,17 @@ pub struct AuthUserInfo { pub auth_type: AuthType, } -impl FromRequestParts for AuthUserInfo -where - S: Send + Sync, -{ +impl FromRequestParts for AuthUserInfo { type Rejection = Response; - async fn from_request_parts(req: &mut Parts, state: &S) -> Result { - let Extension(ctx) = Extension::::from_request_parts(req, state) - .await - .expect("AppContext should be present"); - - let auth_service = ctx.get_auth_service(); + async fn from_request_parts( + parts: &mut Parts, + state: &AppContext, + ) -> Result { + let auth_service = state.get_auth_service(); auth_service - .extract_user_info(req) + .extract_user_info(parts) .await .map_err(|err| err.into_response()) } diff --git a/apps/recorder/src/controllers/subscribers.rs b/apps/recorder/src/controllers/auth.rs similarity index 100% rename from apps/recorder/src/controllers/subscribers.rs rename to apps/recorder/src/controllers/auth.rs diff --git a/apps/recorder/src/controllers/graphql.rs b/apps/recorder/src/controllers/graphql.rs index aaa550b..e349e7d 100644 --- a/apps/recorder/src/controllers/graphql.rs +++ b/apps/recorder/src/controllers/graphql.rs @@ -1,25 +1,40 @@ use async_graphql::http::{playground_source, GraphQLPlaygroundConfig}; -use async_graphql_axum::GraphQL; +use async_graphql_axum::{GraphQLRequest, GraphQLResponse}; use axum::{ + extract::State, + middleware::from_extractor_with_state, response::{Html, IntoResponse}, - routing::{get, post_service}, + routing::{get, post}, }; -use loco_rs::prelude::Routes; +use loco_rs::{app::AppContext, prelude::Routes}; -use crate::graphql::service::AppGraphQLService; +use crate::{app::AppContextExt, auth::AuthUserInfo}; -pub async fn graphql_playground() -> impl IntoResponse { +async fn graphql_playground() -> impl IntoResponse { Html(playground_source(GraphQLPlaygroundConfig::new( "/api/graphql", ))) } -pub fn routes(graphql_service: &AppGraphQLService) -> Routes { +async fn graphql_handler( + State(ctx): State, + auth_user_info: AuthUserInfo, + req: GraphQLRequest, +) -> GraphQLResponse { + let graphql_service = ctx.get_graphql_service(); + let mut req = req.into_inner(); + req = req.data(auth_user_info); + + graphql_service.schema.execute(req).await.into() +} + +pub fn routes(state: AppContext) -> Routes { Routes::new() .prefix("/graphql") .add("/playground", get(graphql_playground)) .add( "/", - post_service(GraphQL::new(graphql_service.schema.clone())), + post(graphql_handler) + .layer(from_extractor_with_state::(state)), ) } diff --git a/apps/recorder/src/controllers/mod.rs b/apps/recorder/src/controllers/mod.rs index 3f16630..e292702 100644 --- a/apps/recorder/src/controllers/mod.rs +++ b/apps/recorder/src/controllers/mod.rs @@ -1,2 +1,2 @@ +pub mod auth; pub mod graphql; -pub mod subscribers; diff --git a/apps/recorder/src/graphql/mod.rs b/apps/recorder/src/graphql/mod.rs index 3be8f75..6024bcd 100644 --- a/apps/recorder/src/graphql/mod.rs +++ b/apps/recorder/src/graphql/mod.rs @@ -1,5 +1,5 @@ +pub mod config; pub mod query_root; pub mod service; -pub mod config; -pub use query_root::schema; \ No newline at end of file +pub use query_root::schema; diff --git a/apps/recorder/src/graphql/query_root.rs b/apps/recorder/src/graphql/query_root.rs index 2bde677..d14b05a 100644 --- a/apps/recorder/src/graphql/query_root.rs +++ b/apps/recorder/src/graphql/query_root.rs @@ -2,7 +2,11 @@ use async_graphql::dynamic::*; use sea_orm::DatabaseConnection; use seaography::{Builder, BuilderContext}; -lazy_static::lazy_static! { static ref CONTEXT : BuilderContext = BuilderContext :: default () ; } +lazy_static::lazy_static! { static ref CONTEXT : BuilderContext = { + BuilderContext { + ..Default::default() + } +}; } pub fn schema( database: DatabaseConnection, @@ -34,6 +38,7 @@ pub fn schema( } let schema = builder.schema_builder(); + let schema = if let Some(depth) = depth { schema.limit_depth(depth) } else { diff --git a/apps/recorder/src/models/bangumi.rs b/apps/recorder/src/models/bangumi.rs index af4230a..d014d8b 100644 --- a/apps/recorder/src/models/bangumi.rs +++ b/apps/recorder/src/models/bangumi.rs @@ -1,3 +1,4 @@ +use async_graphql::SimpleObject; use async_trait::async_trait; use loco_rs::app::AppContext; use sea_orm::{entity::prelude::*, sea_query::OnConflict, ActiveValue, FromJsonQueryResult}; @@ -5,13 +6,19 @@ use serde::{Deserialize, Serialize}; use super::subscription_bangumi; -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)] +#[derive( + Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult, SimpleObject, +)] +#[graphql(name = "BangumiFilter")] pub struct BangumiFilter { pub name: Option>, pub group: Option>, } -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)] +#[derive( + Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult, SimpleObject, +)] +#[graphql(name = "BangumiExtra")] pub struct BangumiExtra { pub name_zh: Option, pub s_name_zh: Option, @@ -21,14 +28,16 @@ pub struct BangumiExtra { pub s_name_jp: Option, } -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize, SimpleObject)] #[sea_orm(table_name = "bangumi")] +#[graphql(name = "Bangumi")] pub struct Model { pub created_at: DateTime, pub updated_at: DateTime, #[sea_orm(primary_key)] pub id: i32, pub mikan_bangumi_id: Option, + #[graphql(default_with = "default_subscriber_id")] pub subscriber_id: i32, pub display_name: String, pub raw_name: String, diff --git a/apps/recorder/src/models/subscribers.rs b/apps/recorder/src/models/subscribers.rs index 9758695..8604b6b 100644 --- a/apps/recorder/src/models/subscribers.rs +++ b/apps/recorder/src/models/subscribers.rs @@ -1,3 +1,4 @@ +use async_graphql::SimpleObject; use async_trait::async_trait; use loco_rs::{ app::AppContext, @@ -8,7 +9,9 @@ use serde::{Deserialize, Serialize}; pub const SEED_SUBSCRIBER: &str = "konobangu"; -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)] +#[derive( + Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult, SimpleObject, +)] pub struct SubscriberBangumiConfig { pub leading_group_tag: Option, } @@ -104,11 +107,6 @@ impl ActiveModelBehavior for ActiveModel { } impl Model { - /// finds a user by the provided pid - /// - /// # Errors - /// - /// When could not find user or DB query error pub async fn find_by_pid(ctx: &AppContext, pid: &str) -> ModelResult { let db = &ctx.db; let parse_uuid = Uuid::parse_str(pid).map_err(|e| ModelError::Any(e.into()))?; @@ -148,12 +146,6 @@ impl Model { Self::find_by_pid(ctx, SEED_SUBSCRIBER).await } - /// Asynchronously creates a user with a password and saves it to the - /// database. - /// - /// # Errors - /// - /// When could not save the user into the DB pub async fn create_root(ctx: &AppContext) -> ModelResult { let db = &ctx.db; let txn = db.begin().await?; diff --git a/justfile b/justfile index b26c60b..4a4a3ce 100644 --- a/justfile +++ b/justfile @@ -9,6 +9,9 @@ prepare-dev-recorder: dev-webui: pnpm run dev +dev-proxy: + pnpm run --filter=proxy dev + dev-recorder: cargo watch -w apps/recorder -x 'recorder start'