diff --git a/.gitignore b/.gitignore index 360b42d..3720274 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ **/*.rs.bk Cargo.lock .vscode +**/.idea diff --git a/backend-actix/Cargo.lock b/backend-actix/Cargo.lock index 087b252..466d718 100644 --- a/backend-actix/Cargo.lock +++ b/backend-actix/Cargo.lock @@ -36,9 +36,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.11.0" +version = "3.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44dfe5c9e0004c623edc65391dfd51daa201e7e30ebd9c9bedf873048ec32bc2" +checksum = "7926860314cbe2fb5d1f13731e387ab43bd32bca224e82e6e2db85de0a3dba49" dependencies = [ "actix-codec", "actix-rt", @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "actix-rt" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208" +checksum = "92589714878ca59a7626ea19734f0e07a6a875197eec751bb5d3f99e64998c63" dependencies = [ "futures-core", "tokio", @@ -120,7 +120,7 @@ dependencies = [ "futures-core", "futures-util", "mio", - "socket2", + "socket2 0.5.10", "tokio", "tracing", ] @@ -147,9 +147,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.11.0" +version = "4.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a597b77b5c6d6a1e1097fddde329a83665e25c5437c696a3a9a4aa514a614dea" +checksum = "1654a77ba142e37f049637a3e5685f864514af11fcbc51cb51eb6596afe5b8d6" dependencies = [ "actix-codec", "actix-http", @@ -182,7 +182,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2", + "socket2 0.6.1", "time", "tracing", "url", @@ -200,15 +200,6 @@ dependencies = [ "syn", ] -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - [[package]] name = "adler2" version = "2.0.1" @@ -217,9 +208,9 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] @@ -239,12 +230,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -256,9 +241,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.19" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -271,9 +256,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" @@ -286,22 +271,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.9" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -340,21 +325,6 @@ dependencies = [ "validator", ] -[[package]] -name = "backtrace" -version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", -] - [[package]] name = "base64" version = "0.22.1" @@ -363,15 +333,15 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" +checksum = "0e050f626429857a27ddccb31e0aca21356bfa709c04041aefddac081a8f068a" [[package]] name = "bitflags" -version = "2.9.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "blake2" @@ -393,9 +363,9 @@ dependencies = [ [[package]] name = "brotli" -version = "8.0.1" +version = "8.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9991eea70ea4f293524138648e41ee89b0b2b12ddef3b255effa43c8056e0e0d" +checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -414,9 +384,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byteorder" @@ -426,25 +396,26 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "bytestring" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e465647ae23b2823b0753f50decb2d5a86d2bb2cac04788fafd1f80e45378e5f" +checksum = "113b4343b5f6617e7ad401ced8de3cc8b012e73a594347c307b90db3e9271289" dependencies = [ "bytes", ] [[package]] name = "cc" -version = "1.2.29" +version = "1.2.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" +checksum = "9f50d563227a1c37cc0a263f64eca3334388c01c5e4c4861a9def205c614383c" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -452,17 +423,16 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", @@ -477,6 +447,15 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "cookie" version = "0.16.2" @@ -505,18 +484,18 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", @@ -528,8 +507,18 @@ version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.11", + "darling_macro 0.20.11", +] + +[[package]] +name = "darling" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" +dependencies = [ + "darling_core 0.21.3", + "darling_macro 0.21.3", ] [[package]] @@ -546,57 +535,85 @@ dependencies = [ "syn", ] +[[package]] +name = "darling_core" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + [[package]] name = "darling_macro" version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core", + "darling_core 0.20.11", + "quote", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" +dependencies = [ + "darling_core 0.21.3", "quote", "syn", ] [[package]] name = "deranged" -version = "0.4.0" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" dependencies = [ "powerfmt", ] [[package]] name = "derive_more" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" dependencies = [ + "convert_case", "proc-macro2", "quote", + "rustc_version", "syn", "unicode-xid", ] [[package]] name = "diesel" -version = "2.2.12" +version = "2.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229850a212cd9b84d4f0290ad9d294afc0ae70fccaa8949dbe8b43ffafa1e20c" +checksum = "e130c806dccc85428c564f2dc5a96e05b6615a27c9a28776bd7761a9af4bb552" dependencies = [ "bitflags", "byteorder", "chrono", "diesel_derives", + "downcast-rs", "itoa", "pq-sys", "r2d2", @@ -617,9 +634,9 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.2.7" +version = "2.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b96984c469425cb577bf6f17121ecb3e4fe1e81de5d8f780dd372802858d756" +checksum = "c30b2969f923fa1f73744b92bb7df60b858df8832742d9a3aceb79236c0be1d2" dependencies = [ "diesel_table_macro_syntax", "dsl_auto_type", @@ -630,9 +647,9 @@ dependencies = [ [[package]] name = "diesel_migrations" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a73ce704bad4231f001bff3314d91dce4aba0770cee8b233991859abc15c1f6" +checksum = "745fd255645f0f1135f9ec55c7b00e0882192af9683ab4731e4bba3da82b8f9c" dependencies = [ "diesel", "migrations_internals", @@ -641,9 +658,9 @@ dependencies = [ [[package]] name = "diesel_table_macro_syntax" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" +checksum = "fe2444076b48641147115697648dc743c2c00b61adade0f01ce67133c7babe8c" dependencies = [ "syn", ] @@ -671,12 +688,18 @@ dependencies = [ ] [[package]] -name = "dsl_auto_type" -version = "0.1.3" +name = "downcast-rs" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139ae9aca7527f85f26dd76483eb38533fd84bd571065da1739656ef71c5ff5b" +checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" + +[[package]] +name = "dsl_auto_type" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd122633e4bef06db27737f21d3738fb89c8f6d5360d6d9d7635dda142a7757e" dependencies = [ - "darling", + "darling 0.21.3", "either", "heck 0.5.0", "proc-macro2", @@ -701,9 +724,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" dependencies = [ "log", "regex", @@ -729,10 +752,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] -name = "flate2" -version = "1.1.2" +name = "find-msvc-tools" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" + +[[package]] +name = "flate2" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" dependencies = [ "crc32fast", "miniz_oxide", @@ -752,9 +781,9 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -823,28 +852,22 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "wasip2", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "h2" version = "0.3.27" @@ -866,9 +889,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.4" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "heck" @@ -907,9 +930,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "iana-time-zone" -version = "0.1.63" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -931,9 +954,9 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", "potential_utf", @@ -944,9 +967,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", @@ -957,11 +980,10 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", @@ -972,42 +994,38 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", - "potential_utf", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", "icu_locale_core", - "stable_deref_trait", - "tinystr", "writeable", "yoke", "zerofrom", @@ -1023,9 +1041,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -1050,55 +1068,44 @@ checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" [[package]] name = "indexmap" -version = "2.10.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", "hashbrown", ] -[[package]] -name = "io-uring" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" -dependencies = [ - "bitflags", - "cfg-if", - "libc", -] - [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010" [[package]] name = "jiff" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" +checksum = "49cce2b81f2098e7e3efc35bc2e0a6b7abec9d34128283d7a26fa8f32a6dbb35" dependencies = [ "jiff-static", "log", "portable-atomic", "portable-atomic-util", - "serde", + "serde_core", ] [[package]] name = "jiff-static" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +checksum = "980af8b43c3ad5d8d349ace167ec8170839f753a42d233ba19e08afe1850fa69" dependencies = [ "proc-macro2", "quote", @@ -1107,19 +1114,19 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -1148,15 +1155,15 @@ checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" [[package]] name = "libc" -version = "0.2.174" +version = "0.2.178" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" [[package]] name = "litemap" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "local-channel" @@ -1177,31 +1184,30 @@ checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" [[package]] name = "lock_api" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.27" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "memchr" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "migrations_internals" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bda1634d70d5bd53553cf15dca9842a396e8c799982a3ad22998dc44d961f24" +checksum = "36c791ecdf977c99f45f23280405d7723727470f6689a5e6dbf513ac547ae10d" dependencies = [ "serde", "toml", @@ -1209,9 +1215,9 @@ dependencies = [ [[package]] name = "migrations_macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb161cc72176cb37aa47f1fc520d3ef02263d67d661f44f05d05a079e1237fd" +checksum = "36fc5ac76be324cfd2d3f2cf0fdf5d5d3c4f14ed8aaebadb09e304ba42282703" dependencies = [ "migrations_internals", "proc-macro2", @@ -1231,18 +1237,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", + "simd-adler32", ] [[package]] name = "mio" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", "log", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", + "wasi", + "windows-sys 0.61.2", ] [[package]] @@ -1285,15 +1292,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -1302,15 +1300,15 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "once_cell_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "parking_lot" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -1318,15 +1316,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.11" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-link", ] [[package]] @@ -1342,19 +1340,19 @@ dependencies = [ [[package]] name = "pem" -version = "3.0.5" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" +checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" dependencies = [ "base64", - "serde", + "serde_core", ] [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project" @@ -1396,9 +1394,9 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" +checksum = "f59e70c4aef1e55797c2e8fd94a4f2a973fc972cfde0e0b05f683667b0cd39dd" [[package]] name = "portable-atomic-util" @@ -1411,9 +1409,9 @@ dependencies = [ [[package]] name = "potential_utf" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" dependencies = [ "zerovec", ] @@ -1435,11 +1433,12 @@ dependencies = [ [[package]] name = "pq-sys" -version = "0.7.2" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfd6cf44cca8f9624bc19df234fc4112873432f5fda1caff174527846d026fa9" +checksum = "574ddd6a267294433f140b02a726b0640c43cf7c6f717084684aaa3b285aba61" dependencies = [ "libc", + "pkg-config", "vcpkg", ] @@ -1467,18 +1466,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ "proc-macro2", ] @@ -1502,9 +1501,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha", "rand_core 0.9.3", @@ -1535,23 +1534,23 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", ] [[package]] name = "redox_syscall" -version = "0.5.13" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", @@ -1561,9 +1560,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", @@ -1572,15 +1571,15 @@ dependencies = [ [[package]] name = "regex-lite" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" +checksum = "8d942b98df5e658f56f20d592c7f868833fe38115e65c33003d8cd224b0155da" [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "ring" @@ -1597,22 +1596,25 @@ dependencies = [ ] [[package]] -name = "rustc-demangle" -version = "0.1.25" +name = "rustc_version" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] [[package]] name = "rustversion" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "62049b2877bf12821e8f9ad256ee38fdc31db7387ec2d3b3f403024de2034aea" [[package]] name = "scheduled-thread-pool" @@ -1630,19 +1632,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "serde" -version = "1.0.219" +name = "semver" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -1651,23 +1669,24 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "217ca874ae0207aac254aa02c957ded05585a90892cc8d87f9e5fa49669dadd8" dependencies = [ "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] name = "serde_spanned" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -1701,13 +1720,19 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.5" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + [[package]] name = "simple_asn1" version = "0.6.3" @@ -1722,9 +1747,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "smallvec" @@ -1743,10 +1768,20 @@ dependencies = [ ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "socket2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "strsim" @@ -1762,9 +1797,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.104" +version = "2.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" dependencies = [ "proc-macro2", "quote", @@ -1784,18 +1819,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.12" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.12" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", @@ -1804,9 +1839,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.41" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", "itoa", @@ -1819,15 +1854,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" [[package]] name = "time-macros" -version = "0.2.22" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" dependencies = [ "num-conv", "time-core", @@ -1835,9 +1870,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" dependencies = [ "displaydoc", "zerovec", @@ -1845,28 +1880,25 @@ dependencies = [ [[package]] name = "tokio" -version = "1.46.1" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ - "backtrace", "bytes", - "io-uring", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", - "slab", - "socket2", - "windows-sys 0.52.0", + "socket2 0.6.1", + "windows-sys 0.61.2", ] [[package]] name = "tokio-util" -version = "0.7.15" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" dependencies = [ "bytes", "futures-core", @@ -1877,48 +1909,40 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.2" +version = "0.9.10+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0aee96c12fa71097902e0bb061a5e1ebd766a6636bb605ba401c45c1650eac" +checksum = "0825052159284a1a8b4d6c0c86cbc801f2da5afd2b225fa548c72f2e74002f48" dependencies = [ - "indexmap", - "serde", + "serde_core", "serde_spanned", "toml_datetime", "toml_parser", - "toml_writer", "winnow", ] [[package]] name = "toml_datetime" -version = "0.7.0" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ - "serde", + "serde_core", ] [[package]] name = "toml_parser" -version = "1.0.1" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97200572db069e74c512a14117b296ba0a80a30123fbbb5aa1f4a348f639ca30" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ "winnow", ] -[[package]] -name = "toml_writer" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" - [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", @@ -1928,9 +1952,9 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2340b7722695166c7fc9b3e3cd1166e7c74fedb9075b8f0c74d3822d2e41caf5" +checksum = "2f28f45dd524790b44a7b372f7c3aec04a3af6b42d494e861b67de654cb25a5e" dependencies = [ "actix-web", "mutually_exclusive_features", @@ -1941,9 +1965,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", @@ -1952,24 +1976,30 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.34" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", ] [[package]] name = "typenum" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-xid" @@ -1985,13 +2015,14 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -2008,13 +2039,13 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.17.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", "js-sys", - "serde", + "serde_core", "wasm-bindgen", ] @@ -2040,7 +2071,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7df16e474ef958526d1205f6dda359fdfab79d9aa6d54bafcb92dcd07673dca" dependencies = [ - "darling", + "darling 0.20.11", "once_cell", "proc-macro-error2", "proc-macro2", @@ -2067,45 +2098,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" +name = "wasip2" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen-rt", + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2113,31 +2131,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn", - "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] [[package]] name = "windows-core" -version = "0.61.2" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", @@ -2148,9 +2166,9 @@ dependencies = [ [[package]] name = "windows-implement" -version = "0.60.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", @@ -2159,9 +2177,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.59.1" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", @@ -2170,24 +2188,24 @@ dependencies = [ [[package]] name = "windows-link" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-result" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ "windows-link", ] [[package]] name = "windows-strings" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ "windows-link", ] @@ -2198,16 +2216,25 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets", + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", ] [[package]] @@ -2216,14 +2243,31 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -2232,42 +2276,84 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -2275,33 +2361,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "winnow" -version = "0.7.12" +name = "windows_x86_64_msvc" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "winnow" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags", -] +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "yoke" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ - "serde", "stable_deref_trait", "yoke-derive", "zerofrom", @@ -2309,9 +2397,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", @@ -2321,18 +2409,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.26" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.26" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" dependencies = [ "proc-macro2", "quote", @@ -2362,9 +2450,9 @@ dependencies = [ [[package]] name = "zerotrie" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" dependencies = [ "displaydoc", "yoke", @@ -2373,9 +2461,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" dependencies = [ "yoke", "zerofrom", @@ -2384,9 +2472,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", @@ -2413,9 +2501,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.15+zstd.1.5.7" +version = "2.0.16+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" dependencies = [ "cc", "pkg-config", diff --git a/backend-actix/build.rs b/backend-actix/build.rs index 21e75ca..88053a2 100644 --- a/backend-actix/build.rs +++ b/backend-actix/build.rs @@ -1,5 +1,8 @@ -use std::{fs::{exists, read_dir, remove_dir_all, File}, io::Write, process::Command}; - +use std::{ + fs::{exists, read_dir, remove_dir_all, File}, + io::Write, + process::Command, +}; fn main() { println!("cargo::rerun-if-changed=gamenight-api.yaml"); @@ -7,12 +10,19 @@ fn main() { if exists("src/models").unwrap() { remove_dir_all("src/models").unwrap(); } - - let _ = - Command::new("openapi-generator") - .args(["generate", "-i", "gamenight-api.yaml", "-g", "rust", "--global-property", "models"]) - .output() - .expect("Failed to generate models sources for the gamenight API"); + + let _ = Command::new("openapi-generator") + .args([ + "generate", + "-i", + "gamenight-api.yaml", + "-g", + "rust", + "--global-property", + "models", + ]) + .output() + .expect("Failed to generate models sources for the gamenight API"); let mut file = File::create("src/models/mod.rs").unwrap(); let paths = read_dir("./src/models").unwrap(); @@ -21,10 +31,10 @@ fn main() { let path = path.path(); let stem = path.file_stem().unwrap(); if stem == "mod" { - continue + continue; } - + let line = format!("pub mod {};\n", stem.to_str().unwrap()); let _ = file.write(line.as_bytes()).unwrap(); } -} \ No newline at end of file +} diff --git a/backend-actix/gamenight-api.yaml b/backend-actix/gamenight-api.yaml index 6c155ea..1d1e085 100644 --- a/backend-actix/gamenight-api.yaml +++ b/backend-actix/gamenight-api.yaml @@ -38,6 +38,17 @@ paths: parameters: [] security: - JWT-Auth: [] + /users: + get: + responses: + '200': + $ref: '#/components/responses/UsersResponse' + '400': + $ref: '#/components/responses/FailureResponse' + '401': + $ref: '#/components/responses/FailureResponse' + security: + - JWT-Auth: [] /user: post: summary: '' @@ -242,9 +253,72 @@ paths: $ref: '#/components/requestBodies/OwnedGamesRequest' security: - JWT-Auth: [] + /location: + get: + responses: + '200': + $ref: '#/components/responses/LocationResponse' + '401': + $ref: '#/components/responses/FailureResponse' + '422': + $ref: '#/components/responses/FailureResponse' + requestBody: + $ref: '#/components/requestBodies/GetLocationRequest' + security: + - JWT-Auth: [] + post: + responses: + '200': + description: 'Ok' + $ref: '#/components/responses/LocationIdResponse' + '401': + $ref: '#/components/responses/FailureResponse' + '422': + $ref: '#/components/responses/FailureResponse' + requestBody: + $ref: '#/components/requestBodies/AddLocationRequest' + security: + - JWT-Auth: [] + /locations: + get: + responses: + '200': + $ref: '#/components/responses/LocationsResponse' + '401': + $ref: '#/components/responses/FailureResponse' + '422': + $ref: '#/components/responses/FailureResponse' + security: + - JWT-Auth: [] + /location_authorize: + post: + responses: + '200': + description: 'Ok' + '401': + $ref: '#/components/responses/FailureResponse' + '422': + $ref: '#/components/responses/FailureResponse' + requestBody: + $ref: '#/components/requestBodies/AuthorizeLocationRequest' + security: + - JWT-Auth: [] + /authorized_location_user_ids: + get: + responses: + '200': + $ref: "#/components/responses/UserIdsResponse" + '401': + $ref: '#/components/responses/FailureResponse' + '422': + $ref: '#/components/responses/FailureResponse' + requestBody: + $ref: '#/components/requestBodies/AuthorizedLocationUserIdsRequest' + security: + - JWT-Auth: [] + - components: schemas: Gamenight: @@ -326,6 +400,14 @@ components: type: string required: - user_id + LocationId: + title: LocationId + type: object + properties: + location_id: + type: string + required: + - location_id AddGamenightRequestBody: title: AddGamenightRequestBody type: object @@ -401,7 +483,49 @@ components: type: array items: type: string - + UserIdsResponse: + type: array + items: + $ref: "#/components/schemas/UserId" + AddLocationRequestBody: + type: object + properties: + name: + type: string + address: + type: string + note: + type: string + required: + - name + Location: + type: object + properties: + id: + type: string + name: + type: string + address: + type: string + note: + type: string + required: + - id + - name + AuthorizeLocationRequestBody: + type: object + properties: + location_id: + type: string + user_id: + type: string + op: + type: string + enum: [grant, revoke] + required: + - location_id + - user_id + - op requestBodies: LoginRequest: content: @@ -473,6 +597,27 @@ components: application/json: schema: $ref: '#/components/schemas/UserId' + GetLocationRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/LocationId' + AddLocationRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/AddLocationRequestBody' + AuthorizeLocationRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizeLocationRequestBody' + AuthorizedLocationUserIdsRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/LocationId' + responses: TokenResponse: description: Example response @@ -500,6 +645,14 @@ components: type: array items: $ref: '#/components/schemas/Gamenight' + UsersResponse: + description: List of all Users + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' GamenightResponse: description: A gamenight being hosted content: @@ -532,6 +685,34 @@ components: application/json: schema: $ref: '#/components/schemas/GameIdsResponse' + UserIdsResponse: + description: A list of user ids. + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdsResponse' + LocationResponse: + description: A location + content: + application/json: + schema: + $ref: '#/components/schemas/Location' + LocationIdResponse: + description: A location Id + content: + application/json: + schema: + $ref: '#/components/schemas/LocationId' + + LocationsResponse: + description: A list of all LocationsResponse + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Location' + securitySchemes: JWT-Auth: type: http diff --git a/backend-actix/src/main.rs b/backend-actix/src/main.rs index b3cab40..96ef763 100644 --- a/backend-actix/src/main.rs +++ b/backend-actix/src/main.rs @@ -3,19 +3,19 @@ pub mod models; pub mod request; use actix_cors::Cors; -use actix_web::middleware::Logger; -use actix_web::HttpServer; -use actix_web::App; use actix_web::http; +use actix_web::middleware::Logger; use actix_web::web; -use request::{*, login, register, gamenights}; -use tracing_actix_web::TracingLogger; +use actix_web::App; +use actix_web::HttpServer; use gamenight_database::*; +use request::{gamenights, login, register, *}; +use tracing_actix_web::TracingLogger; #[actix_web::main] async fn main() -> std::io::Result<()> { let url = "postgres://root:root@127.0.0.1/gamenight"; - + let pool = get_connection_pool(url); let mut conn = pool.get_conn(); @@ -26,11 +26,11 @@ async fn main() -> std::io::Result<()> { HttpServer::new(move || { let cors = Cors::default() .allowed_origin("0.0.0.0") - .allowed_origin_fn(|_origin, _req_head| { true }) - .allowed_methods(vec!["GET", "POST"]) - .allowed_headers(vec![http::header::AUTHORIZATION, http::header::ACCEPT]) - .allowed_header(http::header::CONTENT_TYPE) - .max_age(3600); + .allowed_origin_fn(|_origin, _req_head| true) + .allowed_methods(vec!["GET", "POST"]) + .allowed_headers(vec![http::header::AUTHORIZATION, http::header::ACCEPT]) + .allowed_header(http::header::CONTENT_TYPE) + .max_age(3600); App::new() .wrap(cors) @@ -44,6 +44,7 @@ async fn main() -> std::io::Result<()> { .service(gamenight_post) .service(gamenight_get) .service(get_user) + .service(get_users) .service(get_user_unauthenticated) .service(post_join_gamenight) .service(post_leave_gamenight) @@ -55,8 +56,12 @@ async fn main() -> std::io::Result<()> { .service(post_own_game) .service(post_disown_game) .service(get_owned_games) + .service(get_locations) + .service(post_location) + .service(post_location_authorize) + .service(get_authorized_location_user_ids) }) .bind(("::1", 8080))? .run() .await -} \ No newline at end of file +} diff --git a/backend-actix/src/request/authorization.rs b/backend-actix/src/request/authorization.rs index 26d8d79..bea9f0a 100644 --- a/backend-actix/src/request/authorization.rs +++ b/backend-actix/src/request/authorization.rs @@ -1,19 +1,22 @@ -use std::future::{Ready, ready}; +use std::future::{ready, Ready}; -use actix_web::{FromRequest, http, HttpRequest, dev::Payload, web::Data}; +use actix_web::{dev::Payload, http, web::Data, FromRequest, HttpRequest}; use chrono::Utc; -use jsonwebtoken::{encode, Header, EncodingKey, decode, DecodingKey, Validation}; -use serde::{Serialize, Deserialize}; +use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, Validation}; +use serde::{Deserialize, Serialize}; use uuid::Uuid; -use gamenight_database::{user::{get_user, User}, DbPool}; +use gamenight_database::{ + user::{get_user, User}, + DbPool, +}; use super::error::ApiError; #[derive(Debug, Serialize, Deserialize)] pub struct Claims { exp: i64, - uid: Uuid + uid: Uuid, } pub struct AuthUser(pub User); @@ -25,24 +28,31 @@ pub struct AuthUser(pub User); // pub role: Role, // } -impl From for AuthUser { +impl From for AuthUser { fn from(value: User) -> Self { Self(value) } } -fn get_claims(req: &HttpRequest) -> Result { - let token = req.headers() +fn get_claims(req: &HttpRequest) -> Result { + let token = req + .headers() .get(http::header::AUTHORIZATION) .map(|h| h.to_str().unwrap().split_at(7).1.to_string()); - let token = token.ok_or(ApiError{ + let token = token.ok_or(ApiError { status: 400, - message: "JWT-token was not specified in the Authorization header as Bearer: token".to_string() + message: "JWT-token was not specified in the Authorization header as Bearer: token" + .to_string(), })?; let secret = "secret"; - Ok(decode::(token.as_str(), &DecodingKey::from_secret(secret.as_bytes()), &Validation::default())?.claims) + Ok(decode::( + token.as_str(), + &DecodingKey::from_secret(secret.as_bytes()), + &Validation::default(), + )? + .claims) } pub fn get_token(user: &User) -> Result { @@ -55,7 +65,8 @@ pub fn get_token(user: &User) -> Result { Ok(encode( &Header::default(), &claims, - &EncodingKey::from_secret(secret.as_bytes()))?) + &EncodingKey::from_secret(secret.as_bytes()), + )?) } impl FromRequest for AuthUser { @@ -63,15 +74,15 @@ impl FromRequest for AuthUser { type Future = Ready>; fn from_request(req: &HttpRequest, _payload: &mut Payload) -> Self::Future { - ready( - (|| -> Result{ - let pool = req.app_data::>().expect("No database configured"); - let mut conn = pool.get().expect("couldn't get db connection from pool"); - let uid = get_claims(req)?.uid; - let user = get_user(&mut conn, uid)?; - - Ok(user.into()) - })() - ) + ready((|| -> Result { + let pool = req + .app_data::>() + .expect("No database configured"); + let mut conn = pool.get().expect("couldn't get db connection from pool"); + let uid = get_claims(req)?.uid; + let user = get_user(&mut conn, uid)?; + + Ok(user.into()) + })()) } -} \ No newline at end of file +} diff --git a/backend-actix/src/request/error.rs b/backend-actix/src/request/error.rs index 1e2e829..55d108d 100644 --- a/backend-actix/src/request/error.rs +++ b/backend-actix/src/request/error.rs @@ -1,6 +1,10 @@ +use actix_web::{ + error::BlockingError, + http::{header::ContentType, StatusCode}, + HttpResponse, ResponseError, +}; +use serde::{Deserialize, Serialize}; use std::fmt::{Display, Formatter, Result}; -use actix_web::{ResponseError, error::BlockingError, HttpResponse, http::{header::ContentType, StatusCode}}; -use serde::{Serialize, Deserialize}; use validator::ValidationErrors; use gamenight_database::error::DatabaseError; @@ -9,7 +13,7 @@ use gamenight_database::error::DatabaseError; pub struct ApiError { #[serde(skip_serializing)] pub status: u16, - pub message: String + pub message: String, } impl Display for ApiError { @@ -21,9 +25,9 @@ impl Display for ApiError { impl ResponseError for ApiError { fn error_response(&self) -> HttpResponse { HttpResponse::build(StatusCode::from_u16(self.status).unwrap()) - .content_type(ContentType::json()) - .body(serde_json::to_string(&self).unwrap()) - } + .content_type(ContentType::json()) + .body(serde_json::to_string(&self).unwrap()) + } } impl From for ApiError { @@ -31,7 +35,7 @@ impl From for ApiError { ApiError { //Todo, split this in unrecoverable and schema error status: 500, - message: value.0 + message: value.0, } } } @@ -40,7 +44,7 @@ impl From for ApiError { fn from(value: BlockingError) -> Self { ApiError { status: 500, - message: value.to_string() + message: value.to_string(), } } } @@ -49,7 +53,7 @@ impl From for ApiError { fn from(value: serde_json::Error) -> Self { ApiError { status: 500, - message: value.to_string() + message: value.to_string(), } } } @@ -58,7 +62,7 @@ impl From for ApiError { fn from(value: jsonwebtoken::errors::Error) -> Self { ApiError { status: 500, - message: value.to_string() + message: value.to_string(), } } } @@ -67,7 +71,7 @@ impl From for ApiError { fn from(value: ValidationErrors) -> Self { ApiError { status: 422, - message: value.to_string() + message: value.to_string(), } } } @@ -76,7 +80,7 @@ impl From for ApiError { fn from(value: chrono::ParseError) -> Self { ApiError { status: 422, - message: value.to_string() + message: value.to_string(), } } } @@ -85,7 +89,7 @@ impl From for ApiError { fn from(value: uuid::Error) -> Self { ApiError { status: 422, - message: value.to_string() + message: value.to_string(), } } } diff --git a/backend-actix/src/request/game.rs b/backend-actix/src/request/game.rs index 45c7416..21796e0 100644 --- a/backend-actix/src/request/game.rs +++ b/backend-actix/src/request/game.rs @@ -1,53 +1,73 @@ use actix_web::{get, http::header::ContentType, post, web, HttpResponse, Responder}; -use gamenight_database::{game::{insert_game, load_game, rename_game}, owned_game::{disown_game, own_game, owned_games, OwnedGame}, DbPool, GetConnection}; +use gamenight_database::{ + game::{insert_game, load_game, rename_game}, + owned_game::{disown_game, own_game, owned_games, OwnedGame}, + DbPool, GetConnection, +}; use uuid::Uuid; -use crate::{models::{add_game_request_body::AddGameRequestBody, game::Game, game_id::GameId, rename_game_request_body::RenameGameRequestBody}, request::{authorization::AuthUser, error::ApiError}}; +use crate::{ + models::{ + add_game_request_body::AddGameRequestBody, game::Game, game_id::GameId, + rename_game_request_body::RenameGameRequestBody, + }, + request::{authorization::AuthUser, error::ApiError}, +}; #[get("/games")] -pub async fn get_games(pool: web::Data, _user: AuthUser) -> Result { +pub async fn get_games( + pool: web::Data, + _user: AuthUser, +) -> Result { let mut conn = pool.get_conn(); let games: Vec = gamenight_database::games(&mut conn)?; - let model: Vec = games.iter().map(|x| { - Game { + let model: Vec = games + .iter() + .map(|x| Game { id: x.id.to_string(), name: x.name.clone(), - }} - ).collect(); + }) + .collect(); Ok(HttpResponse::Ok() .content_type(ContentType::json()) - .body(serde_json::to_string(&model)?) - ) + .body(serde_json::to_string(&model)?)) } impl From for gamenight_database::game::Game { fn from(value: AddGameRequestBody) -> Self { Self { id: Uuid::new_v4(), - name: value.name + name: value.name, } } } #[get("/game")] -pub async fn get_game(pool: web::Data, _user: AuthUser, game_id: web::Json) -> Result { +pub async fn get_game( + pool: web::Data, + _user: AuthUser, + game_id: web::Json, +) -> Result { let mut conn = pool.get_conn(); let db_game = load_game(&mut conn, Uuid::parse_str(&game_id.0.game_id)?)?; - let model = Game { + let model = Game { id: db_game.id.to_string(), - name: db_game.name + name: db_game.name, }; Ok(HttpResponse::Ok() .content_type(ContentType::json()) - .body(serde_json::to_string(&model)?) - ) + .body(serde_json::to_string(&model)?)) } #[post("/game")] -pub async fn post_game(pool: web::Data, _user: AuthUser, game_data: web::Json) -> Result { +pub async fn post_game( + pool: web::Data, + _user: AuthUser, + game_data: web::Json, +) -> Result { let mut conn = pool.get_conn(); insert_game(&mut conn, game_data.0.into())?; @@ -55,40 +75,68 @@ pub async fn post_game(pool: web::Data, _user: AuthUser, game_data: web: } #[post("/rename_game")] -pub async fn post_rename_game(pool: web::Data, _user: AuthUser, game_data: web::Json) -> Result { +pub async fn post_rename_game( + pool: web::Data, + _user: AuthUser, + game_data: web::Json, +) -> Result { let mut conn = pool.get_conn(); - rename_game(&mut conn, Uuid::parse_str(&game_data.0.id)?, game_data.0.name)?; + rename_game( + &mut conn, + Uuid::parse_str(&game_data.0.id)?, + game_data.0.name, + )?; Ok(HttpResponse::Ok()) } #[post("/own")] -pub async fn post_own_game(pool: web::Data, user: AuthUser, game_id: web::Json) -> Result { +pub async fn post_own_game( + pool: web::Data, + user: AuthUser, + game_id: web::Json, +) -> Result { let mut conn = pool.get_conn(); - own_game(&mut conn, OwnedGame { user_id: user.0.id, game_id: Uuid::parse_str(&game_id.0.game_id)? })?; + own_game( + &mut conn, + OwnedGame { + user_id: user.0.id, + game_id: Uuid::parse_str(&game_id.0.game_id)?, + }, + )?; Ok(HttpResponse::Ok()) } #[post("/disown")] -pub async fn post_disown_game(pool: web::Data, user: AuthUser, game_id: web::Json) -> Result { +pub async fn post_disown_game( + pool: web::Data, + user: AuthUser, + game_id: web::Json, +) -> Result { let mut conn = pool.get_conn(); - disown_game(&mut conn, OwnedGame { user_id: user.0.id, game_id: Uuid::parse_str(&game_id.0.game_id)? })?; + disown_game( + &mut conn, + OwnedGame { + user_id: user.0.id, + game_id: Uuid::parse_str(&game_id.0.game_id)?, + }, + )?; Ok(HttpResponse::Ok()) } #[get("/owned_games")] -pub async fn get_owned_games(pool: web::Data, user: AuthUser) -> Result { +pub async fn get_owned_games( + pool: web::Data, + user: AuthUser, +) -> Result { let mut conn = pool.get_conn(); let game_ids = owned_games(&mut conn, user.0.id)?; - let model : Vec = game_ids.iter().map(|x| { - x.to_string() - }).collect(); + let model: Vec = game_ids.iter().map(|x| x.to_string()).collect(); Ok(HttpResponse::Ok() .content_type(ContentType::json()) - .body(serde_json::to_string(&model)?) - ) + .body(serde_json::to_string(&model)?)) } diff --git a/backend-actix/src/request/gamenight_handlers.rs b/backend-actix/src/request/gamenight_handlers.rs index 1dac672..3196fec 100644 --- a/backend-actix/src/request/gamenight_handlers.rs +++ b/backend-actix/src/request/gamenight_handlers.rs @@ -1,12 +1,17 @@ -use actix_web::{get, web, Responder, http::header::ContentType, HttpResponse, post}; +use actix_web::{get, http::header::ContentType, post, web, HttpResponse, Responder}; use chrono::{DateTime, ParseError}; use uuid::Uuid; use gamenight_database::{gamenight, DbPool, GetConnection}; -use crate::{models::{add_gamenight_request_body::AddGamenightRequestBody, gamenight::Gamenight, get_gamenight_request_body::GetGamenightRequestBody}, request::authorization::AuthUser}; use crate::request::error::ApiError; - +use crate::{ + models::{ + add_gamenight_request_body::AddGamenightRequestBody, gamenight::Gamenight, + get_gamenight_request_body::GetGamenightRequestBody, + }, + request::authorization::AuthUser, +}; impl AddGamenightRequestBody { pub fn into_with_user(&self, user: AuthUser) -> Result { @@ -14,7 +19,8 @@ impl AddGamenightRequestBody { datetime: DateTime::parse_from_rfc3339(&self.datetime)?.with_timezone(&chrono::Utc), id: Uuid::new_v4(), name: self.name.clone(), - owner_id: user.0.id + owner_id: user.0.id, + location_id: None, }) } } @@ -26,38 +32,49 @@ impl From for Uuid { } #[get("/gamenights")] -pub async fn gamenights(pool: web::Data, _user: AuthUser) -> Result { +pub async fn gamenights( + pool: web::Data, + _user: AuthUser, +) -> Result { let mut conn = pool.get_conn(); let gamenights: Vec = gamenight_database::gamenights(&mut conn)?; - let model: Vec = gamenights.iter().map(|x| { - Gamenight { + let model: Vec = gamenights + .iter() + .map(|x| Gamenight { id: x.id.to_string(), name: x.name.clone(), datetime: x.datetime.to_rfc3339(), - owner_id: x.owner_id.to_string() - }} - ).collect(); + owner_id: x.owner_id.to_string(), + }) + .collect(); Ok(HttpResponse::Ok() .content_type(ContentType::json()) - .body(serde_json::to_string(&model)?) - ) + .body(serde_json::to_string(&model)?)) } #[post("/gamenight")] -pub async fn gamenight_post(pool: web::Data, user: AuthUser, gamenight_data: web::Json) -> Result { +pub async fn gamenight_post( + pool: web::Data, + user: AuthUser, + gamenight_data: web::Json, +) -> Result { let mut conn = pool.get_conn(); - + gamenight::add_gamenight(&mut conn, gamenight_data.into_with_user(user)?)?; - + Ok(HttpResponse::Ok()) } #[get("/gamenight")] -pub async fn gamenight_get(pool: web::Data, _user: AuthUser, gamenight_data: web::Json) -> Result { +pub async fn gamenight_get( + pool: web::Data, + _user: AuthUser, + gamenight_data: web::Json, +) -> Result { let mut conn = pool.get_conn(); let gamenight = gamenight::get_gamenight(&mut conn, gamenight_data.into_inner().into())?; - let model = Gamenight{ + let model = Gamenight { id: gamenight.id.to_string(), datetime: gamenight.datetime.to_rfc3339(), name: gamenight.name, @@ -67,4 +84,4 @@ pub async fn gamenight_get(pool: web::Data, _user: AuthUser, gamenight_d Ok(HttpResponse::Ok() .content_type(ContentType::json()) .body(serde_json::to_string(&model)?)) -} \ No newline at end of file +} diff --git a/backend-actix/src/request/join_gamenight.rs b/backend-actix/src/request/join_gamenight.rs index 4bf960b..922919a 100644 --- a/backend-actix/src/request/join_gamenight.rs +++ b/backend-actix/src/request/join_gamenight.rs @@ -1,34 +1,55 @@ use actix_web::{post, web, HttpResponse, Responder}; -use gamenight_database::{gamenight_participants::{delete_gamenight_participant, insert_gamenight_participant, GamenightParticipant}, DbPool, GetConnection}; +use gamenight_database::{ + gamenight_participants::{ + delete_gamenight_participant, insert_gamenight_participant, GamenightParticipant, + }, + DbPool, GetConnection, +}; use uuid::Uuid; -use crate::{models::gamenight_id::GamenightId, request::{authorization::AuthUser, error::ApiError}}; +use crate::{ + models::gamenight_id::GamenightId, + request::{authorization::AuthUser, error::ApiError}, +}; #[post("/join")] -pub async fn post_join_gamenight(pool: web::Data, user: AuthUser, gamenight_id: web::Json) -> Result { +pub async fn post_join_gamenight( + pool: web::Data, + user: AuthUser, + gamenight_id: web::Json, +) -> Result { web::block(move || -> Result { let mut conn = pool.get_conn(); - Ok(insert_gamenight_participant(&mut conn, GamenightParticipant { - gamenight_id: Uuid::parse_str(&gamenight_id.gamenight_id)?, - user_id: user.0.id - })?) - }).await??; + Ok(insert_gamenight_participant( + &mut conn, + GamenightParticipant { + gamenight_id: Uuid::parse_str(&gamenight_id.gamenight_id)?, + user_id: user.0.id, + }, + )?) + }) + .await??; Ok(HttpResponse::Ok()) } #[post("/leave")] -pub async fn post_leave_gamenight(pool: web::Data, user: AuthUser, gamenight_id: web::Json) -> Result { +pub async fn post_leave_gamenight( + pool: web::Data, + user: AuthUser, + gamenight_id: web::Json, +) -> Result { web::block(move || -> Result { let mut conn = pool.get_conn(); let participant = GamenightParticipant { gamenight_id: Uuid::parse_str(&gamenight_id.gamenight_id)?, - user_id: user.0.id + user_id: user.0.id, }; let x = delete_gamenight_participant(&mut conn, participant)?; Ok(x) - }).await??; + }) + .await??; Ok(HttpResponse::Ok()) } diff --git a/backend-actix/src/request/location.rs b/backend-actix/src/request/location.rs new file mode 100644 index 0000000..1e3e06f --- /dev/null +++ b/backend-actix/src/request/location.rs @@ -0,0 +1,65 @@ +use actix_web::{get, http::header::ContentType, post, web, HttpResponse, Responder}; +use gamenight_database::{ + location::{insert_location, locations}, + DbPool, GetConnection, +}; +use uuid::Uuid; + +use crate::{ + models::{ + add_location_request_body::AddLocationRequestBody, location::Location, + location_id::LocationId, + }, + request::{authorization::AuthUser, error::ApiError}, +}; + +impl From for gamenight_database::location::Location { + fn from(value: AddLocationRequestBody) -> Self { + Self { + id: Uuid::new_v4(), + name: value.name, + address: value.address, + note: value.note, + } + } +} + +#[get("/locations")] +pub async fn get_locations( + pool: web::Data, + _user: AuthUser, +) -> Result { + let mut conn = pool.get_conn(); + let games: Vec = locations(&mut conn)?; + let model: Vec = games + .iter() + .map(|x| Location { + id: x.id.to_string(), + name: x.name.clone(), + address: x.address.clone(), + note: x.note.clone(), + }) + .collect(); + + Ok(HttpResponse::Ok() + .content_type(ContentType::json()) + .body(serde_json::to_string(&model)?)) +} + +#[post("/location")] +pub async fn post_location( + pool: web::Data, + _user: AuthUser, + game_data: web::Json, +) -> Result { + let mut conn = pool.get_conn(); + let uuid = insert_location(&mut conn, game_data.0.into())?; + + let model = LocationId { + location_id: uuid.to_string(), + }; + + Ok(HttpResponse::Ok() + .content_type(ContentType::json()) + .body(serde_json::to_string(&model)?)) +} diff --git a/backend-actix/src/request/location_owner.rs b/backend-actix/src/request/location_owner.rs new file mode 100644 index 0000000..550a937 --- /dev/null +++ b/backend-actix/src/request/location_owner.rs @@ -0,0 +1,79 @@ +use actix_web::{get, http::header::ContentType, post, web, HttpResponse, Responder}; +use gamenight_database::{ + location_owner::{grant_permission, location_permissions, revoke_permission, LocationOwner}, + user::Role, + DbPool, GetConnection, +}; +use uuid::Uuid; + +use crate::{ + models::{ + authorize_location_request_body::{ + AuthorizeLocationRequestBody, + Op::{Grant, Revoke}, + }, + location_id::LocationId, + user_id::UserId, + }, + request::{authorization::AuthUser, error::ApiError}, +}; + +impl<'a> TryFrom<&'a AuthorizeLocationRequestBody> for LocationOwner { + type Error = ApiError; + + fn try_from(value: &'a AuthorizeLocationRequestBody) -> Result { + Ok(LocationOwner { + location_id: Uuid::parse_str(&value.location_id)?, + user_id: Uuid::parse_str(&value.user_id)?, + }) + } +} + +#[post("/location_authorize")] +pub async fn post_location_authorize( + pool: web::Data, + user: AuthUser, + auth_data: web::Json, +) -> Result { + let mut conn = pool.get_conn(); + + let inner_auth_data = &auth_data.into_inner(); + let location_owner: LocationOwner = inner_auth_data.try_into()?; + let authorized = location_permissions(&mut conn, location_owner.location_id)?; + if user.0.role != Role::Admin && !authorized.contains(&user.0.id) { + Ok(HttpResponse::Unauthorized()) + } else { + match inner_auth_data.op { + Grant => grant_permission(&mut conn, location_owner)?, + Revoke => revoke_permission(&mut conn, location_owner)?, + }; + + Ok(HttpResponse::Ok()) + } +} + +impl From for UserId { + fn from(value: Uuid) -> Self { + Self { + user_id: value.to_string(), + } + } +} + +#[get("/authorized_location_user_ids")] +pub async fn get_authorized_location_user_ids( + pool: web::Data, + _user: AuthUser, + location_id: web::Json, +) -> Result { + let mut conn = pool.get_conn(); + + let permissions = + location_permissions(&mut conn, Uuid::parse_str(&location_id.0.location_id)?)?; + + let model: Vec = permissions.into_iter().map(Into::into).collect(); + + Ok(HttpResponse::Ok() + .content_type(ContentType::json()) + .body(serde_json::to_string(&model)?)) +} diff --git a/backend-actix/src/request/mod.rs b/backend-actix/src/request/mod.rs index 8d35323..e2f40e9 100644 --- a/backend-actix/src/request/mod.rs +++ b/backend-actix/src/request/mod.rs @@ -1,27 +1,33 @@ - -mod user_handlers; -mod gamenight_handlers; -mod error; mod authorization; -mod join_gamenight; -mod participant_handlers; +mod error; mod game; +mod gamenight_handlers; +mod join_gamenight; +mod location; +mod location_owner; +mod participant_handlers; +mod user_handlers; +pub use game::get_game; +pub use game::get_games; +pub use game::get_owned_games; +pub use game::post_disown_game; +pub use game::post_game; +pub use game::post_own_game; +pub use game::post_rename_game; +pub use gamenight_handlers::gamenight_get; +pub use gamenight_handlers::gamenight_post; +pub use gamenight_handlers::gamenights; +pub use join_gamenight::post_join_gamenight; +pub use join_gamenight::post_leave_gamenight; +pub use location::get_locations; +pub use location::post_location; +pub use location_owner::get_authorized_location_user_ids; +pub use location_owner::post_location_authorize; +pub use participant_handlers::get_get_participants; +pub use user_handlers::get_user; +pub use user_handlers::get_user_unauthenticated; +pub use user_handlers::get_users; pub use user_handlers::login; pub use user_handlers::refresh; pub use user_handlers::register; -pub use gamenight_handlers::gamenights; -pub use gamenight_handlers::gamenight_post; -pub use gamenight_handlers::gamenight_get; -pub use user_handlers::get_user; -pub use user_handlers::get_user_unauthenticated; -pub use join_gamenight::post_join_gamenight; -pub use join_gamenight::post_leave_gamenight; -pub use participant_handlers::get_get_participants; -pub use game::get_games; -pub use game::get_game; -pub use game::post_game; -pub use game::post_rename_game; -pub use game::post_own_game; -pub use game::post_disown_game; -pub use game::get_owned_games; diff --git a/backend-actix/src/request/participant_handlers.rs b/backend-actix/src/request/participant_handlers.rs index 8289abc..a890328 100644 --- a/backend-actix/src/request/participant_handlers.rs +++ b/backend-actix/src/request/participant_handlers.rs @@ -2,16 +2,30 @@ use actix_web::{get, http::header::ContentType, web, HttpResponse, Responder}; use gamenight_database::{DbPool, GetConnection}; use uuid::Uuid; -use crate::{models::{gamenight_id::GamenightId, participants::Participants}, request::{authorization::AuthUser, error::ApiError}}; +use crate::{ + models::{gamenight_id::GamenightId, participants::Participants}, + request::{authorization::AuthUser, error::ApiError}, +}; #[get("/participants")] -pub async fn get_get_participants(pool: web::Data, _user: AuthUser, gamenight_info: web::Json) -> Result { +pub async fn get_get_participants( + pool: web::Data, + _user: AuthUser, + gamenight_info: web::Json, +) -> Result { let mut conn = pool.get_conn(); - - let users = gamenight_database::get_participants(&mut conn, &Uuid::parse_str(&gamenight_info.into_inner().gamenight_id)?)? - .iter().map(|x| x.to_string()).collect(); - + + let users = gamenight_database::get_participants( + &mut conn, + &Uuid::parse_str(&gamenight_info.into_inner().gamenight_id)?, + )? + .iter() + .map(|x| x.to_string()) + .collect(); + Ok(HttpResponse::Ok() .content_type(ContentType::json()) - .body(serde_json::to_string(&Participants{participants: users})?)) -} \ No newline at end of file + .body(serde_json::to_string(&Participants { + participants: users, + })?)) +} diff --git a/backend-actix/src/request/user_handlers.rs b/backend-actix/src/request/user_handlers.rs index dd47516..43b51cc 100644 --- a/backend-actix/src/request/user_handlers.rs +++ b/backend-actix/src/request/user_handlers.rs @@ -1,19 +1,14 @@ - -use actix_web::http::header::ContentType; -use actix_web::{get, post, web, HttpResponse, Responder}; +use crate::models::{ + login::Login, registration::Registration, token::Token, user::User, user_id::UserId, +}; +use crate::request::{authorization::get_token, error::ApiError}; +use actix_web::{get, http::header::ContentType, post, web, HttpResponse, Responder}; use gamenight_database::user::{count_users_with_email, count_users_with_username}; +use gamenight_database::{DbPool, GetConnection}; use serde::{Deserialize, Serialize}; +use serde_json; use uuid::Uuid; use validator::{Validate, ValidateArgs, ValidationError}; -use crate::models::login::Login; -use crate::models::registration::Registration; -use crate::models::token::Token; -use crate::models::user::User; -use crate::models::user_id::UserId; -use crate::request::error::ApiError; -use crate::request::authorization::get_token; -use serde_json; -use gamenight_database::{DbPool, GetConnection}; use super::authorization::AuthUser; @@ -21,7 +16,7 @@ impl From for gamenight_database::user::LoginUser { fn from(val: Login) -> Self { gamenight_database::user::LoginUser { username: val.username, - password: val.password + password: val.password, } } } @@ -31,20 +26,22 @@ impl From for gamenight_database::user::Register { gamenight_database::user::Register { email: val.email, username: val.username, - password: val.password + password: val.password, } } } pub struct RegisterContext<'v_a> { - pub pool: &'v_a DbPool + pub pool: &'v_a DbPool, } -pub fn unique_username(username: &String, context: &RegisterContext) -> Result<(), ValidationError> { +pub fn unique_username( + username: &String, + context: &RegisterContext, +) -> Result<(), ValidationError> { let mut conn = context.pool.get_conn(); - match count_users_with_username(&mut conn, username) - { + match count_users_with_username(&mut conn, username) { Ok(0) => Ok(()), Ok(_) => Err(ValidationError::new("User already exists")), Err(_) => Err(ValidationError::new("Database error while validating user")), @@ -54,28 +51,23 @@ pub fn unique_username(username: &String, context: &RegisterContext) -> Result<( pub fn unique_email(email: &String, context: &RegisterContext) -> Result<(), ValidationError> { let mut conn = context.pool.get_conn(); - match count_users_with_email(&mut conn, email) - { + match count_users_with_email(&mut conn, email) { Ok(0) => Ok(()), Ok(_) => Err(ValidationError::new("email already exists")), - Err(_) => Err(ValidationError::new("Database error while validating email")) + Err(_) => Err(ValidationError::new( + "Database error while validating email", + )), } } #[derive(Serialize, Deserialize, Clone, Validate)] #[validate(context = RegisterContext::<'v_a>)] pub struct ValidatableRegistration { - #[validate( - length(min = 1), - custom(function = "unique_username", use_context) - )] + #[validate(length(min = 1), custom(function = "unique_username", use_context))] pub username: String, - #[validate( - email, - custom(function = "unique_email", use_context) - )] + #[validate(email, custom(function = "unique_email", use_context))] pub email: String, - #[validate(length(min = 10), must_match(other = "password_repeat", ))] + #[validate(length(min = 10), must_match(other = "password_repeat",))] pub password: String, pub password_repeat: String, } @@ -86,13 +78,16 @@ impl From for ValidatableRegistration { username: value.username, email: value.email, password: value.password, - password_repeat: value.password_repeat + password_repeat: value.password_repeat, } } } #[get("/token")] -pub async fn login(pool: web::Data, login_data: web::Json) -> Result { +pub async fn login( + pool: web::Data, + login_data: web::Json, +) -> Result { let data = login_data.into_inner(); if let Ok(Some(user)) = web::block(move || { @@ -102,35 +97,45 @@ pub async fn login(pool: web::Data, login_data: web::Json) -> Res .await? { let token = get_token(&user)?; - let response = Token{ jwt_token: Some(token) }; + let response = Token { + jwt_token: Some(token), + }; Ok(HttpResponse::Ok() .content_type(ContentType::json()) .body(serde_json::to_string(&response)?)) - } - else { - Err(ApiError{status: 401, message: "User doesn't exist or password doesn't match".to_string()}) + } else { + Err(ApiError { + status: 401, + message: "User doesn't exist or password doesn't match".to_string(), + }) } } #[post("/token")] pub async fn refresh(user: AuthUser) -> Result { let new_token = get_token(&user.0)?; - let response = Token{ jwt_token: Some(new_token) }; + let response = Token { + jwt_token: Some(new_token), + }; Ok(HttpResponse::Ok() .content_type(ContentType::json()) .body(serde_json::to_string(&response)?)) } #[post("/user")] -pub async fn register(pool: web::Data, register_data: web::Json) -> Result { +pub async fn register( + pool: web::Data, + register_data: web::Json, +) -> Result { web::block(move || -> Result<(), ApiError> { let validatable_registration: ValidatableRegistration = register_data.clone().into(); - validatable_registration.validate_with_args(&RegisterContext{pool: &pool})?; + validatable_registration.validate_with_args(&RegisterContext { pool: &pool })?; let register_request = register_data.into_inner().into(); let mut conn = pool.get_conn(); gamenight_database::register(&mut conn, register_request)?; Ok(()) - }).await??; + }) + .await??; Ok(HttpResponse::Ok()) } @@ -146,20 +151,42 @@ impl From for User { } #[get("/user")] -pub async fn get_user(pool: web::Data, _user: AuthUser, user_info: web::Json) -> Result { +pub async fn get_user( + pool: web::Data, + _user: AuthUser, + user_info: web::Json, +) -> Result { let mut conn = pool.get_conn(); - - let user = gamenight_database::user::get_user(&mut conn, Uuid::parse_str(&user_info.into_inner().user_id)?)?; - + + let user = gamenight_database::user::get_user( + &mut conn, + Uuid::parse_str(&user_info.into_inner().user_id)?, + )?; + Ok(HttpResponse::Ok() .content_type(ContentType::json()) .body(serde_json::to_string(&user)?)) } #[get("/user")] -pub async fn get_user_unauthenticated(_path: web::Path) -> Result { +pub async fn get_user_unauthenticated( + _path: web::Path, +) -> Result { Ok(HttpResponse::Forbidden()) } +#[get("/users")] +pub async fn get_users( + pool: web::Data, + _user: AuthUser, +) -> Result { + let mut conn = pool.get_conn(); + let users = gamenight_database::user::get_users(&mut conn)?; + let model: Vec = users.into_iter().map(Into::into).collect(); + + Ok(HttpResponse::Ok() + .content_type(ContentType::json()) + .body(serde_json::to_string(&model)?)) +} diff --git a/gamenight-api-client-rs/.openapi-generator/FILES b/gamenight-api-client-rs/.openapi-generator/FILES index eb7c8ea..a9ce83b 100644 --- a/gamenight-api-client-rs/.openapi-generator/FILES +++ b/gamenight-api-client-rs/.openapi-generator/FILES @@ -4,6 +4,8 @@ Cargo.toml README.md docs/AddGameRequestBody.md docs/AddGamenightRequestBody.md +docs/AddLocationRequestBody.md +docs/AuthorizeLocationRequestBody.md docs/DefaultApi.md docs/Failure.md docs/Game.md @@ -11,6 +13,8 @@ docs/GameId.md docs/Gamenight.md docs/GamenightId.md docs/GetGamenightRequestBody.md +docs/Location.md +docs/LocationId.md docs/Login.md docs/Participants.md docs/Registration.md @@ -25,12 +29,16 @@ src/apis/mod.rs src/lib.rs src/models/add_game_request_body.rs src/models/add_gamenight_request_body.rs +src/models/add_location_request_body.rs +src/models/authorize_location_request_body.rs src/models/failure.rs src/models/game.rs src/models/game_id.rs src/models/gamenight.rs src/models/gamenight_id.rs src/models/get_gamenight_request_body.rs +src/models/location.rs +src/models/location_id.rs src/models/login.rs src/models/mod.rs src/models/participants.rs diff --git a/gamenight-api-client-rs/.openapi-generator/VERSION b/gamenight-api-client-rs/.openapi-generator/VERSION index e465da4..6328c54 100644 --- a/gamenight-api-client-rs/.openapi-generator/VERSION +++ b/gamenight-api-client-rs/.openapi-generator/VERSION @@ -1 +1 @@ -7.14.0 +7.17.0 diff --git a/gamenight-api-client-rs/Cargo.toml b/gamenight-api-client-rs/Cargo.toml index d22886f..9373266 100644 --- a/gamenight-api-client-rs/Cargo.toml +++ b/gamenight-api-client-rs/Cargo.toml @@ -12,3 +12,8 @@ serde_json = "^1.0" serde_repr = "^0.1" url = "^2.5" reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } + +[features] +default = ["native-tls"] +native-tls = ["reqwest/native-tls"] +rustls-tls = ["reqwest/rustls-tls"] diff --git a/gamenight-api-client-rs/README.md b/gamenight-api-client-rs/README.md index b6b6097..d09cdd8 100644 --- a/gamenight-api-client-rs/README.md +++ b/gamenight-api-client-rs/README.md @@ -10,7 +10,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat - API version: 1.0 - Package version: 0.1.0 -- Generator version: 7.14.0 +- Generator version: 7.17.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` ## Installation @@ -27,6 +27,7 @@ All URIs are relative to *http://localhost:8080* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**authorized_location_user_ids_get**](docs/DefaultApi.md#authorized_location_user_ids_get) | **GET** /authorized_location_user_ids | *DefaultApi* | [**disown_post**](docs/DefaultApi.md#disown_post) | **POST** /disown | *DefaultApi* | [**game_get**](docs/DefaultApi.md#game_get) | **GET** /game | *DefaultApi* | [**game_post**](docs/DefaultApi.md#game_post) | **POST** /game | @@ -36,6 +37,10 @@ Class | Method | HTTP request | Description *DefaultApi* | [**get_token**](docs/DefaultApi.md#get_token) | **GET** /token | *DefaultApi* | [**join_post**](docs/DefaultApi.md#join_post) | **POST** /join | *DefaultApi* | [**leave_post**](docs/DefaultApi.md#leave_post) | **POST** /leave | +*DefaultApi* | [**location_authorize_post**](docs/DefaultApi.md#location_authorize_post) | **POST** /location_authorize | +*DefaultApi* | [**location_get**](docs/DefaultApi.md#location_get) | **GET** /location | +*DefaultApi* | [**location_post**](docs/DefaultApi.md#location_post) | **POST** /location | +*DefaultApi* | [**locations_get**](docs/DefaultApi.md#locations_get) | **GET** /locations | *DefaultApi* | [**own_post**](docs/DefaultApi.md#own_post) | **POST** /own | *DefaultApi* | [**owned_games_get**](docs/DefaultApi.md#owned_games_get) | **GET** /owned_games | *DefaultApi* | [**participants_get**](docs/DefaultApi.md#participants_get) | **GET** /participants | Get all participants for a gamenight @@ -44,18 +49,23 @@ Class | Method | HTTP request | Description *DefaultApi* | [**post_token**](docs/DefaultApi.md#post_token) | **POST** /token | *DefaultApi* | [**rename_game_post**](docs/DefaultApi.md#rename_game_post) | **POST** /rename_game | *DefaultApi* | [**user_get**](docs/DefaultApi.md#user_get) | **GET** /user | +*DefaultApi* | [**users_get**](docs/DefaultApi.md#users_get) | **GET** /users | ## Documentation For Models - [AddGameRequestBody](docs/AddGameRequestBody.md) - [AddGamenightRequestBody](docs/AddGamenightRequestBody.md) + - [AddLocationRequestBody](docs/AddLocationRequestBody.md) + - [AuthorizeLocationRequestBody](docs/AuthorizeLocationRequestBody.md) - [Failure](docs/Failure.md) - [Game](docs/Game.md) - [GameId](docs/GameId.md) - [Gamenight](docs/Gamenight.md) - [GamenightId](docs/GamenightId.md) - [GetGamenightRequestBody](docs/GetGamenightRequestBody.md) + - [Location](docs/Location.md) + - [LocationId](docs/LocationId.md) - [Login](docs/Login.md) - [Participants](docs/Participants.md) - [Registration](docs/Registration.md) diff --git a/gamenight-api-client-rs/docs/AddLocation.md b/gamenight-api-client-rs/docs/AddLocation.md new file mode 100644 index 0000000..9805da3 --- /dev/null +++ b/gamenight-api-client-rs/docs/AddLocation.md @@ -0,0 +1,13 @@ +# AddLocation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**address** | Option<**String**> | | [optional] +**note** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gamenight-api-client-rs/docs/AddLocationRequestBody.md b/gamenight-api-client-rs/docs/AddLocationRequestBody.md new file mode 100644 index 0000000..11a64da --- /dev/null +++ b/gamenight-api-client-rs/docs/AddLocationRequestBody.md @@ -0,0 +1,13 @@ +# AddLocationRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**address** | Option<**String**> | | [optional] +**note** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gamenight-api-client-rs/docs/AuthorizeLocationRequestBody.md b/gamenight-api-client-rs/docs/AuthorizeLocationRequestBody.md new file mode 100644 index 0000000..f84ea63 --- /dev/null +++ b/gamenight-api-client-rs/docs/AuthorizeLocationRequestBody.md @@ -0,0 +1,13 @@ +# AuthorizeLocationRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location_id** | **String** | | +**user_id** | **String** | | +**op** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gamenight-api-client-rs/docs/DefaultApi.md b/gamenight-api-client-rs/docs/DefaultApi.md index 250d4b2..bf96f58 100644 --- a/gamenight-api-client-rs/docs/DefaultApi.md +++ b/gamenight-api-client-rs/docs/DefaultApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://localhost:8080* Method | HTTP request | Description ------------- | ------------- | ------------- +[**authorized_location_user_ids_get**](DefaultApi.md#authorized_location_user_ids_get) | **GET** /authorized_location_user_ids | [**disown_post**](DefaultApi.md#disown_post) | **POST** /disown | [**game_get**](DefaultApi.md#game_get) | **GET** /game | [**game_post**](DefaultApi.md#game_post) | **POST** /game | @@ -13,6 +14,10 @@ Method | HTTP request | Description [**get_token**](DefaultApi.md#get_token) | **GET** /token | [**join_post**](DefaultApi.md#join_post) | **POST** /join | [**leave_post**](DefaultApi.md#leave_post) | **POST** /leave | +[**location_authorize_post**](DefaultApi.md#location_authorize_post) | **POST** /location_authorize | +[**location_get**](DefaultApi.md#location_get) | **GET** /location | +[**location_post**](DefaultApi.md#location_post) | **POST** /location | +[**locations_get**](DefaultApi.md#locations_get) | **GET** /locations | [**own_post**](DefaultApi.md#own_post) | **POST** /own | [**owned_games_get**](DefaultApi.md#owned_games_get) | **GET** /owned_games | [**participants_get**](DefaultApi.md#participants_get) | **GET** /participants | Get all participants for a gamenight @@ -21,9 +26,38 @@ Method | HTTP request | Description [**post_token**](DefaultApi.md#post_token) | **POST** /token | [**rename_game_post**](DefaultApi.md#rename_game_post) | **POST** /rename_game | [**user_get**](DefaultApi.md#user_get) | **GET** /user | +[**users_get**](DefaultApi.md#users_get) | **GET** /users | +## authorized_location_user_ids_get + +> Vec authorized_location_user_ids_get(location_id) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**location_id** | Option<[**LocationId**](LocationId.md)> | | | + +### Return type + +[**Vec**](UserId.md) + +### Authorization + +[JWT-Auth](../README.md#JWT-Auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## disown_post > disown_post(game_id) @@ -274,6 +308,115 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## location_authorize_post + +> location_authorize_post(authorize_location_request_body) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**authorize_location_request_body** | Option<[**AuthorizeLocationRequestBody**](AuthorizeLocationRequestBody.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +[JWT-Auth](../README.md#JWT-Auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## location_get + +> models::Location location_get(location_id) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**location_id** | Option<[**LocationId**](LocationId.md)> | | | + +### Return type + +[**models::Location**](Location.md) + +### Authorization + +[JWT-Auth](../README.md#JWT-Auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## location_post + +> models::LocationId location_post(add_location_request_body) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**add_location_request_body** | Option<[**AddLocationRequestBody**](AddLocationRequestBody.md)> | | | + +### Return type + +[**models::LocationId**](LocationId.md) + +### Authorization + +[JWT-Auth](../README.md#JWT-Auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## locations_get + +> Vec locations_get() + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec**](Location.md) + +### Authorization + +[JWT-Auth](../README.md#JWT-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## own_post > own_post(game_id) @@ -504,3 +647,28 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## users_get + +> Vec users_get() + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec**](User.md) + +### Authorization + +[JWT-Auth](../README.md#JWT-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/gamenight-api-client-rs/docs/Location.md b/gamenight-api-client-rs/docs/Location.md new file mode 100644 index 0000000..e08a3c4 --- /dev/null +++ b/gamenight-api-client-rs/docs/Location.md @@ -0,0 +1,14 @@ +# Location + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | | +**address** | Option<**String**> | | [optional] +**note** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gamenight-api-client-rs/docs/LocationId.md b/gamenight-api-client-rs/docs/LocationId.md new file mode 100644 index 0000000..84cb4ed --- /dev/null +++ b/gamenight-api-client-rs/docs/LocationId.md @@ -0,0 +1,11 @@ +# LocationId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location_id** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gamenight-api-client-rs/src/apis/default_api.rs b/gamenight-api-client-rs/src/apis/default_api.rs index d14550f..1fa6ff7 100644 --- a/gamenight-api-client-rs/src/apis/default_api.rs +++ b/gamenight-api-client-rs/src/apis/default_api.rs @@ -15,6 +15,15 @@ use crate::{apis::ResponseContent, models}; use super::{Error, configuration, ContentType}; +/// struct for typed errors of method [`authorized_location_user_ids_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthorizedLocationUserIdsGetError { + Status401(models::Failure), + Status422(models::Failure), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`disown_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -95,6 +104,42 @@ pub enum LeavePostError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`location_authorize_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LocationAuthorizePostError { + Status401(models::Failure), + Status422(models::Failure), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`location_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LocationGetError { + Status401(models::Failure), + Status422(models::Failure), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`location_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LocationPostError { + Status401(models::Failure), + Status422(models::Failure), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`locations_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LocationsGetError { + Status401(models::Failure), + Status422(models::Failure), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`own_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -166,10 +211,59 @@ pub enum UserGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`users_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UsersGetError { + Status400(models::Failure), + Status401(models::Failure), + UnknownValue(serde_json::Value), +} + + +pub async fn authorized_location_user_ids_get(configuration: &configuration::Configuration, location_id: Option) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_location_id = location_id; + + let uri_str = format!("{}/authorized_location_user_ids", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_location_id); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UserId>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UserId>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} pub async fn disown_post(configuration: &configuration::Configuration, game_id: Option) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions - let p_game_id = game_id; + let p_body_game_id = game_id; let uri_str = format!("{}/disown", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -180,7 +274,7 @@ pub async fn disown_post(configuration: &configuration::Configuration, game_id: if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_game_id); + req_builder = req_builder.json(&p_body_game_id); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -198,7 +292,7 @@ pub async fn disown_post(configuration: &configuration::Configuration, game_id: pub async fn game_get(configuration: &configuration::Configuration, game_id: Option) -> Result> { // add a prefix to parameters to efficiently prevent name collisions - let p_game_id = game_id; + let p_body_game_id = game_id; let uri_str = format!("{}/game", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -209,7 +303,7 @@ pub async fn game_get(configuration: &configuration::Configuration, game_id: Opt if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_game_id); + req_builder = req_builder.json(&p_body_game_id); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -238,7 +332,7 @@ pub async fn game_get(configuration: &configuration::Configuration, game_id: Opt pub async fn game_post(configuration: &configuration::Configuration, add_game_request_body: Option) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions - let p_add_game_request_body = add_game_request_body; + let p_body_add_game_request_body = add_game_request_body; let uri_str = format!("{}/game", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -249,7 +343,7 @@ pub async fn game_post(configuration: &configuration::Configuration, add_game_re if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_add_game_request_body); + req_builder = req_builder.json(&p_body_add_game_request_body); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -304,7 +398,7 @@ pub async fn games_get(configuration: &configuration::Configuration, ) -> Result pub async fn get_gamenight(configuration: &configuration::Configuration, get_gamenight_request_body: Option) -> Result> { // add a prefix to parameters to efficiently prevent name collisions - let p_get_gamenight_request_body = get_gamenight_request_body; + let p_body_get_gamenight_request_body = get_gamenight_request_body; let uri_str = format!("{}/gamenight", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -315,7 +409,7 @@ pub async fn get_gamenight(configuration: &configuration::Configuration, get_gam if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_get_gamenight_request_body); + req_builder = req_builder.json(&p_body_get_gamenight_request_body); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -383,7 +477,7 @@ pub async fn get_gamenights(configuration: &configuration::Configuration, ) -> R /// Submit your credentials to get a JWT-token to use with the rest of the api. pub async fn get_token(configuration: &configuration::Configuration, login: Option) -> Result> { // add a prefix to parameters to efficiently prevent name collisions - let p_login = login; + let p_body_login = login; let uri_str = format!("{}/token", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -391,7 +485,7 @@ pub async fn get_token(configuration: &configuration::Configuration, login: Opti if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - req_builder = req_builder.json(&p_login); + req_builder = req_builder.json(&p_body_login); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -420,7 +514,7 @@ pub async fn get_token(configuration: &configuration::Configuration, login: Opti pub async fn join_post(configuration: &configuration::Configuration, gamenight_id: Option) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions - let p_gamenight_id = gamenight_id; + let p_body_gamenight_id = gamenight_id; let uri_str = format!("{}/join", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -431,7 +525,7 @@ pub async fn join_post(configuration: &configuration::Configuration, gamenight_i if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_gamenight_id); + req_builder = req_builder.json(&p_body_gamenight_id); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -449,7 +543,7 @@ pub async fn join_post(configuration: &configuration::Configuration, gamenight_i pub async fn leave_post(configuration: &configuration::Configuration, gamenight_id: Option) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions - let p_gamenight_id = gamenight_id; + let p_body_gamenight_id = gamenight_id; let uri_str = format!("{}/leave", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -460,7 +554,7 @@ pub async fn leave_post(configuration: &configuration::Configuration, gamenight_ if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_gamenight_id); + req_builder = req_builder.json(&p_body_gamenight_id); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -476,9 +570,155 @@ pub async fn leave_post(configuration: &configuration::Configuration, gamenight_ } } +pub async fn location_authorize_post(configuration: &configuration::Configuration, authorize_location_request_body: Option) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_authorize_location_request_body = authorize_location_request_body; + + let uri_str = format!("{}/location_authorize", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authorize_location_request_body); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn location_get(configuration: &configuration::Configuration, location_id: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_location_id = location_id; + + let uri_str = format!("{}/location", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_location_id); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Location`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Location`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn location_post(configuration: &configuration::Configuration, add_location_request_body: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_add_location_request_body = add_location_request_body; + + let uri_str = format!("{}/location", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_add_location_request_body); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LocationId`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LocationId`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn locations_get(configuration: &configuration::Configuration, ) -> Result, Error> { + + let uri_str = format!("{}/locations", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Location>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Location>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub async fn own_post(configuration: &configuration::Configuration, game_id: Option) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions - let p_game_id = game_id; + let p_body_game_id = game_id; let uri_str = format!("{}/own", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -489,7 +729,7 @@ pub async fn own_post(configuration: &configuration::Configuration, game_id: Opt if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_game_id); + req_builder = req_builder.json(&p_body_game_id); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -507,7 +747,7 @@ pub async fn own_post(configuration: &configuration::Configuration, game_id: Opt pub async fn owned_games_get(configuration: &configuration::Configuration, user_id: Option) -> Result, Error> { // add a prefix to parameters to efficiently prevent name collisions - let p_user_id = user_id; + let p_body_user_id = user_id; let uri_str = format!("{}/owned_games", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -518,7 +758,7 @@ pub async fn owned_games_get(configuration: &configuration::Configuration, user_ if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_user_id); + req_builder = req_builder.json(&p_body_user_id); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -548,7 +788,7 @@ pub async fn owned_games_get(configuration: &configuration::Configuration, user_ /// Retrieve the participants of a single gamenight by id. pub async fn participants_get(configuration: &configuration::Configuration, gamenight_id: Option) -> Result> { // add a prefix to parameters to efficiently prevent name collisions - let p_gamenight_id = gamenight_id; + let p_body_gamenight_id = gamenight_id; let uri_str = format!("{}/participants", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -559,7 +799,7 @@ pub async fn participants_get(configuration: &configuration::Configuration, game if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_gamenight_id); + req_builder = req_builder.json(&p_body_gamenight_id); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -589,7 +829,7 @@ pub async fn participants_get(configuration: &configuration::Configuration, game /// Add a gamenight by providing a name and a date, only available when providing an JWT token. pub async fn post_gamenight(configuration: &configuration::Configuration, add_gamenight_request_body: Option) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions - let p_add_gamenight_request_body = add_gamenight_request_body; + let p_body_add_gamenight_request_body = add_gamenight_request_body; let uri_str = format!("{}/gamenight", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -600,7 +840,7 @@ pub async fn post_gamenight(configuration: &configuration::Configuration, add_ga if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_add_gamenight_request_body); + req_builder = req_builder.json(&p_body_add_gamenight_request_body); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -619,7 +859,7 @@ pub async fn post_gamenight(configuration: &configuration::Configuration, add_ga /// Create a new user given a registration token and user information, username and email must be unique, and password and password_repeat must match. pub async fn post_register(configuration: &configuration::Configuration, registration: Option) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions - let p_registration = registration; + let p_body_registration = registration; let uri_str = format!("{}/user", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -630,7 +870,7 @@ pub async fn post_register(configuration: &configuration::Configuration, registr if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_registration); + req_builder = req_builder.json(&p_body_registration); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -686,7 +926,7 @@ pub async fn post_token(configuration: &configuration::Configuration, ) -> Resul pub async fn rename_game_post(configuration: &configuration::Configuration, rename_game_request_body: Option) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions - let p_rename_game_request_body = rename_game_request_body; + let p_body_rename_game_request_body = rename_game_request_body; let uri_str = format!("{}/rename_game", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -697,7 +937,7 @@ pub async fn rename_game_post(configuration: &configuration::Configuration, rena if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_rename_game_request_body); + req_builder = req_builder.json(&p_body_rename_game_request_body); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -716,7 +956,7 @@ pub async fn rename_game_post(configuration: &configuration::Configuration, rena /// Get a user from primary id pub async fn user_get(configuration: &configuration::Configuration, user_id: Option) -> Result> { // add a prefix to parameters to efficiently prevent name collisions - let p_user_id = user_id; + let p_body_user_id = user_id; let uri_str = format!("{}/user", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -727,7 +967,7 @@ pub async fn user_get(configuration: &configuration::Configuration, user_id: Opt if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); }; - req_builder = req_builder.json(&p_user_id); + req_builder = req_builder.json(&p_body_user_id); let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -754,3 +994,40 @@ pub async fn user_get(configuration: &configuration::Configuration, user_id: Opt } } +pub async fn users_get(configuration: &configuration::Configuration, ) -> Result, Error> { + + let uri_str = format!("{}/users", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/gamenight-api-client-rs/src/models/add_location.rs b/gamenight-api-client-rs/src/models/add_location.rs new file mode 100644 index 0000000..855d230 --- /dev/null +++ b/gamenight-api-client-rs/src/models/add_location.rs @@ -0,0 +1,33 @@ +/* + * Gamenight + * + * Api specifaction for a Gamenight server + * + * The version of the OpenAPI document: 1.0 + * Contact: dennis@brentj.es + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AddLocation { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "address", skip_serializing_if = "Option::is_none")] + pub address: Option, + #[serde(rename = "note", skip_serializing_if = "Option::is_none")] + pub note: Option, +} + +impl AddLocation { + pub fn new(name: String) -> AddLocation { + AddLocation { + name, + address: None, + note: None, + } + } +} + diff --git a/gamenight-api-client-rs/src/models/add_location_request_body.rs b/gamenight-api-client-rs/src/models/add_location_request_body.rs new file mode 100644 index 0000000..582b14e --- /dev/null +++ b/gamenight-api-client-rs/src/models/add_location_request_body.rs @@ -0,0 +1,33 @@ +/* + * Gamenight + * + * Api specifaction for a Gamenight server + * + * The version of the OpenAPI document: 1.0 + * Contact: dennis@brentj.es + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AddLocationRequestBody { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "address", skip_serializing_if = "Option::is_none")] + pub address: Option, + #[serde(rename = "note", skip_serializing_if = "Option::is_none")] + pub note: Option, +} + +impl AddLocationRequestBody { + pub fn new(name: String) -> AddLocationRequestBody { + AddLocationRequestBody { + name, + address: None, + note: None, + } + } +} + diff --git a/gamenight-api-client-rs/src/models/authorize_location_request_body.rs b/gamenight-api-client-rs/src/models/authorize_location_request_body.rs new file mode 100644 index 0000000..52161a4 --- /dev/null +++ b/gamenight-api-client-rs/src/models/authorize_location_request_body.rs @@ -0,0 +1,47 @@ +/* + * Gamenight + * + * Api specifaction for a Gamenight server + * + * The version of the OpenAPI document: 1.0 + * Contact: dennis@brentj.es + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthorizeLocationRequestBody { + #[serde(rename = "location_id")] + pub location_id: String, + #[serde(rename = "user_id")] + pub user_id: String, + #[serde(rename = "op")] + pub op: Op, +} + +impl AuthorizeLocationRequestBody { + pub fn new(location_id: String, user_id: String, op: Op) -> AuthorizeLocationRequestBody { + AuthorizeLocationRequestBody { + location_id, + user_id, + op, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Op { + #[serde(rename = "grant")] + Grant, + #[serde(rename = "revoke")] + Revoke, +} + +impl Default for Op { + fn default() -> Op { + Self::Grant + } +} + diff --git a/gamenight-api-client-rs/src/models/location.rs b/gamenight-api-client-rs/src/models/location.rs new file mode 100644 index 0000000..db4efb8 --- /dev/null +++ b/gamenight-api-client-rs/src/models/location.rs @@ -0,0 +1,36 @@ +/* + * Gamenight + * + * Api specifaction for a Gamenight server + * + * The version of the OpenAPI document: 1.0 + * Contact: dennis@brentj.es + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Location { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "address", skip_serializing_if = "Option::is_none")] + pub address: Option, + #[serde(rename = "note", skip_serializing_if = "Option::is_none")] + pub note: Option, +} + +impl Location { + pub fn new(id: String, name: String) -> Location { + Location { + id, + name, + address: None, + note: None, + } + } +} + diff --git a/gamenight-api-client-rs/src/models/location_id.rs b/gamenight-api-client-rs/src/models/location_id.rs new file mode 100644 index 0000000..0bacc4e --- /dev/null +++ b/gamenight-api-client-rs/src/models/location_id.rs @@ -0,0 +1,27 @@ +/* + * Gamenight + * + * Api specifaction for a Gamenight server + * + * The version of the OpenAPI document: 1.0 + * Contact: dennis@brentj.es + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LocationId { + #[serde(rename = "location_id")] + pub location_id: String, +} + +impl LocationId { + pub fn new(location_id: String) -> LocationId { + LocationId { + location_id, + } + } +} + diff --git a/gamenight-api-client-rs/src/models/mod.rs b/gamenight-api-client-rs/src/models/mod.rs index e41f6a1..9747971 100644 --- a/gamenight-api-client-rs/src/models/mod.rs +++ b/gamenight-api-client-rs/src/models/mod.rs @@ -2,6 +2,10 @@ pub mod add_game_request_body; pub use self::add_game_request_body::AddGameRequestBody; pub mod add_gamenight_request_body; pub use self::add_gamenight_request_body::AddGamenightRequestBody; +pub mod add_location_request_body; +pub use self::add_location_request_body::AddLocationRequestBody; +pub mod authorize_location_request_body; +pub use self::authorize_location_request_body::AuthorizeLocationRequestBody; pub mod failure; pub use self::failure::Failure; pub mod game; @@ -14,6 +18,10 @@ pub mod gamenight_id; pub use self::gamenight_id::GamenightId; pub mod get_gamenight_request_body; pub use self::get_gamenight_request_body::GetGamenightRequestBody; +pub mod location; +pub use self::location::Location; +pub mod location_id; +pub use self::location_id::LocationId; pub mod login; pub use self::login::Login; pub mod participants; diff --git a/gamenight-cli/Cargo.lock b/gamenight-cli/Cargo.lock index cd5c3d5..b3dfe36 100644 --- a/gamenight-cli/Cargo.lock +++ b/gamenight-cli/Cargo.lock @@ -2,27 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -34,36 +13,27 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.88" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "backtrace" -version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - [[package]] name = "base64" version = "0.22.1" @@ -78,15 +48,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byteorder" @@ -96,32 +66,32 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "cc" -version = "1.2.29" +version = "1.2.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" +checksum = "9f50d563227a1c37cc0a263f64eca3334388c01c5e4c4861a9def205c614383c" dependencies = [ + "find-msvc-tools", "shlex", ] [[package]] name = "cfg-if" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", @@ -138,6 +108,16 @@ dependencies = [ "cc", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -171,9 +151,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.4.0" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" dependencies = [ "powerfmt", ] @@ -191,21 +171,52 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] -name = "fnv" -version = "1.0.7" +name = "errno" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "find-msvc-tools" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -355,36 +366,29 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "wasip2", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "http" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ "bytes", - "fnv", "itoa", ] @@ -419,28 +423,46 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "hyper" -version = "1.6.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", + "futures-core", "http", "http-body", "httparse", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", ] [[package]] -name = "hyper-util" -version = "0.1.15" +name = "hyper-tls" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" dependencies = [ "base64", "bytes", @@ -462,9 +484,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.63" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -486,9 +508,9 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", "potential_utf", @@ -499,9 +521,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", @@ -512,11 +534,10 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", @@ -527,42 +548,38 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", - "potential_utf", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", "icu_locale_core", - "stable_deref_trait", - "tinystr", "writeable", "yoke", "zerofrom", @@ -572,9 +589,9 @@ dependencies = [ [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -597,7 +614,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.10.0", "chrono", "crossterm", "dyn-clone", @@ -605,21 +622,11 @@ dependencies = [ "fxhash", "newline-converter", "once_cell", + "tempfile", "unicode-segmentation", "unicode-width", ] -[[package]] -name = "io-uring" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" -dependencies = [ - "bitflags 2.9.1", - "cfg-if", - "libc", -] - [[package]] name = "ipnet" version = "2.11.0" @@ -628,9 +635,9 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" dependencies = [ "memchr", "serde", @@ -638,15 +645,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010" [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -669,37 +676,42 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.174" +version = "0.2.178" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "lock_api" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.27" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "memchr" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "mime" @@ -717,15 +729,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", -] - [[package]] name = "mio" version = "0.8.11" @@ -734,19 +737,36 @@ checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", - "wasi 0.11.1+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] [[package]] name = "mio" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] [[package]] @@ -792,15 +812,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -808,10 +819,54 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] -name = "parking_lot" -version = "0.12.4" +name = "openssl" +version = "0.10.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" +dependencies = [ + "bitflags 2.10.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -819,32 +874,32 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.11" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-link", ] [[package]] name = "pem" -version = "3.0.5" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" +checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" dependencies = [ "base64", - "serde", + "serde_core", ] [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project-lite" @@ -859,10 +914,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "potential_utf" -version = "0.1.2" +name = "pkg-config" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" dependencies = [ "zerovec", ] @@ -875,18 +936,18 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ "proc-macro2", ] @@ -899,18 +960,18 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "redox_syscall" -version = "0.5.13" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.10.0", ] [[package]] name = "reqwest" -version = "0.12.22" +version = "0.12.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" +checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" dependencies = [ "base64", "bytes", @@ -920,17 +981,21 @@ dependencies = [ "http-body", "http-body-util", "hyper", + "hyper-tls", "hyper-util", "js-sys", "log", "mime_guess", + "native-tls", "percent-encoding", "pin-project-lite", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "tokio", + "tokio-native-tls", "tower", "tower-http", "tower-service", @@ -955,22 +1020,47 @@ dependencies = [ ] [[package]] -name = "rustc-demangle" -version = "0.1.25" +name = "rustix" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +dependencies = [ + "bitflags 2.10.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-pki-types" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" +dependencies = [ + "zeroize", +] [[package]] name = "rustversion" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "62049b2877bf12821e8f9ad256ee38fdc31db7387ec2d3b3f403024de2034aea" + +[[package]] +name = "schannel" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +dependencies = [ + "windows-sys 0.61.2", +] [[package]] name = "scopeguard" @@ -979,19 +1069,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "serde" -version = "1.0.219" +name = "security-framework" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.10.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -1000,14 +1123,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "217ca874ae0207aac254aa02c957ded05585a90892cc8d87f9e5fa49669dadd8" dependencies = [ "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] @@ -1051,9 +1175,9 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc" dependencies = [ "libc", "mio 0.8.11", @@ -1062,9 +1186,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.5" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" dependencies = [ "libc", ] @@ -1083,9 +1207,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "smallvec" @@ -1095,25 +1219,25 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" -version = "0.5.10" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "syn" -version = "2.0.104" +version = "2.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" dependencies = [ "proc-macro2", "quote", @@ -1141,19 +1265,32 @@ dependencies = [ ] [[package]] -name = "thiserror" -version = "2.0.12" +name = "tempfile" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +dependencies = [ + "fastrand", + "getrandom 0.3.4", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.12" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", @@ -1171,9 +1308,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.41" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", "itoa", @@ -1186,15 +1323,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" [[package]] name = "time-macros" -version = "0.2.22" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" dependencies = [ "num-conv", "time-core", @@ -1202,9 +1339,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" dependencies = [ "displaydoc", "zerovec", @@ -1212,35 +1349,42 @@ dependencies = [ [[package]] name = "tokio" -version = "1.46.1" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ - "backtrace", "bytes", - "io-uring", "libc", - "mio 1.0.4", + "mio 1.1.1", "parking_lot", "pin-project-lite", "signal-hook-registry", - "slab", "socket2", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tower" version = "0.5.2" @@ -1258,11 +1402,11 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.10.0", "bytes", "futures-util", "http", @@ -1288,9 +1432,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "pin-project-lite", "tracing-core", @@ -1298,9 +1442,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.34" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", ] @@ -1319,9 +1463,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-segmentation" @@ -1343,13 +1487,14 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -1360,16 +1505,22 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.17.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", "js-sys", - "serde", + "serde_core", "wasm-bindgen", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "want" version = "0.3.1" @@ -1386,45 +1537,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" +name = "wasip2" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen-rt", + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", "js-sys", @@ -1435,9 +1573,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1445,31 +1583,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn", - "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", @@ -1499,9 +1637,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.61.2" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", @@ -1512,9 +1650,9 @@ dependencies = [ [[package]] name = "windows-implement" -version = "0.60.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", @@ -1523,9 +1661,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.59.1" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", @@ -1534,24 +1672,24 @@ dependencies = [ [[package]] name = "windows-link" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-result" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ "windows-link", ] [[package]] name = "windows-strings" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ "windows-link", ] @@ -1576,11 +1714,20 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", ] [[package]] @@ -1607,13 +1754,30 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -1626,6 +1790,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -1638,6 +1808,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -1650,12 +1826,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -1668,6 +1856,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -1680,6 +1874,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -1692,6 +1892,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -1705,27 +1911,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "windows_x86_64_msvc" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags 2.9.1", -] +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "yoke" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ - "serde", "stable_deref_trait", "yoke-derive", "zerofrom", @@ -1733,9 +1941,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", @@ -1765,10 +1973,16 @@ dependencies = [ ] [[package]] -name = "zerotrie" -version = "0.2.2" +name = "zeroize" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" dependencies = [ "displaydoc", "yoke", @@ -1777,9 +1991,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" dependencies = [ "yoke", "zerofrom", @@ -1788,9 +2002,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", diff --git a/gamenight-cli/Cargo.toml b/gamenight-cli/Cargo.toml index 793a285..953f815 100644 --- a/gamenight-cli/Cargo.toml +++ b/gamenight-cli/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] gamenight-api-client-rs = { path = "../gamenight-api-client-rs" } tokio = { version = "1", features = ["full"] } -inquire = { version = "0.7.5", features = ["date"] } +inquire = { version = "0.7.5", features = ["date", "editor"] } async-trait = "0.1" dyn-clone = "1.0" chrono = "0.4" diff --git a/gamenight-cli/src/domain/config.rs b/gamenight-cli/src/domain/config.rs index 83e9b3f..4aa3597 100644 --- a/gamenight-cli/src/domain/config.rs +++ b/gamenight-cli/src/domain/config.rs @@ -42,6 +42,9 @@ pub struct Config { #[serde(skip_serializing_if = "Option::is_none")] #[serde(default)] pub last_instance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default)] + pub editor: Option, } impl Config { @@ -57,7 +60,8 @@ impl Config { pub fn new() -> Config { Config { instances: vec![], - last_instance: None + last_instance: None, + editor: None } } diff --git a/gamenight-cli/src/domain/location.rs b/gamenight-cli/src/domain/location.rs new file mode 100644 index 0000000..808fb41 --- /dev/null +++ b/gamenight-cli/src/domain/location.rs @@ -0,0 +1,31 @@ +use std::fmt::Display; + +use gamenight_api_client_rs::models; +use uuid::Uuid; + +#[derive(Clone)] +pub struct Location { + pub id: Uuid, + pub name: String, + pub address: Option, + pub note: Option, +} + +impl From for Location { + fn from(location: models::Location) -> Self { + Self { + id: Uuid::parse_str(&location.id).unwrap(), + name: location.name, + address: location.address, + note: location.note + } + } +} + +impl Display for Location { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, r#"name: {} +address: {} +note: {}"#, &self.name, & as Clone>::clone(&self.address).unwrap_or_default(), & as Clone>::clone(&self.note).unwrap_or_default()) + } +} \ No newline at end of file diff --git a/gamenight-cli/src/domain/mod.rs b/gamenight-cli/src/domain/mod.rs index 8ba9434..af54e9e 100644 --- a/gamenight-cli/src/domain/mod.rs +++ b/gamenight-cli/src/domain/mod.rs @@ -3,4 +3,5 @@ pub mod user; pub mod config; pub mod participants; pub mod game; -pub mod owned_games; \ No newline at end of file +pub mod owned_games; +pub mod location; \ No newline at end of file diff --git a/gamenight-cli/src/flows/add_location.rs b/gamenight-cli/src/flows/add_location.rs new file mode 100644 index 0000000..9c0e5a3 --- /dev/null +++ b/gamenight-cli/src/flows/add_location.rs @@ -0,0 +1,65 @@ +use std::{ffi::OsStr, fmt::Display}; + +use async_trait::async_trait; +use gamenight_api_client_rs::{apis::default_api::{location_authorize_post, location_post}, models::{authorize_location_request_body::Op::Grant, AddLocationRequestBody, AuthorizeLocationRequestBody}}; +use inquire::{Editor, Text}; + + +use super::*; + + +#[derive(Clone)] +pub struct AddLocation { +} + +impl AddLocation { + pub fn new() -> Self { + Self {} + } +} + +#[async_trait] +impl<'a> Flow<'a> for AddLocation { + async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> { + if let Some(name) = Text::new("What is the name of the location you want to add?").prompt_skippable()? { + + let address; + let note; + { + address = Text::new("Optional: What is the address?").prompt_skippable()?; + + let mut editor_prompt = Editor::new("What is the name of the location you want to add?"); + + let editor_command; + if let Some(editor) = &state.gamenight_configuration.editor { + editor_command = editor.clone(); + editor_prompt = editor_prompt.with_editor_command(OsStr::new(&editor_command)) + } + note = editor_prompt.prompt_skippable()?; + } + + let add_location_request = AddLocationRequestBody { + name, + address, + note + }; + + let location_id = location_post(&state.api_configuration, Some(add_location_request)).await?; + + let add_authorize_request = AuthorizeLocationRequestBody { + location_id: location_id.location_id.to_string(), + user_id: state.get_user_id()?.to_string(), + op: Grant + }; + + location_authorize_post(&state.api_configuration, Some(add_authorize_request)).await?; + } + Ok((FlowOutcome::Cancelled, state)) + } +} + +impl Display for AddLocation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Add Location") + } +} \ No newline at end of file diff --git a/gamenight-cli/src/flows/gamenight_menu.rs b/gamenight-cli/src/flows/gamenight_menu.rs index 194593a..8324a51 100644 --- a/gamenight-cli/src/flows/gamenight_menu.rs +++ b/gamenight-cli/src/flows/gamenight_menu.rs @@ -1,7 +1,7 @@ use inquire::{ui::RenderConfig, Select}; -use crate::flows::{add_gamenight::AddGamenight, exit::Exit, games::Games, list_gamenights::ListGamenights}; +use crate::flows::{add_gamenight::AddGamenight, exit::Exit, games::Games, list_gamenights::ListGamenights, locations::Locations}; use super::*; @@ -27,6 +27,7 @@ impl<'a> Flow<'a> for GamenightMenu { Box::new(ListGamenights::new()), Box::new(AddGamenight::new()), Box::new(Games::new()), + Box::new(Locations::new()), Box::new(Exit::new()) ]; diff --git a/gamenight-cli/src/flows/list_locations.rs b/gamenight-cli/src/flows/list_locations.rs new file mode 100644 index 0000000..020d51f --- /dev/null +++ b/gamenight-cli/src/flows/list_locations.rs @@ -0,0 +1,49 @@ +use std::fmt::Display; + +use async_trait::async_trait; +use gamenight_api_client_rs::apis::default_api::locations_get; +use inquire::{ui::RenderConfig, Select}; + +use crate::flows::{exit::Exit, view_location::ViewLocation}; + +use super::*; + + +#[derive(Clone)] +pub struct ListLocations { +} + +impl ListLocations { + pub fn new() -> Self { + Self {} + } +} + +#[async_trait] +impl<'a> Flow<'a> for ListLocations { + async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> { + let locations = locations_get(&state.api_configuration).await?; + + let mut flows = locations.into_iter().map(|location| -> Box { + Box::new(ViewLocation::new(location.into())) + }).collect::>>(); + + flows.push(Box::new(Exit::new())); + + let choice = Select::new("What would you like to do?", flows) + .with_help_message("Select the action you want to take or quit the program") + .with_render_config(RenderConfig { + option_index_prefix: inquire::ui::IndexPrefix::Simple, + ..Default::default() + }) + .prompt_skippable()?; + + self.continue_choice(state, &choice).await + } +} + +impl Display for ListLocations { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "List all locations") + } +} \ No newline at end of file diff --git a/gamenight-cli/src/flows/location_authorize.rs b/gamenight-cli/src/flows/location_authorize.rs new file mode 100644 index 0000000..f230d40 --- /dev/null +++ b/gamenight-cli/src/flows/location_authorize.rs @@ -0,0 +1,101 @@ +use std::fmt::Display; + +use async_trait::async_trait; +use gamenight_api_client_rs::{apis::default_api::{self, authorized_location_user_ids_get, users_get}, models::{AuthorizeLocationRequestBody, LocationId, User}}; +use inquire::MultiSelect; +use uuid::Uuid; + +use crate::flows::FlowError; + +use super::{Flow, FlowOutcome, FlowResult, GamenightState}; + +#[derive(Clone)] +pub struct LocationAuthorize { + location_id: Uuid +} + +impl LocationAuthorize { + pub fn new(location_id: Uuid) -> Self { + Self { + location_id + } + } +} + +struct AuthorizeMultiSelectStruct<'a> { + id: Uuid, + username: &'a String +} + +impl<'a> Display for AuthorizeMultiSelectStruct<'a> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.username) + } +} + +impl<'a> TryFrom<&'a User> for AuthorizeMultiSelectStruct<'a> { + type Error = FlowError; + + fn try_from(value: &'a User) -> Result { + Ok(AuthorizeMultiSelectStruct{ + id: Uuid::parse_str(&value.id)?, + username: &value.username + }) + } +} + +#[async_trait] +impl<'a> Flow<'a> for LocationAuthorize { + async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> { + let users = users_get(&state.api_configuration).await?; + let location_id = LocationId { + location_id: self.location_id.to_string() + }; + let authorized_user_ids = authorized_location_user_ids_get(&state.api_configuration, Some(location_id)).await?; + let authorized_user_ids : Vec = authorized_user_ids.into_iter().map(|x| x.user_id).collect(); + + let options: Vec = users.iter().map(|x| {x.try_into()}).collect::, FlowError>>()?; + + let (authorized_indices, authorized_users) : &(Vec, Vec<&User>) = &users.iter().enumerate().filter(|t| { + authorized_user_ids.contains(&t.1.id) + }).unzip(); + + let selections = MultiSelect::new("Which users should be able to host gamenights in this location?", options) + .with_default(&authorized_indices[..]) + .prompt_skippable()?; + + if let Some(selections) = &selections { + for selection in selections { + if authorized_users.iter().find(|x| {x.id == selection.id.to_string()}).is_none() { + default_api::location_authorize_post(&state.api_configuration, Some( + AuthorizeLocationRequestBody { + location_id: self.location_id.to_string(), + user_id: selection.id.to_string(), + op: gamenight_api_client_rs::models::authorize_location_request_body::Op::Grant + } + )).await? + } + } + for authorized_user in authorized_users { + if selections.iter().find(|x| {x.id.to_string() == authorized_user.id}).is_none() { + default_api::location_authorize_post(&state.api_configuration, Some( + AuthorizeLocationRequestBody { + location_id: self.location_id.to_string(), + user_id: authorized_user.id.to_string(), + op: gamenight_api_client_rs::models::authorize_location_request_body::Op::Revoke + } + )).await? + } + } + } + + clear_screen::clear(); + Ok((FlowOutcome::Successful, state)) + } +} + +impl Display for LocationAuthorize { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Authorize users for location") + } +} \ No newline at end of file diff --git a/gamenight-cli/src/flows/locations.rs b/gamenight-cli/src/flows/locations.rs new file mode 100644 index 0000000..e69577b --- /dev/null +++ b/gamenight-cli/src/flows/locations.rs @@ -0,0 +1,46 @@ +use std::fmt::Display; + +use async_trait::async_trait; +use inquire::{ui::RenderConfig, Select}; + +use crate::flows::{add_location::AddLocation, exit::Exit, list_locations::ListLocations}; + +use super::*; + + +#[derive(Clone)] +pub struct Locations { +} + +impl Locations { + pub fn new() -> Self { + Self {} + } +} + +#[async_trait] +impl<'a> Flow<'a> for Locations { + async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> { + let flows: Vec> = vec![ + Box::new(ListLocations::new()), + Box::new(AddLocation::new()), + Box::new(Exit::new()) + ]; + + let choice = Select::new("What would you like to do?", flows) + .with_help_message("Select the action you want to take or quit the program") + .with_render_config(RenderConfig { + option_index_prefix: inquire::ui::IndexPrefix::Simple, + ..Default::default() + }) + .prompt_skippable()?; + + self.continue_choice(state, &choice).await + } +} + +impl Display for Locations { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Locations") + } +} \ No newline at end of file diff --git a/gamenight-cli/src/flows/mod.rs b/gamenight-cli/src/flows/mod.rs index 7606f59..01ad6d0 100644 --- a/gamenight-cli/src/flows/mod.rs +++ b/gamenight-cli/src/flows/mod.rs @@ -30,6 +30,11 @@ mod view_game; mod rename_game; mod own; mod disown; +mod locations; +mod list_locations; +mod view_location; +mod add_location; +mod location_authorize; pub struct GamenightState { api_configuration: Configuration, @@ -122,6 +127,14 @@ impl From for FlowError { } } +impl From for FlowError { + fn from(value: jsonwebtoken::errors::Error) -> Self { + Self { + error: value.to_string() + } + } +} + #[derive(PartialEq)] pub enum FlowOutcome { Successful, diff --git a/gamenight-cli/src/flows/view_gamenight.rs b/gamenight-cli/src/flows/view_gamenight.rs index 8d1bc66..6052769 100644 --- a/gamenight-cli/src/flows/view_gamenight.rs +++ b/gamenight-cli/src/flows/view_gamenight.rs @@ -23,14 +23,6 @@ impl ViewGamenight { } } -impl From for FlowError { - fn from(value: jsonwebtoken::errors::Error) -> Self { - Self { - error: value.to_string() - } - } -} - #[async_trait] impl<'a> Flow<'a> for ViewGamenight { async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> { diff --git a/gamenight-cli/src/flows/view_location.rs b/gamenight-cli/src/flows/view_location.rs new file mode 100644 index 0000000..49bb251 --- /dev/null +++ b/gamenight-cli/src/flows/view_location.rs @@ -0,0 +1,44 @@ + +use inquire::Select; + +use crate::{domain::location::Location, flows::{exit::Exit, location_authorize::LocationAuthorize}}; + +use super::*; + +#[derive(Clone)] +pub struct ViewLocation { + location: Location +} + +impl ViewLocation { + pub fn new(location: Location) -> Self { + Self { + location + } + } +} + +#[async_trait] +impl<'a> Flow<'a> for ViewLocation { + async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> { + + println!("{}", self.location); + + let options: Vec + Send>> = vec![ + Box::new(LocationAuthorize::new(self.location.id)), + Box::new(Exit::new()) + ]; + + let choice = Select::new("What do you want to do:", options) + .prompt_skippable()?; + + self.continue_choice(state, &choice).await + } +} + +impl Display for ViewLocation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.location.name) + } +} + diff --git a/gamenight-database/migrations/2025-07-20-082144_locations/down.sql b/gamenight-database/migrations/2025-07-20-082144_locations/down.sql new file mode 100644 index 0000000..664e656 --- /dev/null +++ b/gamenight-database/migrations/2025-07-20-082144_locations/down.sql @@ -0,0 +1,8 @@ + +ALTER TABLE gamenight +DROP CONSTRAINT FK_location_id, +DROP column location_id; + +DROP TABLE location_owner; + +DROP TABLE location; diff --git a/gamenight-database/migrations/2025-07-20-082144_locations/up.sql b/gamenight-database/migrations/2025-07-20-082144_locations/up.sql new file mode 100644 index 0000000..256f26a --- /dev/null +++ b/gamenight-database/migrations/2025-07-20-082144_locations/up.sql @@ -0,0 +1,18 @@ +CREATE TABLE location ( + id UUID NOT NULL PRIMARY KEY, + name VARCHAR UNIQUE NOT NULL, + address VARCHAR, + note VARCHAR +); + +CREATE TABLE location_owner ( + location_id UUID NOT NULL, + user_id UUID NOT NULL, + CONSTRAINT FK_location_id FOREIGN KEY (location_id) REFERENCES location(id) ON DELETE CASCADE, + CONSTRAINT FK_user_id FOREIGN KEY (user_id) REFERENCES client(id) ON DELETE CASCADE, + PRIMARY KEY(location_id, user_id) +); + +ALTER TABLE gamenight +ADD location_id UUID, +ADD CONSTRAINT FK_location_id FOREIGN KEY (location_id) REFERENCES location(id) ON DELETE SET NULL; \ No newline at end of file diff --git a/gamenight-database/src/error.rs b/gamenight-database/src/error.rs index 692b5af..82b5c4b 100644 --- a/gamenight-database/src/error.rs +++ b/gamenight-database/src/error.rs @@ -11,4 +11,4 @@ impl From for DatabaseError { fn from(value: argon2::password_hash::Error) -> Self { DatabaseError(value.to_string()) } -} \ No newline at end of file +} diff --git a/gamenight-database/src/game.rs b/gamenight-database/src/game.rs index 67fe48a..dd7fd09 100644 --- a/gamenight-database/src/game.rs +++ b/gamenight-database/src/game.rs @@ -1,7 +1,9 @@ -use diesel::{dsl::insert_into, ExpressionMethods, Insertable, PgConnection, QueryDsl, Queryable, RunQueryDsl}; -use serde::{Serialize, Deserialize}; -use uuid::Uuid; use crate::schema::game; +use diesel::{ + ExpressionMethods, Insertable, PgConnection, QueryDsl, Queryable, RunQueryDsl, dsl::insert_into, +}; +use serde::{Deserialize, Serialize}; +use uuid::Uuid; use super::error::DatabaseError; @@ -12,7 +14,7 @@ pub struct Game { pub name: String, } -pub fn games(conn: &mut PgConnection) -> Result, DatabaseError> { +pub fn games(conn: &mut PgConnection) -> Result, DatabaseError> { Ok(game::table.load::(conn)?) } @@ -24,8 +26,12 @@ pub fn insert_game(conn: &mut PgConnection, game: Game) -> Result Result { +pub fn rename_game( + conn: &mut PgConnection, + id: Uuid, + name: String, +) -> Result { Ok(diesel::update(game::table.filter(game::id.eq(id))) .set(game::name.eq(&name)) - .execute(conn)?) -} \ No newline at end of file + .execute(conn)?) +} diff --git a/gamenight-database/src/gamenight.rs b/gamenight-database/src/gamenight.rs index 49442b9..ad44ea1 100644 --- a/gamenight-database/src/gamenight.rs +++ b/gamenight-database/src/gamenight.rs @@ -1,8 +1,8 @@ -use chrono::{DateTime, Utc}; -use diesel::{Insertable, Queryable, PgConnection, RunQueryDsl, insert_into, QueryDsl}; -use serde::{Serialize, Deserialize}; -use uuid::Uuid; use crate::schema::gamenight; +use chrono::{DateTime, Utc}; +use diesel::{Insertable, PgConnection, QueryDsl, Queryable, RunQueryDsl, insert_into}; +use serde::{Deserialize, Serialize}; +use uuid::Uuid; use super::error::DatabaseError; @@ -13,16 +13,22 @@ pub struct Gamenight { pub name: String, pub datetime: DateTime, pub owner_id: Uuid, + pub location_id: Option, } -pub fn gamenights(conn: &mut PgConnection) -> Result, DatabaseError> { +pub fn gamenights(conn: &mut PgConnection) -> Result, DatabaseError> { Ok(gamenight::table.load::(conn)?) } -pub fn add_gamenight(conn: &mut PgConnection, gamenight: Gamenight) -> Result { - Ok(insert_into(gamenight::table).values(&gamenight).execute(conn)?) +pub fn add_gamenight( + conn: &mut PgConnection, + gamenight: Gamenight, +) -> Result { + Ok(insert_into(gamenight::table) + .values(&gamenight) + .execute(conn)?) } pub fn get_gamenight(conn: &mut PgConnection, id: Uuid) -> Result { Ok(gamenight::table.find(id).first(conn)?) -} \ No newline at end of file +} diff --git a/gamenight-database/src/gamenight_participants.rs b/gamenight-database/src/gamenight_participants.rs index 4b2312c..0b72326 100644 --- a/gamenight-database/src/gamenight_participants.rs +++ b/gamenight-database/src/gamenight_participants.rs @@ -1,11 +1,13 @@ -use diesel::{BoolExpressionMethods, ExpressionMethods, Insertable, QueryDsl, Queryable, RunQueryDsl}; -use serde::{Serialize, Deserialize}; +use diesel::{ + BoolExpressionMethods, ExpressionMethods, Insertable, QueryDsl, Queryable, RunQueryDsl, +}; +use serde::{Deserialize, Serialize}; use uuid::Uuid; use crate::schema::gamenight_participant; -use super::error::DatabaseError; use super::DbConnection; +use super::error::DatabaseError; #[derive(Serialize, Deserialize, Debug, Insertable, Queryable)] #[diesel(belongs_to(Gamenight))] @@ -23,14 +25,23 @@ pub fn get_participants(conn: &mut DbConnection, id: &Uuid) -> Result, .get_results(conn)?) } -pub fn insert_gamenight_participant(conn: &mut DbConnection, gp: GamenightParticipant) -> Result { +pub fn insert_gamenight_participant( + conn: &mut DbConnection, + gp: GamenightParticipant, +) -> Result { Ok(gp.insert_into(gamenight_participant::table).execute(conn)?) } -pub fn delete_gamenight_participant(conn: &mut DbConnection, gp: GamenightParticipant) -> Result { - Ok(diesel::delete(gamenight_participant::table - .filter(gamenight_participant::gamenight_id.eq(&gp.gamenight_id) - .and(gamenight_participant::user_id.eq(gp.user_id)))) - .execute(conn)?) - -} \ No newline at end of file +pub fn delete_gamenight_participant( + conn: &mut DbConnection, + gp: GamenightParticipant, +) -> Result { + Ok(diesel::delete( + gamenight_participant::table.filter( + gamenight_participant::gamenight_id + .eq(&gp.gamenight_id) + .and(gamenight_participant::user_id.eq(gp.user_id)), + ), + ) + .execute(conn)?) +} diff --git a/gamenight-database/src/lib.rs b/gamenight-database/src/lib.rs index e7d5d43..0db617f 100644 --- a/gamenight-database/src/lib.rs +++ b/gamenight-database/src/lib.rs @@ -1,25 +1,27 @@ -pub mod user; pub mod error; -pub mod schema; +pub mod game; pub mod gamenight; pub mod gamenight_participants; -pub mod game; +pub mod location; +pub mod location_owner; pub mod owned_game; +pub mod schema; +pub mod user; +use diesel::PgConnection; use diesel::r2d2::ConnectionManager; use diesel::r2d2::ManageConnection; use diesel::r2d2::Pool; use diesel::r2d2::PooledConnection; -use diesel::PgConnection; -use diesel_migrations::embed_migrations; use diesel_migrations::EmbeddedMigrations; +use diesel_migrations::embed_migrations; use diesel_migrations::MigrationHarness; -pub use user::login; -pub use user::register; +pub use game::games; pub use gamenight::gamenights; pub use gamenight_participants::get_participants; -pub use game::games; +pub use user::login; +pub use user::register; pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!(); pub type DbConnection = PgConnection; @@ -38,7 +40,10 @@ pub fn get_connection_pool(url: &str) -> DbPool { .build(manager) .expect("Could not build connection pool") } -pub trait GetConnection where T: ManageConnection { +pub trait GetConnection +where + T: ManageConnection, +{ fn get_conn(&self) -> PooledConnection; } @@ -46,4 +51,4 @@ impl GetConnection for Pool { fn get_conn(&self) -> PooledConnection { self.get().expect("Couldn't get db connection from pool") } -} \ No newline at end of file +} diff --git a/gamenight-database/src/location.rs b/gamenight-database/src/location.rs new file mode 100644 index 0000000..0c2e55d --- /dev/null +++ b/gamenight-database/src/location.rs @@ -0,0 +1,44 @@ +use crate::schema::location::{self, id}; +use diesel::{ + ExpressionMethods, Insertable, PgConnection, QueryDsl, Queryable, RunQueryDsl, dsl::insert_into, +}; +use serde::{Deserialize, Serialize}; +use uuid::Uuid; + +use super::error::DatabaseError; + +#[derive(Serialize, Deserialize, Debug, Insertable, Queryable)] +#[diesel(table_name = location)] +pub struct Location { + pub id: Uuid, + pub name: String, + pub address: Option, + pub note: Option, +} + +pub fn locations(conn: &mut PgConnection) -> Result, DatabaseError> { + Ok(location::table.load::(conn)?) +} + +pub fn load_location(conn: &mut PgConnection, uuid: Uuid) -> Result { + Ok(location::table.find(uuid).get_result(conn)?) +} + +pub fn insert_location(conn: &mut PgConnection, location: Location) -> Result { + Ok(insert_into(location::table) + .values(&location) + .returning(id) + .get_result(conn)?) +} + +pub fn rename_location( + conn: &mut PgConnection, + uuid: Uuid, + name: String, +) -> Result { + Ok( + diesel::update(location::table.filter(location::id.eq(uuid))) + .set(location::name.eq(&name)) + .execute(conn)?, + ) +} diff --git a/gamenight-database/src/location_owner.rs b/gamenight-database/src/location_owner.rs new file mode 100644 index 0000000..46cb13e --- /dev/null +++ b/gamenight-database/src/location_owner.rs @@ -0,0 +1,47 @@ +use crate::{DbConnection, schema::location_owner, user::DatabaseError}; +use diesel::{ + BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl, + dsl::{delete, insert_into}, + prelude::{Insertable, Queryable}, +}; +use serde::{Deserialize, Serialize}; +use uuid::Uuid; + +#[derive(Serialize, Deserialize, Debug, Insertable, Queryable)] +#[diesel(table_name = location_owner)] +pub struct LocationOwner { + pub location_id: Uuid, + pub user_id: Uuid, +} + +pub fn grant_permission( + conn: &mut DbConnection, + location_owner: LocationOwner, +) -> Result { + Ok(insert_into(location_owner::table) + .values(&location_owner) + .execute(conn)?) +} + +pub fn revoke_permission( + conn: &mut DbConnection, + location_owner: LocationOwner, +) -> Result { + Ok(delete(location_owner::table) + .filter( + location_owner::location_id + .eq(location_owner.location_id) + .and(location_owner::user_id.eq(location_owner.user_id)), + ) + .execute(conn)?) +} + +pub fn location_permissions( + conn: &mut DbConnection, + location_id: Uuid, +) -> Result, DatabaseError> { + Ok(location_owner::table + .select(location_owner::user_id) + .filter(location_owner::location_id.eq(location_id)) + .get_results(conn)?) +} diff --git a/gamenight-database/src/owned_game.rs b/gamenight-database/src/owned_game.rs index a54ce15..5ba806a 100644 --- a/gamenight-database/src/owned_game.rs +++ b/gamenight-database/src/owned_game.rs @@ -1,28 +1,38 @@ -use diesel::{dsl::{delete, insert_into}, prelude::{Insertable, Queryable}, BoolExpressionMethods, ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl}; -use serde::{Serialize, Deserialize}; -use uuid::Uuid; use crate::{schema::owned_game, user::DatabaseError}; +use diesel::{ + BoolExpressionMethods, ExpressionMethods, PgConnection, QueryDsl, RunQueryDsl, + dsl::{delete, insert_into}, + prelude::{Insertable, Queryable}, +}; +use serde::{Deserialize, Serialize}; +use uuid::Uuid; #[derive(Serialize, Deserialize, Debug, Insertable, Queryable)] #[diesel(table_name = owned_game)] pub struct OwnedGame { pub user_id: Uuid, - pub game_id: Uuid + pub game_id: Uuid, } -pub fn own_game(conn: &mut PgConnection, owned_game: OwnedGame) -> Result{ - Ok(insert_into(owned_game::table).values(&owned_game).execute(conn)?) +pub fn own_game(conn: &mut PgConnection, owned_game: OwnedGame) -> Result { + Ok(insert_into(owned_game::table) + .values(&owned_game) + .execute(conn)?) } pub fn disown_game(conn: &mut PgConnection, owned_game: OwnedGame) -> Result { Ok(delete(owned_game::table) - .filter(owned_game::user_id.eq(&owned_game.user_id) - .and(owned_game::game_id.eq(&owned_game.game_id)) - ).execute(conn)?) + .filter( + owned_game::user_id + .eq(&owned_game.user_id) + .and(owned_game::game_id.eq(&owned_game.game_id)), + ) + .execute(conn)?) } pub fn owned_games(conn: &mut PgConnection, uuid: Uuid) -> Result, DatabaseError> { - Ok(owned_game::table.select(owned_game::game_id) + Ok(owned_game::table + .select(owned_game::game_id) .filter(owned_game::user_id.eq(uuid)) .get_results(conn)?) -} \ No newline at end of file +} diff --git a/gamenight-database/src/schema.rs b/gamenight-database/src/schema.rs index 0056e00..c8819f3 100644 --- a/gamenight-database/src/schema.rs +++ b/gamenight-database/src/schema.rs @@ -31,6 +31,7 @@ diesel::table! { name -> Varchar, datetime -> Timestamptz, owner_id -> Uuid, + location_id -> Nullable, } } @@ -48,6 +49,22 @@ diesel::table! { } } +diesel::table! { + location (id) { + id -> Uuid, + name -> Varchar, + address -> Nullable, + note -> Nullable, + } +} + +diesel::table! { + location_owner (location_id, user_id) { + location_id -> Uuid, + user_id -> Uuid, + } +} + diesel::table! { owned_game (user_id, game_id) { user_id -> Uuid, @@ -73,10 +90,13 @@ diesel::table! { } diesel::joinable!(gamenight -> client (owner_id)); +diesel::joinable!(gamenight -> location (location_id)); diesel::joinable!(gamenight_gamelist -> game (game_id)); diesel::joinable!(gamenight_gamelist -> gamenight (gamenight_id)); diesel::joinable!(gamenight_participant -> client (user_id)); diesel::joinable!(gamenight_participant -> gamenight (gamenight_id)); +diesel::joinable!(location_owner -> client (user_id)); +diesel::joinable!(location_owner -> location (location_id)); diesel::joinable!(owned_game -> client (user_id)); diesel::joinable!(owned_game -> game (game_id)); diesel::joinable!(pwd -> client (user_id)); @@ -87,6 +107,8 @@ diesel::allow_tables_to_appear_in_same_query!( gamenight, gamenight_gamelist, gamenight_participant, + location, + location_owner, owned_game, pwd, registration_tokens, diff --git a/gamenight-database/src/user.rs b/gamenight-database/src/user.rs index a4681f5..1d08f2f 100644 --- a/gamenight-database/src/user.rs +++ b/gamenight-database/src/user.rs @@ -1,22 +1,20 @@ -use argon2::password_hash::Salt; -use diesel::Connection; -use serde::{Serialize, Deserialize}; -use uuid::Uuid; -use diesel::{ExpressionMethods, QueryDsl, RunQueryDsl, Insertable, Queryable}; -use diesel_derive_enum::DbEnum; -use argon2::password_hash::SaltString; +use crate::DbConnection; +use argon2::Argon2; use argon2::PasswordHash; use argon2::PasswordVerifier; -use argon2::Argon2; use argon2::password_hash::PasswordHasher; +use argon2::password_hash::Salt; +use argon2::password_hash::SaltString; use argon2::password_hash::rand_core::OsRng; use argon2::password_hash::rand_core::RngCore; -use crate::DbConnection; +use diesel::Connection; +use diesel::{ExpressionMethods, Insertable, QueryDsl, Queryable, RunQueryDsl}; +use diesel_derive_enum::DbEnum; +use serde::{Deserialize, Serialize}; +use uuid::Uuid; -use super::schema::{pwd, client}; pub use super::error::DatabaseError; - - +use super::schema::{client, pwd}; #[derive(Serialize, Deserialize, Debug, Insertable, Queryable)] #[diesel(table_name = pwd)] @@ -38,12 +36,12 @@ pub struct User { #[ExistingTypePath = "crate::schema::sql_types::Role"] pub enum Role { Admin, - User + User, } pub struct LoginUser { pub username: String, - pub password: String + pub password: String, } #[derive(Serialize, Deserialize)] @@ -61,7 +59,7 @@ pub struct RegisterResult { pub struct Register { pub username: String, pub email: String, - pub password: String + pub password: String, } pub fn login(conn: &mut DbConnection, user: LoginUser) -> Result, DatabaseError> { @@ -85,7 +83,7 @@ pub fn login(conn: &mut DbConnection, user: LoginUser) -> Result, D Ok(Some(client::table.find(id).first(conn)?)) } else { Ok(None) - } + } } pub fn get_user(conn: &mut DbConnection, id: Uuid) -> Result { @@ -125,16 +123,26 @@ pub fn register(conn: &mut DbConnection, register: Register) -> Result<(), Datab }) } -pub fn count_users_with_username(conn: &mut DbConnection, username: &String) -> Result { +pub fn count_users_with_username( + conn: &mut DbConnection, + username: &String, +) -> Result { Ok(client::table .count() .filter(client::username.eq(username)) .get_result::(conn)?) } -pub fn count_users_with_email(conn: &mut DbConnection, email: &String) -> Result { +pub fn count_users_with_email( + conn: &mut DbConnection, + email: &String, +) -> Result { Ok(client::table .count() .filter(client::email.eq(email)) .get_result::(conn)?) -} \ No newline at end of file +} + +pub fn get_users(conn: &mut DbConnection) -> Result, DatabaseError> { + Ok(client::table.load(conn)?) +}