From f25366e34919addb36e3f7e5a8e19e5e9e07c6e9 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 9 Mar 2023 21:16:29 -0500 Subject: [PATCH] Initial web studio functionality --- .gitignore | 1 + backend/Cargo.lock | 460 ++-- backend/Cargo.toml | 1 + backend/caylon-config/Cargo.lock | 105 + backend/caylon-config/Cargo.toml | 15 + .../config => caylon-config/src}/about.rs | 2 +- .../config => caylon-config/src}/action.rs | 14 +- .../{src/config => caylon-config/src}/base.rs | 6 +- .../config => caylon-config/src}/button.rs | 2 +- .../config => caylon-config/src}/element.rs | 2 +- .../src}/event_display.rs | 4 +- .../mod.rs => caylon-config/src/lib.rs} | 2 +- .../config => caylon-config/src}/reading.rs | 2 +- .../src}/result_display.rs | 2 +- .../config => caylon-config/src}/slider.rs | 2 +- .../config => caylon-config/src}/toggle.rs | 2 +- .../src}/transformer.rs | 14 +- backend/caylon-studio/.gitignore | 2 + backend/caylon-studio/Cargo.lock | 2265 +++++++++++++++++ backend/caylon-studio/Cargo.toml | 41 + backend/caylon-studio/README.md | 5 + backend/caylon-studio/index.html | 14 + backend/caylon-studio/index.scss | 290 +++ backend/caylon-studio/run.sh | 3 + backend/caylon-studio/src/api/get_hits.rs | 9 + backend/caylon-studio/src/api/get_index.rs | 43 + .../caylon-studio/src/api/get_resources.rs | 8 + backend/caylon-studio/src/api/mod.rs | 7 + backend/caylon-studio/src/bin/backend.rs | 27 + backend/caylon-studio/src/bin/frontend.rs | 13 + backend/caylon-studio/src/lib.rs | 3 + backend/caylon-studio/src/ui/app.rs | 26 + .../src/ui/element/add_element.rs | 194 ++ .../caylon-studio/src/ui/element/button.rs | 72 + .../src/ui/element/edit/action_editor.rs | 230 ++ .../src/ui/element/edit/actions/command.rs | 42 + .../src/ui/element/edit/actions/javascript.rs | 42 + .../src/ui/element/edit/actions/json.rs | 42 + .../src/ui/element/edit/actions/mirror.rs | 28 + .../src/ui/element/edit/actions/mod.rs | 11 + .../src/ui/element/edit/actions/transform.rs | 232 ++ .../src/ui/element/edit/always_str.rs | 45 + .../src/ui/element/edit/always_usize.rs | 50 + .../caylon-studio/src/ui/element/edit/mod.rs | 15 + .../src/ui/element/edit/optional_str.rs | 46 + .../src/ui/element/edit/optional_u64.rs | 46 + .../caylon-studio/src/ui/element/elements.rs | 65 + .../src/ui/element/event_display.rs | 66 + .../src/ui/element/fake/button.rs | 15 + .../src/ui/element/fake/display.rs | 19 + .../caylon-studio/src/ui/element/fake/mod.rs | 9 + .../src/ui/element/fake/slider.rs | 18 + .../src/ui/element/fake/toggle.rs | 24 + backend/caylon-studio/src/ui/element/mod.rs | 22 + .../src/ui/element/msg_common.rs | 105 + .../src/ui/element/reading_display.rs | 71 + .../src/ui/element/remove_element.rs | 22 + .../src/ui/element/result_display.rs | 71 + .../caylon-studio/src/ui/element/slider.rs | 67 + .../caylon-studio/src/ui/element/toggle.rs | 70 + backend/caylon-studio/src/ui/footer_bar.rs | 27 + backend/caylon-studio/src/ui/hit_counter.rs | 26 + backend/caylon-studio/src/ui/json_context.rs | 74 + backend/caylon-studio/src/ui/json_view.rs | 20 + backend/caylon-studio/src/ui/mod.rs | 14 + backend/caylon-studio/src/ui/title_bar.rs | 13 + backend/src/main.rs | 3 +- backend/src/runtime/actors/actor.rs | 2 +- backend/src/runtime/actors/command_actor.rs | 2 +- .../src/runtime/actors/javascript_actor.rs | 2 +- backend/src/runtime/actors/json_actor.rs | 2 +- backend/src/runtime/actors/periodic_actor.rs | 2 +- .../src/runtime/actors/sequential_actor.rs | 2 +- backend/src/runtime/actors/transform_actor.rs | 2 +- backend/src/runtime/communication.rs | 2 +- backend/src/runtime/executor.rs | 2 +- main.py | 14 +- package.json | 2 +- pnpm-lock.yaml | 20 +- src/backend.ts | 2 +- 80 files changed, 5097 insertions(+), 267 deletions(-) create mode 100644 backend/caylon-config/Cargo.lock create mode 100644 backend/caylon-config/Cargo.toml rename backend/{src/config => caylon-config/src}/about.rs (93%) rename backend/{src/config => caylon-config/src}/action.rs (73%) rename backend/{src/config => caylon-config/src}/base.rs (90%) rename backend/{src/config => caylon-config/src}/button.rs (75%) rename backend/{src/config => caylon-config/src}/element.rs (92%) rename backend/{src/config => caylon-config/src}/event_display.rs (93%) rename backend/{src/config/mod.rs => caylon-config/src/lib.rs} (99%) rename backend/{src/config => caylon-config/src}/reading.rs (85%) rename backend/{src/config => caylon-config/src}/result_display.rs (77%) rename backend/{src/config => caylon-config/src}/slider.rs (81%) rename backend/{src/config => caylon-config/src}/toggle.rs (79%) rename backend/{src/config => caylon-config/src}/transformer.rs (77%) create mode 100644 backend/caylon-studio/.gitignore create mode 100644 backend/caylon-studio/Cargo.lock create mode 100644 backend/caylon-studio/Cargo.toml create mode 100644 backend/caylon-studio/README.md create mode 100644 backend/caylon-studio/index.html create mode 100644 backend/caylon-studio/index.scss create mode 100755 backend/caylon-studio/run.sh create mode 100644 backend/caylon-studio/src/api/get_hits.rs create mode 100644 backend/caylon-studio/src/api/get_index.rs create mode 100644 backend/caylon-studio/src/api/get_resources.rs create mode 100644 backend/caylon-studio/src/api/mod.rs create mode 100644 backend/caylon-studio/src/bin/backend.rs create mode 100644 backend/caylon-studio/src/bin/frontend.rs create mode 100644 backend/caylon-studio/src/lib.rs create mode 100644 backend/caylon-studio/src/ui/app.rs create mode 100644 backend/caylon-studio/src/ui/element/add_element.rs create mode 100644 backend/caylon-studio/src/ui/element/button.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/action_editor.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/actions/command.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/actions/javascript.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/actions/json.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/actions/mirror.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/actions/mod.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/actions/transform.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/always_str.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/always_usize.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/mod.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/optional_str.rs create mode 100644 backend/caylon-studio/src/ui/element/edit/optional_u64.rs create mode 100644 backend/caylon-studio/src/ui/element/elements.rs create mode 100644 backend/caylon-studio/src/ui/element/event_display.rs create mode 100644 backend/caylon-studio/src/ui/element/fake/button.rs create mode 100644 backend/caylon-studio/src/ui/element/fake/display.rs create mode 100644 backend/caylon-studio/src/ui/element/fake/mod.rs create mode 100644 backend/caylon-studio/src/ui/element/fake/slider.rs create mode 100644 backend/caylon-studio/src/ui/element/fake/toggle.rs create mode 100644 backend/caylon-studio/src/ui/element/mod.rs create mode 100644 backend/caylon-studio/src/ui/element/msg_common.rs create mode 100644 backend/caylon-studio/src/ui/element/reading_display.rs create mode 100644 backend/caylon-studio/src/ui/element/remove_element.rs create mode 100644 backend/caylon-studio/src/ui/element/result_display.rs create mode 100644 backend/caylon-studio/src/ui/element/slider.rs create mode 100644 backend/caylon-studio/src/ui/element/toggle.rs create mode 100644 backend/caylon-studio/src/ui/footer_bar.rs create mode 100644 backend/caylon-studio/src/ui/hit_counter.rs create mode 100644 backend/caylon-studio/src/ui/json_context.rs create mode 100644 backend/caylon-studio/src/ui/json_view.rs create mode 100644 backend/caylon-studio/src/ui/mod.rs create mode 100644 backend/caylon-studio/src/ui/title_bar.rs diff --git a/.gitignore b/.gitignore index 4e23009..f94c678 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ yalc.lock /backend/target /backend/out /bin +/**/target/ # packaged teasers *.zip diff --git a/backend/Cargo.lock b/backend/Cargo.lock index fc20017..ed6f052 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -40,18 +40,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.19" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] [[package]] name = "async-recursion" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cda8f4bcc10624c4e85bc66b3f452cca98cfa5ca002dc83a16aad2367641bea" +checksum = "3b015a331cc64ebd1774ba119538573603427eaace0a1950c423ab971f903796" dependencies = [ "proc-macro2", "quote", @@ -60,9 +60,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", @@ -77,9 +77,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bitflags" @@ -89,18 +89,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" -version = "0.9.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array", ] @@ -123,15 +114,16 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "caylon" version = "0.1.0" dependencies = [ "async-trait", + "caylon-config", "clap", "jmespath", "log", @@ -143,6 +135,15 @@ dependencies = [ "usdpl-back", ] +[[package]] +name = "caylon-config" +version = "0.1.0" +dependencies = [ + "log", + "serde", + "serde_json", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -160,9 +161,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.20" +version = "3.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" dependencies = [ "bitflags", "clap_derive", @@ -196,9 +197,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -230,20 +231,11 @@ checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" [[package]] name = "digest" -version = "0.9.0" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" -dependencies = [ - "block-buffer 0.10.2", + "block-buffer", "crypto-common", ] @@ -313,9 +305,9 @@ checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] @@ -328,19 +320,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" dependencies = [ "futures-core", "futures-sink", @@ -348,27 +339,27 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" dependencies = [ "futures-core", "futures-sink", @@ -380,9 +371,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -390,9 +381,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", @@ -411,9 +402,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ "bytes", "fnv", @@ -424,7 +415,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.3", + "tokio-util", "tracing", ] @@ -436,9 +427,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "headers" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cff78e5788be1e0ab65b04d306b2ed5092c815ec97ec70f4ebd5aee158aa55d" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ "base64", "bitflags", @@ -447,7 +438,7 @@ dependencies = [ "http", "httpdate", "mime", - "sha-1 0.10.0", + "sha1", ] [[package]] @@ -461,15 +452,15 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" dependencies = [ "libc", ] @@ -482,9 +473,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -504,9 +495,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -516,9 +507,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" dependencies = [ "bytes", "futures-channel", @@ -540,20 +531,19 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown", @@ -570,9 +560,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jmespath" @@ -594,9 +584,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "log" @@ -607,12 +597,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "memchr" version = "2.5.0" @@ -637,14 +621,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -667,9 +651,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ "hermit-abi", "libc", @@ -692,9 +676,9 @@ checksum = "7b2b2cbbfd8defa51ff24450a61d73b3ff3e158484ddd274a883e886e6fbaa78" [[package]] name = "once_cell" -version = "1.13.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "opaque-debug" @@ -704,30 +688,30 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "os_str_bytes" -version = "6.3.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pin-project" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -760,9 +744,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-error" @@ -790,9 +774,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" dependencies = [ "unicode-ident", ] @@ -805,9 +789,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] @@ -835,27 +819,27 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] name = "redox_syscall" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", @@ -864,9 +848,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remove_dir_all" @@ -878,10 +862,19 @@ dependencies = [ ] [[package]] -name = "ryu" -version = "1.0.10" +name = "rustls-pemfile" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64", +] + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "safemem" @@ -891,24 +884,24 @@ checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" [[package]] name = "scoped-tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "serde" -version = "1.0.140" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -917,9 +910,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" dependencies = [ "itoa", "ryu", @@ -940,26 +933,24 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.8" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ - "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "digest", ] [[package]] -name = "sha-1" -version = "0.10.0" +name = "sha1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3", + "digest", ] [[package]] @@ -975,9 +966,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] @@ -993,9 +984,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -1009,9 +1000,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.98" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -1043,24 +1034,24 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -1069,21 +1060,32 @@ dependencies = [ [[package]] name = "time" -version = "0.3.11" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +checksum = "53250a3b3fed8ff8fd988587d8925d26a83ac3845d9e03b220b37f34c2b8d6c2" dependencies = [ "itoa", "libc", "num_threads", + "serde", + "time-core", "time-macros", ] [[package]] -name = "time-macros" -version = "0.2.4" +name = "time-core" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a460aeb8de6dcb0f381e1ee05f1cd56fcf5a5f6eb8187ff3d8f0b11078d38b7c" +dependencies = [ + "time-core", +] [[package]] name = "tinyvec" @@ -1096,15 +1098,15 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.20.0" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" dependencies = [ "autocfg", "bytes", @@ -1112,17 +1114,16 @@ dependencies = [ "memchr", "mio", "num_cpus", - "once_cell", "pin-project-lite", "socket2", - "winapi", + "windows-sys 0.42.0", ] [[package]] name = "tokio-stream" -version = "0.1.9" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite", @@ -1131,36 +1132,21 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.15.0" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "511de3f85caf1c98983545490c3d09685fa8eb634e57eec22bb4db271f46cbd8" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" dependencies = [ "futures-util", "log", - "pin-project", "tokio", "tungstenite", ] [[package]] name = "tokio-util" -version = "0.6.10" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", @@ -1178,9 +1164,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", @@ -1190,24 +1176,24 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", ] [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.14.0" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0b2d8558abd2e276b0a8df5c05a2ec762609344191e5fd23e292c910e9165b5" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ "base64", "byteorder", @@ -1216,7 +1202,7 @@ dependencies = [ "httparse", "log", "rand", - "sha-1 0.9.8", + "sha-1", "thiserror", "url", "utf-8", @@ -1233,9 +1219,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicase" @@ -1248,21 +1234,21 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -1279,21 +1265,20 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] [[package]] name = "usdpl-back" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64335d4a1eda1a4b56b80fcf22eaf43543b22186d20999a400f80eecd7587e0" +checksum = "2d185cc6e3f5d305e6e97f1b5cadf1da78bac6b62ea3457802d250708c315306" dependencies = [ "async-recursion", "async-trait", @@ -1341,9 +1326,9 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cef4e1e9114a4b7f1ac799f16ce71c14de5778500c5450ec6b7b920c55b587e" +checksum = "ed7b8be92646fc3d18b06147664ebc5f48d222686cb11a8755e561a735aacc6d" dependencies = [ "bytes", "futures-channel", @@ -1357,6 +1342,7 @@ dependencies = [ "multipart", "percent-encoding", "pin-project", + "rustls-pemfile", "scoped-tls", "serde", "serde_json", @@ -1364,7 +1350,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-tungstenite", - "tokio-util 0.6.10", + "tokio-util", "tower-service", "tracing", ] @@ -1408,46 +1394,84 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ + "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_msvc", "windows_x86_64_gnu", + "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" +name = "windows-sys" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "zeroize" diff --git a/backend/Cargo.toml b/backend/Cargo.toml index c7c2595..c5e7c06 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -8,6 +8,7 @@ license = "MIT" repository = "https://github.com/NGnius/kaylon" [dependencies] +caylon-config = { version = "0.1.0", path = "./caylon-config" } usdpl-back = { version = "0.10.0"} clap = { version = "3.2", features = ["derive", "std"], default-features = false } diff --git a/backend/caylon-config/Cargo.lock b/backend/caylon-config/Cargo.lock new file mode 100644 index 0000000..31fcff2 --- /dev/null +++ b/backend/caylon-config/Cargo.lock @@ -0,0 +1,105 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "caylon-config" +version = "0.1.0" +dependencies = [ + "log", + "serde", + "serde_json", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "itoa" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "proc-macro2" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "serde" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" diff --git a/backend/caylon-config/Cargo.toml b/backend/caylon-config/Cargo.toml new file mode 100644 index 0000000..c85ccc1 --- /dev/null +++ b/backend/caylon-config/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "caylon-config" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde = { version = "1.0", features = ["derive"] } +serde_json = { version = "1.0" } + +log = { version = "0.4" } + +[dev-dependencies] + diff --git a/backend/src/config/about.rs b/backend/caylon-config/src/about.rs similarity index 93% rename from backend/src/config/about.rs rename to backend/caylon-config/src/about.rs index 7a90230..4cba1e5 100644 --- a/backend/src/config/about.rs +++ b/backend/caylon-config/src/about.rs @@ -1,6 +1,6 @@ use serde::{Serialize, Deserialize}; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct AboutConfig { pub name: String, pub version: String, diff --git a/backend/src/config/action.rs b/backend/caylon-config/src/action.rs similarity index 73% rename from backend/src/config/action.rs rename to backend/caylon-config/src/action.rs index 013032f..a968a17 100644 --- a/backend/src/config/action.rs +++ b/backend/caylon-config/src/action.rs @@ -1,6 +1,6 @@ use serde::{Serialize, Deserialize}; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] #[serde(tag = "action")] pub enum TopLevelActionConfig { #[serde(rename = "sequence")] @@ -17,7 +17,7 @@ pub enum TopLevelActionConfig { Json(JsonAction), } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] #[serde(tag = "action")] pub enum ActionConfig { #[serde(rename = "command")] @@ -30,25 +30,25 @@ pub enum ActionConfig { Json(JsonAction), } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct SequenceAction { pub steps: Vec, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct CommandAction { pub run: String, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct MirrorAction; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct JavascriptAction { pub run: String, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct JsonAction { pub jmespath: String, } diff --git a/backend/src/config/base.rs b/backend/caylon-config/src/base.rs similarity index 90% rename from backend/src/config/base.rs rename to backend/caylon-config/src/base.rs index d576eae..b46b56d 100644 --- a/backend/src/config/base.rs +++ b/backend/caylon-config/src/base.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::{ElementConfig, AboutConfig}; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] #[serde(tag = "api-version")] pub enum BaseConfig { #[serde(rename = "v0.0.0")] @@ -55,4 +55,8 @@ impl BaseConfig { Self::V0 {items, ..} => items, } } + + pub fn assemble(items: Vec, about: AboutConfig) -> Self { + Self::V0 { items, about } + } } diff --git a/backend/src/config/button.rs b/backend/caylon-config/src/button.rs similarity index 75% rename from backend/src/config/button.rs rename to backend/caylon-config/src/button.rs index 0bcb167..f60567f 100644 --- a/backend/src/config/button.rs +++ b/backend/caylon-config/src/button.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::TopLevelActionConfig; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct ButtonConfig { pub title: String, pub on_click: TopLevelActionConfig, diff --git a/backend/src/config/element.rs b/backend/caylon-config/src/element.rs similarity index 92% rename from backend/src/config/element.rs rename to backend/caylon-config/src/element.rs index d796deb..51e7630 100644 --- a/backend/src/config/element.rs +++ b/backend/caylon-config/src/element.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::{ButtonConfig, ToggleConfig, SliderConfig, ReadingConfig, ResultDisplayConfig, EventDisplayConfig}; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] #[serde(tag = "element")] pub enum ElementConfig { #[serde(rename = "button")] diff --git a/backend/src/config/event_display.rs b/backend/caylon-config/src/event_display.rs similarity index 93% rename from backend/src/config/event_display.rs rename to backend/caylon-config/src/event_display.rs index 67e24a7..7cea5f5 100644 --- a/backend/src/config/event_display.rs +++ b/backend/caylon-config/src/event_display.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::TopLevelActionConfig; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct EventDisplayConfig { pub title: String, /// Type of event to listen for @@ -11,7 +11,7 @@ pub struct EventDisplayConfig { pub on_event: TopLevelActionConfig, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub enum EventType { #[serde(rename = "achievement")] Achievement, diff --git a/backend/src/config/mod.rs b/backend/caylon-config/src/lib.rs similarity index 99% rename from backend/src/config/mod.rs rename to backend/caylon-config/src/lib.rs index 2955fc5..64c5576 100644 --- a/backend/src/config/mod.rs +++ b/backend/caylon-config/src/lib.rs @@ -25,7 +25,7 @@ pub use transformer::{TransformAction, TransformTypeAction, ReplaceTransformActi #[cfg(test)] mod test { use super::*; - + #[test] fn dump_test() { let conf = BaseConfig::V0 { diff --git a/backend/src/config/reading.rs b/backend/caylon-config/src/reading.rs similarity index 85% rename from backend/src/config/reading.rs rename to backend/caylon-config/src/reading.rs index fdd4e7a..40615d1 100644 --- a/backend/src/config/reading.rs +++ b/backend/caylon-config/src/reading.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::TopLevelActionConfig; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct ReadingConfig { pub title: String, /// Period in milliseconds, or None/null for non-repeating actions diff --git a/backend/src/config/result_display.rs b/backend/caylon-config/src/result_display.rs similarity index 77% rename from backend/src/config/result_display.rs rename to backend/caylon-config/src/result_display.rs index 783c67f..dcc7fd7 100644 --- a/backend/src/config/result_display.rs +++ b/backend/caylon-config/src/result_display.rs @@ -1,6 +1,6 @@ use serde::{Serialize, Deserialize}; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct ResultDisplayConfig { pub title: String, /// Index of element who's action's result will be used diff --git a/backend/src/config/slider.rs b/backend/caylon-config/src/slider.rs similarity index 81% rename from backend/src/config/slider.rs rename to backend/caylon-config/src/slider.rs index 33ff452..c180654 100644 --- a/backend/src/config/slider.rs +++ b/backend/caylon-config/src/slider.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::TopLevelActionConfig; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct SliderConfig { pub title: String, pub min: u64, diff --git a/backend/src/config/toggle.rs b/backend/caylon-config/src/toggle.rs similarity index 79% rename from backend/src/config/toggle.rs rename to backend/caylon-config/src/toggle.rs index 6afad75..950df03 100644 --- a/backend/src/config/toggle.rs +++ b/backend/caylon-config/src/toggle.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::TopLevelActionConfig; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct ToggleConfig { pub title: String, pub description: Option, diff --git a/backend/src/config/transformer.rs b/backend/caylon-config/src/transformer.rs similarity index 77% rename from backend/src/config/transformer.rs rename to backend/caylon-config/src/transformer.rs index adebb73..b7ea1d5 100644 --- a/backend/src/config/transformer.rs +++ b/backend/caylon-config/src/transformer.rs @@ -2,12 +2,12 @@ use serde::{Serialize, Deserialize}; -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct TransformAction { pub transformer: TransformTypeAction, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] #[serde(tag = "rule")] pub enum TransformTypeAction { #[serde(rename = "replace")] @@ -18,13 +18,13 @@ pub enum TransformTypeAction { Log(LogTransformAction), } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct ReplaceTransformAction { /// Regex pub patterns: Vec, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct PatternConfig { /// Regex pub pattern: String, @@ -43,17 +43,17 @@ pub struct PatternConfig { pub x: Option, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct ExpandTransformAction { pub format: String, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub struct LogTransformAction { pub level: LogLevel, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, PartialEq)] pub enum LogLevel { DEBUG, INFO, diff --git a/backend/caylon-studio/.gitignore b/backend/caylon-studio/.gitignore new file mode 100644 index 0000000..adb443d --- /dev/null +++ b/backend/caylon-studio/.gitignore @@ -0,0 +1,2 @@ +/dist/ +/target/ diff --git a/backend/caylon-studio/Cargo.lock b/backend/caylon-studio/Cargo.lock new file mode 100644 index 0000000..2d0a0a9 --- /dev/null +++ b/backend/caylon-studio/Cargo.lock @@ -0,0 +1,2265 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "actix-codec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-sink", + "log", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "actix-files" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d832782fac6ca7369a70c9ee9a20554623c5e51c76e190ad151780ebea1cf689" +dependencies = [ + "actix-http", + "actix-service", + "actix-utils", + "actix-web", + "askama_escape", + "bitflags", + "bytes", + "derive_more", + "futures-core", + "http-range", + "log", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", +] + +[[package]] +name = "actix-http" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0070905b2c4a98d184c4e81025253cb192aa8a73827553f38e9410801ceb35bb" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "ahash", + "base64", + "bitflags", + "brotli", + "bytes", + "bytestring", + "derive_more", + "encoding_rs", + "flate2", + "futures-core", + "h2", + "http", + "httparse", + "httpdate", + "itoa", + "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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "actix-router" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" +dependencies = [ + "bytestring", + "http", + "regex", + "serde", + "tracing", +] + +[[package]] +name = "actix-rt" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" +dependencies = [ + "futures-core", + "tokio", +] + +[[package]] +name = "actix-server" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e8613a75dd50cc45f473cee3c34d59ed677c0f7b44480ce3b8247d7dc519327" +dependencies = [ + "actix-rt", + "actix-service", + "actix-utils", + "futures-core", + "futures-util", + "mio", + "num_cpus", + "socket2", + "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.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "464e0fddc668ede5f26ec1f9557a8d44eda948732f40c6b0ad79126930eb775f" +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", + "http", + "itoa", + "language-tags", + "log", + "mime", + "once_cell", + "pin-project-lite", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "smallvec", + "socket2", + "time", + "url", +] + +[[package]] +name = "actix-web-codegen" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa9362663c8643d67b2d5eafba49e4cb2c8a053a29ed00a0bea121f17c76b13" +dependencies = [ + "actix-router", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +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 = "anymap2" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" + +[[package]] +name = "askama_escape" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "boolinator" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" + +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "bytestring" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7f83e57d9154148e355404702e2694463241880b939570d7c97c014da7a69a1" +dependencies = [ + "bytes", +] + +[[package]] +name = "caylon-config" +version = "0.1.0" +dependencies = [ + "log", + "serde", + "serde_json", +] + +[[package]] +name = "caylon-studio" +version = "0.1.0" +dependencies = [ + "actix-files", + "actix-web", + "bytes", + "caylon-config", + "clap", + "futures", + "log", + "reqwest", + "serde", + "serde_json", + "simplelog", + "tokio", + "uuid", + "wasm-bindgen-futures", + "wasm-log", + "web-sys", + "yew", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "flate2" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +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.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-executor" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" + +[[package]] +name = "futures-macro" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gloo" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4bef6b277b3ab073253d4bca60761240cf8d6998f4bd142211957b69a61b20" +dependencies = [ + "gloo-console", + "gloo-dialogs", + "gloo-events", + "gloo-file", + "gloo-history", + "gloo-net", + "gloo-render", + "gloo-storage", + "gloo-timers", + "gloo-utils", + "gloo-worker", +] + +[[package]] +name = "gloo-console" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b7ce3c05debe147233596904981848862b068862e9ec3e34be446077190d3f" +dependencies = [ + "gloo-utils", + "js-sys", + "serde", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-dialogs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67062364ac72d27f08445a46cab428188e2e224ec9e37efdba48ae8c289002e6" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-events" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b107f8abed8105e4182de63845afcc7b69c098b7852a813ea7462a320992fc" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-file" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" +dependencies = [ + "gloo-events", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-history" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce5ae65c5d76e2bbd9f274d7dcc00a306a79964305efa275a0ac728caaeb792" +dependencies = [ + "gloo-events", + "gloo-utils", + "serde", + "serde-wasm-bindgen", + "serde_urlencoded", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9050ff8617e950288d7bf7f300707639fdeda5ca0d0ecf380cff448cfd52f4a6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-render" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd9306aef67cfd4449823aadcd14e3958e0800aa2183955a309112a84ec7764" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-storage" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6ab60bf5dbfd6f0ed1f7843da31b41010515c745735c970e821945ca91e480" +dependencies = [ + "gloo-utils", + "js-sys", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-timers" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98c4a8d6391675c6b2ee1a6c8d06e8e2d03605c44cec1270675985a4c2a5500b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "gloo-utils" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e8fc851e9c7b9852508bc6e3f690f452f474417e8545ec9857b7f7377036b5" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-worker" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13471584da78061a28306d1359dd0178d8d6fc1c7c80e5e35d27260346e0516a" +dependencies = [ + "anymap2", + "bincode", + "gloo-console", + "gloo-utils", + "js-sys", + "serde", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "h2" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "html-escape" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" +dependencies = [ + "utf8-width", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "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 = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "implicit-clone" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "649cb12b410f9519ebc452e87a8e32c4f8cfc080968cf9b4db43d40d1da4d7e4" +dependencies = [ + "indexmap", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "jobserver" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" + +[[package]] +name = "local-channel" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" +dependencies = [ + "futures-core", + "futures-sink", + "futures-util", + "local-waker", +] + +[[package]] +name = "local-waker" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[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.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num_cpus" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "openssl" +version = "0.10.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "paste" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pinned" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a829027bd95e54cfe13e3e258a1ae7b645960553fb82b75ff852c29688ee595b" +dependencies = [ + "futures", + "rustversion", + "thiserror", +] + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c142c0e46b57171fe0c528bee8c5b7569e80f0c17e377cd0e30ea57dbc11bb51" +dependencies = [ + "proc-macro2", + "syn", +] + +[[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", + "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.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prokio" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b55e106e5791fa5a13abd13c85d6127312e8e09098059ca2bc9b03ca4cf488" +dependencies = [ + "futures", + "gloo", + "num_cpus", + "once_cell", + "pin-project", + "pinned", + "tokio", + "tokio-stream", + "wasm-bindgen-futures", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "reqwest" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +dependencies = [ + "base64", + "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", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "security-framework" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c4437699b6d34972de58652c68b98cb5b53a4199ab126db8e20ec8ded29a721" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" + +[[package]] +name = "serde" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "618365e8e586c22123d692b72a7d791d5ee697817b65a218cdf12a98870af0f7" +dependencies = [ + "fnv", + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +dependencies = [ + "itoa", + "ryu", + "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", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "simplelog" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dfff04aade74dd495b007c831cd6f4e0cee19c344dd9dc0884c0289b70a786" +dependencies = [ + "log", + "termcolor", + "time", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +dependencies = [ + "itoa", + "libc", + "num_threads", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8-width" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" + +[[package]] +name = "uuid" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" +dependencies = [ + "serde", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "wasm-log" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "def95b2a762924804037f77e3de791f1c177d6ecbe0385a64e519bd7902a5f81" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "yew" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dbecfe44343b70cc2932c3eb445425969ae21754a8ab3a0966981c1cf7af1cc" +dependencies = [ + "base64ct", + "bincode", + "console_error_panic_hook", + "futures", + "gloo", + "html-escape", + "implicit-clone", + "indexmap", + "js-sys", + "prokio", + "rustversion", + "serde", + "slab", + "thiserror", + "tokio", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "yew-macro", +] + +[[package]] +name = "yew-macro" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b64c253c1d401f1ea868ca9988db63958cfa15a69f739101f338d6f05eea8301" +dependencies = [ + "boolinator", + "once_cell", + "prettyplease", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zstd" +version = "0.12.3+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "6.0.3+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68e4a3f57d13d0ab7e478665c60f35e2a613dcd527851c2c7287ce5c787e134a" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.6+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a3f9792c0c3dc6c165840a75f47ae1f4da402c2d006881129579f6597e801b" +dependencies = [ + "cc", + "libc", + "pkg-config", +] diff --git a/backend/caylon-studio/Cargo.toml b/backend/caylon-studio/Cargo.toml new file mode 100644 index 0000000..4998d07 --- /dev/null +++ b/backend/caylon-studio/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "caylon-studio" +version = "0.1.0" +edition = "2021" +description = "Template for starting a Yew project using Trunk" +readme = "README.md" +repository = "https://github.com/yewstack/yew-trunk-minimal-template" +license = "MIT" +keywords = ["yew", "trunk"] +categories = ["gui", "wasm", "web-programming"] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[bin]] +name = "frontend" + +[[bin]] +name = "backend" + +[dependencies] +caylon-config = { version = "0.1.0", path = "../caylon-config" } +reqwest = { version = "0.11.8", features = ["json"] } +serde = { version = "1.0.132", features = ["derive"] } +serde_json = { version = "1.0" } +uuid = { version = "1.0.0", features = ["serde"] } +futures = "0.3" +bytes = "1.0" +log = "0.4" + +[target.'cfg(target_arch = "wasm32")'.dependencies] +yew = { version = "0.20", features = [ "csr", "hydration" ] } +wasm-bindgen-futures = "0.4" +wasm-log = "0.3" +web-sys = { version = "0.3", features = [ "HtmlSelectElement", "HtmlInputElement" ] } + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +yew = { version = "0.20", features = [ "ssr" ] } +tokio = { version = "1", features = ["full"] } +actix-web = { version = "4.3" } +actix-files = { version = "0.6" } +clap = { version = "3.1.7", features = ["derive"] } +simplelog = { version = "0.12" } diff --git a/backend/caylon-studio/README.md b/backend/caylon-studio/README.md new file mode 100644 index 0000000..6092713 --- /dev/null +++ b/backend/caylon-studio/README.md @@ -0,0 +1,5 @@ +# caylon-studio + +## Running + +Execute `run.sh` in your terminal. You will need cargo, Rust, and the wasm toolchain installed. diff --git a/backend/caylon-studio/index.html b/backend/caylon-studio/index.html new file mode 100644 index 0000000..2be0f04 --- /dev/null +++ b/backend/caylon-studio/index.html @@ -0,0 +1,14 @@ + + + + + + Caylon Studio + + + + + diff --git a/backend/caylon-studio/index.scss b/backend/caylon-studio/index.scss new file mode 100644 index 0000000..ddf3408 --- /dev/null +++ b/backend/caylon-studio/index.scss @@ -0,0 +1,290 @@ +html, +body { + height: 100%; + width: 98%; + margin: 0; + padding: 1%; +} + +div.work-view { + padding: 0; + margin: 0; + display: inline-block; + width: 100%; +} + +div.json-view { + padding: 0; + margin: auto 0; + display: inline-block; + width: 40%; + vertical-align: middle; +} + +.json-input { + margin: auto; + width: 98%; +} + +div.elements-view { + padding: 0; + margin: auto; + display: inline-block; + width: 60%; + text-align: center; + vertical-align: top; +} + +/* Element styling */ + +// * + +div.caylon-element {} + +// actions/* + +div.caylon-action-config {} + +// actions/command.rs + +div.caylon-command-action-edit {} + +// actions/javascript.rs + +div.caylon-javascript-action-edit {} + +// actions/json.rs + +div.caylon-json-action-edit {} + +// actions/mirror.rs + +div.caylon-mirror-action-edit {} + +// actions/transform.rs + +div.caylon-transformer-replace-item {} + +div.caylon-transformer-replace {} + +div.caylon-transformer-expand {} + +div.caylon-transformer-log {} + +div.caylon-transformer-action-edit {} + +div.caylon-transformer-type-action-edit {} + +// add_element.rs + +div.add-element {} + +button.add-element-button {} + +// button.rs + +div.caylon-button {} + +// fake/button.rs + +button.fake-button {} + +// edit/* + +div.caylon-edit {} + +label.caylon-label-edit {} + +input.caylon-input-editor {} + +// edit/action_editor.rs + +div.caylon-action-edit {} + +div.caylon-sequence-action-edit {} + +div.caylon-sequence-command-action {} + +div.caylon-sequence-transform-action {} + +div.caylon-sequence-javascript-action {} + +div.caylon-sequence-json-action {} + +div.caylon-sequence-action-edit-item {} + +div.caylon-sequence-action-edit {} + +div.caylon-action-config {} + +div.caylon-editor {} + +// edit/always_str.rs + +div.caylon-always-str-edit {} + +input.caylon-always-str-input {} + +// edit/always_usize.rs + +div.caylon-always-usize-edit {} + +input.caylon-always-usize-input {} + +// edit/optional_str.rs + +div.caylon-option-str-edit {} + +input.caylon-option-str-input {} + +// edit/optional_u64.rs + +div.caylon-option-u64-edit {} + +input.caylon-option-u64-input {} + +// elements.rs + +div.elements-view {} + +div.elements-toolbar {} + +div.elements-list {} + +div.elements-item {} + +// event_display.rs + +div.caylon-event-display {} + +// reading_display.rs + +div.caylon-reading-display {} + +// reading_display.rs + +div.caylon-reading-display {} + +// remove_element.rs + +div.remove-element {} + +button.remove-element-button {} + +// result_display.rs + +div.caylon-result-display {} + +// fake/display.rs + +div.fake-slider {} + +span.fake-slider-title {} + +input.fake-slider-content {} + +// slider.rs + +div.caylon-slider {} + +// fake/slider.rs + +div.fake-slider {} + +span.fake-slider-title {} + +input.fake-slider-input {} + +// toggle.rs + +div.caylon-toggle {} + +// fake/toggle.rs +// adapted from https://www.w3schools.com/howto/howto_css_switch.asp +.fake-toggle-button { + position: relative; + display: inline-block; + width: 60px; + height: 34px; +} + +.fake-toggle-button input { + opacity: 0; + width: 0; + height: 0; +} + +.toggle-round { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + -webkit-transition: .4s; + transition: .4s; +} + +.toggle-round:before { + position: absolute; + content: ""; + height: 26px; + width: 26px; + left: 4px; + bottom: 4px; + background-color: white; + -webkit-transition: .4s; + transition: .4s; +} + +input:checked + .toggle-round { + background-color: #2196F3; +} + +input:focus + .toggle-round { + box-shadow: 0 0 1px #2196F3; +} + +input:checked + .toggle-round:before { + -webkit-transform: translateX(26px); + -ms-transform: translateX(26px); + transform: translateX(26px); +} + +.toggle-round { + border-radius: 34px; +} + +.toggle-round:before { + border-radius: 50%; +} + +/* End element styling */ + +div.footer { + width: 98%; + height: 5%; + margin: auto; + text-align: right; +} + +.footer-elem { + display: inline-block; + padding: 0% 4%; +} + +div.header { + width: 98%; + height: 10%; + margin: auto; + text-align: center; +} + +.header-elem { + display: inline-block; +} + +.hit-count { + margin: auto; +} diff --git a/backend/caylon-studio/run.sh b/backend/caylon-studio/run.sh new file mode 100755 index 0000000..833cb5c --- /dev/null +++ b/backend/caylon-studio/run.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +trunk build ./index.html && cargo run --bin backend diff --git a/backend/caylon-studio/src/api/get_hits.rs b/backend/caylon-studio/src/api/get_hits.rs new file mode 100644 index 0000000..a4d80ea --- /dev/null +++ b/backend/caylon-studio/src/api/get_hits.rs @@ -0,0 +1,9 @@ +use actix_web::{get, web, Responder}; +use std::sync::atomic::{AtomicU64, Ordering}; + +pub(crate) static INDEX_HITS: AtomicU64 = AtomicU64::new(0); + +#[get("/stats/hits")] +pub async fn hits() -> impl Responder { + web::Json(INDEX_HITS.load(Ordering::Relaxed)) +} diff --git a/backend/caylon-studio/src/api/get_index.rs b/backend/caylon-studio/src/api/get_index.rs new file mode 100644 index 0000000..abf6dfd --- /dev/null +++ b/backend/caylon-studio/src/api/get_index.rs @@ -0,0 +1,43 @@ +use actix_web::{get, web, HttpResponse, Responder}; + +use bytes::Bytes; +use futures::stream::{self, Stream, StreamExt}; + +type BoxedError = Box; + +pub struct IndexPage { + before: String, + after: String, +} + +impl IndexPage { + async fn render(&self) -> impl Stream> + Send { + let renderer = yew::ServerRenderer::::new(); + let before = self.before.clone(); + let after = self.after.clone(); + + stream::once(async move { before }) + .chain(renderer.render_stream()) + .chain(stream::once(async move { after })) + .map(|m| Result::<_, BoxedError>::Ok(m.into())) + } + + pub fn load(path: impl AsRef) -> std::io::Result { + let index_html = std::fs::read_to_string(path.as_ref())?; + let (index_before, index_after) = index_html.split_once("").unwrap().to_owned(); + let (mut index_before, index_after) = (index_before.to_owned(), index_after.to_owned()); + index_before.push_str(""); + log::trace!(" before: {}", index_before); + log::trace!(" after: {}", index_after); + Ok(Self { + before: index_before.to_owned(), + after: index_after.to_owned(), + }) + } +} + +#[get("/")] +pub async fn index(page: web::Data) -> impl Responder { + super::get_hits::INDEX_HITS.fetch_add(1, std::sync::atomic::Ordering::AcqRel); + HttpResponse::Ok().streaming(page.render().await) +} diff --git a/backend/caylon-studio/src/api/get_resources.rs b/backend/caylon-studio/src/api/get_resources.rs new file mode 100644 index 0000000..c4df97b --- /dev/null +++ b/backend/caylon-studio/src/api/get_resources.rs @@ -0,0 +1,8 @@ +use actix_web::{get, web, Responder}; + +#[get("/{name}")] +pub async fn resource(path: web::Path) -> impl Responder { + //println!("GET resource {}", path); + let filepath = std::path::PathBuf::from("dist").join(&*path); + actix_files::NamedFile::open_async(filepath).await +} diff --git a/backend/caylon-studio/src/api/mod.rs b/backend/caylon-studio/src/api/mod.rs new file mode 100644 index 0000000..15dac92 --- /dev/null +++ b/backend/caylon-studio/src/api/mod.rs @@ -0,0 +1,7 @@ +pub(crate) mod get_hits; +mod get_index; +mod get_resources; + +pub use get_hits::hits; +pub use get_index::{index, IndexPage}; +pub use get_resources::resource; diff --git a/backend/caylon-studio/src/bin/backend.rs b/backend/caylon-studio/src/bin/backend.rs new file mode 100644 index 0000000..c73dd2e --- /dev/null +++ b/backend/caylon-studio/src/bin/backend.rs @@ -0,0 +1,27 @@ +use actix_web::{web, App, HttpServer}; + +use simplelog::{ColorChoice, LevelFilter, TermLogger, TerminalMode}; + +use caylon_studio::api::{hits, index, resource, IndexPage}; + +#[tokio::main] +async fn main() -> std::io::Result<()> { + TermLogger::init( + LevelFilter::Debug, + Default::default(), + TerminalMode::Mixed, + ColorChoice::Auto, + ) + .unwrap(); + log::info!("Starting HTTP server @ 127.0.0.1:8080"); + HttpServer::new(|| { + App::new() + .app_data(web::Data::new(IndexPage::load("dist/index.html").unwrap())) + .service(index) + .service(resource) + .service(hits) + }) + .bind(("127.0.0.1", 8080))? + .run() + .await +} diff --git a/backend/caylon-studio/src/bin/frontend.rs b/backend/caylon-studio/src/bin/frontend.rs new file mode 100644 index 0000000..00d8525 --- /dev/null +++ b/backend/caylon-studio/src/bin/frontend.rs @@ -0,0 +1,13 @@ +use caylon_studio::ui::App; + +#[cfg(target_arch = "wasm32")] +fn main() { + wasm_log::init(wasm_log::Config::default()); + log::info!("Hydrating UI"); + yew::Renderer::::new().hydrate(); +} + +#[cfg(not(target_arch = "wasm32"))] +fn main() { + compile_error!("frontend is for browsers (wasm32)"); +} diff --git a/backend/caylon-studio/src/lib.rs b/backend/caylon-studio/src/lib.rs new file mode 100644 index 0000000..70fe815 --- /dev/null +++ b/backend/caylon-studio/src/lib.rs @@ -0,0 +1,3 @@ +#[cfg(not(target_arch = "wasm32"))] +pub mod api; +pub mod ui; diff --git a/backend/caylon-studio/src/ui/app.rs b/backend/caylon-studio/src/ui/app.rs new file mode 100644 index 0000000..bc566d2 --- /dev/null +++ b/backend/caylon-studio/src/ui/app.rs @@ -0,0 +1,26 @@ +use yew::prelude::*; + +use super::element::ElementsComponent; +use super::FooterComponent; +use super::JsonViewComponent; +use super::TitleComponent; +use super::{JsonContext, JsonCtx}; + +#[function_component(App)] +pub fn app() -> Html { + let json_ctx = use_reducer(JsonCtx::init); + log::debug!("App render"); + html! { +
+ + context={json_ctx}> +
+ + +
+ //

