diff --git a/Cargo.lock b/Cargo.lock index 00e3231..040b1bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,208 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "actix-codec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" -dependencies = [ - "bitflags 2.5.0", - "bytes", - "futures-core", - "futures-sink", - "memchr", - "pin-project-lite", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "actix-files" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0bdd6ff79de7c9a021f5d9ea79ce23e108d8bfc9b49b5b4a2cf6fad5a35212" -dependencies = [ - "actix-http", - "actix-service", - "actix-utils", - "actix-web", - "bitflags 2.5.0", - "bytes", - "derive_more", - "futures-core", - "http-range", - "log", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "v_htmlescape", -] - -[[package]] -name = "actix-http" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d223b13fd481fc0d1f83bb12659ae774d9e3601814c68a0bc539731698cca743" -dependencies = [ - "actix-codec", - "actix-rt", - "actix-service", - "actix-utils", - "ahash", - "base64 0.21.7", - "bitflags 2.5.0", - "brotli", - "bytes", - "bytestring", - "derive_more", - "encoding_rs", - "flate2", - "futures-core", - "h2", - "http", - "httparse", - "httpdate", - "itoa 1.0.11", - "language-tags", - "local-channel", - "mime", - "percent-encoding", - "pin-project-lite", - "rand", - "sha1", - "smallvec", - "tokio", - "tokio-util", - "tracing", - "zstd", -] - -[[package]] -name = "actix-macros" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" -dependencies = [ - "quote", - "syn 2.0.60", -] - -[[package]] -name = "actix-router" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511" -dependencies = [ - "bytestring", - "http", - "regex", - "serde", - "tracing", -] - -[[package]] -name = "actix-rt" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" -dependencies = [ - "futures-core", - "tokio", -] - -[[package]] -name = "actix-server" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb13e7eef0423ea6eab0e59f6c72e7cb46d33691ad56a726b3cd07ddec2c2d4" -dependencies = [ - "actix-rt", - "actix-service", - "actix-utils", - "futures-core", - "futures-util", - "mio", - "socket2 0.5.7", - "tokio", - "tracing", -] - -[[package]] -name = "actix-service" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" -dependencies = [ - "futures-core", - "paste", - "pin-project-lite", -] - -[[package]] -name = "actix-utils" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" -dependencies = [ - "local-waker", - "pin-project-lite", -] - -[[package]] -name = "actix-web" -version = "4.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a6556ddebb638c2358714d853257ed226ece6023ef9364f23f0c70737ea984" -dependencies = [ - "actix-codec", - "actix-http", - "actix-macros", - "actix-router", - "actix-rt", - "actix-server", - "actix-service", - "actix-utils", - "actix-web-codegen", - "ahash", - "bytes", - "bytestring", - "cfg-if", - "cookie", - "derive_more", - "encoding_rs", - "futures-core", - "futures-util", - "itoa 1.0.11", - "language-tags", - "log", - "mime", - "once_cell", - "pin-project-lite", - "regex", - "serde", - "serde_json", - "serde_urlencoded", - "smallvec", - "socket2 0.5.7", - "time", - "url", -] - -[[package]] -name = "actix-web-codegen" -version = "4.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1f50ebbb30eca122b188319a4398b3f7bb4a8cdf50ecfb73bfc6a3c3ce54f5" -dependencies = [ - "actix-router", - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "addr2line" version = "0.21.0" @@ -241,21 +39,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -319,6 +102,28 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "async-trait" version = "0.1.80" @@ -330,6 +135,21 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + +[[package]] +name = "atomic" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +dependencies = [ + "bytemuck", +] + [[package]] name = "autocfg" version = "1.2.0" @@ -363,6 +183,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "binascii" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" + [[package]] name = "bitflags" version = "1.3.2" @@ -396,27 +222,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "brotli" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "bson" version = "2.10.0" @@ -444,51 +249,41 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "bytemuck" +version = "1.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" + [[package]] name = "bytes" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" -[[package]] -name = "bytestring" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" -dependencies = [ - "bytes", -] - [[package]] name = "cc" version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" -dependencies = [ - "jobserver", - "libc", - "once_cell", -] [[package]] name = "cdb" version = "0.1.0" dependencies = [ - "actix-web", "chrono", - "env_logger", "futures", "log", - "maud 0.25.0", "mdq", "mongodb", + "rocket", + "rocket_cors", "serde", "serde_json", "serde_yaml", "tokio", "toml", "uuid", - "web-base", ] [[package]] @@ -564,25 +359,15 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cookie" -version = "0.16.2" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" dependencies = [ "percent-encoding", "time", "version_check", ] -[[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.6" @@ -598,15 +383,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc32fast" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" -dependencies = [ - "cfg-if", -] - [[package]] name = "crossterm" version = "0.27.0" @@ -646,7 +422,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" dependencies = [ "csv-core", - "itoa 1.0.11", + "itoa", "ryu", "serde", ] @@ -734,6 +510,39 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "devise" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6eacefd3f541c66fc61433d65e54e0e46e0a029a819a7dbbc7a7b489e8a85f8" +dependencies = [ + "devise_codegen", + "devise_core", +] + +[[package]] +name = "devise_codegen" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8cf4b8dd484ede80fd5c547592c46c3745a617c8af278e2b72bea86b2dfed6" +dependencies = [ + "devise_core", + "quote", +] + +[[package]] +name = "devise_core" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35b50dba0afdca80b187392b24f2499a88c336d5a8493e4b4ccfb608708be56a" +dependencies = [ + "bitflags 2.5.0", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn 2.0.60", +] + [[package]] name = "digest" version = "0.10.7" @@ -745,6 +554,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "either" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + [[package]] name = "encoding_rs" version = "0.8.34" @@ -801,43 +616,32 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +[[package]] +name = "figment" +version = "0.10.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" +dependencies = [ + "atomic 0.6.0", + "pear", + "serde", + "toml", + "uncased", + "version_check", +] + [[package]] name = "finl_unicode" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" -[[package]] -name = "flate2" -version = "1.0.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[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" @@ -942,6 +746,19 @@ dependencies = [ "slab", ] +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -969,6 +786,12 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "h2" version = "0.3.26" @@ -980,7 +803,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.12", "indexmap", "slab", "tokio", @@ -1040,7 +863,18 @@ checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", - "itoa 1.0.11", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", ] [[package]] @@ -1050,16 +884,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", "pin-project-lite", ] -[[package]] -name = "http-range" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" - [[package]] name = "httparse" version = "1.8.0" @@ -1089,11 +917,11 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "httparse", "httpdate", - "itoa 1.0.11", + "itoa", "pin-project-lite", "socket2 0.5.7", "tokio", @@ -1102,19 +930,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "iana-time-zone" version = "0.1.60" @@ -1173,8 +988,15 @@ checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", + "serde", ] +[[package]] +name = "inlinable_string" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" + [[package]] name = "ipconfig" version = "0.3.2" @@ -1204,27 +1026,12 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - [[package]] name = "itoa" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "jobserver" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.69" @@ -1245,12 +1052,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "language-tags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" - [[package]] name = "lazy_static" version = "1.4.0" @@ -1275,23 +1076,6 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" -[[package]] -name = "local-channel" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" -dependencies = [ - "futures-core", - "futures-sink", - "local-waker", -] - -[[package]] -name = "local-waker" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" - [[package]] name = "lock_api" version = "0.4.12" @@ -1308,6 +1092,21 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lru-cache" version = "0.1.2" @@ -1323,56 +1122,21 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matches" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" -[[package]] -name = "maud" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19aff2cd19eb4b93df29efa602652513b0f731f1d3474f6e377f763fddf61e58" -dependencies = [ - "itoa 0.4.8", - "maud_macros 0.24.0", -] - -[[package]] -name = "maud" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0bab19cef8a7fe1c18a43e881793bfc9d4ea984befec3ae5bd0415abf3ecf00" -dependencies = [ - "itoa 1.0.11", - "maud_macros 0.25.0", -] - -[[package]] -name = "maud_macros" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c114f6f24b08fdd4a25d2fb87a8b140df56b577723247b382e8b04c583f2eb" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "maud_macros" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be95d66c3024ffce639216058e5bae17a83ecaf266ffc6e4d060ad447c9eed2" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "md-5" version = "0.10.6" @@ -1414,16 +1178,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "miniz_oxide" version = "0.7.2" @@ -1440,7 +1194,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", - "log", "wasi", "windows-sys 0.48.0", ] @@ -1493,21 +1246,32 @@ dependencies = [ ] [[package]] -name = "native-tls" -version = "0.2.11" +name = "multer" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "bytes", + "encoding_rs", + "futures-util", + "http 1.1.0", + "httparse", + "memchr", + "mime", + "spin", + "tokio", + "tokio-util", + "version_check", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", ] [[package]] @@ -1551,48 +1315,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags 2.5.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" +name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" @@ -1617,12 +1343,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - [[package]] name = "pbkdf2" version = "0.11.0" @@ -1632,6 +1352,29 @@ dependencies = [ "digest", ] +[[package]] +name = "pear" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdeeaa00ce488657faba8ebf44ab9361f9365a97bd39ffb8a60663f57ff4b467" +dependencies = [ + "inlinable_string", + "pear_codegen", + "yansi", +] + +[[package]] +name = "pear_codegen" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bab5b985dc082b345f812b7df84e1bef27e7207b39e448439ba8bd69c93f147" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn 2.0.60", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1650,12 +1393,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "powerfmt" version = "0.2.0" @@ -1668,30 +1405,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.81" @@ -1701,6 +1414,19 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proc-macro2-diagnostics" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", + "version_check", + "yansi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -1761,6 +1487,26 @@ dependencies = [ "bitflags 2.5.0", ] +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "regex" version = "1.10.4" @@ -1769,8 +1515,17 @@ checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -1781,55 +1536,21 @@ checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.3", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - [[package]] name = "resolv-conf" version = "0.7.0" @@ -1855,6 +1576,105 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rocket" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a516907296a31df7dc04310e7043b61d71954d703b603cc6867a026d7e72d73f" +dependencies = [ + "async-stream", + "async-trait", + "atomic 0.5.3", + "binascii", + "bytes", + "either", + "figment", + "futures", + "indexmap", + "log", + "memchr", + "multer", + "num_cpus", + "parking_lot", + "pin-project-lite", + "rand", + "ref-cast", + "rocket_codegen", + "rocket_http", + "serde", + "serde_json", + "state", + "tempfile", + "time", + "tokio", + "tokio-stream", + "tokio-util", + "ubyte", + "version_check", + "yansi", +] + +[[package]] +name = "rocket_codegen" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575d32d7ec1a9770108c879fc7c47815a80073f96ca07ff9525a94fcede1dd46" +dependencies = [ + "devise", + "glob", + "indexmap", + "proc-macro2", + "quote", + "rocket_http", + "syn 2.0.60", + "unicode-xid", + "version_check", +] + +[[package]] +name = "rocket_cors" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfac3a1df83f8d4fc96aa41dba3b86c786417b7fc0f52ec76295df2ba781aa69" +dependencies = [ + "http 0.2.12", + "log", + "regex", + "rocket", + "serde", + "serde_derive", + "unicase", + "unicase_serde", + "url", +] + +[[package]] +name = "rocket_http" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e274915a20ee3065f611c044bd63c40757396b6dbc057d6046aec27f14f882b9" +dependencies = [ + "cookie", + "either", + "futures", + "http 0.2.12", + "hyper", + "indexmap", + "log", + "memchr", + "pear", + "percent-encoding", + "pin-project-lite", + "ref-cast", + "serde", + "smallvec", + "stable-pattern", + "state", + "time", + "tokio", + "uncased", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -1955,13 +1775,10 @@ dependencies = [ ] [[package]] -name = "schannel" -version = "0.1.23" +name = "scoped-tls" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" @@ -1979,29 +1796,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "security-framework" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "0.9.0" @@ -2059,7 +1853,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "indexmap", - "itoa 1.0.11", + "itoa", "ryu", "serde", ] @@ -2073,18 +1867,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa 1.0.11", - "ryu", - "serde", -] - [[package]] name = "serde_with" version = "1.14.0" @@ -2114,7 +1896,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ "indexmap", - "itoa 1.0.11", + "itoa", "ryu", "serde", "unsafe-libyaml", @@ -2131,17 +1913,6 @@ dependencies = [ "digest", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha2" version = "0.10.8" @@ -2153,6 +1924,15 @@ dependencies = [ "digest", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -2203,6 +1983,24 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "stable-pattern" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" +dependencies = [ + "memchr", +] + +[[package]] +name = "state" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" +dependencies = [ + "loom", +] + [[package]] name = "stringprep" version = "0.1.4" @@ -2273,33 +2071,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "take_mut" version = "0.2.2" @@ -2353,6 +2124,16 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "time" version = "0.3.36" @@ -2360,7 +2141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa 1.0.11", + "itoa", "num-conv", "powerfmt", "serde", @@ -2429,16 +2210,6 @@ dependencies = [ "syn 2.0.60", ] -[[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 = "tokio-rustls" version = "0.24.1" @@ -2449,6 +2220,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.10" @@ -2510,11 +2292,22 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "tracing-core" version = "0.1.32" @@ -2522,6 +2315,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -2592,6 +2415,25 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + +[[package]] +name = "uncased" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +dependencies = [ + "serde", + "version_check", +] + [[package]] name = "unicase" version = "2.7.0" @@ -2601,6 +2443,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "unicase_serde" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ef53697679d874d69f3160af80bc28de12730a985d57bdf2b47456ccb8b11f1" +dependencies = [ + "serde", + "unicase", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -2628,6 +2480,12 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -2664,33 +2522,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", - "rand", "serde", - "uuid-macro-internal", ] [[package]] -name = "uuid-macro-internal" -version = "1.8.0" +name = "valuable" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9881bea7cbe687e36c9ab3b778c36cd0487402e270304e8b1296d5085303c1a2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - -[[package]] -name = "v_htmlescape" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e8257fbc510f0a46eb602c10215901938b5c2a7d5e70fc11483b1d3c9b5b18c" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" @@ -2748,18 +2587,6 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.92" @@ -2789,33 +2616,6 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" -[[package]] -name = "web-base" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca672044405cfd4e89e651eed84e6ace252559f97bc050dd7c8ac15346dc2a0" -dependencies = [ - "actix-files", - "actix-web", - "maud 0.24.0", - "reqwest", - "serde", - "serde_json", - "tokio", - "url", - "uuid", -] - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "webpki-roots" version = "0.25.4" @@ -2859,6 +2659,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -3035,6 +2844,15 @@ dependencies = [ "tap", ] +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +dependencies = [ + "is-terminal", +] + [[package]] name = "zerocopy" version = "0.7.32" @@ -3054,31 +2872,3 @@ dependencies = [ "quote", "syn 2.0.60", ] - -[[package]] -name = "zstd" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/Cargo.toml b/Cargo.toml index ae6c4ff..ed7e4c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,18 +4,16 @@ version = "0.1.0" edition = "2021" [dependencies] -actix-web = "4.4.1" chrono = "0.4.38" -env_logger = "0.10.1" futures = "0.3.30" log = "0.4.20" -maud = "0.25.0" -mdq = { git = "https://git.hydrar.de/mdtools/mdq", version = "0.3.0" } +mdq = { git = "https://git.hydrar.de/mdtools/mdq" } mongodb = "2.8.0" +rocket = { version = "0.5.1", features = ["json"] } +rocket_cors = "0.6.0" serde = { version = "1.0.195", features = ["derive"] } serde_json = "1.0.111" serde_yaml = "0.9.34" tokio = { version = "1.35.1", features = ["full"] } toml = "0.8.8" uuid = { version = "1.8.0", features = ["v4"] } -web-base = "0.2.2" diff --git a/rocket.toml b/rocket.toml new file mode 100644 index 0000000..30421bb --- /dev/null +++ b/rocket.toml @@ -0,0 +1,3 @@ +[default] +address = "0.0.0.0" +port = 8080 diff --git a/src/cache.rs b/src/cache.rs index 63d35f0..2ade0fb 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -1,4 +1,4 @@ -use mongodb::{bson::doc, ClientSession}; +use mongodb::bson::doc; use crate::get_mongo; @@ -16,8 +16,7 @@ impl InventoryCache { .return_document(mongodb::options::ReturnDocument::After) .build(); - let result = db - .database("cdb") + db.database("cdb") .collection::("cache") .find_one_and_update(doc! { "_id": "inventory"}, update, options) .await @@ -51,8 +50,7 @@ impl InventoryCache { .return_document(mongodb::options::ReturnDocument::After) .build(); - let result = db - .database("cdb") + db.database("cdb") .collection::("cache") .find_one_and_update(doc! { "_id": "inventory"}, update, options) .await diff --git a/src/db.rs b/src/db.rs index 718b69c..40c7a32 100644 --- a/src/db.rs +++ b/src/db.rs @@ -49,7 +49,7 @@ impl ItemDB { let mongodb = get_mongo!(); for item in &index.documents { - let item = ItemEntry::new(item.clone()); + let item = ItemEntry::new(item); item.init_db(&mongodb).await; } @@ -62,7 +62,7 @@ impl ItemDB { self.index .documents .iter() - .map(|x| ItemEntry::new(x.clone())) + .map(ItemEntry::new) .find(|x| x.name == item)?, )) } @@ -71,7 +71,7 @@ impl ItemDB { pub fn items(&self) -> Vec { let mut ret = vec![]; for item in &self.index.documents { - let item = ItemEntry::new(item.clone()); + let item = ItemEntry::new(item); ret.push(item.name); } ret diff --git a/src/item.rs b/src/item.rs index 710411f..5ff53c3 100644 --- a/src/item.rs +++ b/src/item.rs @@ -32,7 +32,7 @@ pub struct ItemEntry { } impl ItemEntry { - pub fn new(doc: mdq::Document) -> Self { + pub fn new(doc: &mdq::Document) -> Self { let name = std::path::Path::new(&doc.path) .file_stem() .unwrap() @@ -56,13 +56,12 @@ impl ItemEntry { .as_mapping() .unwrap() .get("variants") - .unwrap() - .as_mapping() - .unwrap() + .map(|x| x.as_mapping().unwrap().clone()) + .unwrap_or_default() { variants.insert( variant_name.as_str().unwrap().to_string(), - Variant::from_yml(variant, variant_name.as_str().unwrap(), &name), + Variant::from_yml(&variant, variant_name.as_str().unwrap(), &name), ); } @@ -111,15 +110,15 @@ pub struct Item { } impl Item { - pub fn new(item: ItemEntry) -> Self { + pub const fn new(item: ItemEntry) -> Self { Self { item } } - pub async fn get_variants(&self) -> Vec { + pub fn get_variants(&self) -> Vec { self.item.variants.keys().cloned().collect() } - pub async fn variant(&self, variant: &str) -> Option { - self.item.variants.get(variant).map(|x| x.clone()) + pub fn variant(&self, variant: &str) -> Option { + self.item.variants.get(variant).cloned() } } diff --git a/src/main.rs b/src/main.rs index 8bb727b..3d863f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ -use actix_web::{get, HttpRequest, Responder}; +use rocket::routes as route; +use rocket::{http::Method, launch}; mod cache; mod db; @@ -22,31 +23,35 @@ mod variant; // ░████▀░░░▀▀█████▄▄▄▄█████████▄░░ // ░░▀▀░░░░░░░░░▀▀██████▀▀░░░▀▀██░░ -#[get("/")] -pub(crate) async fn index(r: HttpRequest) -> impl Responder { - let itemdb: &actix_web::web::Data = r.app_data().unwrap(); - let content = ""; - web_base::func::build_site(&r, "Index", &content) -} - -#[actix_web::main] -async fn main() -> std::io::Result<()> { - env_logger::init(); +#[launch] +async fn rocket() -> _ { + let cors = rocket_cors::CorsOptions { + allowed_origins: rocket_cors::AllowedOrigins::all(), + allowed_methods: vec![Method::Get, Method::Post, Method::Options] + .into_iter() + .map(From::from) + .collect(), + allowed_headers: rocket_cors::AllowedHeaders::all(), + allow_credentials: true, + ..Default::default() + } + .to_cors() + .expect("error creating CORS options"); let itemdb = db::ItemDB::new("./itemdb").await; - let itemdb = actix_web::web::Data::new(itemdb); - web_base::map!(web_base::Site::new(), |app: actix_web::App<_>| { - app.app_data(itemdb.clone()) - .service(index) - .service(routes::item::supply_route) // /supply - .service(routes::item::item_variants_page) // /item/{item_id}/variants - .service(routes::item::get_items_route) // /items - .service(routes::item::demand_route) // /demand - .service(routes::item::supply_log_route) // /item/{item_id}/{variant_id}/supply - .service(routes::item::demand_log_route) // /item/{item_id}/{variant_id}/demand - }) - .bind(("0.0.0.0".to_string(), 8080))? - .run() - .await + rocket::build() + .mount( + "/", + route![ + routes::item::get_items_route, + routes::item::item_variants_page, + routes::item::supply_log_route, + routes::item::demand_log_route, + routes::item::supply_route, + routes::item::demand_route, + ], + ) + .manage(itemdb) + .attach(cors) } diff --git a/src/routes/item/mod.rs b/src/routes/item/mod.rs index e4690f0..dbb9545 100644 --- a/src/routes/item/mod.rs +++ b/src/routes/item/mod.rs @@ -1,24 +1,20 @@ -use actix_web::post; -use actix_web::{get, HttpRequest, HttpResponse, Responder}; +use rocket::serde::json::Json; +use rocket::State; +use rocket::{get, post}; use serde::Deserialize; +use serde_json::json; -use crate::item; -use crate::routes::bad_req; +use crate::db::ItemDB; use crate::variant::Variant; -macro_rules! get_itemdb { - ($req:expr) => {{ - let itemdb: &actix_web::web::Data = $req.app_data().unwrap(); - itemdb - }}; +use super::{api_error, ApiError, FallibleApiResponse}; + +pub fn item_does_not_exist_error() -> ApiError { + api_error("The item does not exist") } -pub fn item_does_not_exist_error() -> actix_web::Error { - bad_req("The item does not exist") -} - -pub fn variant_does_not_exist_error() -> actix_web::Error { - bad_req("The item does not exist") +pub fn variant_does_not_exist_error() -> ApiError { + api_error("The item does not exist") } #[derive(Debug, Deserialize)] @@ -28,24 +24,20 @@ pub struct DemandForm { price: String, } -#[post("/demand")] -pub async fn demand_route( - req: HttpRequest, - f: actix_web::web::Form, -) -> actix_web::Result { - let itemdb = get_itemdb!(req); +#[post("/demand", data = "")] +pub async fn demand_route(f: Json) -> FallibleApiResponse { let uuid = Variant::demand( &f.uuid, f.price .clone() .try_into() - .map_err(|_| bad_req("Price malformed"))?, + .map_err(|()| api_error("Price malformed"))?, &f.destination, ) .await - .ok_or_else(|| bad_req("Demand failed"))?; + .ok_or_else(|| api_error("Demand failed"))?; - Ok(actix_web::HttpResponse::Ok().json(serde_json::json!({"uuid": uuid}))) + Ok(json!({"uuid": uuid})) } #[derive(Deserialize, Debug)] pub struct SupplyForm { @@ -56,18 +48,13 @@ pub struct SupplyForm { origin: String, } -#[post("/supply")] -pub async fn supply_route( - req: HttpRequest, - form: actix_web::web::Form, -) -> actix_web::Result { - let itemdb = get_itemdb!(req); +#[post("/supply", data = "
")] +pub async fn supply_route(form: Json, itemdb: &State) -> FallibleApiResponse { println!("{form:?}"); let variant = itemdb .get_item(&form.item) .ok_or_else(item_does_not_exist_error)? .variant(&form.variant) - .await .ok_or_else(variant_does_not_exist_error)?; let transaction_id = variant @@ -76,72 +63,63 @@ pub async fn supply_route( form.price .clone() .try_into() - .map_err(|_| bad_req("Price malformed"))?, + .map_err(|()| api_error("Price malformed"))?, &form.origin, ) .await; - Ok(actix_web::HttpResponse::Ok().json(serde_json::json!({"uuid": transaction_id}))) + Ok(json!({"uuid": transaction_id})) } #[get("/items")] -pub async fn get_items_route(r: HttpRequest) -> impl Responder { - let itemdb = get_itemdb!(r); +pub fn get_items_route(itemdb: &State) -> serde_json::Value { let items = itemdb.items(); - actix_web::HttpResponse::Ok().json(serde_json::json!({"items": items})) + json!({"items": items}) } -#[derive(Deserialize, Debug)] -pub struct AddVariantForm { - pub variant: String, - pub amount: usize, -} +#[get("/item//variants")] +pub fn item_variants_page(item_id: &str, itemdb: &State) -> FallibleApiResponse { + let item = itemdb + .get_item(item_id) + .ok_or_else(item_does_not_exist_error)?; + let variants = item.get_variants(); -#[get("/item/{item_id}/variants")] -pub async fn item_variants_page(r: HttpRequest) -> actix_web::Result { - let id = r.match_info().query("item_id"); - let itemdb = get_itemdb!(r); - let item = itemdb.get_item(id).ok_or_else(item_does_not_exist_error)?; - let variants = item.get_variants().await; - - Ok(HttpResponse::Ok().json(serde_json::json!({ - "item": id, + Ok(json!({ + "item": item_id, "variants": variants - }))) + })) } -#[get("/item/{item_id}/{variant_id}/supply")] -pub async fn supply_log_route(r: HttpRequest) -> actix_web::Result { - let itemdb = get_itemdb!(r); - let item_id = r.match_info().query("item_id"); - let variant_id = r.match_info().query("variant_id"); - +#[get("/item///supply")] +pub async fn supply_log_route( + item_id: &str, + variant_id: &str, + itemdb: &State, +) -> FallibleApiResponse { let variant = itemdb .get_item(item_id) .ok_or_else(item_does_not_exist_error)? .variant(variant_id) - .await .ok_or_else(variant_does_not_exist_error)?; let transactions = variant.supply_log().await; - Ok(HttpResponse::Ok().json(serde_json::json!(transactions))) + Ok(json!(transactions)) } -#[get("/item/{item_id}/{variant_id}/demand")] -pub async fn demand_log_route(r: HttpRequest) -> actix_web::Result { - let itemdb = get_itemdb!(r); - let item_id = r.match_info().query("item_id"); - let variant_id = r.match_info().query("variant_id"); - +#[get("/item///demand")] +pub async fn demand_log_route( + item_id: &str, + variant_id: &str, + itemdb: &State, +) -> FallibleApiResponse { let variant = itemdb .get_item(item_id) .ok_or_else(item_does_not_exist_error)? .variant(variant_id) - .await .ok_or_else(variant_does_not_exist_error)?; let transactions = variant.demand_log().await; - Ok(HttpResponse::Ok().json(serde_json::json!(transactions))) + Ok(json!(transactions)) } diff --git a/src/routes/mod.rs b/src/routes/mod.rs index e7384e3..be6d9ca 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -1,5 +1,13 @@ +use rocket::response::status::BadRequest; +use serde_json::json; + pub mod item; -pub fn bad_req(msg: &'static str) -> actix_web::Error { - actix_web::error::ErrorBadRequest(msg) +type ApiError = BadRequest; +type FallibleApiResponse = Result; + +fn api_error(msg: &str) -> ApiError { + BadRequest(json!({ + "error": msg + })) } diff --git a/src/transaction.rs b/src/transaction.rs index 5b92a31..de80cf9 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -3,14 +3,14 @@ pub enum TransactionType { Normal(Transaction), } -impl TransactionType { - pub fn from(b: mongodb::bson::Document) -> Self { - if let Ok(kind) = b.get_str("kind") { +impl From for TransactionType { + fn from(value: mongodb::bson::Document) -> Self { + if let Ok(kind) = value.get_str("kind") { if kind == "batch" { - return Self::Batch(BatchTransaction::from(b)); + return Self::Batch(value.into()); } } - Self::Normal(Transaction::from(b)) + Self::Normal(value.into()) } } @@ -40,12 +40,14 @@ impl Transaction { "_id": &self.uuid, "item": &self.item, "variant": &self.variant, - "price": self.price.as_bson(), + "price": Into::::into(self.price.clone()), "origin": &self.origin, "timestamp": self.timestamp } } +} +impl From for Transaction { fn from(b: mongodb::bson::Document) -> Self { let uuid = b.get_str("oid").unwrap().to_string(); let item = b.get_str("item").unwrap().to_string(); @@ -64,6 +66,19 @@ impl Transaction { } } +impl From for mongodb::bson::Document { + fn from(value: Transaction) -> Self { + mongodb::bson::doc! { + "_id": &value.uuid, + "item": &value.item, + "variant": &value.variant, + "price": Into::::into(value.price), + "origin": &value.origin, + "timestamp": value.timestamp + } + } +} + pub struct BatchTransaction { pub uuid: String, pub transactions: Vec, @@ -76,27 +91,32 @@ impl BatchTransaction { transactions, } } +} - pub fn as_doc(&self) -> mongodb::bson::Document { - mongodb::bson::doc! { - "_id": &self.uuid, - "kind": "batch", - "transactions": &self.transactions - } - } - - fn from(b: mongodb::bson::Document) -> Self { - let uuid = b.get_str("_id").unwrap().to_string(); - let transactions = b +impl From for BatchTransaction { + fn from(value: mongodb::bson::Document) -> Self { + let uuid = value.get_str("_id").unwrap().to_string(); + let transactions = value .get_array("transactions") .unwrap() - .into_iter() + .iter() .map(|x| x.as_str().unwrap().to_string()) .collect(); + Self { uuid, transactions } } } +impl From for mongodb::bson::Document { + fn from(value: BatchTransaction) -> Self { + mongodb::bson::doc! { + "_id": value.uuid, + "kind": "batch", + "transactions": value.transactions + } + } +} + #[derive(Debug, Clone)] pub struct Price { pub value: f64, @@ -119,11 +139,13 @@ impl Price { currency: currency.to_string(), }) } +} - pub fn as_bson(&self) -> mongodb::bson::Bson { +impl From for mongodb::bson::Bson { + fn from(value: Price) -> Self { mongodb::bson::bson!({ - "value": self.value, - "currency": self.currency.clone() + "value": value.value, + "currency": value.currency }) } } diff --git a/src/variant.rs b/src/variant.rs index ab6ff1e..7cb6bfe 100644 --- a/src/variant.rs +++ b/src/variant.rs @@ -34,8 +34,7 @@ impl Variant { .as_mapping() .unwrap() .get("amount") - .map(|x| x.as_u64().unwrap()) - .unwrap_or(1), + .map_or(1, |x| x.as_u64().unwrap()), depends: json .as_mapping() .unwrap() @@ -43,11 +42,11 @@ impl Variant { .map(|x| { x.as_sequence() .unwrap() - .into_iter() + .iter() .map(|x| x.as_str().unwrap().to_string()) .collect() }) - .unwrap_or(Vec::new()), + .unwrap_or_default(), } } @@ -104,14 +103,10 @@ impl Variant { // check if supply transaction exists let supply_t = cdb_col!(db, "supply"); - if supply_t - .find_one(doc! { "_id": uuid }, None) + supply_t + .find_one(doc! { "_id": uuid}, None) .await - .unwrap() - .is_none() - { - return None; - } + .unwrap()?; // todo : demand batch @@ -122,7 +117,7 @@ impl Variant { doc! { "_id": uuid, "destination": destination, - "price": price.as_bson() + "price": Into::::into(price) }, None, ) @@ -163,7 +158,7 @@ impl Variant { } for transaction in &transactions { - let r = col.insert_one(transaction.as_doc(), None).await.unwrap(); + col.insert_one(transaction.as_doc(), None).await.unwrap(); // update cache InventoryCache::push(&transaction.uuid).await; @@ -177,8 +172,12 @@ impl Variant { BatchTransaction::new(transactions.iter().map(|x| x.uuid.clone()).collect()); let col: mongodb::Collection = db.database("cdb").collection("transactions_batch"); - col.insert_one(batch.as_doc(), None).await.unwrap(); - batch.uuid + let batch_uuid = batch.uuid.clone(); + + col.insert_one(Into::::into(batch), None) + .await + .unwrap(); + batch_uuid }; ret_uuid