diff --git a/Cargo.lock b/Cargo.lock index d023e35..8af5f38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,7 +239,7 @@ dependencies = [ "futures-timer", "futures-util", "http", - "indexmap 2.8.0", + "indexmap 2.9.0", "mime", "multer", "num-traits", @@ -288,7 +288,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0cde74de18e3a00c5dd5cfa002ab6f532e1a06c2a79ee6671e2fc353b400b92" dependencies = [ "bytes", - "indexmap 2.8.0", + "indexmap 2.9.0", "serde", "serde_json", ] @@ -357,9 +357,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" +checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288" dependencies = [ "axum-core", "bytes", @@ -392,12 +392,12 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "http-body-util", @@ -412,9 +412,9 @@ dependencies = [ [[package]] name = "axum-test" -version = "17.2.0" +version = "17.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317c1f4ecc1e68e0ad5decb78478421055c963ce215e736ed97463fa609cd196" +checksum = "0eb1dfb84bd48bad8e4aa1acb82ed24c2bb5e855b659959b4e03b4dca118fcac" dependencies = [ "anyhow", "assert-json-diff", @@ -501,16 +501,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bit-vec 0.6.3", -] - -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec 0.8.0", + "bit-vec", ] [[package]] @@ -519,12 +510,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" -[[package]] -name = "bit-vec" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" - [[package]] name = "bitflags" version = "2.9.0" @@ -554,9 +539,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17679a8d69b6d7fd9cd9801a536cec9fa5e5970b69f9d4747f70b39b031f5e7" +checksum = "389a099b34312839e16420d499a9cad9650541715937ffbdd40d36f49e77eeb3" dependencies = [ "arrayref", "arrayvec", @@ -586,9 +571,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.6" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b74d67a0fc0af8e9823b79fd1c43a0900e5a8f0e0f4cc9210796bf3a820126" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" dependencies = [ "borsh-derive", "cfg_aliases", @@ -596,9 +581,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.6" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d37ed1b2c9b78421218a0b4f6d8349132d6ec2cfeba1cfb0118b0a8e268df9e" +checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" dependencies = [ "once_cell", "proc-macro-crate", @@ -658,9 +643,9 @@ dependencies = [ [[package]] name = "bytesize" -version = "1.3.2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2c12f985c78475a6b8d629afd0c360260ef34cfef52efccdcfd31972f81c2e" +checksum = "a3c8f83209414aacf0eeae3cf730b18d6981697fba62f200fcfb92b9f082acba" [[package]] name = "castaway" @@ -673,9 +658,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.16" +version = "1.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" dependencies = [ "shlex", ] @@ -913,9 +898,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -923,9 +908,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -937,9 +922,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", @@ -1043,9 +1028,9 @@ dependencies = [ [[package]] name = "dmp" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaa1135a34d26e5cc5b4927a8935af887d4f30a5653a797c33b9a4222beb6d9" +checksum = "7a742337ba8f9745310573b60196a507e54e8c0267741763eb0ed89d87bd29ae" dependencies = [ "urlencoding", ] @@ -1120,9 +1105,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", "windows-sys 0.59.0", @@ -1141,9 +1126,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ "event-listener", "pin-project-lite", @@ -1162,17 +1147,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "fancy-regex" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" -dependencies = [ - "bit-set 0.8.0", - "regex-automata", - "regex-syntax", -] - [[package]] name = "fastrand" version = "2.3.0" @@ -1187,9 +1161,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", "miniz_oxide", @@ -1406,9 +1380,9 @@ dependencies = [ [[package]] name = "geo-types" -version = "0.7.15" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd1157f0f936bf0cd68dec91e8f7c311afe60295574d62b70d4861a1bfdf2d9" +checksum = "62ddb1950450d67efee2bbc5e429c68d052a822de3aad010d28b351fbb705224" dependencies = [ "approx 0.5.1", "arbitrary", @@ -1668,9 +1642,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" dependencies = [ "bytes", "futures-channel", @@ -1678,6 +1652,7 @@ dependencies = [ "http", "http-body", "hyper", + "libc", "pin-project-lite", "socket2", "tokio", @@ -1687,16 +1662,17 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core 0.61.0", ] [[package]] @@ -1749,9 +1725,9 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" [[package]] name = "icu_normalizer" @@ -1773,9 +1749,9 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" [[package]] name = "icu_properties" @@ -1794,9 +1770,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" [[package]] name = "icu_provider" @@ -1875,21 +1851,18 @@ name = "imphnen-backend-service" version = "0.1.0" dependencies = [ "anyhow", - "argon2", "axum", "axum-test", "chrono", - "fancy-regex", - "jsonwebtoken", + "imphnen-entities", + "imphnen-libs", + "imphnen-utils", "lazy_static", - "lettre", - "log", "rand 0.9.0", "regex", "serde", "serde_json", "surrealdb", - "thiserror 2.0.12", "tokio", "tower-http", "utoipa", @@ -1897,6 +1870,49 @@ dependencies = [ "validator", ] +[[package]] +name = "imphnen-entities" +version = "0.1.0" +dependencies = [ + "axum", + "serde", + "surrealdb", + "thiserror 2.0.12", + "utoipa", +] + +[[package]] +name = "imphnen-libs" +version = "0.1.0" +dependencies = [ + "argon2", + "axum", + "chrono", + "imphnen-entities", + "jsonwebtoken", + "lettre", + "serde", + "surrealdb", + "tokio", +] + +[[package]] +name = "imphnen-utils" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "axum-test", + "chrono", + "imphnen-entities", + "imphnen-libs", + "rand 0.9.0", + "serde", + "serde_json", + "surrealdb", + "validator", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -1910,9 +1926,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -1999,7 +2015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", - "bit-set 0.5.3", + "bit-set", "ena", "itertools 0.11.0", "lalrpop-util", @@ -2130,9 +2146,9 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lru" @@ -2248,9 +2264,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" dependencies = [ "adler2", ] @@ -2466,15 +2482,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssl" -version = "0.10.71" +version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ "bitflags", "cfg-if", @@ -2504,9 +2520,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.106" +version = "0.9.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" dependencies = [ "cc", "libc", @@ -2596,9 +2612,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.15" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" dependencies = [ "memchr", "thiserror 2.0.12", @@ -2612,7 +2628,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.8.0", + "indexmap 2.9.0", ] [[package]] @@ -2715,7 +2731,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -2877,9 +2893,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" +checksum = "541d0f57c6ec747a90738a52741d3221f7960e8ac2f0ff4b1a63680e033b4ab5" dependencies = [ "cfg_aliases", "libc", @@ -2946,7 +2962,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -3021,9 +3037,9 @@ checksum = "ffead9d0a0b45f3e0bc063a244b1779fd53a09d2c2f7282c186a016b1f10a778" [[package]] name = "redox_syscall" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" dependencies = [ "bitflags", ] @@ -3145,11 +3161,10 @@ dependencies = [ [[package]] name = "reserve-port" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "359fc315ed556eb0e42ce74e76f4b1cd807b50fa6307f3de4e51f92dbe86e2d5" +checksum = "ba3747658ee2585ecf5607fa9887c92eff61b362ff5253dbf797dfeb73d33d78" dependencies = [ - "lazy_static", "thiserror 2.0.12", ] @@ -3276,9 +3291,9 @@ dependencies = [ [[package]] name = "roaring" -version = "0.10.10" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652edd001c53df0b3f96a36a8dc93fce6866988efc16808235653c6bcac8bf2" +checksum = "19e8d2cfa184d94d0726d650a9f4a1be7f9b76ac9fdb954219878dc00c1c1e7b" dependencies = [ "bytemuck", "byteorder", @@ -3338,16 +3353,15 @@ dependencies = [ [[package]] name = "rust-multipart-rfc7578_2" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc4bb9e7c9abe5fa5f30c2d8f8fefb9e0080a2c1e3c2e567318d2907054b35d3" +checksum = "c839d037155ebc06a571e305af66ff9fd9063a6e662447051737e1ac75beea41" dependencies = [ "bytes", "futures-core", "futures-util", "http", "mime", - "mime_guess", "rand 0.9.0", "thiserror 2.0.12", ] @@ -3364,9 +3378,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.37.0" +version = "1.37.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c24af6e7ac43c88a8a458d1139d0246fdce2f6cd2f1ac6cb51eb88b29c978af" +checksum = "faa7de2ba56ac291bd90c6b9bece784a52ae1411f9506544b3eae36dd2356d50" dependencies = [ "arrayvec", "borsh", @@ -3410,9 +3424,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" dependencies = [ "bitflags", "errno", @@ -3456,9 +3470,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.0" +version = "0.103.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa4eeac2588ffff23e9d7a7e9b3f971c5fb5b7ebc9452745e0c232c64f83b2f" +checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" dependencies = [ "ring", "rustls-pki-types", @@ -3601,7 +3615,7 @@ version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", "itoa", "memchr", "ryu", @@ -3640,7 +3654,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.8.0", + "indexmap 2.9.0", "serde", "serde_derive", "serde_json", @@ -3729,9 +3743,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "smol_str" @@ -3772,9 +3786,9 @@ checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3837,9 +3851,9 @@ dependencies = [ [[package]] name = "string_cache" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938d512196766101d333398efde81bc1f37b00cb42c2f8350e5df639f040bbbe" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" dependencies = [ "new_debug_unreachable", "parking_lot", @@ -3907,7 +3921,7 @@ dependencies = [ "dmp", "futures", "geo", - "indexmap 2.8.0", + "indexmap 2.9.0", "path-clean", "pharos", "reblessive", @@ -4197,9 +4211,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9c75b47bdff86fa3334a3db91356b8d7d86a9b839dab7d0bdc5c3d3a077618" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -4218,9 +4232,9 @@ checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29aa485584182073ed57fd5004aa09c371f021325014694e432313345865fd04" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -4262,9 +4276,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.1" +version = "1.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" dependencies = [ "backtrace", "bytes", @@ -4349,7 +4363,7 @@ version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", "toml_datetime", "winnow", ] @@ -4591,7 +4605,7 @@ version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "435c6f69ef38c9017b4b4eea965dfb91e71e53d869e896db40d1cf2441dd75c0" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", "serde", "serde_json", "utoipa-gen", @@ -4611,9 +4625,9 @@ dependencies = [ [[package]] name = "utoipa-swagger-ui" -version = "9.0.0" +version = "9.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161166ec520c50144922a625d8bc4925cc801b2dda958ab69878527c0e5c5d61" +checksum = "d29519b3c485df6b13f4478ac909a491387e9ef70204487c3b64b53749aec0be" dependencies = [ "axum", "base64 0.22.1", @@ -4928,12 +4942,25 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" dependencies = [ - "windows-implement", - "windows-interface", + "windows-implement 0.57.0", + "windows-interface 0.57.0", "windows-result 0.1.2", "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.2", + "windows-strings 0.4.0", +] + [[package]] name = "windows-implement" version = "0.57.0" @@ -4945,6 +4972,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "windows-interface" version = "0.57.0" @@ -4956,6 +4994,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "windows-link" version = "0.1.1" @@ -4969,7 +5018,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ "windows-result 0.3.2", - "windows-strings", + "windows-strings 0.3.1", "windows-targets 0.53.0", ] @@ -5000,6 +5049,15 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -5245,11 +5303,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.23", + "zerocopy-derive 0.8.24", ] [[package]] @@ -5265,9 +5323,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", @@ -5325,18 +5383,16 @@ dependencies = [ [[package]] name = "zip" -version = "2.4.2" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" +checksum = "1dcb24d0152526ae49b9b96c1dcf71850ca1e0b882e4e28ed898a93c41334744" dependencies = [ "arbitrary", "crc32fast", "crossbeam-utils", - "displaydoc", "flate2", - "indexmap 2.8.0", + "indexmap 2.9.0", "memchr", - "thiserror 2.0.12", "zopfli", ] diff --git a/Cargo.toml b/Cargo.toml index 68705a4..af6c163 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,13 @@ -[package] -name = "imphnen-backend-service" -version = "0.1.0" -edition = "2021" +[workspace] +resolver = "2" +members = [ + "imphnen-apis", + "imphnen-utils", + "imphnen-libs", + "imphnen-entities", +] -[dependencies] +[workspace.dependencies] axum = { version = "0.8.1", features = ["multipart"] } log = "0.4.25" serde = { version = "1.0.217", features = ["derive"] } diff --git a/imphnen-apis/Cargo.toml b/imphnen-apis/Cargo.toml new file mode 100644 index 0000000..df1cba3 --- /dev/null +++ b/imphnen-apis/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "imphnen-backend-service" +version = "0.1.0" +edition = "2021" + +[dependencies] +imphnen-entities = { version = "0.1.0", path = "../imphnen-entities" } +imphnen-libs = { version = "0.1.0", path = "../imphnen-libs" } +imphnen-utils = { version = "0.1.0", path = "../imphnen-utils" } +axum.workspace = true +serde.workspace = true +serde_json.workspace = true +utoipa.workspace = true +lazy_static.workspace = true +regex.workspace = true +validator.workspace = true +axum-test.workspace = true +surrealdb.workspace = true +rand.workspace = true +tokio.workspace = true +chrono.workspace = true +anyhow.workspace = true +tower-http.workspace = true +utoipa-swagger-ui.workspace = true \ No newline at end of file diff --git a/src/apps/mod.rs b/imphnen-apis/src/apps/mod.rs similarity index 100% rename from src/apps/mod.rs rename to imphnen-apis/src/apps/mod.rs diff --git a/src/apps/v1/auth/auth_controller.rs b/imphnen-apis/src/apps/v1/auth/auth_controller.rs similarity index 100% rename from src/apps/v1/auth/auth_controller.rs rename to imphnen-apis/src/apps/v1/auth/auth_controller.rs diff --git a/src/apps/v1/auth/auth_controller_test.rs b/imphnen-apis/src/apps/v1/auth/auth_controller_test.rs similarity index 100% rename from src/apps/v1/auth/auth_controller_test.rs rename to imphnen-apis/src/apps/v1/auth/auth_controller_test.rs diff --git a/src/apps/v1/auth/auth_dto.rs b/imphnen-apis/src/apps/v1/auth/auth_dto.rs similarity index 100% rename from src/apps/v1/auth/auth_dto.rs rename to imphnen-apis/src/apps/v1/auth/auth_dto.rs diff --git a/src/apps/v1/auth/auth_middleware.rs b/imphnen-apis/src/apps/v1/auth/auth_middleware.rs similarity index 100% rename from src/apps/v1/auth/auth_middleware.rs rename to imphnen-apis/src/apps/v1/auth/auth_middleware.rs diff --git a/src/apps/v1/auth/auth_repository.rs b/imphnen-apis/src/apps/v1/auth/auth_repository.rs similarity index 100% rename from src/apps/v1/auth/auth_repository.rs rename to imphnen-apis/src/apps/v1/auth/auth_repository.rs diff --git a/src/apps/v1/auth/auth_repository_test.rs b/imphnen-apis/src/apps/v1/auth/auth_repository_test.rs similarity index 100% rename from src/apps/v1/auth/auth_repository_test.rs rename to imphnen-apis/src/apps/v1/auth/auth_repository_test.rs diff --git a/src/apps/v1/auth/auth_schema.rs b/imphnen-apis/src/apps/v1/auth/auth_schema.rs similarity index 100% rename from src/apps/v1/auth/auth_schema.rs rename to imphnen-apis/src/apps/v1/auth/auth_schema.rs diff --git a/src/apps/v1/auth/auth_service.rs b/imphnen-apis/src/apps/v1/auth/auth_service.rs similarity index 100% rename from src/apps/v1/auth/auth_service.rs rename to imphnen-apis/src/apps/v1/auth/auth_service.rs diff --git a/src/apps/v1/auth/mod.rs b/imphnen-apis/src/apps/v1/auth/mod.rs similarity index 100% rename from src/apps/v1/auth/mod.rs rename to imphnen-apis/src/apps/v1/auth/mod.rs diff --git a/src/apps/v1/docs/docs_controller.rs b/imphnen-apis/src/apps/v1/docs/docs_controller.rs similarity index 100% rename from src/apps/v1/docs/docs_controller.rs rename to imphnen-apis/src/apps/v1/docs/docs_controller.rs diff --git a/src/apps/v1/docs/mod.rs b/imphnen-apis/src/apps/v1/docs/mod.rs similarity index 100% rename from src/apps/v1/docs/mod.rs rename to imphnen-apis/src/apps/v1/docs/mod.rs diff --git a/src/apps/v1/gacha/gacha_controller.rs b/imphnen-apis/src/apps/v1/gacha/gacha_controller.rs similarity index 100% rename from src/apps/v1/gacha/gacha_controller.rs rename to imphnen-apis/src/apps/v1/gacha/gacha_controller.rs diff --git a/src/apps/v1/gacha/gacha_dto.rs b/imphnen-apis/src/apps/v1/gacha/gacha_dto.rs similarity index 100% rename from src/apps/v1/gacha/gacha_dto.rs rename to imphnen-apis/src/apps/v1/gacha/gacha_dto.rs diff --git a/src/apps/v1/gacha/gacha_repository.rs b/imphnen-apis/src/apps/v1/gacha/gacha_repository.rs similarity index 100% rename from src/apps/v1/gacha/gacha_repository.rs rename to imphnen-apis/src/apps/v1/gacha/gacha_repository.rs diff --git a/src/apps/v1/gacha/gacha_schema.rs b/imphnen-apis/src/apps/v1/gacha/gacha_schema.rs similarity index 100% rename from src/apps/v1/gacha/gacha_schema.rs rename to imphnen-apis/src/apps/v1/gacha/gacha_schema.rs diff --git a/src/apps/v1/gacha/gacha_service.rs b/imphnen-apis/src/apps/v1/gacha/gacha_service.rs similarity index 100% rename from src/apps/v1/gacha/gacha_service.rs rename to imphnen-apis/src/apps/v1/gacha/gacha_service.rs diff --git a/src/apps/v1/gacha/mod.rs b/imphnen-apis/src/apps/v1/gacha/mod.rs similarity index 100% rename from src/apps/v1/gacha/mod.rs rename to imphnen-apis/src/apps/v1/gacha/mod.rs diff --git a/src/apps/v1/mod.rs b/imphnen-apis/src/apps/v1/mod.rs similarity index 100% rename from src/apps/v1/mod.rs rename to imphnen-apis/src/apps/v1/mod.rs diff --git a/src/apps/v1/permissions/mod.rs b/imphnen-apis/src/apps/v1/permissions/mod.rs similarity index 100% rename from src/apps/v1/permissions/mod.rs rename to imphnen-apis/src/apps/v1/permissions/mod.rs diff --git a/src/apps/v1/permissions/permissions_controller.rs b/imphnen-apis/src/apps/v1/permissions/permissions_controller.rs similarity index 100% rename from src/apps/v1/permissions/permissions_controller.rs rename to imphnen-apis/src/apps/v1/permissions/permissions_controller.rs diff --git a/src/apps/v1/permissions/permissions_controller_test.rs b/imphnen-apis/src/apps/v1/permissions/permissions_controller_test.rs similarity index 100% rename from src/apps/v1/permissions/permissions_controller_test.rs rename to imphnen-apis/src/apps/v1/permissions/permissions_controller_test.rs diff --git a/src/apps/v1/permissions/permissions_dto.rs b/imphnen-apis/src/apps/v1/permissions/permissions_dto.rs similarity index 100% rename from src/apps/v1/permissions/permissions_dto.rs rename to imphnen-apis/src/apps/v1/permissions/permissions_dto.rs diff --git a/src/apps/v1/permissions/permissions_enum.rs b/imphnen-apis/src/apps/v1/permissions/permissions_enum.rs similarity index 100% rename from src/apps/v1/permissions/permissions_enum.rs rename to imphnen-apis/src/apps/v1/permissions/permissions_enum.rs diff --git a/src/apps/v1/permissions/permissions_guard.rs b/imphnen-apis/src/apps/v1/permissions/permissions_guard.rs similarity index 100% rename from src/apps/v1/permissions/permissions_guard.rs rename to imphnen-apis/src/apps/v1/permissions/permissions_guard.rs diff --git a/src/apps/v1/permissions/permissions_repository.rs b/imphnen-apis/src/apps/v1/permissions/permissions_repository.rs similarity index 100% rename from src/apps/v1/permissions/permissions_repository.rs rename to imphnen-apis/src/apps/v1/permissions/permissions_repository.rs diff --git a/src/apps/v1/permissions/permissions_repository_test.rs b/imphnen-apis/src/apps/v1/permissions/permissions_repository_test.rs similarity index 100% rename from src/apps/v1/permissions/permissions_repository_test.rs rename to imphnen-apis/src/apps/v1/permissions/permissions_repository_test.rs diff --git a/src/apps/v1/permissions/permissions_schema.rs b/imphnen-apis/src/apps/v1/permissions/permissions_schema.rs similarity index 100% rename from src/apps/v1/permissions/permissions_schema.rs rename to imphnen-apis/src/apps/v1/permissions/permissions_schema.rs diff --git a/src/apps/v1/permissions/permissions_service.rs b/imphnen-apis/src/apps/v1/permissions/permissions_service.rs similarity index 100% rename from src/apps/v1/permissions/permissions_service.rs rename to imphnen-apis/src/apps/v1/permissions/permissions_service.rs diff --git a/src/apps/v1/roles/mod.rs b/imphnen-apis/src/apps/v1/roles/mod.rs similarity index 100% rename from src/apps/v1/roles/mod.rs rename to imphnen-apis/src/apps/v1/roles/mod.rs diff --git a/src/apps/v1/roles/roles_controller.rs b/imphnen-apis/src/apps/v1/roles/roles_controller.rs similarity index 100% rename from src/apps/v1/roles/roles_controller.rs rename to imphnen-apis/src/apps/v1/roles/roles_controller.rs diff --git a/src/apps/v1/roles/roles_controller_test.rs b/imphnen-apis/src/apps/v1/roles/roles_controller_test.rs similarity index 100% rename from src/apps/v1/roles/roles_controller_test.rs rename to imphnen-apis/src/apps/v1/roles/roles_controller_test.rs diff --git a/src/apps/v1/roles/roles_dto.rs b/imphnen-apis/src/apps/v1/roles/roles_dto.rs similarity index 100% rename from src/apps/v1/roles/roles_dto.rs rename to imphnen-apis/src/apps/v1/roles/roles_dto.rs diff --git a/src/apps/v1/roles/roles_enum.rs b/imphnen-apis/src/apps/v1/roles/roles_enum.rs similarity index 100% rename from src/apps/v1/roles/roles_enum.rs rename to imphnen-apis/src/apps/v1/roles/roles_enum.rs diff --git a/src/apps/v1/roles/roles_repository.rs b/imphnen-apis/src/apps/v1/roles/roles_repository.rs similarity index 100% rename from src/apps/v1/roles/roles_repository.rs rename to imphnen-apis/src/apps/v1/roles/roles_repository.rs diff --git a/src/apps/v1/roles/roles_repository_test.rs b/imphnen-apis/src/apps/v1/roles/roles_repository_test.rs similarity index 100% rename from src/apps/v1/roles/roles_repository_test.rs rename to imphnen-apis/src/apps/v1/roles/roles_repository_test.rs diff --git a/src/apps/v1/roles/roles_schema.rs b/imphnen-apis/src/apps/v1/roles/roles_schema.rs similarity index 100% rename from src/apps/v1/roles/roles_schema.rs rename to imphnen-apis/src/apps/v1/roles/roles_schema.rs diff --git a/src/apps/v1/roles/roles_service.rs b/imphnen-apis/src/apps/v1/roles/roles_service.rs similarity index 100% rename from src/apps/v1/roles/roles_service.rs rename to imphnen-apis/src/apps/v1/roles/roles_service.rs diff --git a/src/apps/v1/users/mod.rs b/imphnen-apis/src/apps/v1/users/mod.rs similarity index 100% rename from src/apps/v1/users/mod.rs rename to imphnen-apis/src/apps/v1/users/mod.rs diff --git a/src/apps/v1/users/users_controller.rs b/imphnen-apis/src/apps/v1/users/users_controller.rs similarity index 100% rename from src/apps/v1/users/users_controller.rs rename to imphnen-apis/src/apps/v1/users/users_controller.rs diff --git a/src/apps/v1/users/users_controller_test.rs b/imphnen-apis/src/apps/v1/users/users_controller_test.rs similarity index 100% rename from src/apps/v1/users/users_controller_test.rs rename to imphnen-apis/src/apps/v1/users/users_controller_test.rs diff --git a/src/apps/v1/users/users_dto.rs b/imphnen-apis/src/apps/v1/users/users_dto.rs similarity index 100% rename from src/apps/v1/users/users_dto.rs rename to imphnen-apis/src/apps/v1/users/users_dto.rs diff --git a/src/apps/v1/users/users_repository.rs b/imphnen-apis/src/apps/v1/users/users_repository.rs similarity index 100% rename from src/apps/v1/users/users_repository.rs rename to imphnen-apis/src/apps/v1/users/users_repository.rs diff --git a/src/apps/v1/users/users_repository_test.rs b/imphnen-apis/src/apps/v1/users/users_repository_test.rs similarity index 100% rename from src/apps/v1/users/users_repository_test.rs rename to imphnen-apis/src/apps/v1/users/users_repository_test.rs diff --git a/src/apps/v1/users/users_schema.rs b/imphnen-apis/src/apps/v1/users/users_schema.rs similarity index 100% rename from src/apps/v1/users/users_schema.rs rename to imphnen-apis/src/apps/v1/users/users_schema.rs diff --git a/src/apps/v1/users/users_service.rs b/imphnen-apis/src/apps/v1/users/users_service.rs similarity index 100% rename from src/apps/v1/users/users_service.rs rename to imphnen-apis/src/apps/v1/users/users_service.rs diff --git a/src/apps/v2/auth/mod.rs b/imphnen-apis/src/apps/v2/auth/mod.rs similarity index 100% rename from src/apps/v2/auth/mod.rs rename to imphnen-apis/src/apps/v2/auth/mod.rs diff --git a/src/apps/v2/mod.rs b/imphnen-apis/src/apps/v2/mod.rs similarity index 100% rename from src/apps/v2/mod.rs rename to imphnen-apis/src/apps/v2/mod.rs diff --git a/src/apps/v2/permissions/.gitkeep b/imphnen-apis/src/apps/v2/permissions/.gitkeep similarity index 100% rename from src/apps/v2/permissions/.gitkeep rename to imphnen-apis/src/apps/v2/permissions/.gitkeep diff --git a/src/apps/v2/roles/.gitkeep b/imphnen-apis/src/apps/v2/roles/.gitkeep similarity index 100% rename from src/apps/v2/roles/.gitkeep rename to imphnen-apis/src/apps/v2/roles/.gitkeep diff --git a/src/apps/v2/users/.gitkeep b/imphnen-apis/src/apps/v2/users/.gitkeep similarity index 100% rename from src/apps/v2/users/.gitkeep rename to imphnen-apis/src/apps/v2/users/.gitkeep diff --git a/src/bin/api.rs b/imphnen-apis/src/bin/api.rs similarity index 100% rename from src/bin/api.rs rename to imphnen-apis/src/bin/api.rs diff --git a/src/bin/seed_permissions.rs b/imphnen-apis/src/bin/seed_permissions.rs similarity index 98% rename from src/bin/seed_permissions.rs rename to imphnen-apis/src/bin/seed_permissions.rs index 8e95b71..53e4660 100644 --- a/src/bin/seed_permissions.rs +++ b/imphnen-apis/src/bin/seed_permissions.rs @@ -1,4 +1,4 @@ -use imphnen_backend_service::{get_iso_date, Env}; +use imphnen_utils::{get_iso_date, Env}; use serde_json::json; use std::error::Error; use surrealdb::{engine::remote::ws::Ws, opt::auth::Root, Surreal}; diff --git a/src/bin/seed_roles.rs b/imphnen-apis/src/bin/seed_roles.rs similarity index 97% rename from src/bin/seed_roles.rs rename to imphnen-apis/src/bin/seed_roles.rs index 111e00f..b01af23 100644 --- a/src/bin/seed_roles.rs +++ b/imphnen-apis/src/bin/seed_roles.rs @@ -1,4 +1,4 @@ -use imphnen_backend_service::{get_iso_date, Env}; +use imphnen_utils::{get_iso_date, Env}; use serde_json::json; use std::error::Error; use surrealdb::{engine::remote::ws::Ws, opt::auth::Root, Surreal}; diff --git a/src/bin/seed_roles_permissions.rs b/imphnen-apis/src/bin/seed_roles_permissions.rs similarity index 96% rename from src/bin/seed_roles_permissions.rs rename to imphnen-apis/src/bin/seed_roles_permissions.rs index 1f2db5a..816962d 100644 --- a/src/bin/seed_roles_permissions.rs +++ b/imphnen-apis/src/bin/seed_roles_permissions.rs @@ -1,4 +1,4 @@ -use imphnen_backend_service::{get_iso_date, make_thing, Env}; +use imphnen_utils::{get_iso_date, make_thing, Env}; use std::error::Error; use surrealdb::{engine::remote::ws::Ws, opt::auth::Root, Surreal}; diff --git a/src/bin/seed_users.rs b/imphnen-apis/src/bin/seed_users.rs similarity index 97% rename from src/bin/seed_users.rs rename to imphnen-apis/src/bin/seed_users.rs index 31f431f..7318d79 100644 --- a/src/bin/seed_users.rs +++ b/imphnen-apis/src/bin/seed_users.rs @@ -1,4 +1,4 @@ -use imphnen_backend_service::{get_iso_date, hash_password, Env}; +use imphnen_utils::{get_iso_date, hash_password, Env}; use serde::{Deserialize, Serialize}; use std::error::Error; use surrealdb::{engine::remote::ws::Ws, opt::auth::Root, sql::Thing, Surreal}; diff --git a/imphnen-apis/src/lib.rs b/imphnen-apis/src/lib.rs new file mode 100644 index 0000000..cae114e --- /dev/null +++ b/imphnen-apis/src/lib.rs @@ -0,0 +1,32 @@ +use ::surrealdb::Uuid; +use imphnen_entities::*; +use imphnen_libs::*; +use imphnen_utils::*; + +pub mod apps; + +pub use apps::*; +pub use imphnen_entities::*; +pub use imphnen_libs::*; + +pub fn create_test_user( + email: &str, + fullname: &str, + is_active: bool, + role_id: &str, +) -> UsersSchema { + UsersSchema { + id: make_thing("app_users", &Uuid::new_v4().to_string()), + email: email.to_string(), + fullname: format!("Randomize {} {}", fullname, rand::random::()), + password: hash_password("secret").unwrap(), + is_deleted: false, + avatar: None, + phone_number: "081234567890".to_string(), + is_active, + gender: None, + birthdate: None, + role: make_thing("app_roles", role_id), + ..Default::default() + } +} diff --git a/src/main.rs b/imphnen-apis/src/main.rs similarity index 100% rename from src/main.rs rename to imphnen-apis/src/main.rs diff --git a/imphnen-entities/Cargo.toml b/imphnen-entities/Cargo.toml new file mode 100644 index 0000000..bce60d5 --- /dev/null +++ b/imphnen-entities/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "imphnen-entities" +version = "0.1.0" +edition = "2024" + +[dependencies] +axum.workspace = true +serde.workspace = true +surrealdb = { workspace = true, features = ["kv-mem"] } +thiserror.workspace = true +utoipa.workspace = true diff --git a/src/entities/common_dto.rs b/imphnen-entities/src/common_dto.rs similarity index 100% rename from src/entities/common_dto.rs rename to imphnen-entities/src/common_dto.rs diff --git a/src/entities/error_dto.rs b/imphnen-entities/src/error_dto.rs similarity index 100% rename from src/entities/error_dto.rs rename to imphnen-entities/src/error_dto.rs diff --git a/src/entities/mod.rs b/imphnen-entities/src/lib.rs similarity index 98% rename from src/entities/mod.rs rename to imphnen-entities/src/lib.rs index d5cb2ef..3e78fd6 100644 --- a/src/entities/mod.rs +++ b/imphnen-entities/src/lib.rs @@ -1,5 +1,4 @@ pub mod common_dto; pub mod error_dto; - pub use common_dto::*; pub use error_dto::*; diff --git a/imphnen-libs/Cargo.toml b/imphnen-libs/Cargo.toml new file mode 100644 index 0000000..da99949 --- /dev/null +++ b/imphnen-libs/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "imphnen-libs" +version = "0.1.0" +edition = "2024" + +[dependencies] +imphnen-entities = { path = "../imphnen-entities" } +argon2.workspace = true +axum.workspace = true +tokio.workspace = true +chrono.workspace = true +jsonwebtoken.workspace = true +serde.workspace = true +lettre.workspace = true +surrealdb = { workspace = true, features = ["kv-mem"] } \ No newline at end of file diff --git a/src/libs/argon/mod.rs b/imphnen-libs/src/argon/mod.rs similarity index 100% rename from src/libs/argon/mod.rs rename to imphnen-libs/src/argon/mod.rs diff --git a/src/libs/axum/mod.rs b/imphnen-libs/src/axum/mod.rs similarity index 100% rename from src/libs/axum/mod.rs rename to imphnen-libs/src/axum/mod.rs diff --git a/src/libs/enviroment/mod.rs b/imphnen-libs/src/enviroment/mod.rs similarity index 100% rename from src/libs/enviroment/mod.rs rename to imphnen-libs/src/enviroment/mod.rs diff --git a/src/libs/jsonwebtoken/mod.rs b/imphnen-libs/src/jsonwebtoken/mod.rs similarity index 100% rename from src/libs/jsonwebtoken/mod.rs rename to imphnen-libs/src/jsonwebtoken/mod.rs diff --git a/src/libs/lettre/mod.rs b/imphnen-libs/src/lettre/mod.rs similarity index 100% rename from src/libs/lettre/mod.rs rename to imphnen-libs/src/lettre/mod.rs diff --git a/src/libs/mod.rs b/imphnen-libs/src/lib.rs similarity index 80% rename from src/libs/mod.rs rename to imphnen-libs/src/lib.rs index b96e744..0678288 100644 --- a/src/libs/mod.rs +++ b/imphnen-libs/src/lib.rs @@ -1,3 +1,5 @@ +use imphnen_entities::*; + pub mod argon; pub mod axum; pub mod enviroment; @@ -8,6 +10,7 @@ pub mod surrealdb; pub use argon::*; pub use axum::*; pub use enviroment::*; +pub use imphnen_entities::*; pub use jsonwebtoken::*; pub use lettre::*; pub use surrealdb::*; diff --git a/src/libs/surrealdb/mod.rs b/imphnen-libs/src/surrealdb/mod.rs similarity index 100% rename from src/libs/surrealdb/mod.rs rename to imphnen-libs/src/surrealdb/mod.rs diff --git a/src/libs/surrealdb/resource.rs b/imphnen-libs/src/surrealdb/resource.rs similarity index 100% rename from src/libs/surrealdb/resource.rs rename to imphnen-libs/src/surrealdb/resource.rs diff --git a/imphnen-utils/Cargo.toml b/imphnen-utils/Cargo.toml new file mode 100644 index 0000000..2296459 --- /dev/null +++ b/imphnen-utils/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "imphnen-utils" +version = "0.1.0" +edition = "2024" + +[dependencies] +imphnen-libs = { path = "../imphnen-libs"} +imphnen-entities = { path = "../imphnen-entities" } +surrealdb.workspace = true +axum.workspace = true +chrono.workspace = true +rand.workspace = true +anyhow.workspace = true +axum-test.workspace = true +serde.workspace = true +serde_json.workspace = true +validator.workspace = true \ No newline at end of file diff --git a/src/utils/bind_filter.rs b/imphnen-utils/src/bind_filter.rs similarity index 100% rename from src/utils/bind_filter.rs rename to imphnen-utils/src/bind_filter.rs diff --git a/src/utils/extract_email.rs b/imphnen-utils/src/extract_email.rs similarity index 100% rename from src/utils/extract_email.rs rename to imphnen-utils/src/extract_email.rs diff --git a/src/utils/generate_date.rs b/imphnen-utils/src/generate_date.rs similarity index 100% rename from src/utils/generate_date.rs rename to imphnen-utils/src/generate_date.rs diff --git a/src/utils/generate_otp.rs b/imphnen-utils/src/generate_otp.rs similarity index 100% rename from src/utils/generate_otp.rs rename to imphnen-utils/src/generate_otp.rs diff --git a/src/utils/get_id.rs b/imphnen-utils/src/get_id.rs similarity index 100% rename from src/utils/get_id.rs rename to imphnen-utils/src/get_id.rs diff --git a/src/utils/mod.rs b/imphnen-utils/src/lib.rs similarity index 81% rename from src/utils/mod.rs rename to imphnen-utils/src/lib.rs index 0504a49..e21a316 100644 --- a/src/utils/mod.rs +++ b/imphnen-utils/src/lib.rs @@ -1,3 +1,6 @@ +use imphnen_entities::*; +use imphnen_libs::*; + pub mod bind_filter; pub mod extract_email; pub mod generate_date; @@ -14,6 +17,8 @@ pub use extract_email::*; pub use generate_date::*; pub use generate_otp::*; pub use get_id::*; +pub use imphnen_entities::*; +pub use imphnen_libs::*; pub use make_thing::*; pub use mock_test::*; pub use query_list::*; diff --git a/src/utils/make_thing.rs b/imphnen-utils/src/make_thing.rs similarity index 100% rename from src/utils/make_thing.rs rename to imphnen-utils/src/make_thing.rs diff --git a/src/utils/mock_test.rs b/imphnen-utils/src/mock_test.rs similarity index 61% rename from src/utils/mock_test.rs rename to imphnen-utils/src/mock_test.rs index 3a0743f..5cef85d 100644 --- a/src/utils/mock_test.rs +++ b/imphnen-utils/src/mock_test.rs @@ -1,12 +1,10 @@ -use crate::{hash_password, AppState, UsersSchema}; +use crate::AppState; use surrealdb::{ + Surreal, engine::{local::Mem, remote::ws::Ws}, opt::auth::Root, - Surreal, Uuid, }; -use super::make_thing; - pub async fn create_mock_app_state() -> AppState { let db_mem = Surreal::new::(()).await.unwrap(); let db_ws = Surreal::new::("localhost:8000").await.unwrap(); @@ -51,25 +49,3 @@ pub async fn cleanup_db() { ) .await; } - -pub fn create_test_user( - email: &str, - fullname: &str, - is_active: bool, - role_id: &str, -) -> UsersSchema { - UsersSchema { - id: make_thing("app_users", &Uuid::new_v4().to_string()), - email: email.to_string(), - fullname: format!("Randomize {} {}", fullname, rand::random::()), - password: hash_password("secret").unwrap(), - is_deleted: false, - avatar: None, - phone_number: "081234567890".to_string(), - is_active, - gender: None, - birthdate: None, - role: make_thing("app_roles", role_id), - ..Default::default() - } -} diff --git a/src/utils/query_list.rs b/imphnen-utils/src/query_list.rs similarity index 100% rename from src/utils/query_list.rs rename to imphnen-utils/src/query_list.rs diff --git a/src/utils/response_format.rs b/imphnen-utils/src/response_format.rs similarity index 100% rename from src/utils/response_format.rs rename to imphnen-utils/src/response_format.rs diff --git a/src/utils/validator.rs b/imphnen-utils/src/validator.rs similarity index 100% rename from src/utils/validator.rs rename to imphnen-utils/src/validator.rs diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 43301ac..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub mod apps; -pub mod entities; -pub mod libs; -pub mod utils; - -pub use apps::*; -pub use entities::*; -pub use libs::*; -pub use utils::*;