Compare commits
1 Commits
68dadd1c5b
...
247953ba03
Author | SHA1 | Date | |
---|---|---|---|
247953ba03 |
306
Cargo.lock
generated
306
Cargo.lock
generated
@ -63,7 +63,7 @@ checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04"
|
|||||||
name = "app"
|
name = "app"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum 0.8.1",
|
"axum",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"http",
|
"http",
|
||||||
"leptos",
|
"leptos",
|
||||||
@ -75,7 +75,6 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"server_fn",
|
"server_fn",
|
||||||
"thiserror 2.0.11",
|
"thiserror 2.0.11",
|
||||||
"uuid",
|
|
||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -166,37 +165,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f"
|
checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum-core 0.4.5",
|
"axum-core",
|
||||||
"bytes",
|
|
||||||
"futures-util",
|
|
||||||
"http",
|
|
||||||
"http-body",
|
|
||||||
"http-body-util",
|
|
||||||
"itoa",
|
|
||||||
"matchit 0.7.3",
|
|
||||||
"memchr",
|
|
||||||
"mime",
|
|
||||||
"multer",
|
|
||||||
"percent-encoding",
|
|
||||||
"pin-project-lite",
|
|
||||||
"rustversion",
|
|
||||||
"serde",
|
|
||||||
"sync_wrapper",
|
|
||||||
"tower",
|
|
||||||
"tower-layer",
|
|
||||||
"tower-service",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "axum"
|
|
||||||
version = "0.8.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8"
|
|
||||||
dependencies = [
|
|
||||||
"axum-core 0.5.0",
|
|
||||||
"axum-macros",
|
"axum-macros",
|
||||||
"bytes",
|
"bytes",
|
||||||
"form_urlencoded",
|
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http",
|
||||||
"http-body",
|
"http-body",
|
||||||
@ -204,9 +175,10 @@ dependencies = [
|
|||||||
"hyper",
|
"hyper",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"itoa",
|
"itoa",
|
||||||
"matchit 0.8.4",
|
"matchit",
|
||||||
"memchr",
|
"memchr",
|
||||||
"mime",
|
"mime",
|
||||||
|
"multer",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
@ -240,33 +212,14 @@ dependencies = [
|
|||||||
"sync_wrapper",
|
"sync_wrapper",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "axum-core"
|
|
||||||
version = "0.5.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733"
|
|
||||||
dependencies = [
|
|
||||||
"bytes",
|
|
||||||
"futures-util",
|
|
||||||
"http",
|
|
||||||
"http-body",
|
|
||||||
"http-body-util",
|
|
||||||
"mime",
|
|
||||||
"pin-project-lite",
|
|
||||||
"rustversion",
|
|
||||||
"sync_wrapper",
|
|
||||||
"tower-layer",
|
|
||||||
"tower-service",
|
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "axum-macros"
|
name = "axum-macros"
|
||||||
version = "0.5.0"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "604fde5e028fea851ce1d8570bbdc034bec850d157f7569d10f347d06808c05c"
|
checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -296,9 +249,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "2.8.0"
|
version = "2.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
|
checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brotli"
|
name = "brotli"
|
||||||
@ -347,9 +300,9 @@ checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.2.10"
|
version = "1.2.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
|
checksum = "ad0cf6e91fde44c773c6ee7ec6bba798504641a8bc2eb7e37a04ffbf4dfaa55a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"jobserver",
|
"jobserver",
|
||||||
"libc",
|
"libc",
|
||||||
@ -584,6 +537,16 @@ version = "1.0.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "erased-serde"
|
||||||
|
version = "0.4.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"typeid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "errno"
|
name = "errno"
|
||||||
version = "0.3.10"
|
version = "0.3.10"
|
||||||
@ -1244,7 +1207,7 @@ name = "lebusiness-client"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app",
|
"app",
|
||||||
"axum 0.8.1",
|
"axum",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
"leptos",
|
"leptos",
|
||||||
"leptos_axum",
|
"leptos_axum",
|
||||||
@ -1257,9 +1220,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos"
|
name = "leptos"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "21c31c9d022c77702c53e02830d08b28320aca9c0899a19c443096c114623fa5"
|
checksum = "a8a90c679094979aa12927e8e925fe8eead1420d69420b2d8c6540863937ca75"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"any_spawner",
|
"any_spawner",
|
||||||
"base64",
|
"base64",
|
||||||
@ -1295,12 +1258,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_axum"
|
name = "leptos_axum"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43b613d5784037baee42a11d21bc263adfc1a55e416556a3d5bfe39c7b87fadf"
|
checksum = "ae4386e955d6ba7c3c8d09583e99044050f6fb9a48b8d4096af948fdb3345434"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"any_spawner",
|
"any_spawner",
|
||||||
"axum 0.7.9",
|
"axum",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"futures",
|
"futures",
|
||||||
"hydration_context",
|
"hydration_context",
|
||||||
@ -1319,9 +1282,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_config"
|
name = "leptos_config"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5d874993c7664d757677d056c8f46b5cb5365fe622005e1bf26050f4996e7e52"
|
checksum = "c712e1ed3283d1acb842cef4cbcce7b2987a347cc1bf7141195e01f92bb8590d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"config",
|
"config",
|
||||||
"regex",
|
"regex",
|
||||||
@ -1332,9 +1295,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_dom"
|
name = "leptos_dom"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a462aaeec85bc4ecfb26bf324437b92690bf3add1e30eb29b3acc08b20e8b4cb"
|
checksum = "99803be421344a2184fd5796e1a7645c2090738b2ab5d1a856084816853ec322"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"or_poisoned",
|
"or_poisoned",
|
||||||
@ -1347,9 +1310,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_hot_reload"
|
name = "leptos_hot_reload"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "07eb295ad2f3b2af190da62af339b84fd01ce3c71702f09eb69a57310fcf0c6d"
|
checksum = "92413c6d93a22d8c4e75b2e7da3867af173e8d9ca49ce170b631e7c2766eef48"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"camino",
|
"camino",
|
||||||
@ -1365,9 +1328,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_integration_utils"
|
name = "leptos_integration_utils"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a8652fcd7a1744f85403b95c5520143f3b962d640c8450b8514f9530fb5c4b76"
|
checksum = "692fbf6dc5358d766932c6e58b30df53cfde916a9f4d20d4bb0cfc1bbf7f85a1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"hydration_context",
|
"hydration_context",
|
||||||
@ -1380,9 +1343,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_macro"
|
name = "leptos_macro"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "90291b25ee576bc9c299d3371cc8f09bf60ea939a8de61fa8b744650aff76e24"
|
checksum = "20bcb2afa03e0614c64eec4a95ec2986fd3c59358daa0f50006e081bc1bd1067"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"attribute-derive",
|
"attribute-derive",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
@ -1402,9 +1365,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_meta"
|
name = "leptos_meta"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7250991b2077ef5869e999c74cf4990926a3c3919b50c9937e101c1c874102db"
|
checksum = "a54d4b942a474e38b606ff0bfe8712f093300bd053adb9dd7a028a14ca3fbfac"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
@ -1418,9 +1381,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_router"
|
name = "leptos_router"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9a193dbd62b9617a5d7d199ea70c570da01a1bbe798e617373b6351845be6778"
|
checksum = "69ff7d8c058b4bd7512fa58224b684d5da10d5f056171b8e27d516e0d36e1a5d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"any_spawner",
|
"any_spawner",
|
||||||
"either_of",
|
"either_of",
|
||||||
@ -1443,9 +1406,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_router_macro"
|
name = "leptos_router_macro"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "34bc3f80ad810b22058f12d278bb0bf929779cc0bc1289a06980d896f62743f0"
|
checksum = "15a48035e8d796233a5b43322aeab9387f946f914dacdf17a1981c3910879b19"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-error2",
|
"proc-macro-error2",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@ -1454,9 +1417,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_server"
|
name = "leptos_server"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "18caffe32c245ddb35697edd898ccb3393efce67672a707a14eebd0db2e8249a"
|
checksum = "0fb23bd110ac04c7276aae3d8ba523f94cf06989d00b4e76eaee89451b06b494"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"any_spawner",
|
"any_spawner",
|
||||||
"base64",
|
"base64",
|
||||||
@ -1508,9 +1471,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.25"
|
version = "0.4.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
|
checksum = "3d6ea2a48c204030ee31a7d7fc72c93294c92fe87ecb1789881c9543516e1a0d"
|
||||||
|
dependencies = [
|
||||||
|
"value-bag",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "manyhow"
|
name = "manyhow"
|
||||||
@ -1541,12 +1507,6 @@ version = "0.7.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
|
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "matchit"
|
|
||||||
version = "0.8.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.7.4"
|
version = "2.7.4"
|
||||||
@ -1577,9 +1537,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.8.3"
|
version = "0.8.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924"
|
checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"adler2",
|
"adler2",
|
||||||
]
|
]
|
||||||
@ -1856,9 +1816,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "prettyplease"
|
name = "prettyplease"
|
||||||
version = "0.2.29"
|
version = "0.2.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac"
|
checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"syn",
|
"syn",
|
||||||
@ -2005,9 +1965,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reactive_graph"
|
name = "reactive_graph"
|
||||||
version = "0.1.4"
|
version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9fbf210c04505e128fb7f64acecc23c71f82f56c7d481b190e1010b7bada2cb9"
|
checksum = "4bee22d7574c73fbfd47d828ee14dc67ca65606ade81de2f8d1691741072a93b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"any_spawner",
|
"any_spawner",
|
||||||
"async-lock",
|
"async-lock",
|
||||||
@ -2317,10 +2277,19 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_fmt"
|
||||||
version = "1.0.137"
|
version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b"
|
checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_json"
|
||||||
|
version = "1.0.135"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
@ -2372,11 +2341,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server_fn"
|
name = "server_fn"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f5dd7fcccd3ef2081da086c1f8595b506627abbbbc9f64be0141d2251219570e"
|
checksum = "d0b9f0d2eecb2bf4f909661acc731009e3657574dec93a0ec9f114e250f74bc4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum 0.7.9",
|
"axum",
|
||||||
"bytes",
|
"bytes",
|
||||||
"const_format",
|
"const_format",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
@ -2408,9 +2377,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server_fn_macro"
|
name = "server_fn_macro"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e0bbac4f01a714b0490247ac625bdb7055548210556c39e8f56a2dbbe3abc70b"
|
checksum = "ee7723bef57b4353cd9939e280d3b5b2ebe45b4a4630c9e9e97a6fa4b84e8b1c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const_format",
|
"const_format",
|
||||||
"convert_case",
|
"convert_case",
|
||||||
@ -2422,9 +2391,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server_fn_macro_default"
|
name = "server_fn_macro_default"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f07dfd1744a5f5612f00f69fe035b0bfafdf12bb46d76e785673078a9e56b170"
|
checksum = "87663ec10f17fbe8f6c53adc2d038df3304bfd17aaaab22f777810a9e6e05fff"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"server_fn_macro",
|
"server_fn_macro",
|
||||||
"syn",
|
"syn",
|
||||||
@ -2509,6 +2478,84 @@ version = "2.6.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_buffer"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
"sval_ref",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_dynamic"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_fmt"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94"
|
||||||
|
dependencies = [
|
||||||
|
"itoa",
|
||||||
|
"ryu",
|
||||||
|
"sval",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_json"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155"
|
||||||
|
dependencies = [
|
||||||
|
"itoa",
|
||||||
|
"ryu",
|
||||||
|
"sval",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_nested"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
"sval_buffer",
|
||||||
|
"sval_ref",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_ref"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_serde"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"sval",
|
||||||
|
"sval_nested",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.96"
|
version = "2.0.96"
|
||||||
@ -2575,9 +2622,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tachys"
|
name = "tachys"
|
||||||
version = "0.1.4"
|
version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d777e4426a597296b020edcb5c3d8f25a3ccd8adfd22eb5154ac81da946aef9f"
|
checksum = "761f12c13d74f1b723e3c53ff70fe291d15fe51cc4b6586aafea974f0b647043"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"any_spawner",
|
"any_spawner",
|
||||||
"const_str_slice_concat",
|
"const_str_slice_concat",
|
||||||
@ -2916,6 +2963,12 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typeid"
|
||||||
|
version = "1.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicase"
|
name = "unicase"
|
||||||
version = "2.8.1"
|
version = "2.8.1"
|
||||||
@ -2977,12 +3030,47 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "1.12.0"
|
version = "1.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4"
|
checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "value-bag"
|
||||||
|
version = "1.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2"
|
||||||
|
dependencies = [
|
||||||
|
"value-bag-serde1",
|
||||||
|
"value-bag-sval2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "value-bag-serde1"
|
||||||
|
version = "1.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b"
|
||||||
|
dependencies = [
|
||||||
|
"erased-serde",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde_fmt",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "value-bag-sval2"
|
||||||
|
version = "1.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
"sval_buffer",
|
||||||
|
"sval_dynamic",
|
||||||
|
"sval_fmt",
|
||||||
|
"sval_json",
|
||||||
|
"sval_ref",
|
||||||
|
"sval_serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
13
Cargo.toml
13
Cargo.toml
@ -9,14 +9,14 @@ lto = true
|
|||||||
opt-level = 'z'
|
opt-level = 'z'
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
leptos = { version = "0.7.4", features = ["nightly"] }
|
leptos = { version = "0.7.2", features = ["nightly"] }
|
||||||
leptos_meta = { version = "0.7.4" }
|
leptos_meta = { version = "0.7.2" }
|
||||||
leptos_router = { version = "0.7.4", features = ["nightly"] }
|
leptos_router = { version = "0.7.2", features = ["nightly"] }
|
||||||
leptos_axum = { version = "0.7.4" }
|
leptos_axum = { version = "0.7.2" }
|
||||||
server_fn = { version = "0.7.4", features = [] }
|
server_fn = { version = "0.7.2", features = [] }
|
||||||
|
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
axum = "0.8.0"
|
axum = "0.8"
|
||||||
cfg-if = "1"
|
cfg-if = "1"
|
||||||
console_error_panic_hook = "0.1.7"
|
console_error_panic_hook = "0.1.7"
|
||||||
console_log = "1"
|
console_log = "1"
|
||||||
@ -28,7 +28,6 @@ tokio = { version = "1.37.0", features = ["full"] }
|
|||||||
tower = { version = "0.5.0", features = ["full"] }
|
tower = { version = "0.5.0", features = ["full"] }
|
||||||
tower-http = { version = "0.6", features = ["full"] }
|
tower-http = { version = "0.6", features = ["full"] }
|
||||||
wasm-bindgen = "=0.2.100"
|
wasm-bindgen = "=0.2.100"
|
||||||
uuid = { version = "1.1.2", features = ["serde", "v4"] }
|
|
||||||
|
|
||||||
# See https://github.com/akesson/cargo-leptos for documentation of all the parameters.
|
# See https://github.com/akesson/cargo-leptos for documentation of all the parameters.
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ serde.workspace = true
|
|||||||
http.workspace = true
|
http.workspace = true
|
||||||
cfg-if.workspace = true
|
cfg-if.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
uuid.workspace = true
|
|
||||||
reqwest = { version = "0.12.11", optional = true, features = ["json"] }
|
reqwest = { version = "0.12.11", optional = true, features = ["json"] }
|
||||||
serde_json = { version = "1.0.134", optional = true }
|
serde_json = { version = "1.0.134", optional = true }
|
||||||
web-sys = { version = "0.3.76", features = [
|
web-sys = { version = "0.3.76", features = [
|
||||||
@ -36,7 +35,6 @@ ssr = [
|
|||||||
"dep:leptos_axum",
|
"dep:leptos_axum",
|
||||||
"dep:serde_json",
|
"dep:serde_json",
|
||||||
"dep:axum",
|
"dep:axum",
|
||||||
"reqwest",
|
|
||||||
]
|
]
|
||||||
reqwest = ["dep:reqwest"]
|
reqwest = ["dep:reqwest"]
|
||||||
axum = ["dep:axum"]
|
axum = ["dep:axum"]
|
||||||
|
@ -25,7 +25,7 @@ impl AppError {
|
|||||||
#[component]
|
#[component]
|
||||||
pub fn ErrorTemplate(
|
pub fn ErrorTemplate(
|
||||||
#[prop(optional)] outside_errors: Option<Errors>,
|
#[prop(optional)] outside_errors: Option<Errors>,
|
||||||
#[prop(optional, into)] errors: Option<RwSignal<Errors>>,
|
#[prop(optional)] errors: Option<RwSignal<Errors>>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
let errors = match outside_errors {
|
let errors = match outside_errors {
|
||||||
Some(e) => RwSignal::new(e),
|
Some(e) => RwSignal::new(e),
|
||||||
@ -49,9 +49,7 @@ pub fn ErrorTemplate(
|
|||||||
cfg_if! { if #[cfg(feature="ssr")] {
|
cfg_if! { if #[cfg(feature="ssr")] {
|
||||||
let response = use_context::<ResponseOptions>();
|
let response = use_context::<ResponseOptions>();
|
||||||
if let Some(response) = response {
|
if let Some(response) = response {
|
||||||
if let Some(resp) = errors.first() {
|
response.set_status(errors[0].status_code());
|
||||||
response.set_status(resp.status_code());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
use std::any::Any;
|
|
||||||
|
|
||||||
use crate::error_template::{AppError, ErrorTemplate};
|
use crate::error_template::{AppError, ErrorTemplate};
|
||||||
|
|
||||||
use leptos::{either::Either, ev::SubmitEvent, html, prelude::*};
|
use leptos::{ev::SubmitEvent, html, prelude::*};
|
||||||
use leptos_meta::*;
|
use leptos_meta::*;
|
||||||
use leptos_router::{components::*, StaticSegment};
|
use leptos_router::{components::*, StaticSegment};
|
||||||
use message::Message;
|
use message::Message;
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
pub mod error_template;
|
pub mod error_template;
|
||||||
|
|
||||||
@ -73,94 +70,34 @@ fn smooth_scroll_to_bottom() {
|
|||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn HomePage() -> impl IntoView {
|
pub fn HomePage() -> impl IntoView {
|
||||||
let conversation_id = uuid::Uuid::new_v4();
|
let (messages, set_messages) = signal(
|
||||||
|
message::get_messages()
|
||||||
let send_message = ServerAction::<SendMessage>::new();
|
.into_iter()
|
||||||
|
.enumerate()
|
||||||
let messages = Resource::new(
|
.map(|(index, value)| (index, ArcRwSignal::new(value)))
|
||||||
move || (send_message.version().get()),
|
.collect::<Vec<_>>(),
|
||||||
move |_| {
|
|
||||||
get_messages(GetMessagesRequest {
|
|
||||||
conversation_id: conversation_id.clone(),
|
|
||||||
})
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let existing_messages = move || {
|
|
||||||
Suspend::new(async move {
|
|
||||||
messages.await.map(|messages| {
|
|
||||||
if messages.messages.is_empty() {
|
|
||||||
Either::Left(view! { <p>"No messages sent yet"</p> })
|
|
||||||
} else {
|
|
||||||
Either::Right(
|
|
||||||
messages
|
|
||||||
.messages
|
|
||||||
.iter()
|
|
||||||
.map(move |message| {
|
|
||||||
view! {
|
|
||||||
<div class=format!(
|
|
||||||
"flex {}",
|
|
||||||
if message.role == "assistant" {
|
|
||||||
"justify-start"
|
|
||||||
} else {
|
|
||||||
"justify-end"
|
|
||||||
},
|
|
||||||
)>
|
|
||||||
<div class=format!(
|
|
||||||
"max-w-[80%] rounded-sm px-4 py-3 {}",
|
|
||||||
if message.role == "assistant" {
|
|
||||||
"bg-white border border-gray-200"
|
|
||||||
} else {
|
|
||||||
"bg-blue-500 text-white"
|
|
||||||
},
|
|
||||||
)>{message.content.clone()}</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect::<Vec<_>>(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
// let (_, set_messages) = signal(
|
|
||||||
// message::get_messages()
|
|
||||||
// .into_iter()
|
|
||||||
// .enumerate()
|
|
||||||
// .map(|(index, value)| (index, ArcRwSignal::new(value)))
|
|
||||||
// .collect::<Vec<_>>(),
|
|
||||||
// );
|
|
||||||
let (input, set_input) = signal("".to_string());
|
let (input, set_input) = signal("".to_string());
|
||||||
|
|
||||||
let on_submit = move |ev: SubmitEvent| {
|
let on_submit = move |ev: SubmitEvent| {
|
||||||
// stop the page from reloading!
|
// stop the page from reloading!
|
||||||
ev.prevent_default();
|
ev.prevent_default();
|
||||||
|
|
||||||
leptos::logging::log!("sending request");
|
let messages_len = messages.get().len();
|
||||||
send_message.dispatch(SendMessage {
|
let mut messages = set_messages.write();
|
||||||
request: SendMessageRequest {
|
messages.push((
|
||||||
conversation_id: Some(conversation_id.clone()),
|
messages_len,
|
||||||
|
ArcRwSignal::new(Message {
|
||||||
role: "user".into(),
|
role: "user".into(),
|
||||||
content: input.get(),
|
content: input.get().into(),
|
||||||
},
|
}),
|
||||||
});
|
));
|
||||||
|
|
||||||
set_input.set("".into());
|
set_input.set("".into());
|
||||||
|
|
||||||
// let messages_len = messages.get().len();
|
request_animation_frame(move || {
|
||||||
// let mut messages = set_messages.write();
|
smooth_scroll_to_bottom();
|
||||||
// messages.push((
|
});
|
||||||
// messages_len,
|
|
||||||
// ArcRwSignal::new(Message {
|
|
||||||
// role: "user".into(),
|
|
||||||
// content: input.get().into(),
|
|
||||||
// }),
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// request_animation_frame(move || {
|
|
||||||
// smooth_scroll_to_bottom();
|
|
||||||
// });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
@ -176,21 +113,38 @@ pub fn HomePage() -> impl IntoView {
|
|||||||
|
|
||||||
<div class="overflow-y-auto flex-1 px-4" id="messages">
|
<div class="overflow-y-auto flex-1 px-4" id="messages">
|
||||||
<div class="py-6 mx-auto space-y-6 max-w-5xl">
|
<div class="py-6 mx-auto space-y-6 max-w-5xl">
|
||||||
|
<For
|
||||||
|
each=move || messages.get()
|
||||||
|
key=|message| message.0
|
||||||
|
children=move |(_id, message)| {
|
||||||
|
let message = message.read();
|
||||||
|
|
||||||
<Transition fallback=move || {
|
view! {
|
||||||
view! {
|
<div class=format!(
|
||||||
<div class="flex justify-start">
|
"flex {}",
|
||||||
<div class="py-3 px-4 bg-white rounded-sm border border-gray-200 max-w-[80%]">
|
if message.role == "assistant" {
|
||||||
"Loading..."
|
"justify-start"
|
||||||
|
} else {
|
||||||
|
"justify-end"
|
||||||
|
},
|
||||||
|
)>
|
||||||
|
<div class=format!(
|
||||||
|
"max-w-[80%] rounded-sm px-4 py-3 {}",
|
||||||
|
if message.role == "assistant" {
|
||||||
|
"bg-white border border-gray-200"
|
||||||
|
} else {
|
||||||
|
"bg-blue-500 text-white"
|
||||||
|
},
|
||||||
|
)>{message.content.clone()}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
}
|
}
|
||||||
}>
|
/>
|
||||||
<ErrorBoundary fallback=|errors| {
|
<div class="flex justify-start">
|
||||||
view! { <ErrorTemplate errors /> }
|
<div class="py-3 px-4 bg-white rounded-sm border border-gray-200 max-w-[80%]">
|
||||||
}>{existing_messages}</ErrorBoundary>
|
"Loading..."
|
||||||
</Transition>
|
</div>
|
||||||
|
</div>
|
||||||
<div />
|
<div />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -217,48 +171,3 @@ pub fn HomePage() -> impl IntoView {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
|
||||||
pub struct GetMessagesRequest {
|
|
||||||
conversation_id: uuid::Uuid,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
|
||||||
pub struct Messages {
|
|
||||||
pub messages: Vec<Message>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[server]
|
|
||||||
pub async fn get_messages(req: GetMessagesRequest) -> Result<Messages, ServerFnError> {
|
|
||||||
let messages: Vec<Message> = reqwest::get(format!(
|
|
||||||
"https://lebusiness-service.prod.kjuulh.app/api/messages?conversation_id={}",
|
|
||||||
req.conversation_id,
|
|
||||||
))
|
|
||||||
.await
|
|
||||||
.map_err(|e| ServerFnError::new(e.to_string()))?
|
|
||||||
.json()
|
|
||||||
.await
|
|
||||||
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
|
||||||
|
|
||||||
Ok(Messages { messages })
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
|
||||||
pub struct SendMessageRequest {
|
|
||||||
conversation_id: Option<uuid::Uuid>,
|
|
||||||
role: String,
|
|
||||||
content: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[server]
|
|
||||||
pub async fn send_message(request: SendMessageRequest) -> Result<(), ServerFnError> {
|
|
||||||
let client = reqwest::Client::new();
|
|
||||||
client
|
|
||||||
.post("https://lebusiness-service.prod.kjuulh.app/api/messages")
|
|
||||||
.json(&request)
|
|
||||||
.send()
|
|
||||||
.await
|
|
||||||
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
|
||||||
pub struct Message {
|
pub struct Message {
|
||||||
pub role: String,
|
pub role: String,
|
||||||
pub content: String,
|
pub content: String,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user