{ "Hello World!" }

+
> + +
+ } +} diff --git a/backend/caylon-studio/src/ui/element/add_element.rs b/backend/caylon-studio/src/ui/element/add_element.rs new file mode 100644 index 0000000..d2f6d1a --- /dev/null +++ b/backend/caylon-studio/src/ui/element/add_element.rs @@ -0,0 +1,194 @@ +use yew::prelude::*; + +use super::super::{JsonContext, JsonCtxAction}; + +#[derive(Properties, PartialEq)] +pub struct AddElementProps { + pub json_ctx: JsonContext, +} + +pub enum AddElementMsg { + SelectCb(SelectedElementType), + AddClick, + ReDraw, + NoOp, +} + +#[derive(PartialEq, Eq)] +pub enum SelectedElementType { + Button, + Toggle, + Slider, + ReadingDisplay, + ResultDisplay, + EventDisplay, +} + +pub struct AddElementComponent { + selected: SelectedElementType, +} + +impl Component for AddElementComponent { + type Message = AddElementMsg; + type Properties = AddElementProps; + + fn create(_ctx: &Context) -> Self { + Self { + selected: SelectedElementType::EventDisplay, // should be last + + + + + + + + + } + } +} + +fn default_top_level_action() -> caylon_config::TopLevelActionConfig { + caylon_config::TopLevelActionConfig::Sequence(caylon_config::SequenceAction { + steps: vec![ + caylon_config::ActionConfig::Command(caylon_config::CommandAction { + run: "echo \"Hello world!\"".to_owned(), + }), + ] + }) +} + +/*fn default_action() -> caylon_config::ActionConfig { + caylon_config::ActionConfig::Command( + caylon_config::CommandAction { run: "echo \"Hello world!\"".to_owned() } + ) +}*/ diff --git a/backend/caylon-studio/src/ui/element/button.rs b/backend/caylon-studio/src/ui/element/button.rs new file mode 100644 index 0000000..091b757 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/button.rs @@ -0,0 +1,72 @@ +use yew::prelude::*; + +use super::super::{JsonContext, JsonCtxAction}; +use super::ElementMessage; +use caylon_config::ButtonConfig; + +#[derive(Properties, PartialEq)] +pub struct ButtonProps { + pub index: usize, + pub config: ButtonConfig, + pub json_ctx: JsonContext, +} + +pub struct ButtonComponent; + +impl Component for ButtonComponent { + type Message = ElementMessage; + type Properties = ButtonProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + let mut new_config = ctx.props().config.clone(); + let index = ctx.props().index; + let update_needed = match msg { + ElementMessage::SetTitle(title) => { + new_config.title = title; + true + } + ElementMessage::SetDescription(_desc) => false, + ElementMessage::SetAction(action) => { + new_config.on_click = action; + true + } + ElementMessage::SetPeriod(_) => false, + ElementMessage::SetResultOf(_) => false, + ElementMessage::NoOp => false, + //_ => false, + }; + if update_needed { + ctx.props().json_ctx.dispatch(JsonCtxAction::UpdateElement { + index, + new_item: caylon_config::ElementConfig::Button(new_config), + }); + } + update_needed + } + + fn view(&self, ctx: &Context) -> Html { + //let theme = &ctx.props().theme; + let props = ctx.props(); + let callback = ctx.link().callback(|msg: Self::Message| msg); + html! { +
+ // TODO editing + + + +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/edit/action_editor.rs b/backend/caylon-studio/src/ui/element/edit/action_editor.rs new file mode 100644 index 0000000..6f2d126 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/action_editor.rs @@ -0,0 +1,230 @@ +use yew::prelude::*; + +//use super::super::super::{JsonContext, JsonCtxAction}; +use super::super::ElementMessage; +use caylon_config::{TopLevelActionConfig, ActionConfig}; + +#[derive(PartialEq, Eq)] +enum SelectedActionConfig { + Command, + Transform, + Javascript, + Json +} + +fn selected(act: &ActionConfig) -> SelectedActionConfig { + match act { + ActionConfig::Command(_) => SelectedActionConfig::Command, + ActionConfig::Transform(_) => SelectedActionConfig::Transform, + ActionConfig::Javascript(_) => SelectedActionConfig::Javascript, + ActionConfig::Json(_) => SelectedActionConfig::Json, + } +} + +#[derive(Properties, PartialEq)] +pub struct ActionProps { + pub index: usize, + pub config: TopLevelActionConfig, + pub callback: super::EditCallback, +} + +pub struct ActionComponent; + +impl Component for ActionComponent { + type Message = (); + type Properties = ActionProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + let inner_action = match &props.config { + TopLevelActionConfig::Sequence(seq) => { + let action_items = seq.steps + .clone() + .into_iter() + .enumerate() + .map(|(index, step)| { + let selected = selected(&step); + let item = match step { + ActionConfig::Command(cmd) => + { + let cb = props.callback.clone(); + let config = seq.clone(); + html! { +
+ +
+ } + }, + ActionConfig::Transform(t) => + { + let cb = props.callback.clone(); + let config = seq.clone(); + html! { +
+ +
+ } + }, + ActionConfig::Javascript(js) => + { + let cb = props.callback.clone(); + let config = seq.clone(); + html! { +
+ +
+ } + }, + ActionConfig::Json(json) => + { + let cb = props.callback.clone(); + let config = seq.clone(); + html! { +
+ +
+ } + }, + }; + #[cfg(target_arch = "wasm32")] + let cb = props.callback.clone(); + #[cfg(target_arch = "wasm32")] + let moved_seq = seq.clone(); + let dropdown_cb = ctx.link().callback(move |#[allow(unused_variables)] event: Event| { + #[cfg(target_arch = "wasm32")] + { + log::debug!("Transformer dropdown select"); + let elem = event.target_unchecked_into::(); + let new_sel = match &elem.value() as &str { + "command" => SelectedActionConfig::Command, + "transform" => SelectedActionConfig::Transform, + "javascript" => SelectedActionConfig::Javascript, + "json" => SelectedActionConfig::Json, + _ => SelectedActionConfig::Json, + }; + let new_item = default_action_config(new_sel); + let mut new_conf = moved_seq.clone(); + new_conf.steps[index] = new_item; + cb.emit(ElementMessage::SetAction(TopLevelActionConfig::Sequence(new_conf))); + } + #[cfg(not(target_arch = "wasm32"))] + { } + }); + html! { +
+ // dropdown to change action + + + + {item} + // TODO remove button +
+ } + }).collect::(); + // TODO add button + html! { +
+ {action_items} +
+ } + }, + _ => html! {{"//TODO"}}, + /*TopLevelActionConfig::Command(cmd) => + html! {}, + TopLevelActionConfig::Transform(t) => html! {{"//TODO"}}, + TopLevelActionConfig::Mirror(mir) => html! {{"//TODO"}}, + TopLevelActionConfig::Javascript(js) => html! {{"//TODO"}}, + TopLevelActionConfig::Json(json) => html! {{"//TODO"}},*/ + }; + html! { +
+ // TODO editing + {inner_action} +
+ } + } +} + +#[cfg(target_arch = "wasm32")] +fn default_action_config(selected: SelectedActionConfig) -> ActionConfig { + match selected { + SelectedActionConfig::Command => ActionConfig::Command( + caylon_config::CommandAction { run: "echo \"Hello caylon world!\"".to_owned() } + ), + SelectedActionConfig::Transform => ActionConfig::Transform(caylon_config::TransformAction { + transformer: caylon_config::TransformTypeAction::Log(caylon_config::LogTransformAction { + level: caylon_config::LogLevel::INFO + }) + }), + SelectedActionConfig::Javascript => ActionConfig::Javascript( + caylon_config::JavascriptAction { run: "console.log(\"Hello caylon world!\")".to_owned() } + ), + SelectedActionConfig::Json => ActionConfig::Json( + caylon_config::JsonAction { jmespath: "".to_owned() } + ), + } +} diff --git a/backend/caylon-studio/src/ui/element/edit/actions/command.rs b/backend/caylon-studio/src/ui/element/edit/actions/command.rs new file mode 100644 index 0000000..5d63553 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/actions/command.rs @@ -0,0 +1,42 @@ +use yew::prelude::*; + +//use super::super::super::{JsonContext, JsonCtxAction}; +use super::super::AlwaysStringComponent; +use caylon_config::CommandAction; + +#[derive(Properties, PartialEq)] +pub struct CommandActionProps { + pub config: CommandAction, + pub callback: Callback, +} + +pub struct CommandActionComponent; + +impl Component for CommandActionComponent { + type Message = (); + type Properties = CommandActionProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + //props.callback.emit(ElementMessage::NoOp); + let cb = props.callback.clone(); + let config = props.config.clone(); + html! { +
+ +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/edit/actions/javascript.rs b/backend/caylon-studio/src/ui/element/edit/actions/javascript.rs new file mode 100644 index 0000000..685b3ee --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/actions/javascript.rs @@ -0,0 +1,42 @@ +use yew::prelude::*; + +//use super::super::super::{JsonContext, JsonCtxAction}; +use super::super::AlwaysStringComponent; +use caylon_config::JavascriptAction; + +#[derive(Properties, PartialEq)] +pub struct JavascriptActionProps { + pub config: JavascriptAction, + pub callback: Callback, +} + +pub struct JavascriptActionComponent; + +impl Component for JavascriptActionComponent { + type Message = (); + type Properties = JavascriptActionProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + //props.callback.emit(ElementMessage::NoOp); + let cb = props.callback.clone(); + let config = props.config.clone(); + html! { +
+ +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/edit/actions/json.rs b/backend/caylon-studio/src/ui/element/edit/actions/json.rs new file mode 100644 index 0000000..89818c0 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/actions/json.rs @@ -0,0 +1,42 @@ +use yew::prelude::*; + +//use super::super::super::{JsonContext, JsonCtxAction}; +use super::super::AlwaysStringComponent; +use caylon_config::JsonAction; + +#[derive(Properties, PartialEq)] +pub struct JsonActionProps { + pub config: JsonAction, + pub callback: Callback, +} + +pub struct JsonActionComponent; + +impl Component for JsonActionComponent { + type Message = (); + type Properties = JsonActionProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + //props.callback.emit(ElementMessage::NoOp); + let cb = props.callback.clone(); + let config = props.config.clone(); + html! { +
+ +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/edit/actions/mirror.rs b/backend/caylon-studio/src/ui/element/edit/actions/mirror.rs new file mode 100644 index 0000000..338e139 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/actions/mirror.rs @@ -0,0 +1,28 @@ +use yew::prelude::*; + +//use super::super::super::{JsonContext, JsonCtxAction}; +use caylon_config::MirrorAction; + +#[derive(Properties, PartialEq)] +pub struct MirrorActionProps { + pub config: MirrorAction, + pub callback: Callback, +} + +pub struct MirrorActionComponent; + +impl Component for MirrorActionComponent { + type Message = (); + type Properties = MirrorActionProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, _ctx: &Context) -> Html { + html! { +
+
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/edit/actions/mod.rs b/backend/caylon-studio/src/ui/element/edit/actions/mod.rs new file mode 100644 index 0000000..232eb21 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/actions/mod.rs @@ -0,0 +1,11 @@ +mod command; +mod javascript; +mod json; +mod mirror; +mod transform; + +pub use command::{CommandActionProps, CommandActionComponent}; +pub use javascript::{JavascriptActionProps, JavascriptActionComponent}; +pub use json::{JsonActionProps, JsonActionComponent}; +pub use mirror::{MirrorActionProps, MirrorActionComponent}; +pub use transform::{TransformActionProps, TransformActionComponent}; diff --git a/backend/caylon-studio/src/ui/element/edit/actions/transform.rs b/backend/caylon-studio/src/ui/element/edit/actions/transform.rs new file mode 100644 index 0000000..60fc728 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/actions/transform.rs @@ -0,0 +1,232 @@ +use yew::prelude::*; + +//use super::super::super::{JsonContext, JsonCtxAction}; +use super::super::AlwaysStringComponent; +use caylon_config::{TransformAction, TransformTypeAction}; +#[cfg(target_arch = "wasm32")] +use caylon_config::PatternConfig; + +#[derive(PartialEq, Eq)] +enum SelectedTransformer { + Replace, + Expand, + Log, +} + +fn selected(trans: &TransformTypeAction) -> SelectedTransformer { + match trans { + TransformTypeAction::Replace(_) => SelectedTransformer::Replace, + TransformTypeAction::Expand(_) => SelectedTransformer::Expand, + TransformTypeAction::Log(_) => SelectedTransformer::Log, + } +} + +#[derive(Properties, PartialEq)] +pub struct TransformActionProps { + pub config: TransformAction, + pub callback: Callback, +} + +pub struct TransformActionComponent; + +impl Component for TransformActionComponent { + type Message = (); + type Properties = TransformActionProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + //props.callback.emit(ElementMessage::NoOp); + #[cfg(target_arch = "wasm32")] + let cb = props.callback.clone(); + let config = props.config.clone(); + let selected = selected(&config.transformer); + let dropdown_cb = ctx.link().callback(move |#[allow(unused_variables)] event: Event| { + #[cfg(target_arch = "wasm32")] + { + log::debug!("Transformer dropdown select"); + let elem = event.target_unchecked_into::(); + let mut new_config = config.clone(); + new_config.transformer = match &elem.value() as &str { + "replace" => default_replace_transformer(), + "expand" => default_expand_transformer(), + "log" => default_log_transformer(), + _ => default_log_transformer(), + }; + cb.emit(new_config); + } + #[cfg(not(target_arch = "wasm32"))] + { } + }); + //let config = props.config.clone(); + let editor = match &props.config.transformer { + TransformTypeAction::Replace(rep) => { + // TODO allow for more than one pattern + //let moved_rep = rep.clone(); + let items = rep.patterns.iter() + .enumerate() + .map(|(index, pattern)| { + let cb_for_p = props.callback.clone(); + let cb_for_f = props.callback.clone(); + let moved_rep_p = rep.clone(); + let moved_rep_f = rep.clone(); + html! { +
+ + +
+ } + }).collect::(); + html! { +
+ {items} +
+ } + } + TransformTypeAction::Expand(exp) => { + let cb = props.callback.clone(); + let moved_exp = exp.clone(); + html! { +
+ +
+ } + } + TransformTypeAction::Log(log) => { + #[cfg(target_arch = "wasm32")] + let cb = props.callback.clone(); + #[cfg(target_arch = "wasm32")] + let moved_log = log.clone(); + let log_cb = ctx.link().callback(move |#[allow(unused_variables)] event: Event| { + #[cfg(target_arch = "wasm32")] + { + log::debug!("Transformer log dropdown select"); + let elem = event.target_unchecked_into::(); + let mut new_conf = moved_log.clone(); + new_conf.level = match &elem.value() as &str { + "debug" => caylon_config::LogLevel::DEBUG, + "info" => caylon_config::LogLevel::INFO, + "warn" => caylon_config::LogLevel::WARN, + "error" => caylon_config::LogLevel::ERROR, + _ => caylon_config::LogLevel::ERROR, + }; + cb.emit(TransformAction { + transformer: TransformTypeAction::Log(new_conf) + }) + } + #[cfg(not(target_arch = "wasm32"))] + { } + }); + html! { +
+ + +
+ } + } + }; + html! { +
+ + +
+ {editor} +
+
+ } + } +} + +#[cfg(target_arch = "wasm32")] +fn default_replace_transformer() -> TransformTypeAction { + TransformTypeAction::Replace(caylon_config::ReplaceTransformAction { patterns: vec![ + PatternConfig { + pattern: "regex".to_owned(), + format: "$1".to_owned(), + i: None, + m: None, + s: None, + u: None, + x: None, + } + ] }) +} + +#[cfg(target_arch = "wasm32")] +fn default_expand_transformer() -> TransformTypeAction { + TransformTypeAction::Expand(caylon_config::ExpandTransformAction { format: "$CAYLON_VALUE".into() }) +} + +#[cfg(target_arch = "wasm32")] +fn default_log_transformer() -> TransformTypeAction { + TransformTypeAction::Log(caylon_config::LogTransformAction { level: caylon_config::LogLevel::INFO }) +} diff --git a/backend/caylon-studio/src/ui/element/edit/always_str.rs b/backend/caylon-studio/src/ui/element/edit/always_str.rs new file mode 100644 index 0000000..a426098 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/always_str.rs @@ -0,0 +1,45 @@ +use yew::prelude::*; + +#[derive(Properties, PartialEq)] +pub struct AlwaysStringProps { + pub title: Option<&'static str>, + pub value: String, + pub callback: Callback, +} + +pub struct AlwaysStringComponent; + +impl Component for AlwaysStringComponent { + type Message = (); + type Properties = AlwaysStringProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + let callback = props.callback.clone(); + html! { +
+ {props.title.map(|t| html!{ })} + (); + callback.emit(elem.value()); + } + #[cfg(not(target_arch = "wasm32"))] + { + callback.emit("[UNREACHABLE]".into()) + } + })} + class={classes!("caylon-always-str-input", "caylon-input-editor")} + /> +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/edit/always_usize.rs b/backend/caylon-studio/src/ui/element/edit/always_usize.rs new file mode 100644 index 0000000..4614d71 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/always_usize.rs @@ -0,0 +1,50 @@ +use yew::prelude::*; + +#[derive(Properties, PartialEq)] +pub struct AlwaysUsizeProps { + pub title: Option<&'static str>, + pub value: usize, + pub callback: Callback, +} + +pub struct AlwaysUsizeComponent; + +impl Component for AlwaysUsizeComponent { + type Message = (); + type Properties = AlwaysUsizeProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + let callback = props.callback.clone(); + html! { +
+ {props.title.map(|t| html!{ })} + (); + let result: Result = elem.value().parse(); + match result { + Ok(value) => callback.emit(value), + Err(e) => log::warn!("Failed to parse always usize: {}", e), + } + + } + #[cfg(not(target_arch = "wasm32"))] + { + callback.emit(usize::MAX) + } + })} + class={classes!("caylon-always-usize-input", "caylon-input-editor")} + /> +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/edit/mod.rs b/backend/caylon-studio/src/ui/element/edit/mod.rs new file mode 100644 index 0000000..37b677a --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/mod.rs @@ -0,0 +1,15 @@ +mod action_editor; +mod always_str; +mod always_usize; +mod optional_str; +mod optional_u64; + +pub mod actions; + +pub use action_editor::{ActionComponent, ActionProps}; +pub use always_str::{AlwaysStringComponent, AlwaysStringProps}; +pub use always_usize::{AlwaysUsizeComponent, AlwaysUsizeProps}; +pub use optional_str::{OptionStringComponent, OptionStringProps}; +pub use optional_u64::{OptionU64Component, OptionU64Props}; + +type EditCallback = yew::prelude::Callback; diff --git a/backend/caylon-studio/src/ui/element/edit/optional_str.rs b/backend/caylon-studio/src/ui/element/edit/optional_str.rs new file mode 100644 index 0000000..7cf4459 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/optional_str.rs @@ -0,0 +1,46 @@ +use yew::prelude::*; + +#[derive(Properties, PartialEq)] +pub struct OptionStringProps { + pub title: Option<&'static str>, + pub value: Option, + pub callback: Callback>, +} + +pub struct OptionStringComponent; + +impl Component for OptionStringComponent { + type Message = (); + type Properties = OptionStringProps; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + let callback = props.callback.clone(); + html! { +
+ {props.title.map(|t| html!{ })} + (); + let value = elem.value(); + callback.emit(if value.is_empty() { None } else { Some(value) }); + } + #[cfg(not(target_arch = "wasm32"))] + { + callback.emit(Some("[UNREACHABLE]".into())) + } + })} + class={classes!("caylon-option-str-input", "caylon-input-editor")} + /> +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/edit/optional_u64.rs b/backend/caylon-studio/src/ui/element/edit/optional_u64.rs new file mode 100644 index 0000000..4975097 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/edit/optional_u64.rs @@ -0,0 +1,46 @@ +use yew::prelude::*; + +#[derive(Properties, PartialEq)] +pub struct OptionU64Props { + pub title: Option<&'static str>, + pub value: Option, + pub callback: Callback>, +} + +pub struct OptionU64Component; + +impl Component for OptionU64Component { + type Message = (); + type Properties = OptionU64Props; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + let callback = props.callback.clone(); + html! { +
+ {props.title.map(|t| html!{ })} + (); + let value: Option = elem.value().parse().ok(); + callback.emit(value); + } + #[cfg(not(target_arch = "wasm32"))] + { + callback.emit(Some(u64::MAX)) + } + })} + class={classes!("caylon-option-u64-input", "caylon-input-editor")} + /> +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/elements.rs b/backend/caylon-studio/src/ui/element/elements.rs new file mode 100644 index 0000000..0a5dd71 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/elements.rs @@ -0,0 +1,65 @@ +use yew::prelude::*; + +use super::super::JsonContext; +use caylon_config::ElementConfig; + +#[function_component] +pub fn ElementsComponent() -> Html { + log::debug!("Elements render"); + let json_ctx = use_context::().expect("Missing JSON context"); + let elem_view = if json_ctx.json.items().is_empty() { + html! { + {"--- No elements ---"} + } + } else { + let elements_html = json_ctx + .json + .items() + .iter() + .enumerate() + .map(|(i, elem)| element_impl(i, elem, &json_ctx)) + .collect::(); + html! { + {elements_html} + } + }; + html! { +
+
+ +
+
+ {elem_view} +
+
+ } +} + +fn element_impl(index: usize, elem: &ElementConfig, ctx: &JsonContext) -> Html { + let inner = match elem { + ElementConfig::Button(button) => html! { + + }, + ElementConfig::Toggle(toggle) => { + html! {} + } + ElementConfig::Slider(slider) => { + html! {} + } + ElementConfig::ReadingDisplay(disp) => { + html! {} + } + ElementConfig::ResultDisplay(disp) => { + html! {} + } + ElementConfig::EventDisplay(disp) => { + html! {} + } //_ => html!{{format!("elem #{} //TODO", index)}}, + }; + html! { +
+ {inner} + +
+ } +} diff --git a/backend/caylon-studio/src/ui/element/event_display.rs b/backend/caylon-studio/src/ui/element/event_display.rs new file mode 100644 index 0000000..0ec5baa --- /dev/null +++ b/backend/caylon-studio/src/ui/element/event_display.rs @@ -0,0 +1,66 @@ +use yew::prelude::*; + +use super::super::{JsonContext, JsonCtxAction}; +use super::ElementMessage; +use caylon_config::EventDisplayConfig; + +#[derive(Properties, PartialEq)] +pub struct EventDisplayProps { + pub index: usize, + pub config: EventDisplayConfig, + pub json_ctx: JsonContext, +} + +pub struct EventDisplayComponent; + +impl Component for EventDisplayComponent { + type Message = ElementMessage; + type Properties = EventDisplayProps; + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + let mut new_config = ctx.props().config.clone(); + let index = ctx.props().index; + let update_needed = match msg { + ElementMessage::SetTitle(title) => { + new_config.title = title; + true + } + ElementMessage::SetDescription(_desc) => false, + ElementMessage::SetAction(action) => { + new_config.on_event = action; + true + } + ElementMessage::SetPeriod(_) => false, + ElementMessage::SetResultOf(_) => false, + ElementMessage::NoOp => false, + //_ => false, + }; + if update_needed { + ctx.props().json_ctx.dispatch(JsonCtxAction::UpdateElement { + index, + new_item: caylon_config::ElementConfig::EventDisplay(new_config), + }); + } + update_needed + } + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + let callback = ctx.link().callback(|msg: Self::Message| msg); + html! { +
+ + + +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/fake/button.rs b/backend/caylon-studio/src/ui/element/fake/button.rs new file mode 100644 index 0000000..350698b --- /dev/null +++ b/backend/caylon-studio/src/ui/element/fake/button.rs @@ -0,0 +1,15 @@ +use yew::prelude::*; + +use caylon_config::ButtonConfig; + +#[derive(Properties, PartialEq)] +pub struct FakeButtonProps { + pub config: ButtonConfig, +} + +#[function_component] +pub fn FakeButtonComponent(props: &FakeButtonProps) -> Html { + html! { + + } +} diff --git a/backend/caylon-studio/src/ui/element/fake/display.rs b/backend/caylon-studio/src/ui/element/fake/display.rs new file mode 100644 index 0000000..578d466 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/fake/display.rs @@ -0,0 +1,19 @@ +use yew::prelude::*; + +//use caylon_config::DisplayConfig; + +#[derive(Properties, PartialEq)] +pub struct FakeDisplayProps { + pub title: String, + pub content: Option, +} + +#[function_component] +pub fn FakeDisplayComponent(props: &FakeDisplayProps) -> Html { + html! { +
+ {props.title.clone()} + {props.content.clone().unwrap_or_else(|| "[info]".into())} +
+ } +} diff --git a/backend/caylon-studio/src/ui/element/fake/mod.rs b/backend/caylon-studio/src/ui/element/fake/mod.rs new file mode 100644 index 0000000..46136b2 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/fake/mod.rs @@ -0,0 +1,9 @@ +mod button; +mod display; +mod slider; +mod toggle; + +pub use button::*; +pub use display::*; +pub use slider::*; +pub use toggle::*; diff --git a/backend/caylon-studio/src/ui/element/fake/slider.rs b/backend/caylon-studio/src/ui/element/fake/slider.rs new file mode 100644 index 0000000..fadf156 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/fake/slider.rs @@ -0,0 +1,18 @@ +use yew::prelude::*; + +use caylon_config::SliderConfig; + +#[derive(Properties, PartialEq)] +pub struct FakeSliderProps { + pub config: SliderConfig, +} + +#[function_component] +pub fn FakeSliderComponent(props: &FakeSliderProps) -> Html { + html! { +
+ {props.config.title.clone()} + +
+ } +} diff --git a/backend/caylon-studio/src/ui/element/fake/toggle.rs b/backend/caylon-studio/src/ui/element/fake/toggle.rs new file mode 100644 index 0000000..2166583 --- /dev/null +++ b/backend/caylon-studio/src/ui/element/fake/toggle.rs @@ -0,0 +1,24 @@ +use yew::prelude::*; + +use caylon_config::ToggleConfig; + +#[derive(Properties, PartialEq)] +pub struct FakeToggleProps { + pub config: ToggleConfig, +} + +#[function_component] +pub fn FakeToggleComponent(props: &FakeToggleProps) -> Html { + html! { +
+ {props.config.title.clone()} + {props.config.description.clone().map(|desc| html! { + {desc} + })} + +
+ } +} diff --git a/backend/caylon-studio/src/ui/element/mod.rs b/backend/caylon-studio/src/ui/element/mod.rs new file mode 100644 index 0000000..75ac82d --- /dev/null +++ b/backend/caylon-studio/src/ui/element/mod.rs @@ -0,0 +1,22 @@ +//! HTML versions of UI elements that Caylon supports. +//! These do not aim to exactly clone the Steam Deck style, +//! as long as they give the right impression. + +mod add_element; +mod button; +mod elements; +mod event_display; +mod msg_common; +mod reading_display; +mod remove_element; +mod result_display; +mod slider; +mod toggle; + +pub mod fake; +pub mod edit; + +pub use add_element::AddElementComponent; +pub use elements::ElementsComponent; +pub use msg_common::{ElementMessage, ElementCtx, ElementContext}; +pub use remove_element::{RemoveElementComponent, RemoveElementProps}; diff --git a/backend/caylon-studio/src/ui/element/msg_common.rs b/backend/caylon-studio/src/ui/element/msg_common.rs new file mode 100644 index 0000000..cdd81dc --- /dev/null +++ b/backend/caylon-studio/src/ui/element/msg_common.rs @@ -0,0 +1,105 @@ +use yew::prelude::*; + +use caylon_config::{ElementConfig, TopLevelActionConfig}; + +use std::rc::Rc; + +pub enum ElementMessage { + SetTitle(String), + SetDescription(Option), + SetAction(TopLevelActionConfig), + SetPeriod(Option), + SetResultOf(usize), + NoOp, +} + +// unused (it's a bad idea) + +#[derive(PartialEq)] +pub struct ElementCtx(ElementConfig); + +pub type ElementContext = UseReducerHandle; + +impl Eq for ElementCtx {} + +impl ElementCtx { + pub fn init(element: ElementConfig) -> Self { + Self(element) + } +} + +impl Reducible for ElementCtx { + type Action = ElementMessage; + + fn reduce(self: Rc, action: Self::Action) -> Rc { + let new_config = match self.0.clone() { + ElementConfig::Button(mut button) => { + match action { + ElementMessage::SetTitle(title) => button.title = title, + ElementMessage::SetDescription(_) => {}, + ElementMessage::SetAction(action) => button.on_click = action, + ElementMessage::SetPeriod(_) => {}, + ElementMessage::SetResultOf(_) => {}, + ElementMessage::NoOp => {}, + } + ElementConfig::Button(button) + }, + ElementConfig::Toggle(mut toggle) => { + match action { + ElementMessage::SetTitle(title) => toggle.title = title, + ElementMessage::SetDescription(desc) => toggle.description = desc, + ElementMessage::SetAction(action) => toggle.on_toggle = action, + ElementMessage::SetPeriod(_) => {}, + ElementMessage::SetResultOf(_) => {}, + ElementMessage::NoOp => {}, + } + ElementConfig::Toggle(toggle) + }, + ElementConfig::Slider(mut slider) => { + match action { + ElementMessage::SetTitle(title) => slider.title = title, + ElementMessage::SetDescription(_) => {}, + ElementMessage::SetAction(action) => slider.on_set = action, + ElementMessage::SetPeriod(_) => {}, + ElementMessage::SetResultOf(_) => {}, + ElementMessage::NoOp => {}, + } + ElementConfig::Slider(slider) + }, + ElementConfig::ReadingDisplay(mut disp) => { + match action { + ElementMessage::SetTitle(title) => disp.title = title, + ElementMessage::SetDescription(_) => {}, + ElementMessage::SetAction(action) => disp.on_period = action, + ElementMessage::SetPeriod(period) => disp.period_ms = period, + ElementMessage::SetResultOf(_) => {}, + ElementMessage::NoOp => {}, + } + ElementConfig::ReadingDisplay(disp) + }, + ElementConfig::ResultDisplay(mut disp) => { + match action { + ElementMessage::SetTitle(title) => disp.title = title, + ElementMessage::SetDescription(_) => {}, + ElementMessage::SetAction(_) => {}, + ElementMessage::SetPeriod(_) => {}, + ElementMessage::SetResultOf(result) => disp.result_of = result, + ElementMessage::NoOp => {}, + } + ElementConfig::ResultDisplay(disp) + }, + ElementConfig::EventDisplay(mut disp) => { + match action { + ElementMessage::SetTitle(title) => disp.title = title, + ElementMessage::SetDescription(_) => {}, + ElementMessage::SetAction(action) => disp.on_event = action, + ElementMessage::SetPeriod(_) => {}, + ElementMessage::SetResultOf(_) => {}, + ElementMessage::NoOp => {}, + } + ElementConfig::EventDisplay(disp) + }, + }; + Rc::new(Self::init(new_config)) + } +} diff --git a/backend/caylon-studio/src/ui/element/reading_display.rs b/backend/caylon-studio/src/ui/element/reading_display.rs new file mode 100644 index 0000000..5d12a8c --- /dev/null +++ b/backend/caylon-studio/src/ui/element/reading_display.rs @@ -0,0 +1,71 @@ +use yew::prelude::*; + +use super::super::{JsonContext, JsonCtxAction}; +use super::ElementMessage; +use caylon_config::ReadingConfig; + +#[derive(Properties, PartialEq)] +pub struct ReadingDisplayProps { + pub index: usize, + pub config: ReadingConfig, + pub json_ctx: JsonContext, +} + +pub struct ReadingDisplayComponent; + +impl Component for ReadingDisplayComponent { + type Message = ElementMessage; + type Properties = ReadingDisplayProps; + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + let mut new_config = ctx.props().config.clone(); + let index = ctx.props().index; + let update_needed = match msg { + ElementMessage::SetTitle(title) => { + new_config.title = title; + true + } + ElementMessage::SetDescription(_desc) => false, + ElementMessage::SetAction(_action) => false, + ElementMessage::SetPeriod(period) => { + new_config.period_ms = period; + true + }, + ElementMessage::SetResultOf(_) => false, + ElementMessage::NoOp => false, + //_ => false, + }; + if update_needed { + ctx.props().json_ctx.dispatch(JsonCtxAction::UpdateElement { + index, + new_item: caylon_config::ElementConfig::ReadingDisplay(new_config), + }); + } + update_needed + } + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + let callback = ctx.link().callback(|msg: Self::Message| msg); + html! { +
+ + + + +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/remove_element.rs b/backend/caylon-studio/src/ui/element/remove_element.rs new file mode 100644 index 0000000..f19b24a --- /dev/null +++ b/backend/caylon-studio/src/ui/element/remove_element.rs @@ -0,0 +1,22 @@ +use yew::prelude::*; + +use super::super::{JsonContext, JsonCtxAction}; + +#[derive(Properties, PartialEq)] +pub struct RemoveElementProps { + pub index: usize, +} + + +#[function_component] +pub fn RemoveElementComponent(props: &RemoveElementProps) -> Html { + let json_ctx = use_context::().expect("Missing JSON context"); + let index = props.index; + html! { +
+ +
+ } +} diff --git a/backend/caylon-studio/src/ui/element/result_display.rs b/backend/caylon-studio/src/ui/element/result_display.rs new file mode 100644 index 0000000..f86511a --- /dev/null +++ b/backend/caylon-studio/src/ui/element/result_display.rs @@ -0,0 +1,71 @@ +use yew::prelude::*; + +use super::super::{JsonContext, JsonCtxAction}; +use super::ElementMessage; +use caylon_config::ResultDisplayConfig; + +#[derive(Properties, PartialEq)] +pub struct ResultDisplayProps { + pub index: usize, + pub config: ResultDisplayConfig, + pub json_ctx: JsonContext, +} + +pub struct ResultDisplayComponent; + +impl Component for ResultDisplayComponent { + type Message = ElementMessage; + type Properties = ResultDisplayProps; + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + let mut new_config = ctx.props().config.clone(); + let index = ctx.props().index; + let update_needed = match msg { + ElementMessage::SetTitle(title) => { + new_config.title = title; + true + } + ElementMessage::SetDescription(_desc) => false, + ElementMessage::SetAction(_action) => false, + ElementMessage::SetPeriod(_) => false, + ElementMessage::SetResultOf(result) => { + new_config.result_of = result; + true + }, + ElementMessage::NoOp => false, + //_ => false, + }; + if update_needed { + ctx.props().json_ctx.dispatch(JsonCtxAction::UpdateElement { + index, + new_item: caylon_config::ElementConfig::ResultDisplay(new_config), + }); + } + update_needed + } + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + //let callback = ctx.link().callback(|msg: Self::Message| msg); + html! { +
+ // TODO editing + + + +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/slider.rs b/backend/caylon-studio/src/ui/element/slider.rs new file mode 100644 index 0000000..b8dbbba --- /dev/null +++ b/backend/caylon-studio/src/ui/element/slider.rs @@ -0,0 +1,67 @@ +use yew::prelude::*; + +use super::super::{JsonContext, JsonCtxAction}; +use super::ElementMessage; +use caylon_config::SliderConfig; + +#[derive(Properties, PartialEq)] +pub struct SliderProps { + pub index: usize, + pub config: SliderConfig, + pub json_ctx: JsonContext, +} + +pub struct SliderComponent; + +impl Component for SliderComponent { + type Message = ElementMessage; + type Properties = SliderProps; + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + let mut new_config = ctx.props().config.clone(); + let index = ctx.props().index; + let update_needed = match msg { + ElementMessage::SetTitle(title) => { + new_config.title = title; + true + } + ElementMessage::SetDescription(_desc) => false, + ElementMessage::SetAction(action) => { + new_config.on_set = action; + true + } + ElementMessage::SetPeriod(_) => false, + ElementMessage::SetResultOf(_) => false, + ElementMessage::NoOp => false, + //_ => false, + }; + if update_needed { + ctx.props().json_ctx.dispatch(JsonCtxAction::UpdateElement { + index, + new_item: caylon_config::ElementConfig::Slider(new_config), + }); + } + update_needed + } + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + let callback = ctx.link().callback(|msg: Self::Message| msg); + html! { +
+ // TODO editing + + + +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/element/toggle.rs b/backend/caylon-studio/src/ui/element/toggle.rs new file mode 100644 index 0000000..68c6c0c --- /dev/null +++ b/backend/caylon-studio/src/ui/element/toggle.rs @@ -0,0 +1,70 @@ +use yew::prelude::*; + +use super::super::{JsonContext, JsonCtxAction}; +use super::ElementMessage; +use caylon_config::ToggleConfig; + +#[derive(Properties, PartialEq)] +pub struct ToggleProps { + pub index: usize, + pub config: ToggleConfig, + pub json_ctx: JsonContext, +} + +pub struct ToggleComponent; + +impl Component for ToggleComponent { + type Message = ElementMessage; + type Properties = ToggleProps; + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + let mut new_config = ctx.props().config.clone(); + let index = ctx.props().index; + let update_needed = match msg { + ElementMessage::SetTitle(title) => { + new_config.title = title; + true + } + ElementMessage::SetDescription(desc) => { + new_config.description = desc; + true + } + ElementMessage::SetAction(action) => { + new_config.on_toggle = action; + true + } + ElementMessage::SetPeriod(_) => false, + ElementMessage::SetResultOf(_) => false, + ElementMessage::NoOp => false, + //_ => false, + }; + if update_needed { + ctx.props().json_ctx.dispatch(JsonCtxAction::UpdateElement { + index, + new_item: caylon_config::ElementConfig::Toggle(new_config), + }); + } + update_needed + } + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + let props = ctx.props(); + let callback = ctx.link().callback(|msg: Self::Message| msg); + html! { +
+ // TODO editing + + + +
+ } + } +} diff --git a/backend/caylon-studio/src/ui/footer_bar.rs b/backend/caylon-studio/src/ui/footer_bar.rs new file mode 100644 index 0000000..521e43b --- /dev/null +++ b/backend/caylon-studio/src/ui/footer_bar.rs @@ -0,0 +1,27 @@ +use yew::prelude::*; + +#[function_component] +pub fn FooterComponent() -> Html { + log::debug!("Footer render"); + html! { +
+ + {"Javascript required (though it's mostly WASM)"} + + + {" Made for "} + {"Caylon"} + {" by "} + {"NGnius"} + + + {"Donate"} + + + + + + +
+ } +} diff --git a/backend/caylon-studio/src/ui/hit_counter.rs b/backend/caylon-studio/src/ui/hit_counter.rs new file mode 100644 index 0000000..9ea6beb --- /dev/null +++ b/backend/caylon-studio/src/ui/hit_counter.rs @@ -0,0 +1,26 @@ +use yew::prelude::*; + +#[cfg(not(target_arch = "wasm32"))] +async fn fetch_hits() -> u64 { + // URL only valid server-side, after the TLS reverse-proxy + //let resp = reqwest::get("http://localhost:8080/stats/hits").await.unwrap(); + //let hits = resp.json::().await.unwrap(); + let hits = crate::api::get_hits::INDEX_HITS.load(std::sync::atomic::Ordering::Relaxed); + + hits +} + +#[function_component] +pub fn HitCounterComponent() -> HtmlResult { + let hits = use_prepared_state!(async move |_| -> u64 { fetch_hits().await }, ())?.unwrap(); + + Ok(html! { + {"Hit #"}{hits} + }) +} + +pub fn fallback() -> Html { + html! { + {"Hit ..."} + } +} diff --git a/backend/caylon-studio/src/ui/json_context.rs b/backend/caylon-studio/src/ui/json_context.rs new file mode 100644 index 0000000..c5dcd4f --- /dev/null +++ b/backend/caylon-studio/src/ui/json_context.rs @@ -0,0 +1,74 @@ +use std::rc::Rc; +use yew::prelude::*; + +pub enum JsonCtxAction { + InsertElement { + item: caylon_config::ElementConfig, + index: usize, + }, + RemoveElement { + index: usize, + }, + UpdateElement { + new_item: caylon_config::ElementConfig, + index: usize, + }, +} + +#[derive(Clone, PartialEq)] +pub struct JsonCtx { + pub json: caylon_config::BaseConfig, +} + +pub type JsonContext = UseReducerHandle; + +impl Eq for JsonCtx {} + +impl JsonCtx { + pub fn init() -> Self { + Self { + json: minimal_config(), + } + } +} + +impl Reducible for JsonCtx { + type Action = JsonCtxAction; + + fn reduce(self: Rc, action: Self::Action) -> Rc { + let json_base = match action { + JsonCtxAction::InsertElement { item, index } => { + let mut items = self.json.items().to_owned(); + items.insert(index, item); + caylon_config::BaseConfig::assemble(items, self.json.get_about().to_owned()) + } + JsonCtxAction::RemoveElement { index } => { + let mut items = self.json.items().to_owned(); + items.remove(index); + caylon_config::BaseConfig::assemble(items, self.json.get_about().to_owned()) + } + JsonCtxAction::UpdateElement { new_item, index } => { + let mut items = self.json.items().to_owned(); + if items.len() > index { + items[index] = new_item; + } + caylon_config::BaseConfig::assemble(items, self.json.get_about().to_owned()) + } + }; + Rc::new(Self { json: json_base }) + } +} + +fn minimal_config() -> caylon_config::BaseConfig { + caylon_config::BaseConfig::V0 { + items: vec![], + about: caylon_config::AboutConfig { + name: env!("CARGO_PKG_NAME").to_owned(), + version: env!("CARGO_PKG_VERSION").to_owned(), + description: "Studio-generated UI layout for Caylon".to_owned(), + url: Some("https://caylon.ngni.us".to_owned()), + authors: vec!["NGnius".to_owned()], + license: Some("MIT".to_owned()), + }, + } +} diff --git a/backend/caylon-studio/src/ui/json_view.rs b/backend/caylon-studio/src/ui/json_view.rs new file mode 100644 index 0000000..c4c313b --- /dev/null +++ b/backend/caylon-studio/src/ui/json_view.rs @@ -0,0 +1,20 @@ +use serde_json::to_string_pretty; +use yew::prelude::*; + +#[function_component] +pub fn JsonViewComponent() -> Html { + log::debug!("Json view render"); + let json_ctx = use_context::().expect("Missing JSON context"); + let pretty_json = to_string_pretty(&json_ctx.json).expect("Invalid JSON"); + let line_count = pretty_json.chars().filter(|&c| c == '\n').count() + 2; + /*html! { +
+            {pretty_json.clone()}
+        
+ }*/ + html! { +
+